code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
/* crypto/engine/eng_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. 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 acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* [email protected].
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* ([email protected]). This product includes software written by Tim
* Hudson ([email protected]).
*
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/engine.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ENGINE,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ENGINE,0,reason)
static ERR_STRING_DATA ENGINE_str_functs[]=
{
{ERR_FUNC(ENGINE_F_DYNAMIC_CTRL), "DYNAMIC_CTRL"},
{ERR_FUNC(ENGINE_F_DYNAMIC_GET_DATA_CTX), "DYNAMIC_GET_DATA_CTX"},
{ERR_FUNC(ENGINE_F_DYNAMIC_LOAD), "DYNAMIC_LOAD"},
{ERR_FUNC(ENGINE_F_DYNAMIC_SET_DATA_CTX), "DYNAMIC_SET_DATA_CTX"},
{ERR_FUNC(ENGINE_F_ENGINE_ADD), "ENGINE_add"},
{ERR_FUNC(ENGINE_F_ENGINE_BY_ID), "ENGINE_by_id"},
{ERR_FUNC(ENGINE_F_ENGINE_CMD_IS_EXECUTABLE), "ENGINE_cmd_is_executable"},
{ERR_FUNC(ENGINE_F_ENGINE_CTRL), "ENGINE_ctrl"},
{ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD), "ENGINE_ctrl_cmd"},
{ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD_STRING), "ENGINE_ctrl_cmd_string"},
{ERR_FUNC(ENGINE_F_ENGINE_FINISH), "ENGINE_finish"},
{ERR_FUNC(ENGINE_F_ENGINE_FREE_UTIL), "ENGINE_FREE_UTIL"},
{ERR_FUNC(ENGINE_F_ENGINE_GET_CIPHER), "ENGINE_get_cipher"},
{ERR_FUNC(ENGINE_F_ENGINE_GET_DEFAULT_TYPE), "ENGINE_GET_DEFAULT_TYPE"},
{ERR_FUNC(ENGINE_F_ENGINE_GET_DIGEST), "ENGINE_get_digest"},
{ERR_FUNC(ENGINE_F_ENGINE_GET_NEXT), "ENGINE_get_next"},
{ERR_FUNC(ENGINE_F_ENGINE_GET_PREV), "ENGINE_get_prev"},
{ERR_FUNC(ENGINE_F_ENGINE_INIT), "ENGINE_init"},
{ERR_FUNC(ENGINE_F_ENGINE_LIST_ADD), "ENGINE_LIST_ADD"},
{ERR_FUNC(ENGINE_F_ENGINE_LIST_REMOVE), "ENGINE_LIST_REMOVE"},
{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY), "ENGINE_load_private_key"},
{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY), "ENGINE_load_public_key"},
{ERR_FUNC(ENGINE_F_ENGINE_NEW), "ENGINE_new"},
{ERR_FUNC(ENGINE_F_ENGINE_REMOVE), "ENGINE_remove"},
{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_STRING), "ENGINE_set_default_string"},
{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_TYPE), "ENGINE_SET_DEFAULT_TYPE"},
{ERR_FUNC(ENGINE_F_ENGINE_SET_ID), "ENGINE_set_id"},
{ERR_FUNC(ENGINE_F_ENGINE_SET_NAME), "ENGINE_set_name"},
{ERR_FUNC(ENGINE_F_ENGINE_TABLE_REGISTER), "ENGINE_TABLE_REGISTER"},
{ERR_FUNC(ENGINE_F_ENGINE_UNLOAD_KEY), "ENGINE_UNLOAD_KEY"},
{ERR_FUNC(ENGINE_F_ENGINE_UNLOCKED_FINISH), "ENGINE_UNLOCKED_FINISH"},
{ERR_FUNC(ENGINE_F_ENGINE_UP_REF), "ENGINE_up_ref"},
{ERR_FUNC(ENGINE_F_INT_CTRL_HELPER), "INT_CTRL_HELPER"},
{ERR_FUNC(ENGINE_F_INT_ENGINE_CONFIGURE), "INT_ENGINE_CONFIGURE"},
{ERR_FUNC(ENGINE_F_INT_ENGINE_MODULE_INIT), "INT_ENGINE_MODULE_INIT"},
{ERR_FUNC(ENGINE_F_LOG_MESSAGE), "LOG_MESSAGE"},
{0,NULL}
};
static ERR_STRING_DATA ENGINE_str_reasons[]=
{
{ERR_REASON(ENGINE_R_ALREADY_LOADED) ,"already loaded"},
{ERR_REASON(ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER),"argument is not a number"},
{ERR_REASON(ENGINE_R_CMD_NOT_EXECUTABLE) ,"cmd not executable"},
{ERR_REASON(ENGINE_R_COMMAND_TAKES_INPUT),"command takes input"},
{ERR_REASON(ENGINE_R_COMMAND_TAKES_NO_INPUT),"command takes no input"},
{ERR_REASON(ENGINE_R_CONFLICTING_ENGINE_ID),"conflicting engine id"},
{ERR_REASON(ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"},
{ERR_REASON(ENGINE_R_DH_NOT_IMPLEMENTED) ,"dh not implemented"},
{ERR_REASON(ENGINE_R_DSA_NOT_IMPLEMENTED),"dsa not implemented"},
{ERR_REASON(ENGINE_R_DSO_FAILURE) ,"DSO failure"},
{ERR_REASON(ENGINE_R_DSO_NOT_FOUND) ,"dso not found"},
{ERR_REASON(ENGINE_R_ENGINES_SECTION_ERROR),"engines section error"},
{ERR_REASON(ENGINE_R_ENGINE_IS_NOT_IN_LIST),"engine is not in the list"},
{ERR_REASON(ENGINE_R_ENGINE_SECTION_ERROR),"engine section error"},
{ERR_REASON(ENGINE_R_FAILED_LOADING_PRIVATE_KEY),"failed loading private key"},
{ERR_REASON(ENGINE_R_FAILED_LOADING_PUBLIC_KEY),"failed loading public key"},
{ERR_REASON(ENGINE_R_FINISH_FAILED) ,"finish failed"},
{ERR_REASON(ENGINE_R_GET_HANDLE_FAILED) ,"could not obtain hardware handle"},
{ERR_REASON(ENGINE_R_ID_OR_NAME_MISSING) ,"'id' or 'name' missing"},
{ERR_REASON(ENGINE_R_INIT_FAILED) ,"init failed"},
{ERR_REASON(ENGINE_R_INTERNAL_LIST_ERROR),"internal list error"},
{ERR_REASON(ENGINE_R_INVALID_ARGUMENT) ,"invalid argument"},
{ERR_REASON(ENGINE_R_INVALID_CMD_NAME) ,"invalid cmd name"},
{ERR_REASON(ENGINE_R_INVALID_CMD_NUMBER) ,"invalid cmd number"},
{ERR_REASON(ENGINE_R_INVALID_INIT_VALUE) ,"invalid init value"},
{ERR_REASON(ENGINE_R_INVALID_STRING) ,"invalid string"},
{ERR_REASON(ENGINE_R_NOT_INITIALISED) ,"not initialised"},
{ERR_REASON(ENGINE_R_NOT_LOADED) ,"not loaded"},
{ERR_REASON(ENGINE_R_NO_CONTROL_FUNCTION),"no control function"},
{ERR_REASON(ENGINE_R_NO_INDEX) ,"no index"},
{ERR_REASON(ENGINE_R_NO_LOAD_FUNCTION) ,"no load function"},
{ERR_REASON(ENGINE_R_NO_REFERENCE) ,"no reference"},
{ERR_REASON(ENGINE_R_NO_SUCH_ENGINE) ,"no such engine"},
{ERR_REASON(ENGINE_R_NO_UNLOAD_FUNCTION) ,"no unload function"},
{ERR_REASON(ENGINE_R_PROVIDE_PARAMETERS) ,"provide parameters"},
{ERR_REASON(ENGINE_R_RSA_NOT_IMPLEMENTED),"rsa not implemented"},
{ERR_REASON(ENGINE_R_UNIMPLEMENTED_CIPHER),"unimplemented cipher"},
{ERR_REASON(ENGINE_R_UNIMPLEMENTED_DIGEST),"unimplemented digest"},
{ERR_REASON(ENGINE_R_VERSION_INCOMPATIBILITY),"version incompatibility"},
{0,NULL}
};
#endif
void ERR_load_ENGINE_strings(void)
{
static int init=1;
if (init)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,ENGINE_str_functs);
ERR_load_strings(0,ENGINE_str_reasons);
#endif
}
}
| ysleu/RTL8685 | uClinux-dist/lib/openssl-0.9.8b/crypto/engine/eng_err.c | C | gpl-2.0 | 8,203 |
package org.wordpress.android.ui.reader.adapters;
import android.content.Context;
import android.os.AsyncTask;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import org.wordpress.android.R;
import org.wordpress.android.datasets.ReaderTagTable;
import org.wordpress.android.models.ReaderTag;
import org.wordpress.android.models.ReaderTagList;
import org.wordpress.android.ui.reader.ReaderInterfaces;
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.AppLog.T;
/**
* populates spinner with reader tags
*/
public class ReaderTagSpinnerAdapter extends BaseAdapter {
private ReaderTagList mTags = new ReaderTagList();
private final LayoutInflater mInflater;
private final ReaderInterfaces.DataLoadedListener mDataListener;
public ReaderTagSpinnerAdapter(Context context, ReaderInterfaces.DataLoadedListener dataListener) {
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mDataListener = dataListener;
refreshTags();
}
public int getIndexOfTag(ReaderTag tag) {
if (tag == null) {
return -1;
}
for (int i = 0; i < mTags.size(); i++) {
if (ReaderTag.isSameTag(tag, mTags.get(i))) {
return i;
}
}
return -1;
}
public void refreshTags() {
if (mIsTaskRunning) {
AppLog.w(T.READER, "reader tag adapter > Load tags task already running");
} else {
new LoadTagsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
public void reloadTags() {
mTags.clear();
refreshTags();
}
@Override
public int getCount() {
return (mTags !=null ? mTags.size() : 0);
}
private boolean isValidPosition(int position) {
return (position >= 0 && position < getCount());
}
@Override
public Object getItem(int index) {
if (isValidPosition(index)) {
return mTags.get(index);
} else {
return null;
}
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ReaderTag tag = mTags.get(position);
final TagViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.reader_toolbar_spinner_item, parent, false);
holder = new TagViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (TagViewHolder) convertView.getTag();
}
holder.textView.setText(tag.getCapitalizedTagName());
return convertView;
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
final ReaderTag tag = mTags.get(position);
final TagViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.toolbar_spinner_dropdown_item, parent, false);
holder = new TagViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (TagViewHolder) convertView.getTag();
}
holder.textView.setText(tag.getCapitalizedTagName());
return convertView;
}
private class TagViewHolder {
private final TextView textView;
TagViewHolder(View view) {
textView = (TextView) view.findViewById(R.id.text);
}
}
private boolean mIsTaskRunning = false;
private class LoadTagsTask extends AsyncTask<Void, Void, Boolean> {
private final ReaderTagList tmpTags = new ReaderTagList();
@Override
protected void onPreExecute() {
mIsTaskRunning = true;
}
@Override
protected void onCancelled() {
mIsTaskRunning = false;
}
@Override
protected Boolean doInBackground(Void... voids) {
tmpTags.addAll(ReaderTagTable.getDefaultTags());
tmpTags.addAll(ReaderTagTable.getFollowedTags());
return !mTags.isSameList(tmpTags);
}
@Override
protected void onPostExecute(Boolean result) {
if (result) {
mTags = (ReaderTagList) tmpTags.clone();
notifyDataSetChanged();
if (mDataListener != null) {
mDataListener.onDataLoaded(mTags.isEmpty());
}
}
mIsTaskRunning = false;
}
}
}
| wangkang0627/WordPress-Android | WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderTagSpinnerAdapter.java | Java | gpl-2.0 | 4,685 |
<?php
/**
* @version $Id: gantrymenu.class.php 11319 2013-06-07 15:26:51Z steph $
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*
* Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
*
*/
// no direct access
defined('GANTRY_VERSION') or die('Restricted access');
// Include the syndicate functions only once
gantry_import('facets.menu.gantrymenutree');
class GantryMenu
{
var $_menudata = null;
var $_formatter = null;
var $_layout_path = null;
var $__cacheables = array(
'_menudata'
);
function __sleep()
{
return $this->__cacheables;
}
// static function to get an instance of the GantryMenu
function &getInstance(GantryRegistry $params)
{
/** @var $gantry Gantry */
global $gantry;
$conf = JFactory::getConfig();
if ($conf->get('caching') && $params->get("module_cache", 0)) {
$user = JFactory::getUser();
$cache = JFactory::getCache('Gantry');
$cache->setCaching(true);
$cache->setLifeTime($gantry->get("cache-time", $conf->get('cachetime') * 60));
$args = array(&$params);
$checksum = md5($params->toString());
$gantrymenu = $cache->get(array(
'GantryMenu',
'_getInstance'
), $args, 'GantryMenu-' . $user->get('aid', 0) . '-' . $checksum);
} else {
$gantrymenu = GantryMenu::_getInstance($params);
}
return $gantrymenu;
}
static function &_getInstance($params)
{
$gantrymenu = new GantryMenu($params);
return $gantrymenu;
}
function GantryMenu($params)
{
if (empty($params)) {
$params = new GantryRegistry();
}
$params->def('menutype', 'mainmenu');
$params->def('class_sfx', '');
$params->def('menu_images', 0);
// Added in 1.5
$params->def('startLevel', 0);
$params->def('endLevel', 0);
$params->def('showAllChildren', 0);
$this->_menudata = GantryMenu::_getMenuData($params);
}
function render($params)
{
$theme_name = $params->get('theme', 'basic');
$this->_loadTheme($theme_name);
// Run the basic formatter
GantryMenu::_applyBasicFormatting($this->_menudata);
if (!empty($this->_formatter)) {
$this->_formatter->format_tree($this->_menudata);
}
// format the menu data $menu is passed to the layout
$menu = &$this->_menudata;
$menurender = "Unable to render menu missing layout.php for theme " . $theme_name;
if (!empty($this->_layout_path) && file_exists($this->_layout_path) && is_readable($this->_layout_path)) {
ob_start();
require($this->_layout_path);
$menurender = ob_get_contents();
ob_end_clean();
}
return $menurender;
}
function _getMenuData(&$params)
{
$menu = new GantryMenuTree();
$menu->_params = &$params;
$app = JFactory::getApplication();
$items = $app->getMenu();
// Get Menu Items
$rows = $items->getItems('menutype', $params->get('menutype'));
$maxdepth = $menu->getParameter('endLevel', 10);
// Build Menu Tree root down (orphan proof - child might have lower id than parent)
$user = JFactory::getUser();
$ids = array();
$ids[0] = true;
$last = null;
$unresolved = array();
// pop the first item until the array is empty if there is any item
if (is_array($rows)) {
while (count($rows) && !is_null($row = array_shift($rows))) {
$row->ionly = $params->get('menu_images_link');
if (!$menu->addNode($params, $row)) {
if (!array_key_exists($row->id, $unresolved) || $unresolved[$row->id] < $maxdepth) {
array_push($rows, $row);
if (!isset($unresolved[$row->id])) $unresolved[$row->id] = 1; else $unresolved[$row->id]++;
}
}
}
}
return $menu;
}
function _loadTheme($theme_name)
{
/** @var $gantry Gantry */
global $gantry;
// Load up the theme info if there is not one already
if (empty($this->_formatter)) {
$theme_parent_paths = array(
$gantry->templatePath . '/facets/menu/themes', $gantry->gantryPath . '/facets/menu/themes'
);
foreach ($theme_parent_paths as $theme_parent_path) {
if (file_exists($theme_parent_path) && is_dir($theme_parent_path)) {
$d = dir($theme_parent_path);
while (false !== ($entry = $d->read())) {
if ($entry != '.' && $entry != '..') {
if ($entry == $theme_name && is_dir($theme_parent_path . '/' . $entry)) {
$formatter_file = $theme_parent_path . '/' . $entry . '/' . 'formatter.php';
$layout_file = $theme_parent_path . '/' . $entry . '/' . 'layout.php';
$formatter_class = 'GantryMenuFormatter' . ucfirst($entry);
if (!file_exists($formatter_file)) {
return false;
}
// Load the Formatter File
require_once($formatter_file);
if (!class_exists($formatter_class)) {
return false;
}
$this->_formatter = new $formatter_class();
if (file_exists($layout_file)) {
$this->_layout_path = $layout_file;
}
break(2); // exit top level foreach
}
}
}
}
}
}
}
/**
* Perform the basic common formatting to all menu nodes
*/
function _applyBasicFormatting(&$menu)
{
//set the active tree branch
$app = JFactory::getApplication();
$joomlamenu = $app->getMenu();
$active = $joomlamenu->getActive();
if (isset($active) && isset($active->tree) && count($active->tree)) {
reset($active->tree);
while (list($key, $value) = each($active->tree)) {
$active_node =& $active->tree[$key];
$active_child = $menu->findChild($active_node);
if ($active_child !== false) {
$active_child->addListItemClass('active');
}
}
}
// set the current node
if (isset($active)) {
$current_child = $menu->findChild($active->id);
if ($current_child !== false && !$current_child->menualias) {
$current_child->css_id = 'current';
}
}
// Limit the levels of the tree is called for By limitLevels
if ($menu->getParameter('limit_levels')) {
$start = $menu->getParameter('startLevel');
$end = $menu->getParameter('endLevel');
//Limit to the active path if the start is more the level 0
if ($start > 0) {
$found = false;
// get active path and find the start level that matches
if (isset($active) && isset($active->tree) && count($active->tree)) {
reset($active->tree);
while (list($key, $value) = each($active->tree)) {
$active_child = $menu->findChild($active->tree[$key]);
if ($active_child != null && $active_child !== false) {
if ($active_child->level == $start - 1) {
$menu->resetTop($active_child->id);
$found = true;
break;
}
}
}
}
if (!$found) {
$menu->_children = array();
}
}
//remove lower then the defined end level
$menu->removeLevel($end);
}
// Remove the child nodes that were not needed to display unless showAllChildren is set
$showAllChildren = $menu->getParameter('showAllChildren');
if (!$showAllChildren) {
if ($menu->hasChildren()) {
reset($menu->_children);
while (list($key, $value) = each($menu->_children)) {
$toplevel =& $menu->_children[$key];
if (isset($active) && isset($active->tree) && in_array($toplevel->id, $active->tree) !== false) {
$last_active = $menu->findChild($active->tree[count($active->tree) - 1]);
if ($last_active !== false) {
$toplevel->removeIfNotInTree($active->tree, $last_active->id);
//$toplevel->removeLevel($last_active->level+1);
}
} else {
$toplevel->removeLevel($toplevel->level);
}
}
}
}
}
} | lusho1/proyecto_mantencion | libraries/gantry/facets/menu/gantrymenu.class.php | PHP | gpl-2.0 | 7,736 |
#ifdef CONFIG_PM_RUNTIME
extern void pm_runtime_init(struct device *dev);
extern void pm_runtime_remove(struct device *dev);
#else /* !CONFIG_PM_RUNTIME */
static inline void pm_runtime_init(struct device *dev) {}
static inline void pm_runtime_remove(struct device *dev) {}
#endif /* !CONFIG_PM_RUNTIME */
#ifdef CONFIG_PM_SLEEP
/* kernel/power/main.c */
extern int pm_async_enabled;
/* drivers/base/power/main.c */
extern struct list_head dpm_list; /* The active device list */
static inline struct device *to_device(struct list_head *entry)
{
return container_of(entry, struct device, power.entry);
}
extern void device_pm_init(struct device *dev);
extern void device_pm_add(struct device *);
extern void device_pm_remove(struct device *);
extern void device_pm_move_before(struct device *, struct device *);
extern void device_pm_move_after(struct device *, struct device *);
extern void device_pm_move_last(struct device *);
extern void (*device_pm_set_timout_handler(void (*new_fun)(unsigned long)))
(unsigned long);
#else /* !CONFIG_PM_SLEEP */
static inline void device_pm_init(struct device *dev)
{
pm_runtime_init(dev);
}
static inline void device_pm_remove(struct device *dev)
{
pm_runtime_remove(dev);
}
static inline void device_pm_add(struct device *dev) {}
static inline void device_pm_move_before(struct device *deva,
struct device *devb) {}
static inline void device_pm_move_after(struct device *deva,
struct device *devb) {}
static inline void device_pm_move_last(struct device *dev) {}
static void (*device_pm_set_timout_handler(void (*new_fun)(unsigned long)))
(unsigned long) {}
#endif /* !CONFIG_PM_SLEEP */
#ifdef CONFIG_PM
/*
* sysfs.c
*/
extern int dpm_sysfs_add(struct device *);
extern void dpm_sysfs_remove(struct device *);
extern void rpm_sysfs_remove(struct device *);
#else /* CONFIG_PM */
static inline int dpm_sysfs_add(struct device *dev)
{
return 0;
}
static inline void dpm_sysfs_remove(struct device *dev)
{
}
#endif
| Krabappel2548/u8500_kernel_sources | drivers/base/power/power.h | C | gpl-2.0 | 1,994 |
<?php
/**
* @package Joomla.Site
* @subpackage com_content
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_HZEXEC_') or die();
jimport('joomla.application.component.modelitem');
/**
* Content Component Article Model
*
* @package Joomla.Site
* @subpackage com_content
* @since 1.5
*/
class ContentModelArticle extends JModelItem
{
/**
* Model context string.
*
* @var string
*/
protected $_context = 'com_content.article';
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/
protected function populateState()
{
$app = JFactory::getApplication('site');
// Load state from the request.
$pk = Request::getInt('id');
$this->setState('article.id', $pk);
$offset = Request::getUInt('limitstart');
$this->setState('list.offset', $offset);
// Load the parameters.
$params = $app->getParams();
$this->setState('params', $params);
// TODO: Tune these values based on other permissions.
if ((!User::authorise('core.edit.state', 'com_content')) && (!User::authorise('core.edit', 'com_content')))
{
$this->setState('filter.published', 1);
$this->setState('filter.archived', 2);
}
$this->setState('filter.language', JLanguageMultilang::isEnabled());
}
/**
* Method to get article data.
*
* @param integer The id of the article.
*
* @return mixed Menu item data object on success, false on failure.
*/
public function &getItem($pk = null)
{
// Initialise variables.
$pk = (!empty($pk)) ? $pk : (int) $this->getState('article.id');
if ($this->_item === null) {
$this->_item = array();
}
if (!isset($this->_item[$pk]))
{
try
{
$db = $this->getDbo();
$query = $db->getQuery(true);
$query->select($this->getState(
'item.select', 'a.id, a.asset_id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, ' .
// If badcats is not null, this means that the article is inside an unpublished category
// In this case, the state is set to 0 to indicate Unpublished (even if the article state is Published)
'CASE WHEN badcats.id is null THEN a.state ELSE 0 END AS state, ' .
'a.mask, a.catid, a.created, a.created_by, a.created_by_alias, ' .
// use created if modified is 0
'CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, ' .
'a.modified_by, a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, ' .
'a.images, a.urls, a.attribs, a.version, a.parentid, a.ordering, ' .
'a.metakey, a.metadesc, a.access, a.hits, a.metadata, a.featured, a.language, a.xreference'
)
);
$query->from('#__content AS a');
// Join on category table.
$query->select('c.title AS category_title, c.alias AS category_alias, c.access AS category_access');
$query->join('LEFT', '#__categories AS c on c.id = a.catid');
// Join on user table.
$query->select('u.name AS author');
$query->join('LEFT', '#__users AS u on u.id = a.created_by');
// Get contact id
$subQuery = $db->getQuery(true);
$subQuery->select('MAX(contact.id) AS id');
$subQuery->from('#__contact_details AS contact');
$subQuery->where('contact.published = 1');
$subQuery->where('contact.user_id = a.created_by');
// Filter by language
if ($this->getState('filter.language'))
{
$subQuery->where('(contact.language in (' . $db->quote(Lang::getTag()) . ',' . $db->quote('*') . ') OR contact.language IS NULL)');
}
// [!] Hubzero - Removed contact_details table
//$query->select('(' . $subQuery . ') as contactid');
$query->select('(0) as contactid');
// Filter by language
if ($this->getState('filter.language'))
{
$query->where('a.language in (' . $db->quote(Lang::getTag()) . ',' . $db->quote('*') . ')');
}
// Join over the categories to get parent category titles
$query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias');
$query->join('LEFT', '#__categories as parent ON parent.id = c.parent_id');
// Join on voting table
$query->select('ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count');
$query->join('LEFT', '#__content_rating AS v ON a.id = v.content_id');
$query->where('a.id = ' . (int) $pk);
if ((!User::authorise('core.edit.state', 'com_content')) && (!User::authorise('core.edit', 'com_content')))
{
// Filter by start and end dates.
$nullDate = $db->Quote($db->getNullDate());
$date = Date::of('now');
$nowDate = $db->Quote($date->toSql());
$query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')');
$query->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')');
}
// Join to check for category published state in parent categories up the tree
// If all categories are published, badcats.id will be null, and we just use the article state
$subquery = ' (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ';
$subquery .= 'ON cat.lft BETWEEN parent.lft AND parent.rgt ';
$subquery .= 'WHERE parent.extension = ' . $db->quote('com_content');
$subquery .= ' AND parent.published <= 0 GROUP BY cat.id)';
$query->join('LEFT OUTER', $subquery . ' AS badcats ON badcats.id = c.id');
// Filter by published state.
$published = $this->getState('filter.published');
$archived = $this->getState('filter.archived');
if (is_numeric($published))
{
$query->where('(a.state = ' . (int) $published . ' OR a.state =' . (int) $archived . ')');
}
$db->setQuery($query);
$data = $db->loadObject();
if ($error = $db->getErrorMsg())
{
throw new Exception($error);
}
if (empty($data))
{
return App::abort(404, Lang::txt('COM_CONTENT_ERROR_ARTICLE_NOT_FOUND'));
}
// Check for published state if filter set.
if (((is_numeric($published)) || (is_numeric($archived))) && (($data->state != $published) && ($data->state != $archived)))
{
return App::abort(404, Lang::txt('COM_CONTENT_ERROR_ARTICLE_NOT_FOUND'));
}
// Convert parameter fields to objects.
$registry = new \Hubzero\Config\Registry($data->attribs);
$data->params = clone $this->getState('params');
$data->params->merge($registry);
$registry = new \Hubzero\Config\Registry($data->metadata);
$data->metadata = $registry;
// Technically guest could edit an article, but lets not check that to improve performance a little.
if (!User::isGuest())
{
$userId = User::get('id');
$asset = 'com_content.article.'.$data->id;
// Check general edit permission first.
if (User::authorise('core.edit', $asset))
{
$data->params->set('access-edit', true);
}
// Now check if edit.own is available.
elseif (!empty($userId) && User::authorise('core.edit.own', $asset))
{
// Check for a valid user and that they are the owner.
if ($userId == $data->created_by)
{
$data->params->set('access-edit', true);
}
}
}
// Compute view access permissions.
if ($access = $this->getState('filter.access')) {
// If the access filter has been set, we already know this user can view.
$data->params->set('access-view', true);
}
else {
// If no access filter is set, the layout takes some responsibility for display of limited information.
$groups = User::getAuthorisedViewLevels();
if ($data->catid == 0 || $data->category_access === null)
{
$data->params->set('access-view', in_array($data->access, $groups));
}
else
{
$data->params->set('access-view', in_array($data->access, $groups) && in_array($data->category_access, $groups));
}
}
$this->_item[$pk] = $data;
}
catch (Exception $e)
{
if ($e->getCode() == 404)
{
// Need to go thru the error handler to allow Redirect to work.
App::abort(404, $e->getMessage());
}
else
{
$this->setError($e);
$this->_item[$pk] = false;
}
}
}
return $this->_item[$pk];
}
/**
* Increment the hit counter for the article.
*
* @param int Optional primary key of the article to increment.
*
* @return boolean True if successful; false otherwise and internal error set.
*/
public function hit($pk = 0)
{
$hitcount = Request::getInt('hitcount', 1);
if ($hitcount)
{
// Initialise variables.
$pk = (!empty($pk)) ? $pk : (int) $this->getState('article.id');
$db = $this->getDbo();
$db->setQuery(
'UPDATE #__content' .
' SET hits = hits + 1' .
' WHERE id = '.(int) $pk
);
if (!$db->query()) {
$this->setError($db->getErrorMsg());
return false;
}
}
return true;
}
public function storeVote($pk = 0, $rate = 0)
{
if ($rate >= 1 && $rate <= 5 && $pk > 0)
{
$userIP = $_SERVER['REMOTE_ADDR'];
$db = $this->getDbo();
$db->setQuery(
'SELECT *' .
' FROM #__content_rating' .
' WHERE content_id = '.(int) $pk
);
$rating = $db->loadObject();
if (!$rating)
{
// There are no ratings yet, so lets insert our rating
$db->setQuery(
'INSERT INTO #__content_rating ( content_id, lastip, rating_sum, rating_count )' .
' VALUES ( '.(int) $pk.', '.$db->Quote($userIP).', '.(int) $rate.', 1 )'
);
if (!$db->query())
{
$this->setError($db->getErrorMsg());
return false;
}
}
else
{
if ($userIP != ($rating->lastip))
{
$db->setQuery(
'UPDATE #__content_rating' .
' SET rating_count = rating_count + 1, rating_sum = rating_sum + '.(int) $rate.', lastip = '.$db->Quote($userIP) .
' WHERE content_id = '.(int) $pk
);
if (!$db->query())
{
$this->setError($db->getErrorMsg());
return false;
}
}
else
{
return false;
}
}
return true;
}
Notify::warning(Lang::txt('COM_CONTENT_INVALID_RATING', $rate) . "JModelArticle::storeVote($rate)");
return false;
}
} | kevinwojo/hubzero-cms | core/components/com_content/site/models/article.php | PHP | gpl-2.0 | 10,295 |
/*
** igmpproxy - IGMP proxy based multicast router
** Copyright (C) 2005 Johnny Egeland <[email protected]>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**
**----------------------------------------------------------------------------
**
** This software is derived work from the following software. The original
** source code has been modified from it's original state by the author
** of igmpproxy.
**
** smcroute 0.92 - Copyright (C) 2001 Carsten Schill <[email protected]>
** - Licensed under the GNU General Public License, version 2
**
** mrouted 3.9-beta3 - COPYRIGHT 1989 by The Board of Trustees of
** Leland Stanford Junior University.
** - Original license can be found in the "doc/mrouted-LINCESE" file.
**
*/
/**
* mcgroup contains functions for joining and leaving multicast groups.
*
*/
#include "defs.h"
/**
* Common function for joining or leaving a MCast group.
*/
static int joinleave( int Cmd, int UdpSock, struct IfDesc *IfDp, uint32 mcastaddr ) {
struct ip_mreq CtlReq;
const char *CmdSt = Cmd == 'j' ? "join" : "leave";
CtlReq.imr_multiaddr.s_addr = mcastaddr;
CtlReq.imr_interface.s_addr = IfDp->InAdr.s_addr;
{
char FmtBu[ 32 ];
igmp_syslog( LOG_NOTICE, 0, "%sMcGroup: %s on %s", CmdSt,
inetFmt( mcastaddr, s1 ), IfDp ? IfDp->Name : "<any>" );
}
if( setsockopt( UdpSock, IPPROTO_IP,
Cmd == 'j' ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP,
(void *)&CtlReq, sizeof( CtlReq ) ) )
{
igmp_syslog( LOG_WARNING, errno, "MRT_%s_MEMBERSHIP failed", Cmd == 'j' ? "ADD" : "DROP" );
return 1;
}
return 0;
}
/**
* Joins the MC group with the address 'McAdr' on the interface 'IfName'.
* The join is bound to the UDP socket 'UdpSock', so if this socket is
* closed the membership is dropped.
*
* @return 0 if the function succeeds, 1 if parameters are wrong or the join fails
*/
int joinMcGroup( int UdpSock, struct IfDesc *IfDp, uint32 mcastaddr ) {
return joinleave( 'j', UdpSock, IfDp, mcastaddr );
}
/**
* Leaves the MC group with the address 'McAdr' on the interface 'IfName'.
*
* @return 0 if the function succeeds, 1 if parameters are wrong or the join fails
*/
int leaveMcGroup( int UdpSock, struct IfDesc *IfDp, uint32 mcastaddr ) {
return joinleave( 'l', UdpSock, IfDp, mcastaddr );
}
| dan82840/Netgear-RBR40 | package/igmpproxy/src/mcgroup.c | C | gpl-2.0 | 3,086 |
EasySocial.require().script('apps/fields/user/datetime/display_content').done(function($) {
$('[data-display-field="<?php echo $field->id; ?>"]').addController('EasySocial.Controller.Field.Datetime.Display', {
id: <?php echo $field->id; ?>,
userid: <?php echo $user->id; ?>
});
});
| cuongnd/banhangonline88_joomla | media/com_easysocial/apps/fields/user/datetime/themes/default/display_content.js | JavaScript | gpl-2.0 | 307 |
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "common/scummsys.h"
#if defined(OPENPANDORA)
#include "backends/graphics/openpandora/op-graphics.h"
#include "backends/events/openpandora/op-events.h"
#include "graphics/scaler/aspect.h"
#include "common/mutex.h"
#include "common/textconsole.h"
static SDL_Cursor *hiddenCursor;
OPGraphicsManager::OPGraphicsManager(SdlEventSource *sdlEventSource)
: SurfaceSdlGraphicsManager(sdlEventSource) {
}
bool OPGraphicsManager::loadGFXMode() {
uint8_t hiddenCursorData = 0;
hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
/* On the OpenPandora we need to work around an SDL assumption that
returns relative mouse coordinates when you get to the screen
edges using the touchscreen. The workaround is to set a blank
SDL cursor and not disable it (Hackish I know).
The root issues likes in the Windows Manager GRAB code in SDL.
That is why the issue is not seen on framebuffer devices like the
GP2X (there is no X window manager ;)).
*/
SDL_ShowCursor(SDL_ENABLE);
SDL_SetCursor(hiddenCursor);
_videoMode.fullscreen = true;
_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
_videoMode.aspectRatioCorrection = false;
if (_videoMode.aspectRatioCorrection)
_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
_videoMode.hardwareHeight = effectiveScreenHeight();
return SurfaceSdlGraphicsManager::loadGFXMode();
}
void OPGraphicsManager::unloadGFXMode() {
uint8_t hiddenCursorData = 0;
hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
// Free the hidden SDL cursor created in loadGFXMode
SDL_FreeCursor(hiddenCursor);
SurfaceSdlGraphicsManager::unloadGFXMode();
}
#endif
| MestreLion/scummvm | backends/graphics/openpandora/op-graphics.cpp | C++ | gpl-2.0 | 2,911 |
/***************************************************************************
dpti.c - description
-------------------
begin : Thu Sep 7 2000
copyright : (C) 2000 by Adaptec
July 30, 2001 First version being submitted
for inclusion in the kernel. V2.4
See Documentation/scsi/dpti.txt for history, notes, license info
and credits
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/***************************************************************************
* Sat Dec 20 2003 Go Taniguchi <[email protected]>
- Support 2.6 kernel and DMA-mapping
- ioctl fix for raid tools
- use schedule_timeout in long long loop
**************************************************************************/
/*#define DEBUG 1 */
/*#define UARTDELAY 1 */
#include <linux/module.h>
MODULE_AUTHOR("Deanna Bonds, with _lots_ of help from Mark Salyzyn");
MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
////////////////////////////////////////////////////////////////
#include <linux/ioctl.h> /* For SCSI-Passthrough */
#include <asm/uaccess.h>
#include <linux/stat.h>
#include <linux/slab.h> /* for kmalloc() */
#include <linux/pci.h> /* for PCI support */
#include <linux/proc_fs.h>
#include <linux/blkdev.h>
#include <linux/delay.h> /* for udelay */
#include <linux/interrupt.h>
#include <linux/kernel.h> /* for printk */
#include <linux/sched.h>
#include <linux/reboot.h>
#include <linux/spinlock.h>
#include <linux/dma-mapping.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/mutex.h>
#include <asm/processor.h> /* for boot_cpu_data */
#include <asm/pgtable.h>
#include <asm/io.h> /* for virt_to_bus, etc. */
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include "dpt/dptsig.h"
#include "dpti.h"
/*============================================================================
* Create a binary signature - this is read by dptsig
* Needed for our management apps
*============================================================================
*/
static DEFINE_MUTEX(adpt_mutex);
static dpt_sig_S DPTI_sig = {
{'d', 'P', 't', 'S', 'i', 'G'}, SIG_VERSION,
#ifdef __i386__
PROC_INTEL, PROC_386 | PROC_486 | PROC_PENTIUM | PROC_SEXIUM,
#elif defined(__ia64__)
PROC_INTEL, PROC_IA64,
#elif defined(__sparc__)
PROC_ULTRASPARC, PROC_ULTRASPARC,
#elif defined(__alpha__)
PROC_ALPHA, PROC_ALPHA,
#else
(-1),(-1),
#endif
FT_HBADRVR, 0, OEM_DPT, OS_LINUX, CAP_OVERLAP, DEV_ALL,
ADF_ALL_SC5, 0, 0, DPT_VERSION, DPT_REVISION, DPT_SUBREVISION,
DPT_MONTH, DPT_DAY, DPT_YEAR, "Adaptec Linux I2O RAID Driver"
};
/*============================================================================
* Globals
*============================================================================
*/
static DEFINE_MUTEX(adpt_configuration_lock);
static struct i2o_sys_tbl *sys_tbl;
static dma_addr_t sys_tbl_pa;
static int sys_tbl_ind;
static int sys_tbl_len;
static adpt_hba* hba_chain = NULL;
static int hba_count = 0;
static struct class *adpt_sysfs_class;
static long adpt_unlocked_ioctl(struct file *, unsigned int, unsigned long);
#ifdef CONFIG_COMPAT
static long compat_adpt_ioctl(struct file *, unsigned int, unsigned long);
#endif
static const struct file_operations adpt_fops = {
.unlocked_ioctl = adpt_unlocked_ioctl,
.open = adpt_open,
.release = adpt_close,
#ifdef CONFIG_COMPAT
.compat_ioctl = compat_adpt_ioctl,
#endif
.llseek = noop_llseek,
};
/* Structures and definitions for synchronous message posting.
* See adpt_i2o_post_wait() for description
* */
struct adpt_i2o_post_wait_data
{
int status;
u32 id;
adpt_wait_queue_head_t *wq;
struct adpt_i2o_post_wait_data *next;
};
static struct adpt_i2o_post_wait_data *adpt_post_wait_queue = NULL;
static u32 adpt_post_wait_id = 0;
static DEFINE_SPINLOCK(adpt_post_wait_lock);
/*============================================================================
* Functions
*============================================================================
*/
static inline int dpt_dma64(adpt_hba *pHba)
{
return (sizeof(dma_addr_t) > 4 && (pHba)->dma64);
}
static inline u32 dma_high(dma_addr_t addr)
{
return upper_32_bits(addr);
}
static inline u32 dma_low(dma_addr_t addr)
{
return (u32)addr;
}
static u8 adpt_read_blink_led(adpt_hba* host)
{
if (host->FwDebugBLEDflag_P) {
if( readb(host->FwDebugBLEDflag_P) == 0xbc ){
return readb(host->FwDebugBLEDvalue_P);
}
}
return 0;
}
/*============================================================================
* Scsi host template interface functions
*============================================================================
*/
static struct pci_device_id dptids[] = {
{ PCI_DPT_VENDOR_ID, PCI_DPT_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
{ PCI_DPT_VENDOR_ID, PCI_DPT_RAPTOR_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
{ 0, }
};
MODULE_DEVICE_TABLE(pci,dptids);
static int adpt_detect(struct scsi_host_template* sht)
{
struct pci_dev *pDev = NULL;
adpt_hba *pHba;
adpt_hba *next;
PINFO("Detecting Adaptec I2O RAID controllers...\n");
/* search for all Adatpec I2O RAID cards */
while ((pDev = pci_get_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) {
if(pDev->device == PCI_DPT_DEVICE_ID ||
pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){
if(adpt_install_hba(sht, pDev) ){
PERROR("Could not Init an I2O RAID device\n");
PERROR("Will not try to detect others.\n");
return hba_count-1;
}
pci_dev_get(pDev);
}
}
/* In INIT state, Activate IOPs */
for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
// Activate does get status , init outbound, and get hrt
if (adpt_i2o_activate_hba(pHba) < 0) {
adpt_i2o_delete_hba(pHba);
}
}
/* Active IOPs in HOLD state */
rebuild_sys_tab:
if (hba_chain == NULL)
return 0;
/*
* If build_sys_table fails, we kill everything and bail
* as we can't init the IOPs w/o a system table
*/
if (adpt_i2o_build_sys_table() < 0) {
adpt_i2o_sys_shutdown();
return 0;
}
PDEBUG("HBA's in HOLD state\n");
/* If IOP don't get online, we need to rebuild the System table */
for (pHba = hba_chain; pHba; pHba = pHba->next) {
if (adpt_i2o_online_hba(pHba) < 0) {
adpt_i2o_delete_hba(pHba);
goto rebuild_sys_tab;
}
}
/* Active IOPs now in OPERATIONAL state */
PDEBUG("HBA's in OPERATIONAL state\n");
printk("dpti: If you have a lot of devices this could take a few minutes.\n");
for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
printk(KERN_INFO"%s: Reading the hardware resource table.\n", pHba->name);
if (adpt_i2o_lct_get(pHba) < 0){
adpt_i2o_delete_hba(pHba);
continue;
}
if (adpt_i2o_parse_lct(pHba) < 0){
adpt_i2o_delete_hba(pHba);
continue;
}
adpt_inquiry(pHba);
}
adpt_sysfs_class = class_create(THIS_MODULE, "dpt_i2o");
if (IS_ERR(adpt_sysfs_class)) {
printk(KERN_WARNING"dpti: unable to create dpt_i2o class\n");
adpt_sysfs_class = NULL;
}
for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
if (adpt_scsi_host_alloc(pHba, sht) < 0){
adpt_i2o_delete_hba(pHba);
continue;
}
pHba->initialized = TRUE;
pHba->state &= ~DPTI_STATE_RESET;
if (adpt_sysfs_class) {
struct device *dev = device_create(adpt_sysfs_class,
NULL, MKDEV(DPTI_I2O_MAJOR, pHba->unit), NULL,
"dpti%d", pHba->unit);
if (IS_ERR(dev)) {
printk(KERN_WARNING"dpti%d: unable to "
"create device in dpt_i2o class\n",
pHba->unit);
}
}
}
// Register our control device node
// nodes will need to be created in /dev to access this
// the nodes can not be created from within the driver
if (hba_count && register_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER, &adpt_fops)) {
adpt_i2o_sys_shutdown();
return 0;
}
return hba_count;
}
/*
* scsi_unregister will be called AFTER we return.
*/
static int adpt_release(struct Scsi_Host *host)
{
adpt_hba* pHba = (adpt_hba*) host->hostdata[0];
// adpt_i2o_quiesce_hba(pHba);
adpt_i2o_delete_hba(pHba);
scsi_unregister(host);
return 0;
}
static void adpt_inquiry(adpt_hba* pHba)
{
u32 msg[17];
u32 *mptr;
u32 *lenptr;
int direction;
int scsidir;
u32 len;
u32 reqlen;
u8* buf;
dma_addr_t addr;
u8 scb[16];
s32 rcode;
memset(msg, 0, sizeof(msg));
buf = dma_alloc_coherent(&pHba->pDev->dev, 80, &addr, GFP_KERNEL);
if(!buf){
printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name);
return;
}
memset((void*)buf, 0, 36);
len = 36;
direction = 0x00000000;
scsidir =0x40000000; // DATA IN (iop<--dev)
if (dpt_dma64(pHba))
reqlen = 17; // SINGLE SGE, 64 bit
else
reqlen = 14; // SINGLE SGE, 32 bit
/* Stick the headers on */
msg[0] = reqlen<<16 | SGL_OFFSET_12;
msg[1] = (0xff<<24|HOST_TID<<12|ADAPTER_TID);
msg[2] = 0;
msg[3] = 0;
// Adaptec/DPT Private stuff
msg[4] = I2O_CMD_SCSI_EXEC|DPT_ORGANIZATION_ID<<16;
msg[5] = ADAPTER_TID | 1<<16 /* Interpret*/;
/* Direction, disconnect ok | sense data | simple queue , CDBLen */
// I2O_SCB_FLAG_ENABLE_DISCONNECT |
// I2O_SCB_FLAG_SIMPLE_QUEUE_TAG |
// I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE;
msg[6] = scsidir|0x20a00000| 6 /* cmd len*/;
mptr=msg+7;
memset(scb, 0, sizeof(scb));
// Write SCSI command into the message - always 16 byte block
scb[0] = INQUIRY;
scb[1] = 0;
scb[2] = 0;
scb[3] = 0;
scb[4] = 36;
scb[5] = 0;
// Don't care about the rest of scb
memcpy(mptr, scb, sizeof(scb));
mptr+=4;
lenptr=mptr++; /* Remember me - fill in when we know */
/* Now fill in the SGList and command */
*lenptr = len;
if (dpt_dma64(pHba)) {
*mptr++ = (0x7C<<24)+(2<<16)+0x02; /* Enable 64 bit */
*mptr++ = 1 << PAGE_SHIFT;
*mptr++ = 0xD0000000|direction|len;
*mptr++ = dma_low(addr);
*mptr++ = dma_high(addr);
} else {
*mptr++ = 0xD0000000|direction|len;
*mptr++ = addr;
}
// Send it on it's way
rcode = adpt_i2o_post_wait(pHba, msg, reqlen<<2, 120);
if (rcode != 0) {
sprintf(pHba->detail, "Adaptec I2O RAID");
printk(KERN_INFO "%s: Inquiry Error (%d)\n",pHba->name,rcode);
if (rcode != -ETIME && rcode != -EINTR)
dma_free_coherent(&pHba->pDev->dev, 80, buf, addr);
} else {
memset(pHba->detail, 0, sizeof(pHba->detail));
memcpy(&(pHba->detail), "Vendor: Adaptec ", 16);
memcpy(&(pHba->detail[16]), " Model: ", 8);
memcpy(&(pHba->detail[24]), (u8*) &buf[16], 16);
memcpy(&(pHba->detail[40]), " FW: ", 4);
memcpy(&(pHba->detail[44]), (u8*) &buf[32], 4);
pHba->detail[48] = '\0'; /* precautionary */
dma_free_coherent(&pHba->pDev->dev, 80, buf, addr);
}
adpt_i2o_status_get(pHba);
return ;
}
static int adpt_slave_configure(struct scsi_device * device)
{
struct Scsi_Host *host = device->host;
adpt_hba* pHba;
pHba = (adpt_hba *) host->hostdata[0];
if (host->can_queue && device->tagged_supported) {
scsi_adjust_queue_depth(device, MSG_SIMPLE_TAG,
host->can_queue - 1);
} else {
scsi_adjust_queue_depth(device, 0, 1);
}
return 0;
}
static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
{
adpt_hba* pHba = NULL;
struct adpt_device* pDev = NULL; /* dpt per device information */
cmd->scsi_done = done;
/*
* SCSI REQUEST_SENSE commands will be executed automatically by the
* Host Adapter for any errors, so they should not be executed
* explicitly unless the Sense Data is zero indicating that no error
* occurred.
*/
if ((cmd->cmnd[0] == REQUEST_SENSE) && (cmd->sense_buffer[0] != 0)) {
cmd->result = (DID_OK << 16);
cmd->scsi_done(cmd);
return 0;
}
pHba = (adpt_hba*)cmd->device->host->hostdata[0];
if (!pHba) {
return FAILED;
}
rmb();
/*
* TODO: I need to block here if I am processing ioctl cmds
* but if the outstanding cmds all finish before the ioctl,
* the scsi-core will not know to start sending cmds to me again.
* I need to a way to restart the scsi-cores queues or should I block
* calling scsi_done on the outstanding cmds instead
* for now we don't set the IOCTL state
*/
if(((pHba->state) & DPTI_STATE_IOCTL) || ((pHba->state) & DPTI_STATE_RESET)) {
pHba->host->last_reset = jiffies;
pHba->host->resetting = 1;
return 1;
}
// TODO if the cmd->device if offline then I may need to issue a bus rescan
// followed by a get_lct to see if the device is there anymore
if((pDev = (struct adpt_device*) (cmd->device->hostdata)) == NULL) {
/*
* First command request for this device. Set up a pointer
* to the device structure. This should be a TEST_UNIT_READY
* command from scan_scsis_single.
*/
if ((pDev = adpt_find_device(pHba, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun)) == NULL) {
// TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response
// with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue.
cmd->result = (DID_NO_CONNECT << 16);
cmd->scsi_done(cmd);
return 0;
}
cmd->device->hostdata = pDev;
}
pDev->pScsi_dev = cmd->device;
/*
* If we are being called from when the device is being reset,
* delay processing of the command until later.
*/
if (pDev->state & DPTI_DEV_RESET ) {
return FAILED;
}
return adpt_scsi_to_i2o(pHba, cmd, pDev);
}
static DEF_SCSI_QCMD(adpt_queue)
static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev,
sector_t capacity, int geom[])
{
int heads=-1;
int sectors=-1;
int cylinders=-1;
// *** First lets set the default geometry ****
// If the capacity is less than ox2000
if (capacity < 0x2000 ) { // floppy
heads = 18;
sectors = 2;
}
// else if between 0x2000 and 0x20000
else if (capacity < 0x20000) {
heads = 64;
sectors = 32;
}
// else if between 0x20000 and 0x40000
else if (capacity < 0x40000) {
heads = 65;
sectors = 63;
}
// else if between 0x4000 and 0x80000
else if (capacity < 0x80000) {
heads = 128;
sectors = 63;
}
// else if greater than 0x80000
else {
heads = 255;
sectors = 63;
}
cylinders = sector_div(capacity, heads * sectors);
// Special case if CDROM
if(sdev->type == 5) { // CDROM
heads = 252;
sectors = 63;
cylinders = 1111;
}
geom[0] = heads;
geom[1] = sectors;
geom[2] = cylinders;
PDEBUG("adpt_bios_param: exit\n");
return 0;
}
static const char *adpt_info(struct Scsi_Host *host)
{
adpt_hba* pHba;
pHba = (adpt_hba *) host->hostdata[0];
return (char *) (pHba->detail);
}
static int adpt_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
int length, int inout)
{
struct adpt_device* d;
int id;
int chan;
int len = 0;
int begin = 0;
int pos = 0;
adpt_hba* pHba;
int unit;
*start = buffer;
if (inout == TRUE) {
/*
* The user has done a write and wants us to take the
* data in the buffer and do something with it.
* proc_scsiwrite calls us with inout = 1
*
* Read data from buffer (writing to us) - NOT SUPPORTED
*/
return -EINVAL;
}
/*
* inout = 0 means the user has done a read and wants information
* returned, so we write information about the cards into the buffer
* proc_scsiread() calls us with inout = 0
*/
// Find HBA (host bus adapter) we are looking for
mutex_lock(&adpt_configuration_lock);
for (pHba = hba_chain; pHba; pHba = pHba->next) {
if (pHba->host == host) {
break; /* found adapter */
}
}
mutex_unlock(&adpt_configuration_lock);
if (pHba == NULL) {
return 0;
}
host = pHba->host;
len = sprintf(buffer , "Adaptec I2O RAID Driver Version: %s\n\n", DPT_I2O_VERSION);
len += sprintf(buffer+len, "%s\n", pHba->detail);
len += sprintf(buffer+len, "SCSI Host=scsi%d Control Node=/dev/%s irq=%d\n",
pHba->host->host_no, pHba->name, host->irq);
len += sprintf(buffer+len, "\tpost fifo size = %d\n\treply fifo size = %d\n\tsg table size = %d\n\n",
host->can_queue, (int) pHba->reply_fifo_size , host->sg_tablesize);
pos = begin + len;
/* CHECKPOINT */
if(pos > offset + length) {
goto stop_output;
}
if(pos <= offset) {
/*
* If we haven't even written to where we last left
* off (the last time we were called), reset the
* beginning pointer.
*/
len = 0;
begin = pos;
}
len += sprintf(buffer+len, "Devices:\n");
for(chan = 0; chan < MAX_CHANNEL; chan++) {
for(id = 0; id < MAX_ID; id++) {
d = pHba->channel[chan].device[id];
while(d){
len += sprintf(buffer+len,"\t%-24.24s", d->pScsi_dev->vendor);
len += sprintf(buffer+len," Rev: %-8.8s\n", d->pScsi_dev->rev);
pos = begin + len;
/* CHECKPOINT */
if(pos > offset + length) {
goto stop_output;
}
if(pos <= offset) {
len = 0;
begin = pos;
}
unit = d->pI2o_dev->lct_data.tid;
len += sprintf(buffer+len, "\tTID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)\n\n",
unit, (int)d->scsi_channel, (int)d->scsi_id, (int)d->scsi_lun,
scsi_device_online(d->pScsi_dev)? "online":"offline");
pos = begin + len;
/* CHECKPOINT */
if(pos > offset + length) {
goto stop_output;
}
if(pos <= offset) {
len = 0;
begin = pos;
}
d = d->next_lun;
}
}
}
/*
* begin is where we last checked our position with regards to offset
* begin is always less than offset. len is relative to begin. It
* is the number of bytes written past begin
*
*/
stop_output:
/* stop the output and calculate the correct length */
*(buffer + len) = '\0';
*start = buffer + (offset - begin); /* Start of wanted data */
len -= (offset - begin);
if(len > length) {
len = length;
} else if(len < 0){
len = 0;
**start = '\0';
}
return len;
}
/*
* Turn a struct scsi_cmnd * into a unique 32 bit 'context'.
*/
static u32 adpt_cmd_to_context(struct scsi_cmnd *cmd)
{
return (u32)cmd->serial_number;
}
/*
* Go from a u32 'context' to a struct scsi_cmnd * .
* This could probably be made more efficient.
*/
static struct scsi_cmnd *
adpt_cmd_from_context(adpt_hba * pHba, u32 context)
{
struct scsi_cmnd * cmd;
struct scsi_device * d;
if (context == 0)
return NULL;
spin_unlock(pHba->host->host_lock);
shost_for_each_device(d, pHba->host) {
unsigned long flags;
spin_lock_irqsave(&d->list_lock, flags);
list_for_each_entry(cmd, &d->cmd_list, list) {
if (((u32)cmd->serial_number == context)) {
spin_unlock_irqrestore(&d->list_lock, flags);
scsi_device_put(d);
spin_lock(pHba->host->host_lock);
return cmd;
}
}
spin_unlock_irqrestore(&d->list_lock, flags);
}
spin_lock(pHba->host->host_lock);
return NULL;
}
/*
* Turn a pointer to ioctl reply data into an u32 'context'
*/
static u32 adpt_ioctl_to_context(adpt_hba * pHba, void *reply)
{
#if BITS_PER_LONG == 32
return (u32)(unsigned long)reply;
#else
ulong flags = 0;
u32 nr, i;
spin_lock_irqsave(pHba->host->host_lock, flags);
nr = ARRAY_SIZE(pHba->ioctl_reply_context);
for (i = 0; i < nr; i++) {
if (pHba->ioctl_reply_context[i] == NULL) {
pHba->ioctl_reply_context[i] = reply;
break;
}
}
spin_unlock_irqrestore(pHba->host->host_lock, flags);
if (i >= nr) {
kfree (reply);
printk(KERN_WARNING"%s: Too many outstanding "
"ioctl commands\n", pHba->name);
return (u32)-1;
}
return i;
#endif
}
/*
* Go from an u32 'context' to a pointer to ioctl reply data.
*/
static void *adpt_ioctl_from_context(adpt_hba *pHba, u32 context)
{
#if BITS_PER_LONG == 32
return (void *)(unsigned long)context;
#else
void *p = pHba->ioctl_reply_context[context];
pHba->ioctl_reply_context[context] = NULL;
return p;
#endif
}
/*===========================================================================
* Error Handling routines
*===========================================================================
*/
static int adpt_abort(struct scsi_cmnd * cmd)
{
adpt_hba* pHba = NULL; /* host bus adapter structure */
struct adpt_device* dptdevice; /* dpt per device information */
u32 msg[5];
int rcode;
if(cmd->serial_number == 0){
return FAILED;
}
pHba = (adpt_hba*) cmd->device->host->hostdata[0];
printk(KERN_INFO"%s: Trying to Abort\n",pHba->name);
if ((dptdevice = (void*) (cmd->device->hostdata)) == NULL) {
printk(KERN_ERR "%s: Unable to abort: No device in cmnd\n",pHba->name);
return FAILED;
}
memset(msg, 0, sizeof(msg));
msg[0] = FIVE_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = I2O_CMD_SCSI_ABORT<<24|HOST_TID<<12|dptdevice->tid;
msg[2] = 0;
msg[3]= 0;
msg[4] = adpt_cmd_to_context(cmd);
if (pHba->host)
spin_lock_irq(pHba->host->host_lock);
rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER);
if (pHba->host)
spin_unlock_irq(pHba->host->host_lock);
if (rcode != 0) {
if(rcode == -EOPNOTSUPP ){
printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name);
return FAILED;
}
printk(KERN_INFO"%s: Abort failed.\n",pHba->name);
return FAILED;
}
printk(KERN_INFO"%s: Abort complete.\n",pHba->name);
return SUCCESS;
}
#define I2O_DEVICE_RESET 0x27
// This is the same for BLK and SCSI devices
// NOTE this is wrong in the i2o.h definitions
// This is not currently supported by our adapter but we issue it anyway
static int adpt_device_reset(struct scsi_cmnd* cmd)
{
adpt_hba* pHba;
u32 msg[4];
u32 rcode;
int old_state;
struct adpt_device* d = cmd->device->hostdata;
pHba = (void*) cmd->device->host->hostdata[0];
printk(KERN_INFO"%s: Trying to reset device\n",pHba->name);
if (!d) {
printk(KERN_INFO"%s: Reset Device: Device Not found\n",pHba->name);
return FAILED;
}
memset(msg, 0, sizeof(msg));
msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = (I2O_DEVICE_RESET<<24|HOST_TID<<12|d->tid);
msg[2] = 0;
msg[3] = 0;
if (pHba->host)
spin_lock_irq(pHba->host->host_lock);
old_state = d->state;
d->state |= DPTI_DEV_RESET;
rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER);
d->state = old_state;
if (pHba->host)
spin_unlock_irq(pHba->host->host_lock);
if (rcode != 0) {
if(rcode == -EOPNOTSUPP ){
printk(KERN_INFO"%s: Device reset not supported\n",pHba->name);
return FAILED;
}
printk(KERN_INFO"%s: Device reset failed\n",pHba->name);
return FAILED;
} else {
printk(KERN_INFO"%s: Device reset successful\n",pHba->name);
return SUCCESS;
}
}
#define I2O_HBA_BUS_RESET 0x87
// This version of bus reset is called by the eh_error handler
static int adpt_bus_reset(struct scsi_cmnd* cmd)
{
adpt_hba* pHba;
u32 msg[4];
u32 rcode;
pHba = (adpt_hba*)cmd->device->host->hostdata[0];
memset(msg, 0, sizeof(msg));
printk(KERN_WARNING"%s: Bus reset: SCSI Bus %d: tid: %d\n",pHba->name, cmd->device->channel,pHba->channel[cmd->device->channel].tid );
msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid);
msg[2] = 0;
msg[3] = 0;
if (pHba->host)
spin_lock_irq(pHba->host->host_lock);
rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER);
if (pHba->host)
spin_unlock_irq(pHba->host->host_lock);
if (rcode != 0) {
printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name);
return FAILED;
} else {
printk(KERN_WARNING"%s: Bus reset success.\n",pHba->name);
return SUCCESS;
}
}
// This version of reset is called by the eh_error_handler
static int __adpt_reset(struct scsi_cmnd* cmd)
{
adpt_hba* pHba;
int rcode;
pHba = (adpt_hba*)cmd->device->host->hostdata[0];
printk(KERN_WARNING"%s: Hba Reset: scsi id %d: tid: %d\n",pHba->name,cmd->device->channel,pHba->channel[cmd->device->channel].tid );
rcode = adpt_hba_reset(pHba);
if(rcode == 0){
printk(KERN_WARNING"%s: HBA reset complete\n",pHba->name);
return SUCCESS;
} else {
printk(KERN_WARNING"%s: HBA reset failed (%x)\n",pHba->name, rcode);
return FAILED;
}
}
static int adpt_reset(struct scsi_cmnd* cmd)
{
int rc;
spin_lock_irq(cmd->device->host->host_lock);
rc = __adpt_reset(cmd);
spin_unlock_irq(cmd->device->host->host_lock);
return rc;
}
// This version of reset is called by the ioctls and indirectly from eh_error_handler via adpt_reset
static int adpt_hba_reset(adpt_hba* pHba)
{
int rcode;
pHba->state |= DPTI_STATE_RESET;
// Activate does get status , init outbound, and get hrt
if ((rcode=adpt_i2o_activate_hba(pHba)) < 0) {
printk(KERN_ERR "%s: Could not activate\n", pHba->name);
adpt_i2o_delete_hba(pHba);
return rcode;
}
if ((rcode=adpt_i2o_build_sys_table()) < 0) {
adpt_i2o_delete_hba(pHba);
return rcode;
}
PDEBUG("%s: in HOLD state\n",pHba->name);
if ((rcode=adpt_i2o_online_hba(pHba)) < 0) {
adpt_i2o_delete_hba(pHba);
return rcode;
}
PDEBUG("%s: in OPERATIONAL state\n",pHba->name);
if ((rcode=adpt_i2o_lct_get(pHba)) < 0){
adpt_i2o_delete_hba(pHba);
return rcode;
}
if ((rcode=adpt_i2o_reparse_lct(pHba)) < 0){
adpt_i2o_delete_hba(pHba);
return rcode;
}
pHba->state &= ~DPTI_STATE_RESET;
adpt_fail_posted_scbs(pHba);
return 0; /* return success */
}
/*===========================================================================
*
*===========================================================================
*/
static void adpt_i2o_sys_shutdown(void)
{
adpt_hba *pHba, *pNext;
struct adpt_i2o_post_wait_data *p1, *old;
printk(KERN_INFO"Shutting down Adaptec I2O controllers.\n");
printk(KERN_INFO" This could take a few minutes if there are many devices attached\n");
/* Delete all IOPs from the controller chain */
/* They should have already been released by the
* scsi-core
*/
for (pHba = hba_chain; pHba; pHba = pNext) {
pNext = pHba->next;
adpt_i2o_delete_hba(pHba);
}
/* Remove any timedout entries from the wait queue. */
// spin_lock_irqsave(&adpt_post_wait_lock, flags);
/* Nothing should be outstanding at this point so just
* free them
*/
for(p1 = adpt_post_wait_queue; p1;) {
old = p1;
p1 = p1->next;
kfree(old);
}
// spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
adpt_post_wait_queue = NULL;
printk(KERN_INFO "Adaptec I2O controllers down.\n");
}
static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev)
{
adpt_hba* pHba = NULL;
adpt_hba* p = NULL;
ulong base_addr0_phys = 0;
ulong base_addr1_phys = 0;
u32 hba_map0_area_size = 0;
u32 hba_map1_area_size = 0;
void __iomem *base_addr_virt = NULL;
void __iomem *msg_addr_virt = NULL;
int dma64 = 0;
int raptorFlag = FALSE;
if(pci_enable_device(pDev)) {
return -EINVAL;
}
if (pci_request_regions(pDev, "dpt_i2o")) {
PERROR("dpti: adpt_config_hba: pci request region failed\n");
return -EINVAL;
}
pci_set_master(pDev);
/*
* See if we should enable dma64 mode.
*/
if (sizeof(dma_addr_t) > 4 &&
pci_set_dma_mask(pDev, DMA_BIT_MASK(64)) == 0) {
if (dma_get_required_mask(&pDev->dev) > DMA_BIT_MASK(32))
dma64 = 1;
}
if (!dma64 && pci_set_dma_mask(pDev, DMA_BIT_MASK(32)) != 0)
return -EINVAL;
/* adapter only supports message blocks below 4GB */
pci_set_consistent_dma_mask(pDev, DMA_BIT_MASK(32));
base_addr0_phys = pci_resource_start(pDev,0);
hba_map0_area_size = pci_resource_len(pDev,0);
// Check if standard PCI card or single BAR Raptor
if(pDev->device == PCI_DPT_DEVICE_ID){
if(pDev->subsystem_device >=0xc032 && pDev->subsystem_device <= 0xc03b){
// Raptor card with this device id needs 4M
hba_map0_area_size = 0x400000;
} else { // Not Raptor - it is a PCI card
if(hba_map0_area_size > 0x100000 ){
hba_map0_area_size = 0x100000;
}
}
} else {// Raptor split BAR config
// Use BAR1 in this configuration
base_addr1_phys = pci_resource_start(pDev,1);
hba_map1_area_size = pci_resource_len(pDev,1);
raptorFlag = TRUE;
}
#if BITS_PER_LONG == 64
/*
* The original Adaptec 64 bit driver has this comment here:
* "x86_64 machines need more optimal mappings"
*
* I assume some HBAs report ridiculously large mappings
* and we need to limit them on platforms with IOMMUs.
*/
if (raptorFlag == TRUE) {
if (hba_map0_area_size > 128)
hba_map0_area_size = 128;
if (hba_map1_area_size > 524288)
hba_map1_area_size = 524288;
} else {
if (hba_map0_area_size > 524288)
hba_map0_area_size = 524288;
}
#endif
base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size);
if (!base_addr_virt) {
pci_release_regions(pDev);
PERROR("dpti: adpt_config_hba: io remap failed\n");
return -EINVAL;
}
if(raptorFlag == TRUE) {
msg_addr_virt = ioremap(base_addr1_phys, hba_map1_area_size );
if (!msg_addr_virt) {
PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n");
iounmap(base_addr_virt);
pci_release_regions(pDev);
return -EINVAL;
}
} else {
msg_addr_virt = base_addr_virt;
}
// Allocate and zero the data structure
pHba = kzalloc(sizeof(adpt_hba), GFP_KERNEL);
if (!pHba) {
if (msg_addr_virt != base_addr_virt)
iounmap(msg_addr_virt);
iounmap(base_addr_virt);
pci_release_regions(pDev);
return -ENOMEM;
}
mutex_lock(&adpt_configuration_lock);
if(hba_chain != NULL){
for(p = hba_chain; p->next; p = p->next);
p->next = pHba;
} else {
hba_chain = pHba;
}
pHba->next = NULL;
pHba->unit = hba_count;
sprintf(pHba->name, "dpti%d", hba_count);
hba_count++;
mutex_unlock(&adpt_configuration_lock);
pHba->pDev = pDev;
pHba->base_addr_phys = base_addr0_phys;
// Set up the Virtual Base Address of the I2O Device
pHba->base_addr_virt = base_addr_virt;
pHba->msg_addr_virt = msg_addr_virt;
pHba->irq_mask = base_addr_virt+0x30;
pHba->post_port = base_addr_virt+0x40;
pHba->reply_port = base_addr_virt+0x44;
pHba->hrt = NULL;
pHba->lct = NULL;
pHba->lct_size = 0;
pHba->status_block = NULL;
pHba->post_count = 0;
pHba->state = DPTI_STATE_RESET;
pHba->pDev = pDev;
pHba->devices = NULL;
pHba->dma64 = dma64;
// Initializing the spinlocks
spin_lock_init(&pHba->state_lock);
spin_lock_init(&adpt_post_wait_lock);
if(raptorFlag == 0){
printk(KERN_INFO "Adaptec I2O RAID controller"
" %d at %p size=%x irq=%d%s\n",
hba_count-1, base_addr_virt,
hba_map0_area_size, pDev->irq,
dma64 ? " (64-bit DMA)" : "");
} else {
printk(KERN_INFO"Adaptec I2O RAID controller %d irq=%d%s\n",
hba_count-1, pDev->irq,
dma64 ? " (64-bit DMA)" : "");
printk(KERN_INFO" BAR0 %p - size= %x\n",base_addr_virt,hba_map0_area_size);
printk(KERN_INFO" BAR1 %p - size= %x\n",msg_addr_virt,hba_map1_area_size);
}
if (request_irq (pDev->irq, adpt_isr, IRQF_SHARED, pHba->name, pHba)) {
printk(KERN_ERR"%s: Couldn't register IRQ %d\n", pHba->name, pDev->irq);
adpt_i2o_delete_hba(pHba);
return -EINVAL;
}
return 0;
}
static void adpt_i2o_delete_hba(adpt_hba* pHba)
{
adpt_hba* p1;
adpt_hba* p2;
struct i2o_device* d;
struct i2o_device* next;
int i;
int j;
struct adpt_device* pDev;
struct adpt_device* pNext;
mutex_lock(&adpt_configuration_lock);
// scsi_unregister calls our adpt_release which
// does a quiese
if(pHba->host){
free_irq(pHba->host->irq, pHba);
}
p2 = NULL;
for( p1 = hba_chain; p1; p2 = p1,p1=p1->next){
if(p1 == pHba) {
if(p2) {
p2->next = p1->next;
} else {
hba_chain = p1->next;
}
break;
}
}
hba_count--;
mutex_unlock(&adpt_configuration_lock);
iounmap(pHba->base_addr_virt);
pci_release_regions(pHba->pDev);
if(pHba->msg_addr_virt != pHba->base_addr_virt){
iounmap(pHba->msg_addr_virt);
}
if(pHba->FwDebugBuffer_P)
iounmap(pHba->FwDebugBuffer_P);
if(pHba->hrt) {
dma_free_coherent(&pHba->pDev->dev,
pHba->hrt->num_entries * pHba->hrt->entry_len << 2,
pHba->hrt, pHba->hrt_pa);
}
if(pHba->lct) {
dma_free_coherent(&pHba->pDev->dev, pHba->lct_size,
pHba->lct, pHba->lct_pa);
}
if(pHba->status_block) {
dma_free_coherent(&pHba->pDev->dev, sizeof(i2o_status_block),
pHba->status_block, pHba->status_block_pa);
}
if(pHba->reply_pool) {
dma_free_coherent(&pHba->pDev->dev,
pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4,
pHba->reply_pool, pHba->reply_pool_pa);
}
for(d = pHba->devices; d ; d = next){
next = d->next;
kfree(d);
}
for(i = 0 ; i < pHba->top_scsi_channel ; i++){
for(j = 0; j < MAX_ID; j++){
if(pHba->channel[i].device[j] != NULL){
for(pDev = pHba->channel[i].device[j]; pDev; pDev = pNext){
pNext = pDev->next_lun;
kfree(pDev);
}
}
}
}
pci_dev_put(pHba->pDev);
if (adpt_sysfs_class)
device_destroy(adpt_sysfs_class,
MKDEV(DPTI_I2O_MAJOR, pHba->unit));
kfree(pHba);
if(hba_count <= 0){
unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER);
if (adpt_sysfs_class) {
class_destroy(adpt_sysfs_class);
adpt_sysfs_class = NULL;
}
}
}
static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun)
{
struct adpt_device* d;
if(chan < 0 || chan >= MAX_CHANNEL)
return NULL;
if( pHba->channel[chan].device == NULL){
printk(KERN_DEBUG"Adaptec I2O RAID: Trying to find device before they are allocated\n");
return NULL;
}
d = pHba->channel[chan].device[id];
if(!d || d->tid == 0) {
return NULL;
}
/* If it is the only lun at that address then this should match*/
if(d->scsi_lun == lun){
return d;
}
/* else we need to look through all the luns */
for(d=d->next_lun ; d ; d = d->next_lun){
if(d->scsi_lun == lun){
return d;
}
}
return NULL;
}
static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout)
{
// I used my own version of the WAIT_QUEUE_HEAD
// to handle some version differences
// When embedded in the kernel this could go back to the vanilla one
ADPT_DECLARE_WAIT_QUEUE_HEAD(adpt_wq_i2o_post);
int status = 0;
ulong flags = 0;
struct adpt_i2o_post_wait_data *p1, *p2;
struct adpt_i2o_post_wait_data *wait_data =
kmalloc(sizeof(struct adpt_i2o_post_wait_data), GFP_ATOMIC);
DECLARE_WAITQUEUE(wait, current);
if (!wait_data)
return -ENOMEM;
/*
* The spin locking is needed to keep anyone from playing
* with the queue pointers and id while we do the same
*/
spin_lock_irqsave(&adpt_post_wait_lock, flags);
// TODO we need a MORE unique way of getting ids
// to support async LCT get
wait_data->next = adpt_post_wait_queue;
adpt_post_wait_queue = wait_data;
adpt_post_wait_id++;
adpt_post_wait_id &= 0x7fff;
wait_data->id = adpt_post_wait_id;
spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
wait_data->wq = &adpt_wq_i2o_post;
wait_data->status = -ETIMEDOUT;
add_wait_queue(&adpt_wq_i2o_post, &wait);
msg[2] |= 0x80000000 | ((u32)wait_data->id);
timeout *= HZ;
if((status = adpt_i2o_post_this(pHba, msg, len)) == 0){
set_current_state(TASK_INTERRUPTIBLE);
if(pHba->host)
spin_unlock_irq(pHba->host->host_lock);
if (!timeout)
schedule();
else{
timeout = schedule_timeout(timeout);
if (timeout == 0) {
// I/O issued, but cannot get result in
// specified time. Freeing resorces is
// dangerous.
status = -ETIME;
}
}
if(pHba->host)
spin_lock_irq(pHba->host->host_lock);
}
remove_wait_queue(&adpt_wq_i2o_post, &wait);
if(status == -ETIMEDOUT){
printk(KERN_INFO"dpti%d: POST WAIT TIMEOUT\n",pHba->unit);
// We will have to free the wait_data memory during shutdown
return status;
}
/* Remove the entry from the queue. */
p2 = NULL;
spin_lock_irqsave(&adpt_post_wait_lock, flags);
for(p1 = adpt_post_wait_queue; p1; p2 = p1, p1 = p1->next) {
if(p1 == wait_data) {
if(p1->status == I2O_DETAIL_STATUS_UNSUPPORTED_FUNCTION ) {
status = -EOPNOTSUPP;
}
if(p2) {
p2->next = p1->next;
} else {
adpt_post_wait_queue = p1->next;
}
break;
}
}
spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
kfree(wait_data);
return status;
}
static s32 adpt_i2o_post_this(adpt_hba* pHba, u32* data, int len)
{
u32 m = EMPTY_QUEUE;
u32 __iomem *msg;
ulong timeout = jiffies + 30*HZ;
do {
rmb();
m = readl(pHba->post_port);
if (m != EMPTY_QUEUE) {
break;
}
if(time_after(jiffies,timeout)){
printk(KERN_WARNING"dpti%d: Timeout waiting for message frame!\n", pHba->unit);
return -ETIMEDOUT;
}
schedule_timeout_uninterruptible(1);
} while(m == EMPTY_QUEUE);
msg = pHba->msg_addr_virt + m;
memcpy_toio(msg, data, len);
wmb();
//post message
writel(m, pHba->post_port);
wmb();
return 0;
}
static void adpt_i2o_post_wait_complete(u32 context, int status)
{
struct adpt_i2o_post_wait_data *p1 = NULL;
/*
* We need to search through the adpt_post_wait
* queue to see if the given message is still
* outstanding. If not, it means that the IOP
* took longer to respond to the message than we
* had allowed and timer has already expired.
* Not much we can do about that except log
* it for debug purposes, increase timeout, and recompile
*
* Lock needed to keep anyone from moving queue pointers
* around while we're looking through them.
*/
context &= 0x7fff;
spin_lock(&adpt_post_wait_lock);
for(p1 = adpt_post_wait_queue; p1; p1 = p1->next) {
if(p1->id == context) {
p1->status = status;
spin_unlock(&adpt_post_wait_lock);
wake_up_interruptible(p1->wq);
return;
}
}
spin_unlock(&adpt_post_wait_lock);
// If this happens we lose commands that probably really completed
printk(KERN_DEBUG"dpti: Could Not find task %d in wait queue\n",context);
printk(KERN_DEBUG" Tasks in wait queue:\n");
for(p1 = adpt_post_wait_queue; p1; p1 = p1->next) {
printk(KERN_DEBUG" %d\n",p1->id);
}
return;
}
static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
{
u32 msg[8];
u8* status;
dma_addr_t addr;
u32 m = EMPTY_QUEUE ;
ulong timeout = jiffies + (TMOUT_IOPRESET*HZ);
if(pHba->initialized == FALSE) { // First time reset should be quick
timeout = jiffies + (25*HZ);
} else {
adpt_i2o_quiesce_hba(pHba);
}
do {
rmb();
m = readl(pHba->post_port);
if (m != EMPTY_QUEUE) {
break;
}
if(time_after(jiffies,timeout)){
printk(KERN_WARNING"Timeout waiting for message!\n");
return -ETIMEDOUT;
}
schedule_timeout_uninterruptible(1);
} while (m == EMPTY_QUEUE);
status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL);
if(status == NULL) {
adpt_send_nop(pHba, m);
printk(KERN_ERR"IOP reset failed - no free memory.\n");
return -ENOMEM;
}
memset(status,0,4);
msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID;
msg[2]=0;
msg[3]=0;
msg[4]=0;
msg[5]=0;
msg[6]=dma_low(addr);
msg[7]=dma_high(addr);
memcpy_toio(pHba->msg_addr_virt+m, msg, sizeof(msg));
wmb();
writel(m, pHba->post_port);
wmb();
while(*status == 0){
if(time_after(jiffies,timeout)){
printk(KERN_WARNING"%s: IOP Reset Timeout\n",pHba->name);
/* We lose 4 bytes of "status" here, but we cannot
free these because controller may awake and corrupt
those bytes at any time */
/* dma_free_coherent(&pHba->pDev->dev, 4, buf, addr); */
return -ETIMEDOUT;
}
rmb();
schedule_timeout_uninterruptible(1);
}
if(*status == 0x01 /*I2O_EXEC_IOP_RESET_IN_PROGRESS*/) {
PDEBUG("%s: Reset in progress...\n", pHba->name);
// Here we wait for message frame to become available
// indicated that reset has finished
do {
rmb();
m = readl(pHba->post_port);
if (m != EMPTY_QUEUE) {
break;
}
if(time_after(jiffies,timeout)){
printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name);
/* We lose 4 bytes of "status" here, but we
cannot free these because controller may
awake and corrupt those bytes at any time */
/* dma_free_coherent(&pHba->pDev->dev, 4, buf, addr); */
return -ETIMEDOUT;
}
schedule_timeout_uninterruptible(1);
} while (m == EMPTY_QUEUE);
// Flush the offset
adpt_send_nop(pHba, m);
}
adpt_i2o_status_get(pHba);
if(*status == 0x02 ||
pHba->status_block->iop_state != ADAPTER_STATE_RESET) {
printk(KERN_WARNING"%s: Reset reject, trying to clear\n",
pHba->name);
} else {
PDEBUG("%s: Reset completed.\n", pHba->name);
}
dma_free_coherent(&pHba->pDev->dev, 4, status, addr);
#ifdef UARTDELAY
// This delay is to allow someone attached to the card through the debug UART to
// set up the dump levels that they want before the rest of the initialization sequence
adpt_delay(20000);
#endif
return 0;
}
static int adpt_i2o_parse_lct(adpt_hba* pHba)
{
int i;
int max;
int tid;
struct i2o_device *d;
i2o_lct *lct = pHba->lct;
u8 bus_no = 0;
s16 scsi_id;
s16 scsi_lun;
u32 buf[10]; // larger than 7, or 8 ...
struct adpt_device* pDev;
if (lct == NULL) {
printk(KERN_ERR "%s: LCT is empty???\n",pHba->name);
return -1;
}
max = lct->table_size;
max -= 3;
max /= 9;
for(i=0;i<max;i++) {
if( lct->lct_entry[i].user_tid != 0xfff){
/*
* If we have hidden devices, we need to inform the upper layers about
* the possible maximum id reference to handle device access when
* an array is disassembled. This code has no other purpose but to
* allow us future access to devices that are currently hidden
* behind arrays, hotspares or have not been configured (JBOD mode).
*/
if( lct->lct_entry[i].class_id != I2O_CLASS_RANDOM_BLOCK_STORAGE &&
lct->lct_entry[i].class_id != I2O_CLASS_SCSI_PERIPHERAL &&
lct->lct_entry[i].class_id != I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL ){
continue;
}
tid = lct->lct_entry[i].tid;
// I2O_DPT_DEVICE_INFO_GROUP_NO;
if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)<0) {
continue;
}
bus_no = buf[0]>>16;
scsi_id = buf[1];
scsi_lun = (buf[2]>>8 )&0xff;
if(bus_no >= MAX_CHANNEL) { // Something wrong skip it
printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no);
continue;
}
if (scsi_id >= MAX_ID){
printk(KERN_WARNING"%s: SCSI ID %d out of range \n", pHba->name, bus_no);
continue;
}
if(bus_no > pHba->top_scsi_channel){
pHba->top_scsi_channel = bus_no;
}
if(scsi_id > pHba->top_scsi_id){
pHba->top_scsi_id = scsi_id;
}
if(scsi_lun > pHba->top_scsi_lun){
pHba->top_scsi_lun = scsi_lun;
}
continue;
}
d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
if(d==NULL)
{
printk(KERN_CRIT"%s: Out of memory for I2O device data.\n",pHba->name);
return -ENOMEM;
}
d->controller = pHba;
d->next = NULL;
memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
d->flags = 0;
tid = d->lct_data.tid;
adpt_i2o_report_hba_unit(pHba, d);
adpt_i2o_install_device(pHba, d);
}
bus_no = 0;
for(d = pHba->devices; d ; d = d->next) {
if(d->lct_data.class_id == I2O_CLASS_BUS_ADAPTER_PORT ||
d->lct_data.class_id == I2O_CLASS_FIBRE_CHANNEL_PORT){
tid = d->lct_data.tid;
// TODO get the bus_no from hrt-but for now they are in order
//bus_no =
if(bus_no > pHba->top_scsi_channel){
pHba->top_scsi_channel = bus_no;
}
pHba->channel[bus_no].type = d->lct_data.class_id;
pHba->channel[bus_no].tid = tid;
if(adpt_i2o_query_scalar(pHba, tid, 0x0200, -1, buf, 28)>=0)
{
pHba->channel[bus_no].scsi_id = buf[1];
PDEBUG("Bus %d - SCSI ID %d.\n", bus_no, buf[1]);
}
// TODO remove - this is just until we get from hrt
bus_no++;
if(bus_no >= MAX_CHANNEL) { // Something wrong skip it
printk(KERN_WARNING"%s: Channel number %d out of range - LCT\n", pHba->name, bus_no);
break;
}
}
}
// Setup adpt_device table
for(d = pHba->devices; d ; d = d->next) {
if(d->lct_data.class_id == I2O_CLASS_RANDOM_BLOCK_STORAGE ||
d->lct_data.class_id == I2O_CLASS_SCSI_PERIPHERAL ||
d->lct_data.class_id == I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL ){
tid = d->lct_data.tid;
scsi_id = -1;
// I2O_DPT_DEVICE_INFO_GROUP_NO;
if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)>=0) {
bus_no = buf[0]>>16;
scsi_id = buf[1];
scsi_lun = (buf[2]>>8 )&0xff;
if(bus_no >= MAX_CHANNEL) { // Something wrong skip it
continue;
}
if (scsi_id >= MAX_ID) {
continue;
}
if( pHba->channel[bus_no].device[scsi_id] == NULL){
pDev = kzalloc(sizeof(struct adpt_device),GFP_KERNEL);
if(pDev == NULL) {
return -ENOMEM;
}
pHba->channel[bus_no].device[scsi_id] = pDev;
} else {
for( pDev = pHba->channel[bus_no].device[scsi_id];
pDev->next_lun; pDev = pDev->next_lun){
}
pDev->next_lun = kzalloc(sizeof(struct adpt_device),GFP_KERNEL);
if(pDev->next_lun == NULL) {
return -ENOMEM;
}
pDev = pDev->next_lun;
}
pDev->tid = tid;
pDev->scsi_channel = bus_no;
pDev->scsi_id = scsi_id;
pDev->scsi_lun = scsi_lun;
pDev->pI2o_dev = d;
d->owner = pDev;
pDev->type = (buf[0])&0xff;
pDev->flags = (buf[0]>>8)&0xff;
if(scsi_id > pHba->top_scsi_id){
pHba->top_scsi_id = scsi_id;
}
if(scsi_lun > pHba->top_scsi_lun){
pHba->top_scsi_lun = scsi_lun;
}
}
if(scsi_id == -1){
printk(KERN_WARNING"Could not find SCSI ID for %s\n",
d->lct_data.identity_tag);
}
}
}
return 0;
}
/*
* Each I2O controller has a chain of devices on it - these match
* the useful parts of the LCT of the board.
*/
static int adpt_i2o_install_device(adpt_hba* pHba, struct i2o_device *d)
{
mutex_lock(&adpt_configuration_lock);
d->controller=pHba;
d->owner=NULL;
d->next=pHba->devices;
d->prev=NULL;
if (pHba->devices != NULL){
pHba->devices->prev=d;
}
pHba->devices=d;
*d->dev_name = 0;
mutex_unlock(&adpt_configuration_lock);
return 0;
}
static int adpt_open(struct inode *inode, struct file *file)
{
int minor;
adpt_hba* pHba;
mutex_lock(&adpt_mutex);
//TODO check for root access
//
minor = iminor(inode);
if (minor >= hba_count) {
mutex_unlock(&adpt_mutex);
return -ENXIO;
}
mutex_lock(&adpt_configuration_lock);
for (pHba = hba_chain; pHba; pHba = pHba->next) {
if (pHba->unit == minor) {
break; /* found adapter */
}
}
if (pHba == NULL) {
mutex_unlock(&adpt_configuration_lock);
mutex_unlock(&adpt_mutex);
return -ENXIO;
}
// if(pHba->in_use){
// mutex_unlock(&adpt_configuration_lock);
// return -EBUSY;
// }
pHba->in_use = 1;
mutex_unlock(&adpt_configuration_lock);
mutex_unlock(&adpt_mutex);
return 0;
}
static int adpt_close(struct inode *inode, struct file *file)
{
int minor;
adpt_hba* pHba;
minor = iminor(inode);
if (minor >= hba_count) {
return -ENXIO;
}
mutex_lock(&adpt_configuration_lock);
for (pHba = hba_chain; pHba; pHba = pHba->next) {
if (pHba->unit == minor) {
break; /* found adapter */
}
}
mutex_unlock(&adpt_configuration_lock);
if (pHba == NULL) {
return -ENXIO;
}
pHba->in_use = 0;
return 0;
}
static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
{
u32 msg[MAX_MESSAGE_SIZE];
u32* reply = NULL;
u32 size = 0;
u32 reply_size = 0;
u32 __user *user_msg = arg;
u32 __user * user_reply = NULL;
void *sg_list[pHba->sg_tablesize];
u32 sg_offset = 0;
u32 sg_count = 0;
int sg_index = 0;
u32 i = 0;
u32 rcode = 0;
void *p = NULL;
dma_addr_t addr;
ulong flags = 0;
memset(&msg, 0, MAX_MESSAGE_SIZE*4);
// get user msg size in u32s
if(get_user(size, &user_msg[0])){
return -EFAULT;
}
size = size>>16;
user_reply = &user_msg[size];
if(size > MAX_MESSAGE_SIZE){
return -EFAULT;
}
size *= 4; // Convert to bytes
/* Copy in the user's I2O command */
if(copy_from_user(msg, user_msg, size)) {
return -EFAULT;
}
get_user(reply_size, &user_reply[0]);
reply_size = reply_size>>16;
if(reply_size > REPLY_FRAME_SIZE){
reply_size = REPLY_FRAME_SIZE;
}
reply_size *= 4;
reply = kzalloc(REPLY_FRAME_SIZE*4, GFP_KERNEL);
if(reply == NULL) {
printk(KERN_WARNING"%s: Could not allocate reply buffer\n",pHba->name);
return -ENOMEM;
}
sg_offset = (msg[0]>>4)&0xf;
msg[2] = 0x40000000; // IOCTL context
msg[3] = adpt_ioctl_to_context(pHba, reply);
if (msg[3] == (u32)-1)
return -EBUSY;
memset(sg_list,0, sizeof(sg_list[0])*pHba->sg_tablesize);
if(sg_offset) {
// TODO add 64 bit API
struct sg_simple_element *sg = (struct sg_simple_element*) (msg+sg_offset);
sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
if (sg_count > pHba->sg_tablesize){
printk(KERN_DEBUG"%s:IOCTL SG List too large (%u)\n", pHba->name,sg_count);
kfree (reply);
return -EINVAL;
}
for(i = 0; i < sg_count; i++) {
int sg_size;
if (!(sg[i].flag_count & 0x10000000 /*I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT*/)) {
printk(KERN_DEBUG"%s:Bad SG element %d - not simple (%x)\n",pHba->name,i, sg[i].flag_count);
rcode = -EINVAL;
goto cleanup;
}
sg_size = sg[i].flag_count & 0xffffff;
/* Allocate memory for the transfer */
p = dma_alloc_coherent(&pHba->pDev->dev, sg_size, &addr, GFP_KERNEL);
if(!p) {
printk(KERN_DEBUG"%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
pHba->name,sg_size,i,sg_count);
rcode = -ENOMEM;
goto cleanup;
}
sg_list[sg_index++] = p; // sglist indexed with input frame, not our internal frame.
/* Copy in the user's SG buffer if necessary */
if(sg[i].flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR*/) {
// sg_simple_element API is 32 bit
if (copy_from_user(p,(void __user *)(ulong)sg[i].addr_bus, sg_size)) {
printk(KERN_DEBUG"%s: Could not copy SG buf %d FROM user\n",pHba->name,i);
rcode = -EFAULT;
goto cleanup;
}
}
/* sg_simple_element API is 32 bit, but addr < 4GB */
sg[i].addr_bus = addr;
}
}
do {
if(pHba->host)
spin_lock_irqsave(pHba->host->host_lock, flags);
// This state stops any new commands from enterring the
// controller while processing the ioctl
// pHba->state |= DPTI_STATE_IOCTL;
// We can't set this now - The scsi subsystem sets host_blocked and
// the queue empties and stops. We need a way to restart the queue
rcode = adpt_i2o_post_wait(pHba, msg, size, FOREVER);
if (rcode != 0)
printk("adpt_i2o_passthru: post wait failed %d %p\n",
rcode, reply);
// pHba->state &= ~DPTI_STATE_IOCTL;
if(pHba->host)
spin_unlock_irqrestore(pHba->host->host_lock, flags);
} while(rcode == -ETIMEDOUT);
if(rcode){
goto cleanup;
}
if(sg_offset) {
/* Copy back the Scatter Gather buffers back to user space */
u32 j;
// TODO add 64 bit API
struct sg_simple_element* sg;
int sg_size;
// re-acquire the original message to handle correctly the sg copy operation
memset(&msg, 0, MAX_MESSAGE_SIZE*4);
// get user msg size in u32s
if(get_user(size, &user_msg[0])){
rcode = -EFAULT;
goto cleanup;
}
size = size>>16;
size *= 4;
if (size > MAX_MESSAGE_SIZE) {
rcode = -EINVAL;
goto cleanup;
}
/* Copy in the user's I2O command */
if (copy_from_user (msg, user_msg, size)) {
rcode = -EFAULT;
goto cleanup;
}
sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
// TODO add 64 bit API
sg = (struct sg_simple_element*)(msg + sg_offset);
for (j = 0; j < sg_count; j++) {
/* Copy out the SG list to user's buffer if necessary */
if(! (sg[j].flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR*/)) {
sg_size = sg[j].flag_count & 0xffffff;
// sg_simple_element API is 32 bit
if (copy_to_user((void __user *)(ulong)sg[j].addr_bus,sg_list[j], sg_size)) {
printk(KERN_WARNING"%s: Could not copy %p TO user %x\n",pHba->name, sg_list[j], sg[j].addr_bus);
rcode = -EFAULT;
goto cleanup;
}
}
}
}
/* Copy back the reply to user space */
if (reply_size) {
// we wrote our own values for context - now restore the user supplied ones
if(copy_from_user(reply+2, user_msg+2, sizeof(u32)*2)) {
printk(KERN_WARNING"%s: Could not copy message context FROM user\n",pHba->name);
rcode = -EFAULT;
}
if(copy_to_user(user_reply, reply, reply_size)) {
printk(KERN_WARNING"%s: Could not copy reply TO user\n",pHba->name);
rcode = -EFAULT;
}
}
cleanup:
if (rcode != -ETIME && rcode != -EINTR) {
struct sg_simple_element *sg =
(struct sg_simple_element*) (msg +sg_offset);
kfree (reply);
while(sg_index) {
if(sg_list[--sg_index]) {
dma_free_coherent(&pHba->pDev->dev,
sg[sg_index].flag_count & 0xffffff,
sg_list[sg_index],
sg[sg_index].addr_bus);
}
}
}
return rcode;
}
#if defined __ia64__
static void adpt_ia64_info(sysInfo_S* si)
{
// This is all the info we need for now
// We will add more info as our new
// managmenent utility requires it
si->processorType = PROC_IA64;
}
#endif
#if defined __sparc__
static void adpt_sparc_info(sysInfo_S* si)
{
// This is all the info we need for now
// We will add more info as our new
// managmenent utility requires it
si->processorType = PROC_ULTRASPARC;
}
#endif
#if defined __alpha__
static void adpt_alpha_info(sysInfo_S* si)
{
// This is all the info we need for now
// We will add more info as our new
// managmenent utility requires it
si->processorType = PROC_ALPHA;
}
#endif
#if defined __i386__
static void adpt_i386_info(sysInfo_S* si)
{
// This is all the info we need for now
// We will add more info as our new
// managmenent utility requires it
switch (boot_cpu_data.x86) {
case CPU_386:
si->processorType = PROC_386;
break;
case CPU_486:
si->processorType = PROC_486;
break;
case CPU_586:
si->processorType = PROC_PENTIUM;
break;
default: // Just in case
si->processorType = PROC_PENTIUM;
break;
}
}
#endif
/*
* This routine returns information about the system. This does not effect
* any logic and if the info is wrong - it doesn't matter.
*/
/* Get all the info we can not get from kernel services */
static int adpt_system_info(void __user *buffer)
{
sysInfo_S si;
memset(&si, 0, sizeof(si));
si.osType = OS_LINUX;
si.osMajorVersion = 0;
si.osMinorVersion = 0;
si.osRevision = 0;
si.busType = SI_PCI_BUS;
si.processorFamily = DPTI_sig.dsProcessorFamily;
#if defined __i386__
adpt_i386_info(&si);
#elif defined (__ia64__)
adpt_ia64_info(&si);
#elif defined(__sparc__)
adpt_sparc_info(&si);
#elif defined (__alpha__)
adpt_alpha_info(&si);
#else
si.processorType = 0xff ;
#endif
if (copy_to_user(buffer, &si, sizeof(si))){
printk(KERN_WARNING"dpti: Could not copy buffer TO user\n");
return -EFAULT;
}
return 0;
}
static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
{
int minor;
int error = 0;
adpt_hba* pHba;
ulong flags = 0;
void __user *argp = (void __user *)arg;
minor = iminor(inode);
if (minor >= DPTI_MAX_HBA){
return -ENXIO;
}
mutex_lock(&adpt_configuration_lock);
for (pHba = hba_chain; pHba; pHba = pHba->next) {
if (pHba->unit == minor) {
break; /* found adapter */
}
}
mutex_unlock(&adpt_configuration_lock);
if(pHba == NULL){
return -ENXIO;
}
while((volatile u32) pHba->state & DPTI_STATE_RESET )
schedule_timeout_uninterruptible(2);
switch (cmd) {
// TODO: handle 3 cases
case DPT_SIGNATURE:
if (copy_to_user(argp, &DPTI_sig, sizeof(DPTI_sig))) {
return -EFAULT;
}
break;
case I2OUSRCMD:
return adpt_i2o_passthru(pHba, argp);
case DPT_CTRLINFO:{
drvrHBAinfo_S HbaInfo;
#define FLG_OSD_PCI_VALID 0x0001
#define FLG_OSD_DMA 0x0002
#define FLG_OSD_I2O 0x0004
memset(&HbaInfo, 0, sizeof(HbaInfo));
HbaInfo.drvrHBAnum = pHba->unit;
HbaInfo.baseAddr = (ulong) pHba->base_addr_phys;
HbaInfo.blinkState = adpt_read_blink_led(pHba);
HbaInfo.pciBusNum = pHba->pDev->bus->number;
HbaInfo.pciDeviceNum=PCI_SLOT(pHba->pDev->devfn);
HbaInfo.Interrupt = pHba->pDev->irq;
HbaInfo.hbaFlags = FLG_OSD_PCI_VALID | FLG_OSD_DMA | FLG_OSD_I2O;
if(copy_to_user(argp, &HbaInfo, sizeof(HbaInfo))){
printk(KERN_WARNING"%s: Could not copy HbaInfo TO user\n",pHba->name);
return -EFAULT;
}
break;
}
case DPT_SYSINFO:
return adpt_system_info(argp);
case DPT_BLINKLED:{
u32 value;
value = (u32)adpt_read_blink_led(pHba);
if (copy_to_user(argp, &value, sizeof(value))) {
return -EFAULT;
}
break;
}
case I2ORESETCMD:
if(pHba->host)
spin_lock_irqsave(pHba->host->host_lock, flags);
adpt_hba_reset(pHba);
if(pHba->host)
spin_unlock_irqrestore(pHba->host->host_lock, flags);
break;
case I2ORESCANCMD:
adpt_rescan(pHba);
break;
default:
return -EINVAL;
}
return error;
}
static long adpt_unlocked_ioctl(struct file *file, uint cmd, ulong arg)
{
struct inode *inode;
long ret;
inode = file->f_dentry->d_inode;
mutex_lock(&adpt_mutex);
ret = adpt_ioctl(inode, file, cmd, arg);
mutex_unlock(&adpt_mutex);
return ret;
}
#ifdef CONFIG_COMPAT
static long compat_adpt_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
struct inode *inode;
long ret;
inode = file->f_dentry->d_inode;
mutex_lock(&adpt_mutex);
switch(cmd) {
case DPT_SIGNATURE:
case I2OUSRCMD:
case DPT_CTRLINFO:
case DPT_SYSINFO:
case DPT_BLINKLED:
case I2ORESETCMD:
case I2ORESCANCMD:
case (DPT_TARGET_BUSY & 0xFFFF):
case DPT_TARGET_BUSY:
ret = adpt_ioctl(inode, file, cmd, arg);
break;
default:
ret = -ENOIOCTLCMD;
}
mutex_unlock(&adpt_mutex);
return ret;
}
#endif
static irqreturn_t adpt_isr(int irq, void *dev_id)
{
struct scsi_cmnd* cmd;
adpt_hba* pHba = dev_id;
u32 m;
void __iomem *reply;
u32 status=0;
u32 context;
ulong flags = 0;
int handled = 0;
if (pHba == NULL){
printk(KERN_WARNING"adpt_isr: NULL dev_id\n");
return IRQ_NONE;
}
if(pHba->host)
spin_lock_irqsave(pHba->host->host_lock, flags);
while( readl(pHba->irq_mask) & I2O_INTERRUPT_PENDING_B) {
m = readl(pHba->reply_port);
if(m == EMPTY_QUEUE){
// Try twice then give up
rmb();
m = readl(pHba->reply_port);
if(m == EMPTY_QUEUE){
// This really should not happen
printk(KERN_ERR"dpti: Could not get reply frame\n");
goto out;
}
}
if (pHba->reply_pool_pa <= m &&
m < pHba->reply_pool_pa +
(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4)) {
reply = (u8 *)pHba->reply_pool +
(m - pHba->reply_pool_pa);
} else {
/* Ick, we should *never* be here */
printk(KERN_ERR "dpti: reply frame not from pool\n");
reply = (u8 *)bus_to_virt(m);
}
if (readl(reply) & MSG_FAIL) {
u32 old_m = readl(reply+28);
void __iomem *msg;
u32 old_context;
PDEBUG("%s: Failed message\n",pHba->name);
if(old_m >= 0x100000){
printk(KERN_ERR"%s: Bad preserved MFA (%x)- dropping frame\n",pHba->name,old_m);
writel(m,pHba->reply_port);
continue;
}
// Transaction context is 0 in failed reply frame
msg = pHba->msg_addr_virt + old_m;
old_context = readl(msg+12);
writel(old_context, reply+12);
adpt_send_nop(pHba, old_m);
}
context = readl(reply+8);
if(context & 0x40000000){ // IOCTL
void *p = adpt_ioctl_from_context(pHba, readl(reply+12));
if( p != NULL) {
memcpy_fromio(p, reply, REPLY_FRAME_SIZE * 4);
}
// All IOCTLs will also be post wait
}
if(context & 0x80000000){ // Post wait message
status = readl(reply+16);
if(status >> 24){
status &= 0xffff; /* Get detail status */
} else {
status = I2O_POST_WAIT_OK;
}
if(!(context & 0x40000000)) {
cmd = adpt_cmd_from_context(pHba,
readl(reply+12));
if(cmd != NULL) {
printk(KERN_WARNING"%s: Apparent SCSI cmd in Post Wait Context - cmd=%p context=%x\n", pHba->name, cmd, context);
}
}
adpt_i2o_post_wait_complete(context, status);
} else { // SCSI message
cmd = adpt_cmd_from_context (pHba, readl(reply+12));
if(cmd != NULL){
scsi_dma_unmap(cmd);
if(cmd->serial_number != 0) { // If not timedout
adpt_i2o_to_scsi(reply, cmd);
}
}
}
writel(m, pHba->reply_port);
wmb();
rmb();
}
handled = 1;
out: if(pHba->host)
spin_unlock_irqrestore(pHba->host->host_lock, flags);
return IRQ_RETVAL(handled);
}
static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* d)
{
int i;
u32 msg[MAX_MESSAGE_SIZE];
u32* mptr;
u32* lptr;
u32 *lenptr;
int direction;
int scsidir;
int nseg;
u32 len;
u32 reqlen;
s32 rcode;
dma_addr_t addr;
memset(msg, 0 , sizeof(msg));
len = scsi_bufflen(cmd);
direction = 0x00000000;
scsidir = 0x00000000; // DATA NO XFER
if(len) {
/*
* Set SCBFlags to indicate if data is being transferred
* in or out, or no data transfer
* Note: Do not have to verify index is less than 0 since
* cmd->cmnd[0] is an unsigned char
*/
switch(cmd->sc_data_direction){
case DMA_FROM_DEVICE:
scsidir =0x40000000; // DATA IN (iop<--dev)
break;
case DMA_TO_DEVICE:
direction=0x04000000; // SGL OUT
scsidir =0x80000000; // DATA OUT (iop-->dev)
break;
case DMA_NONE:
break;
case DMA_BIDIRECTIONAL:
scsidir =0x40000000; // DATA IN (iop<--dev)
// Assume In - and continue;
break;
default:
printk(KERN_WARNING"%s: scsi opcode 0x%x not supported.\n",
pHba->name, cmd->cmnd[0]);
cmd->result = (DID_OK <<16) | (INITIATOR_ERROR << 8);
cmd->scsi_done(cmd);
return 0;
}
}
// msg[0] is set later
// I2O_CMD_SCSI_EXEC
msg[1] = ((0xff<<24)|(HOST_TID<<12)|d->tid);
msg[2] = 0;
msg[3] = adpt_cmd_to_context(cmd); /* Want SCSI control block back */
// Our cards use the transaction context as the tag for queueing
// Adaptec/DPT Private stuff
msg[4] = I2O_CMD_SCSI_EXEC|(DPT_ORGANIZATION_ID<<16);
msg[5] = d->tid;
/* Direction, disconnect ok | sense data | simple queue , CDBLen */
// I2O_SCB_FLAG_ENABLE_DISCONNECT |
// I2O_SCB_FLAG_SIMPLE_QUEUE_TAG |
// I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE;
msg[6] = scsidir|0x20a00000|cmd->cmd_len;
mptr=msg+7;
// Write SCSI command into the message - always 16 byte block
memset(mptr, 0, 16);
memcpy(mptr, cmd->cmnd, cmd->cmd_len);
mptr+=4;
lenptr=mptr++; /* Remember me - fill in when we know */
if (dpt_dma64(pHba)) {
reqlen = 16; // SINGLE SGE
*mptr++ = (0x7C<<24)+(2<<16)+0x02; /* Enable 64 bit */
*mptr++ = 1 << PAGE_SHIFT;
} else {
reqlen = 14; // SINGLE SGE
}
/* Now fill in the SGList and command */
nseg = scsi_dma_map(cmd);
BUG_ON(nseg < 0);
if (nseg) {
struct scatterlist *sg;
len = 0;
scsi_for_each_sg(cmd, sg, nseg, i) {
lptr = mptr;
*mptr++ = direction|0x10000000|sg_dma_len(sg);
len+=sg_dma_len(sg);
addr = sg_dma_address(sg);
*mptr++ = dma_low(addr);
if (dpt_dma64(pHba))
*mptr++ = dma_high(addr);
/* Make this an end of list */
if (i == nseg - 1)
*lptr = direction|0xD0000000|sg_dma_len(sg);
}
reqlen = mptr - msg;
*lenptr = len;
if(cmd->underflow && len != cmd->underflow){
printk(KERN_WARNING"Cmd len %08X Cmd underflow %08X\n",
len, cmd->underflow);
}
} else {
*lenptr = len = 0;
reqlen = 12;
}
/* Stick the headers on */
msg[0] = reqlen<<16 | ((reqlen > 12) ? SGL_OFFSET_12 : SGL_OFFSET_0);
// Send it on it's way
rcode = adpt_i2o_post_this(pHba, msg, reqlen<<2);
if (rcode == 0) {
return 0;
}
return rcode;
}
static s32 adpt_scsi_host_alloc(adpt_hba* pHba, struct scsi_host_template *sht)
{
struct Scsi_Host *host;
host = scsi_host_alloc(sht, sizeof(adpt_hba*));
if (host == NULL) {
printk("%s: scsi_host_alloc returned NULL\n", pHba->name);
return -1;
}
host->hostdata[0] = (unsigned long)pHba;
pHba->host = host;
host->irq = pHba->pDev->irq;
/* no IO ports, so don't have to set host->io_port and
* host->n_io_port
*/
host->io_port = 0;
host->n_io_port = 0;
/* see comments in scsi_host.h */
host->max_id = 16;
host->max_lun = 256;
host->max_channel = pHba->top_scsi_channel + 1;
host->cmd_per_lun = 1;
host->unique_id = (u32)sys_tbl_pa + pHba->unit;
host->sg_tablesize = pHba->sg_tablesize;
host->can_queue = pHba->post_fifo_size;
return 0;
}
static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
{
adpt_hba* pHba;
u32 hba_status;
u32 dev_status;
u32 reply_flags = readl(reply) & 0xff00; // Leave it shifted up 8 bits
// I know this would look cleaner if I just read bytes
// but the model I have been using for all the rest of the
// io is in 4 byte words - so I keep that model
u16 detailed_status = readl(reply+16) &0xffff;
dev_status = (detailed_status & 0xff);
hba_status = detailed_status >> 8;
// calculate resid for sg
scsi_set_resid(cmd, scsi_bufflen(cmd) - readl(reply+20));
pHba = (adpt_hba*) cmd->device->host->hostdata[0];
cmd->sense_buffer[0] = '\0'; // initialize sense valid flag to false
if(!(reply_flags & MSG_FAIL)) {
switch(detailed_status & I2O_SCSI_DSC_MASK) {
case I2O_SCSI_DSC_SUCCESS:
cmd->result = (DID_OK << 16);
// handle underflow
if (readl(reply+20) < cmd->underflow) {
cmd->result = (DID_ERROR <<16);
printk(KERN_WARNING"%s: SCSI CMD underflow\n",pHba->name);
}
break;
case I2O_SCSI_DSC_REQUEST_ABORTED:
cmd->result = (DID_ABORT << 16);
break;
case I2O_SCSI_DSC_PATH_INVALID:
case I2O_SCSI_DSC_DEVICE_NOT_PRESENT:
case I2O_SCSI_DSC_SELECTION_TIMEOUT:
case I2O_SCSI_DSC_COMMAND_TIMEOUT:
case I2O_SCSI_DSC_NO_ADAPTER:
case I2O_SCSI_DSC_RESOURCE_UNAVAILABLE:
printk(KERN_WARNING"%s: SCSI Timeout-Device (%d,%d,%d) hba status=0x%x, dev status=0x%x, cmd=0x%x\n",
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, hba_status, dev_status, cmd->cmnd[0]);
cmd->result = (DID_TIME_OUT << 16);
break;
case I2O_SCSI_DSC_ADAPTER_BUSY:
case I2O_SCSI_DSC_BUS_BUSY:
cmd->result = (DID_BUS_BUSY << 16);
break;
case I2O_SCSI_DSC_SCSI_BUS_RESET:
case I2O_SCSI_DSC_BDR_MESSAGE_SENT:
cmd->result = (DID_RESET << 16);
break;
case I2O_SCSI_DSC_PARITY_ERROR_FAILURE:
printk(KERN_WARNING"%s: SCSI CMD parity error\n",pHba->name);
cmd->result = (DID_PARITY << 16);
break;
case I2O_SCSI_DSC_UNABLE_TO_ABORT:
case I2O_SCSI_DSC_COMPLETE_WITH_ERROR:
case I2O_SCSI_DSC_UNABLE_TO_TERMINATE:
case I2O_SCSI_DSC_MR_MESSAGE_RECEIVED:
case I2O_SCSI_DSC_AUTOSENSE_FAILED:
case I2O_SCSI_DSC_DATA_OVERRUN:
case I2O_SCSI_DSC_UNEXPECTED_BUS_FREE:
case I2O_SCSI_DSC_SEQUENCE_FAILURE:
case I2O_SCSI_DSC_REQUEST_LENGTH_ERROR:
case I2O_SCSI_DSC_PROVIDE_FAILURE:
case I2O_SCSI_DSC_REQUEST_TERMINATED:
case I2O_SCSI_DSC_IDE_MESSAGE_SENT:
case I2O_SCSI_DSC_UNACKNOWLEDGED_EVENT:
case I2O_SCSI_DSC_MESSAGE_RECEIVED:
case I2O_SCSI_DSC_INVALID_CDB:
case I2O_SCSI_DSC_LUN_INVALID:
case I2O_SCSI_DSC_SCSI_TID_INVALID:
case I2O_SCSI_DSC_FUNCTION_UNAVAILABLE:
case I2O_SCSI_DSC_NO_NEXUS:
case I2O_SCSI_DSC_CDB_RECEIVED:
case I2O_SCSI_DSC_LUN_ALREADY_ENABLED:
case I2O_SCSI_DSC_QUEUE_FROZEN:
case I2O_SCSI_DSC_REQUEST_INVALID:
default:
printk(KERN_WARNING"%s: SCSI error %0x-Device(%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
pHba->name, detailed_status & I2O_SCSI_DSC_MASK, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun,
hba_status, dev_status, cmd->cmnd[0]);
cmd->result = (DID_ERROR << 16);
break;
}
// copy over the request sense data if it was a check
// condition status
if (dev_status == SAM_STAT_CHECK_CONDITION) {
u32 len = min(SCSI_SENSE_BUFFERSIZE, 40);
// Copy over the sense data
memcpy_fromio(cmd->sense_buffer, (reply+28) , len);
if(cmd->sense_buffer[0] == 0x70 /* class 7 */ &&
cmd->sense_buffer[2] == DATA_PROTECT ){
/* This is to handle an array failed */
cmd->result = (DID_TIME_OUT << 16);
printk(KERN_WARNING"%s: SCSI Data Protect-Device (%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n",
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun,
hba_status, dev_status, cmd->cmnd[0]);
}
}
} else {
/* In this condtion we could not talk to the tid
* the card rejected it. We should signal a retry
* for a limitted number of retries.
*/
cmd->result = (DID_TIME_OUT << 16);
printk(KERN_WARNING"%s: I2O MSG_FAIL - Device (%d,%d,%d) tid=%d, cmd=0x%x\n",
pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun,
((struct adpt_device*)(cmd->device->hostdata))->tid, cmd->cmnd[0]);
}
cmd->result |= (dev_status);
if(cmd->scsi_done != NULL){
cmd->scsi_done(cmd);
}
return cmd->result;
}
static s32 adpt_rescan(adpt_hba* pHba)
{
s32 rcode;
ulong flags = 0;
if(pHba->host)
spin_lock_irqsave(pHba->host->host_lock, flags);
if ((rcode=adpt_i2o_lct_get(pHba)) < 0)
goto out;
if ((rcode=adpt_i2o_reparse_lct(pHba)) < 0)
goto out;
rcode = 0;
out: if(pHba->host)
spin_unlock_irqrestore(pHba->host->host_lock, flags);
return rcode;
}
static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
{
int i;
int max;
int tid;
struct i2o_device *d;
i2o_lct *lct = pHba->lct;
u8 bus_no = 0;
s16 scsi_id;
s16 scsi_lun;
u32 buf[10]; // at least 8 u32's
struct adpt_device* pDev = NULL;
struct i2o_device* pI2o_dev = NULL;
if (lct == NULL) {
printk(KERN_ERR "%s: LCT is empty???\n",pHba->name);
return -1;
}
max = lct->table_size;
max -= 3;
max /= 9;
// Mark each drive as unscanned
for (d = pHba->devices; d; d = d->next) {
pDev =(struct adpt_device*) d->owner;
if(!pDev){
continue;
}
pDev->state |= DPTI_DEV_UNSCANNED;
}
printk(KERN_INFO "%s: LCT has %d entries.\n", pHba->name,max);
for(i=0;i<max;i++) {
if( lct->lct_entry[i].user_tid != 0xfff){
continue;
}
if( lct->lct_entry[i].class_id == I2O_CLASS_RANDOM_BLOCK_STORAGE ||
lct->lct_entry[i].class_id == I2O_CLASS_SCSI_PERIPHERAL ||
lct->lct_entry[i].class_id == I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL ){
tid = lct->lct_entry[i].tid;
if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)<0) {
printk(KERN_ERR"%s: Could not query device\n",pHba->name);
continue;
}
bus_no = buf[0]>>16;
if (bus_no >= MAX_CHANNEL) { /* Something wrong skip it */
printk(KERN_WARNING
"%s: Channel number %d out of range\n",
pHba->name, bus_no);
continue;
}
scsi_id = buf[1];
scsi_lun = (buf[2]>>8 )&0xff;
pDev = pHba->channel[bus_no].device[scsi_id];
/* da lun */
while(pDev) {
if(pDev->scsi_lun == scsi_lun) {
break;
}
pDev = pDev->next_lun;
}
if(!pDev ) { // Something new add it
d = kmalloc(sizeof(struct i2o_device),
GFP_ATOMIC);
if(d==NULL)
{
printk(KERN_CRIT "Out of memory for I2O device data.\n");
return -ENOMEM;
}
d->controller = pHba;
d->next = NULL;
memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
d->flags = 0;
adpt_i2o_report_hba_unit(pHba, d);
adpt_i2o_install_device(pHba, d);
pDev = pHba->channel[bus_no].device[scsi_id];
if( pDev == NULL){
pDev =
kzalloc(sizeof(struct adpt_device),
GFP_ATOMIC);
if(pDev == NULL) {
return -ENOMEM;
}
pHba->channel[bus_no].device[scsi_id] = pDev;
} else {
while (pDev->next_lun) {
pDev = pDev->next_lun;
}
pDev = pDev->next_lun =
kzalloc(sizeof(struct adpt_device),
GFP_ATOMIC);
if(pDev == NULL) {
return -ENOMEM;
}
}
pDev->tid = d->lct_data.tid;
pDev->scsi_channel = bus_no;
pDev->scsi_id = scsi_id;
pDev->scsi_lun = scsi_lun;
pDev->pI2o_dev = d;
d->owner = pDev;
pDev->type = (buf[0])&0xff;
pDev->flags = (buf[0]>>8)&0xff;
// Too late, SCSI system has made up it's mind, but what the hey ...
if(scsi_id > pHba->top_scsi_id){
pHba->top_scsi_id = scsi_id;
}
if(scsi_lun > pHba->top_scsi_lun){
pHba->top_scsi_lun = scsi_lun;
}
continue;
} // end of new i2o device
// We found an old device - check it
while(pDev) {
if(pDev->scsi_lun == scsi_lun) {
if(!scsi_device_online(pDev->pScsi_dev)) {
printk(KERN_WARNING"%s: Setting device (%d,%d,%d) back online\n",
pHba->name,bus_no,scsi_id,scsi_lun);
if (pDev->pScsi_dev) {
scsi_device_set_state(pDev->pScsi_dev, SDEV_RUNNING);
}
}
d = pDev->pI2o_dev;
if(d->lct_data.tid != tid) { // something changed
pDev->tid = tid;
memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
if (pDev->pScsi_dev) {
pDev->pScsi_dev->changed = TRUE;
pDev->pScsi_dev->removable = TRUE;
}
}
// Found it - mark it scanned
pDev->state = DPTI_DEV_ONLINE;
break;
}
pDev = pDev->next_lun;
}
}
}
for (pI2o_dev = pHba->devices; pI2o_dev; pI2o_dev = pI2o_dev->next) {
pDev =(struct adpt_device*) pI2o_dev->owner;
if(!pDev){
continue;
}
// Drive offline drives that previously existed but could not be found
// in the LCT table
if (pDev->state & DPTI_DEV_UNSCANNED){
pDev->state = DPTI_DEV_OFFLINE;
printk(KERN_WARNING"%s: Device (%d,%d,%d) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->scsi_lun);
if (pDev->pScsi_dev) {
scsi_device_set_state(pDev->pScsi_dev, SDEV_OFFLINE);
}
}
}
return 0;
}
static void adpt_fail_posted_scbs(adpt_hba* pHba)
{
struct scsi_cmnd* cmd = NULL;
struct scsi_device* d = NULL;
shost_for_each_device(d, pHba->host) {
unsigned long flags;
spin_lock_irqsave(&d->list_lock, flags);
list_for_each_entry(cmd, &d->cmd_list, list) {
if(cmd->serial_number == 0){
continue;
}
cmd->result = (DID_OK << 16) | (QUEUE_FULL <<1);
cmd->scsi_done(cmd);
}
spin_unlock_irqrestore(&d->list_lock, flags);
}
}
/*============================================================================
* Routines from i2o subsystem
*============================================================================
*/
/*
* Bring an I2O controller into HOLD state. See the spec.
*/
static int adpt_i2o_activate_hba(adpt_hba* pHba)
{
int rcode;
if(pHba->initialized ) {
if (adpt_i2o_status_get(pHba) < 0) {
if((rcode = adpt_i2o_reset_hba(pHba)) != 0){
printk(KERN_WARNING"%s: Could NOT reset.\n", pHba->name);
return rcode;
}
if (adpt_i2o_status_get(pHba) < 0) {
printk(KERN_INFO "HBA not responding.\n");
return -1;
}
}
if(pHba->status_block->iop_state == ADAPTER_STATE_FAULTED) {
printk(KERN_CRIT "%s: hardware fault\n", pHba->name);
return -1;
}
if (pHba->status_block->iop_state == ADAPTER_STATE_READY ||
pHba->status_block->iop_state == ADAPTER_STATE_OPERATIONAL ||
pHba->status_block->iop_state == ADAPTER_STATE_HOLD ||
pHba->status_block->iop_state == ADAPTER_STATE_FAILED) {
adpt_i2o_reset_hba(pHba);
if (adpt_i2o_status_get(pHba) < 0 || pHba->status_block->iop_state != ADAPTER_STATE_RESET) {
printk(KERN_ERR "%s: Failed to initialize.\n", pHba->name);
return -1;
}
}
} else {
if((rcode = adpt_i2o_reset_hba(pHba)) != 0){
printk(KERN_WARNING"%s: Could NOT reset.\n", pHba->name);
return rcode;
}
}
if (adpt_i2o_init_outbound_q(pHba) < 0) {
return -1;
}
/* In HOLD state */
if (adpt_i2o_hrt_get(pHba) < 0) {
return -1;
}
return 0;
}
/*
* Bring a controller online into OPERATIONAL state.
*/
static int adpt_i2o_online_hba(adpt_hba* pHba)
{
if (adpt_i2o_systab_send(pHba) < 0) {
adpt_i2o_delete_hba(pHba);
return -1;
}
/* In READY state */
if (adpt_i2o_enable_hba(pHba) < 0) {
adpt_i2o_delete_hba(pHba);
return -1;
}
/* In OPERATIONAL state */
return 0;
}
static s32 adpt_send_nop(adpt_hba*pHba,u32 m)
{
u32 __iomem *msg;
ulong timeout = jiffies + 5*HZ;
while(m == EMPTY_QUEUE){
rmb();
m = readl(pHba->post_port);
if(m != EMPTY_QUEUE){
break;
}
if(time_after(jiffies,timeout)){
printk(KERN_ERR "%s: Timeout waiting for message frame!\n",pHba->name);
return 2;
}
schedule_timeout_uninterruptible(1);
}
msg = (u32 __iomem *)(pHba->msg_addr_virt + m);
writel( THREE_WORD_MSG_SIZE | SGL_OFFSET_0,&msg[0]);
writel( I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | 0,&msg[1]);
writel( 0,&msg[2]);
wmb();
writel(m, pHba->post_port);
wmb();
return 0;
}
static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
{
u8 *status;
dma_addr_t addr;
u32 __iomem *msg = NULL;
int i;
ulong timeout = jiffies + TMOUT_INITOUTBOUND*HZ;
u32 m;
do {
rmb();
m = readl(pHba->post_port);
if (m != EMPTY_QUEUE) {
break;
}
if(time_after(jiffies,timeout)){
printk(KERN_WARNING"%s: Timeout waiting for message frame\n",pHba->name);
return -ETIMEDOUT;
}
schedule_timeout_uninterruptible(1);
} while(m == EMPTY_QUEUE);
msg=(u32 __iomem *)(pHba->msg_addr_virt+m);
status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL);
if (!status) {
adpt_send_nop(pHba, m);
printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n",
pHba->name);
return -ENOMEM;
}
memset(status, 0, 4);
writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]);
writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]);
writel(0, &msg[2]);
writel(0x0106, &msg[3]); /* Transaction context */
writel(4096, &msg[4]); /* Host page frame size */
writel((REPLY_FRAME_SIZE)<<16|0x80, &msg[5]); /* Outbound msg frame size and Initcode */
writel(0xD0000004, &msg[6]); /* Simple SG LE, EOB */
writel((u32)addr, &msg[7]);
writel(m, pHba->post_port);
wmb();
// Wait for the reply status to come back
do {
if (*status) {
if (*status != 0x01 /*I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS*/) {
break;
}
}
rmb();
if(time_after(jiffies,timeout)){
printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name);
/* We lose 4 bytes of "status" here, but we
cannot free these because controller may
awake and corrupt those bytes at any time */
/* dma_free_coherent(&pHba->pDev->dev, 4, status, addr); */
return -ETIMEDOUT;
}
schedule_timeout_uninterruptible(1);
} while (1);
// If the command was successful, fill the fifo with our reply
// message packets
if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) {
dma_free_coherent(&pHba->pDev->dev, 4, status, addr);
return -2;
}
dma_free_coherent(&pHba->pDev->dev, 4, status, addr);
if(pHba->reply_pool != NULL) {
dma_free_coherent(&pHba->pDev->dev,
pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4,
pHba->reply_pool, pHba->reply_pool_pa);
}
pHba->reply_pool = dma_alloc_coherent(&pHba->pDev->dev,
pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4,
&pHba->reply_pool_pa, GFP_KERNEL);
if (!pHba->reply_pool) {
printk(KERN_ERR "%s: Could not allocate reply pool\n", pHba->name);
return -ENOMEM;
}
memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4);
for(i = 0; i < pHba->reply_fifo_size; i++) {
writel(pHba->reply_pool_pa + (i * REPLY_FRAME_SIZE * 4),
pHba->reply_port);
wmb();
}
adpt_i2o_status_get(pHba);
return 0;
}
/*
* I2O System Table. Contains information about
* all the IOPs in the system. Used to inform IOPs
* about each other's existence.
*
* sys_tbl_ver is the CurrentChangeIndicator that is
* used by IOPs to track changes.
*/
static s32 adpt_i2o_status_get(adpt_hba* pHba)
{
ulong timeout;
u32 m;
u32 __iomem *msg;
u8 *status_block=NULL;
if(pHba->status_block == NULL) {
pHba->status_block = dma_alloc_coherent(&pHba->pDev->dev,
sizeof(i2o_status_block),
&pHba->status_block_pa, GFP_KERNEL);
if(pHba->status_block == NULL) {
printk(KERN_ERR
"dpti%d: Get Status Block failed; Out of memory. \n",
pHba->unit);
return -ENOMEM;
}
}
memset(pHba->status_block, 0, sizeof(i2o_status_block));
status_block = (u8*)(pHba->status_block);
timeout = jiffies+TMOUT_GETSTATUS*HZ;
do {
rmb();
m = readl(pHba->post_port);
if (m != EMPTY_QUEUE) {
break;
}
if(time_after(jiffies,timeout)){
printk(KERN_ERR "%s: Timeout waiting for message !\n",
pHba->name);
return -ETIMEDOUT;
}
schedule_timeout_uninterruptible(1);
} while(m==EMPTY_QUEUE);
msg=(u32 __iomem *)(pHba->msg_addr_virt+m);
writel(NINE_WORD_MSG_SIZE|SGL_OFFSET_0, &msg[0]);
writel(I2O_CMD_STATUS_GET<<24|HOST_TID<<12|ADAPTER_TID, &msg[1]);
writel(1, &msg[2]);
writel(0, &msg[3]);
writel(0, &msg[4]);
writel(0, &msg[5]);
writel( dma_low(pHba->status_block_pa), &msg[6]);
writel( dma_high(pHba->status_block_pa), &msg[7]);
writel(sizeof(i2o_status_block), &msg[8]); // 88 bytes
//post message
writel(m, pHba->post_port);
wmb();
while(status_block[87]!=0xff){
if(time_after(jiffies,timeout)){
printk(KERN_ERR"dpti%d: Get status timeout.\n",
pHba->unit);
return -ETIMEDOUT;
}
rmb();
schedule_timeout_uninterruptible(1);
}
// Set up our number of outbound and inbound messages
pHba->post_fifo_size = pHba->status_block->max_inbound_frames;
if (pHba->post_fifo_size > MAX_TO_IOP_MESSAGES) {
pHba->post_fifo_size = MAX_TO_IOP_MESSAGES;
}
pHba->reply_fifo_size = pHba->status_block->max_outbound_frames;
if (pHba->reply_fifo_size > MAX_FROM_IOP_MESSAGES) {
pHba->reply_fifo_size = MAX_FROM_IOP_MESSAGES;
}
// Calculate the Scatter Gather list size
if (dpt_dma64(pHba)) {
pHba->sg_tablesize
= ((pHba->status_block->inbound_frame_size * 4
- 14 * sizeof(u32))
/ (sizeof(struct sg_simple_element) + sizeof(u32)));
} else {
pHba->sg_tablesize
= ((pHba->status_block->inbound_frame_size * 4
- 12 * sizeof(u32))
/ sizeof(struct sg_simple_element));
}
if (pHba->sg_tablesize > SG_LIST_ELEMENTS) {
pHba->sg_tablesize = SG_LIST_ELEMENTS;
}
#ifdef DEBUG
printk("dpti%d: State = ",pHba->unit);
switch(pHba->status_block->iop_state) {
case 0x01:
printk("INIT\n");
break;
case 0x02:
printk("RESET\n");
break;
case 0x04:
printk("HOLD\n");
break;
case 0x05:
printk("READY\n");
break;
case 0x08:
printk("OPERATIONAL\n");
break;
case 0x10:
printk("FAILED\n");
break;
case 0x11:
printk("FAULTED\n");
break;
default:
printk("%x (unknown!!)\n",pHba->status_block->iop_state);
}
#endif
return 0;
}
/*
* Get the IOP's Logical Configuration Table
*/
static int adpt_i2o_lct_get(adpt_hba* pHba)
{
u32 msg[8];
int ret;
u32 buf[16];
if ((pHba->lct_size == 0) || (pHba->lct == NULL)){
pHba->lct_size = pHba->status_block->expected_lct_size;
}
do {
if (pHba->lct == NULL) {
pHba->lct = dma_alloc_coherent(&pHba->pDev->dev,
pHba->lct_size, &pHba->lct_pa,
GFP_ATOMIC);
if(pHba->lct == NULL) {
printk(KERN_CRIT "%s: Lct Get failed. Out of memory.\n",
pHba->name);
return -ENOMEM;
}
}
memset(pHba->lct, 0, pHba->lct_size);
msg[0] = EIGHT_WORD_MSG_SIZE|SGL_OFFSET_6;
msg[1] = I2O_CMD_LCT_NOTIFY<<24 | HOST_TID<<12 | ADAPTER_TID;
msg[2] = 0;
msg[3] = 0;
msg[4] = 0xFFFFFFFF; /* All devices */
msg[5] = 0x00000000; /* Report now */
msg[6] = 0xD0000000|pHba->lct_size;
msg[7] = (u32)pHba->lct_pa;
if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 360))) {
printk(KERN_ERR "%s: LCT Get failed (status=%#10x.\n",
pHba->name, ret);
printk(KERN_ERR"Adaptec: Error Reading Hardware.\n");
return ret;
}
if ((pHba->lct->table_size << 2) > pHba->lct_size) {
pHba->lct_size = pHba->lct->table_size << 2;
dma_free_coherent(&pHba->pDev->dev, pHba->lct_size,
pHba->lct, pHba->lct_pa);
pHba->lct = NULL;
}
} while (pHba->lct == NULL);
PDEBUG("%s: Hardware resource table read.\n", pHba->name);
// I2O_DPT_EXEC_IOP_BUFFERS_GROUP_NO;
if(adpt_i2o_query_scalar(pHba, 0 , 0x8000, -1, buf, sizeof(buf))>=0) {
pHba->FwDebugBufferSize = buf[1];
pHba->FwDebugBuffer_P = ioremap(pHba->base_addr_phys + buf[0],
pHba->FwDebugBufferSize);
if (pHba->FwDebugBuffer_P) {
pHba->FwDebugFlags_P = pHba->FwDebugBuffer_P +
FW_DEBUG_FLAGS_OFFSET;
pHba->FwDebugBLEDvalue_P = pHba->FwDebugBuffer_P +
FW_DEBUG_BLED_OFFSET;
pHba->FwDebugBLEDflag_P = pHba->FwDebugBLEDvalue_P + 1;
pHba->FwDebugStrLength_P = pHba->FwDebugBuffer_P +
FW_DEBUG_STR_LENGTH_OFFSET;
pHba->FwDebugBuffer_P += buf[2];
pHba->FwDebugFlags = 0;
}
}
return 0;
}
static int adpt_i2o_build_sys_table(void)
{
adpt_hba* pHba = hba_chain;
int count = 0;
if (sys_tbl)
dma_free_coherent(&pHba->pDev->dev, sys_tbl_len,
sys_tbl, sys_tbl_pa);
sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs
(hba_count) * sizeof(struct i2o_sys_tbl_entry);
sys_tbl = dma_alloc_coherent(&pHba->pDev->dev,
sys_tbl_len, &sys_tbl_pa, GFP_KERNEL);
if (!sys_tbl) {
printk(KERN_WARNING "SysTab Set failed. Out of memory.\n");
return -ENOMEM;
}
memset(sys_tbl, 0, sys_tbl_len);
sys_tbl->num_entries = hba_count;
sys_tbl->version = I2OVERSION;
sys_tbl->change_ind = sys_tbl_ind++;
for(pHba = hba_chain; pHba; pHba = pHba->next) {
u64 addr;
// Get updated Status Block so we have the latest information
if (adpt_i2o_status_get(pHba)) {
sys_tbl->num_entries--;
continue; // try next one
}
sys_tbl->iops[count].org_id = pHba->status_block->org_id;
sys_tbl->iops[count].iop_id = pHba->unit + 2;
sys_tbl->iops[count].seg_num = 0;
sys_tbl->iops[count].i2o_version = pHba->status_block->i2o_version;
sys_tbl->iops[count].iop_state = pHba->status_block->iop_state;
sys_tbl->iops[count].msg_type = pHba->status_block->msg_type;
sys_tbl->iops[count].frame_size = pHba->status_block->inbound_frame_size;
sys_tbl->iops[count].last_changed = sys_tbl_ind - 1; // ??
sys_tbl->iops[count].iop_capabilities = pHba->status_block->iop_capabilities;
addr = pHba->base_addr_phys + 0x40;
sys_tbl->iops[count].inbound_low = dma_low(addr);
sys_tbl->iops[count].inbound_high = dma_high(addr);
count++;
}
#ifdef DEBUG
{
u32 *table = (u32*)sys_tbl;
printk(KERN_DEBUG"sys_tbl_len=%d in 32bit words\n",(sys_tbl_len >>2));
for(count = 0; count < (sys_tbl_len >>2); count++) {
printk(KERN_INFO "sys_tbl[%d] = %0#10x\n",
count, table[count]);
}
}
#endif
return 0;
}
/*
* Dump the information block associated with a given unit (TID)
*/
static void adpt_i2o_report_hba_unit(adpt_hba* pHba, struct i2o_device *d)
{
char buf[64];
int unit = d->lct_data.tid;
printk(KERN_INFO "TID %3.3d ", unit);
if(adpt_i2o_query_scalar(pHba, unit, 0xF100, 3, buf, 16)>=0)
{
buf[16]=0;
printk(" Vendor: %-12.12s", buf);
}
if(adpt_i2o_query_scalar(pHba, unit, 0xF100, 4, buf, 16)>=0)
{
buf[16]=0;
printk(" Device: %-12.12s", buf);
}
if(adpt_i2o_query_scalar(pHba, unit, 0xF100, 6, buf, 8)>=0)
{
buf[8]=0;
printk(" Rev: %-12.12s\n", buf);
}
#ifdef DEBUG
printk(KERN_INFO "\tClass: %.21s\n", adpt_i2o_get_class_name(d->lct_data.class_id));
printk(KERN_INFO "\tSubclass: 0x%04X\n", d->lct_data.sub_class);
printk(KERN_INFO "\tFlags: ");
if(d->lct_data.device_flags&(1<<0))
printk("C"); // ConfigDialog requested
if(d->lct_data.device_flags&(1<<1))
printk("U"); // Multi-user capable
if(!(d->lct_data.device_flags&(1<<4)))
printk("P"); // Peer service enabled!
if(!(d->lct_data.device_flags&(1<<5)))
printk("M"); // Mgmt service enabled!
printk("\n");
#endif
}
#ifdef DEBUG
/*
* Do i2o class name lookup
*/
static const char *adpt_i2o_get_class_name(int class)
{
int idx = 16;
static char *i2o_class_name[] = {
"Executive",
"Device Driver Module",
"Block Device",
"Tape Device",
"LAN Interface",
"WAN Interface",
"Fibre Channel Port",
"Fibre Channel Device",
"SCSI Device",
"ATE Port",
"ATE Device",
"Floppy Controller",
"Floppy Device",
"Secondary Bus Port",
"Peer Transport Agent",
"Peer Transport",
"Unknown"
};
switch(class&0xFFF) {
case I2O_CLASS_EXECUTIVE:
idx = 0; break;
case I2O_CLASS_DDM:
idx = 1; break;
case I2O_CLASS_RANDOM_BLOCK_STORAGE:
idx = 2; break;
case I2O_CLASS_SEQUENTIAL_STORAGE:
idx = 3; break;
case I2O_CLASS_LAN:
idx = 4; break;
case I2O_CLASS_WAN:
idx = 5; break;
case I2O_CLASS_FIBRE_CHANNEL_PORT:
idx = 6; break;
case I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL:
idx = 7; break;
case I2O_CLASS_SCSI_PERIPHERAL:
idx = 8; break;
case I2O_CLASS_ATE_PORT:
idx = 9; break;
case I2O_CLASS_ATE_PERIPHERAL:
idx = 10; break;
case I2O_CLASS_FLOPPY_CONTROLLER:
idx = 11; break;
case I2O_CLASS_FLOPPY_DEVICE:
idx = 12; break;
case I2O_CLASS_BUS_ADAPTER_PORT:
idx = 13; break;
case I2O_CLASS_PEER_TRANSPORT_AGENT:
idx = 14; break;
case I2O_CLASS_PEER_TRANSPORT:
idx = 15; break;
}
return i2o_class_name[idx];
}
#endif
static s32 adpt_i2o_hrt_get(adpt_hba* pHba)
{
u32 msg[6];
int ret, size = sizeof(i2o_hrt);
do {
if (pHba->hrt == NULL) {
pHba->hrt = dma_alloc_coherent(&pHba->pDev->dev,
size, &pHba->hrt_pa, GFP_KERNEL);
if (pHba->hrt == NULL) {
printk(KERN_CRIT "%s: Hrt Get failed; Out of memory.\n", pHba->name);
return -ENOMEM;
}
}
msg[0]= SIX_WORD_MSG_SIZE| SGL_OFFSET_4;
msg[1]= I2O_CMD_HRT_GET<<24 | HOST_TID<<12 | ADAPTER_TID;
msg[2]= 0;
msg[3]= 0;
msg[4]= (0xD0000000 | size); /* Simple transaction */
msg[5]= (u32)pHba->hrt_pa; /* Dump it here */
if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg),20))) {
printk(KERN_ERR "%s: Unable to get HRT (status=%#10x)\n", pHba->name, ret);
return ret;
}
if (pHba->hrt->num_entries * pHba->hrt->entry_len << 2 > size) {
int newsize = pHba->hrt->num_entries * pHba->hrt->entry_len << 2;
dma_free_coherent(&pHba->pDev->dev, size,
pHba->hrt, pHba->hrt_pa);
size = newsize;
pHba->hrt = NULL;
}
} while(pHba->hrt == NULL);
return 0;
}
/*
* Query one scalar group value or a whole scalar group.
*/
static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid,
int group, int field, void *buf, int buflen)
{
u16 opblk[] = { 1, 0, I2O_PARAMS_FIELD_GET, group, 1, field };
u8 *opblk_va;
dma_addr_t opblk_pa;
u8 *resblk_va;
dma_addr_t resblk_pa;
int size;
/* 8 bytes for header */
resblk_va = dma_alloc_coherent(&pHba->pDev->dev,
sizeof(u8) * (8 + buflen), &resblk_pa, GFP_KERNEL);
if (resblk_va == NULL) {
printk(KERN_CRIT "%s: query scalar failed; Out of memory.\n", pHba->name);
return -ENOMEM;
}
opblk_va = dma_alloc_coherent(&pHba->pDev->dev,
sizeof(opblk), &opblk_pa, GFP_KERNEL);
if (opblk_va == NULL) {
dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
resblk_va, resblk_pa);
printk(KERN_CRIT "%s: query operatio failed; Out of memory.\n",
pHba->name);
return -ENOMEM;
}
if (field == -1) /* whole group */
opblk[4] = -1;
memcpy(opblk_va, opblk, sizeof(opblk));
size = adpt_i2o_issue_params(I2O_CMD_UTIL_PARAMS_GET, pHba, tid,
opblk_va, opblk_pa, sizeof(opblk),
resblk_va, resblk_pa, sizeof(u8)*(8+buflen));
dma_free_coherent(&pHba->pDev->dev, sizeof(opblk), opblk_va, opblk_pa);
if (size == -ETIME) {
dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
resblk_va, resblk_pa);
printk(KERN_WARNING "%s: issue params failed; Timed out.\n", pHba->name);
return -ETIME;
} else if (size == -EINTR) {
dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
resblk_va, resblk_pa);
printk(KERN_WARNING "%s: issue params failed; Interrupted.\n", pHba->name);
return -EINTR;
}
memcpy(buf, resblk_va+8, buflen); /* cut off header */
dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
resblk_va, resblk_pa);
if (size < 0)
return size;
return buflen;
}
/* Issue UTIL_PARAMS_GET or UTIL_PARAMS_SET
*
* This function can be used for all UtilParamsGet/Set operations.
* The OperationBlock is given in opblk-buffer,
* and results are returned in resblk-buffer.
* Note that the minimum sized resblk is 8 bytes and contains
* ResultCount, ErrorInfoSize, BlockStatus and BlockSize.
*/
static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid,
void *opblk_va, dma_addr_t opblk_pa, int oplen,
void *resblk_va, dma_addr_t resblk_pa, int reslen)
{
u32 msg[9];
u32 *res = (u32 *)resblk_va;
int wait_status;
msg[0] = NINE_WORD_MSG_SIZE | SGL_OFFSET_5;
msg[1] = cmd << 24 | HOST_TID << 12 | tid;
msg[2] = 0;
msg[3] = 0;
msg[4] = 0;
msg[5] = 0x54000000 | oplen; /* OperationBlock */
msg[6] = (u32)opblk_pa;
msg[7] = 0xD0000000 | reslen; /* ResultBlock */
msg[8] = (u32)resblk_pa;
if ((wait_status = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 20))) {
printk("adpt_i2o_issue_params: post_wait failed (%p)\n", resblk_va);
return wait_status; /* -DetailedStatus */
}
if (res[1]&0x00FF0000) { /* BlockStatus != SUCCESS */
printk(KERN_WARNING "%s: %s - Error:\n ErrorInfoSize = 0x%02x, "
"BlockStatus = 0x%02x, BlockSize = 0x%04x\n",
pHba->name,
(cmd == I2O_CMD_UTIL_PARAMS_SET) ? "PARAMS_SET"
: "PARAMS_GET",
res[1]>>24, (res[1]>>16)&0xFF, res[1]&0xFFFF);
return -((res[1] >> 16) & 0xFF); /* -BlockStatus */
}
return 4 + ((res[1] & 0x0000FFFF) << 2); /* bytes used in resblk */
}
static s32 adpt_i2o_quiesce_hba(adpt_hba* pHba)
{
u32 msg[4];
int ret;
adpt_i2o_status_get(pHba);
/* SysQuiesce discarded if IOP not in READY or OPERATIONAL state */
if((pHba->status_block->iop_state != ADAPTER_STATE_READY) &&
(pHba->status_block->iop_state != ADAPTER_STATE_OPERATIONAL)){
return 0;
}
msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = I2O_CMD_SYS_QUIESCE<<24|HOST_TID<<12|ADAPTER_TID;
msg[2] = 0;
msg[3] = 0;
if((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 240))) {
printk(KERN_INFO"dpti%d: Unable to quiesce (status=%#x).\n",
pHba->unit, -ret);
} else {
printk(KERN_INFO"dpti%d: Quiesced.\n",pHba->unit);
}
adpt_i2o_status_get(pHba);
return ret;
}
/*
* Enable IOP. Allows the IOP to resume external operations.
*/
static int adpt_i2o_enable_hba(adpt_hba* pHba)
{
u32 msg[4];
int ret;
adpt_i2o_status_get(pHba);
if(!pHba->status_block){
return -ENOMEM;
}
/* Enable only allowed on READY state */
if(pHba->status_block->iop_state == ADAPTER_STATE_OPERATIONAL)
return 0;
if(pHba->status_block->iop_state != ADAPTER_STATE_READY)
return -EINVAL;
msg[0]=FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1]=I2O_CMD_SYS_ENABLE<<24|HOST_TID<<12|ADAPTER_TID;
msg[2]= 0;
msg[3]= 0;
if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 240))) {
printk(KERN_WARNING"%s: Could not enable (status=%#10x).\n",
pHba->name, ret);
} else {
PDEBUG("%s: Enabled.\n", pHba->name);
}
adpt_i2o_status_get(pHba);
return ret;
}
static int adpt_i2o_systab_send(adpt_hba* pHba)
{
u32 msg[12];
int ret;
msg[0] = I2O_MESSAGE_SIZE(12) | SGL_OFFSET_6;
msg[1] = I2O_CMD_SYS_TAB_SET<<24 | HOST_TID<<12 | ADAPTER_TID;
msg[2] = 0;
msg[3] = 0;
msg[4] = (0<<16) | ((pHba->unit+2) << 12); /* Host 0 IOP ID (unit + 2) */
msg[5] = 0; /* Segment 0 */
/*
* Provide three SGL-elements:
* System table (SysTab), Private memory space declaration and
* Private i/o space declaration
*/
msg[6] = 0x54000000 | sys_tbl_len;
msg[7] = (u32)sys_tbl_pa;
msg[8] = 0x54000000 | 0;
msg[9] = 0;
msg[10] = 0xD4000000 | 0;
msg[11] = 0;
if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 120))) {
printk(KERN_INFO "%s: Unable to set SysTab (status=%#10x).\n",
pHba->name, ret);
}
#ifdef DEBUG
else {
PINFO("%s: SysTab set.\n", pHba->name);
}
#endif
return ret;
}
/*============================================================================
*
*============================================================================
*/
#ifdef UARTDELAY
static static void adpt_delay(int millisec)
{
int i;
for (i = 0; i < millisec; i++) {
udelay(1000); /* delay for one millisecond */
}
}
#endif
static struct scsi_host_template driver_template = {
.module = THIS_MODULE,
.name = "dpt_i2o",
.proc_name = "dpt_i2o",
.proc_info = adpt_proc_info,
.info = adpt_info,
.queuecommand = adpt_queue,
.eh_abort_handler = adpt_abort,
.eh_device_reset_handler = adpt_device_reset,
.eh_bus_reset_handler = adpt_bus_reset,
.eh_host_reset_handler = adpt_reset,
.bios_param = adpt_bios_param,
.slave_configure = adpt_slave_configure,
.can_queue = MAX_TO_IOP_MESSAGES,
.this_id = 7,
.cmd_per_lun = 1,
.use_clustering = ENABLE_CLUSTERING,
};
static int __init adpt_init(void)
{
int error;
adpt_hba *pHba, *next;
printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
error = adpt_detect(&driver_template);
if (error < 0)
return error;
if (hba_chain == NULL)
return -ENODEV;
for (pHba = hba_chain; pHba; pHba = pHba->next) {
error = scsi_add_host(pHba->host, &pHba->pDev->dev);
if (error)
goto fail;
scsi_scan_host(pHba->host);
}
return 0;
fail:
for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
scsi_remove_host(pHba->host);
}
return error;
}
static void __exit adpt_exit(void)
{
adpt_hba *pHba, *next;
for (pHba = hba_chain; pHba; pHba = pHba->next)
scsi_remove_host(pHba->host);
for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
adpt_release(pHba->host);
}
}
module_init(adpt_init);
module_exit(adpt_exit);
MODULE_LICENSE("GPL");
| davidmueller13/arter97_bb | drivers/scsi/dpt_i2o.c | C | gpl-2.0 | 96,776 |
#!/usr/bin/python
#
# Urwid example lazy text editor suitable for tabbed and format=flowed text
# Copyright (C) 2004-2009 Ian Ward
#
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Urwid web site: http://excess.org/urwid/
"""
Urwid example lazy text editor suitable for tabbed and flowing text
Features:
- custom list walker for lazily loading text file
Usage:
edit.py <filename>
"""
import sys
import urwid
class LineWalker(urwid.ListWalker):
"""ListWalker-compatible class for lazily reading file contents."""
def __init__(self, name):
self.file = open(name)
self.lines = []
self.focus = 0
def get_focus(self):
return self._get_at_pos(self.focus)
def set_focus(self, focus):
self.focus = focus
self._modified()
def get_next(self, start_from):
return self._get_at_pos(start_from + 1)
def get_prev(self, start_from):
return self._get_at_pos(start_from - 1)
def read_next_line(self):
"""Read another line from the file."""
next_line = self.file.readline()
if not next_line or next_line[-1:] != '\n':
# no newline on last line of file
self.file = None
else:
# trim newline characters
next_line = next_line[:-1]
expanded = next_line.expandtabs()
edit = urwid.Edit("", expanded, allow_tab=True)
edit.set_edit_pos(0)
edit.original_text = next_line
self.lines.append(edit)
return next_line
def _get_at_pos(self, pos):
"""Return a widget for the line number passed."""
if pos < 0:
# line 0 is the start of the file, no more above
return None, None
if len(self.lines) > pos:
# we have that line so return it
return self.lines[pos], pos
if self.file is None:
# file is closed, so there are no more lines
return None, None
assert pos == len(self.lines), "out of order request?"
self.read_next_line()
return self.lines[-1], pos
def split_focus(self):
"""Divide the focus edit widget at the cursor location."""
focus = self.lines[self.focus]
pos = focus.edit_pos
edit = urwid.Edit("",focus.edit_text[pos:], allow_tab=True)
edit.original_text = ""
focus.set_edit_text(focus.edit_text[:pos])
edit.set_edit_pos(0)
self.lines.insert(self.focus+1, edit)
def combine_focus_with_prev(self):
"""Combine the focus edit widget with the one above."""
above, ignore = self.get_prev(self.focus)
if above is None:
# already at the top
return
focus = self.lines[self.focus]
above.set_edit_pos(len(above.edit_text))
above.set_edit_text(above.edit_text + focus.edit_text)
del self.lines[self.focus]
self.focus -= 1
def combine_focus_with_next(self):
"""Combine the focus edit widget with the one below."""
below, ignore = self.get_next(self.focus)
if below is None:
# already at bottom
return
focus = self.lines[self.focus]
focus.set_edit_text(focus.edit_text + below.edit_text)
del self.lines[self.focus+1]
class EditDisplay:
palette = [
('body','default', 'default'),
('foot','dark cyan', 'dark blue', 'bold'),
('key','light cyan', 'dark blue', 'underline'),
]
footer_text = ('foot', [
"Text Editor ",
('key', "F5"), " save ",
('key', "F8"), " quit",
])
def __init__(self, name):
self.save_name = name
self.walker = LineWalker(name)
self.listbox = urwid.ListBox(self.walker)
self.footer = urwid.AttrWrap(urwid.Text(self.footer_text),
"foot")
self.view = urwid.Frame(urwid.AttrWrap(self.listbox, 'body'),
footer=self.footer)
def main(self):
self.loop = urwid.MainLoop(self.view, self.palette,
unhandled_input=self.unhandled_keypress)
self.loop.run()
def unhandled_keypress(self, k):
"""Last resort for keypresses."""
if k == "f5":
self.save_file()
elif k == "f8":
raise urwid.ExitMainLoop()
elif k == "delete":
# delete at end of line
self.walker.combine_focus_with_next()
elif k == "backspace":
# backspace at beginning of line
self.walker.combine_focus_with_prev()
elif k == "enter":
# start new line
self.walker.split_focus()
# move the cursor to the new line and reset pref_col
self.loop.process_input(["down", "home"])
elif k == "right":
w, pos = self.walker.get_focus()
w, pos = self.walker.get_next(pos)
if w:
self.listbox.set_focus(pos, 'above')
self.loop.process_input(["home"])
elif k == "left":
w, pos = self.walker.get_focus()
w, pos = self.walker.get_prev(pos)
if w:
self.listbox.set_focus(pos, 'below')
self.loop.process_input(["end"])
else:
return
return True
def save_file(self):
"""Write the file out to disk."""
l = []
walk = self.walker
for edit in walk.lines:
# collect the text already stored in edit widgets
if edit.original_text.expandtabs() == edit.edit_text:
l.append(edit.original_text)
else:
l.append(re_tab(edit.edit_text))
# then the rest
while walk.file is not None:
l.append(walk.read_next_line())
# write back to disk
outfile = open(self.save_name, "w")
prefix = ""
for line in l:
outfile.write(prefix + line)
prefix = "\n"
def re_tab(s):
"""Return a tabbed string from an expanded one."""
l = []
p = 0
for i in range(8, len(s), 8):
if s[i-2:i] == " ":
# collapse two or more spaces into a tab
l.append(s[p:i].rstrip() + "\t")
p = i
if p == 0:
return s
else:
l.append(s[p:])
return "".join(l)
def main():
try:
name = sys.argv[1]
assert open(name, "a")
except:
sys.stderr.write(__doc__)
return
EditDisplay(name).main()
if __name__=="__main__":
main()
| uccgit/the-game | test/edit.py | Python | gpl-2.0 | 7,270 |
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Form\Field;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Form\FormField;
/**
* Provides a modal media selector including upload mechanism
*
* @since 1.6
*/
class MediaField extends FormField
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'Media';
/**
* The authorField.
*
* @var string
* @since 3.2
*/
protected $authorField;
/**
* The asset.
*
* @var string
* @since 3.2
*/
protected $asset;
/**
* The link.
*
* @var string
* @since 3.2
*/
protected $link;
/**
* Modal width.
*
* @var integer
* @since 3.4.5
*/
protected $width;
/**
* Modal height.
*
* @var integer
* @since 3.4.5
*/
protected $height;
/**
* The authorField.
*
* @var string
* @since 3.2
*/
protected $preview;
/**
* The preview.
*
* @var string
* @since 3.2
*/
protected $directory;
/**
* The previewWidth.
*
* @var int
* @since 3.2
*/
protected $previewWidth;
/**
* The previewHeight.
*
* @var int
* @since 3.2
*/
protected $previewHeight;
/**
* Layout to render
*
* @var string
* @since 3.5
*/
protected $layout = 'joomla.form.field.media';
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to get the value.
*
* @return mixed The property value or null.
*
* @since 3.2
*/
public function __get($name)
{
switch ($name)
{
case 'authorField':
case 'asset':
case 'link':
case 'width':
case 'height':
case 'preview':
case 'directory':
case 'previewWidth':
case 'previewHeight':
return $this->$name;
}
return parent::__get($name);
}
/**
* Method to set certain otherwise inaccessible properties of the form field object.
*
* @param string $name The property name for which to set the value.
* @param mixed $value The value of the property.
*
* @return void
*
* @since 3.2
*/
public function __set($name, $value)
{
switch ($name)
{
case 'authorField':
case 'asset':
case 'link':
case 'width':
case 'height':
case 'preview':
case 'directory':
$this->$name = (string) $value;
break;
case 'previewWidth':
case 'previewHeight':
$this->$name = (int) $value;
break;
default:
parent::__set($name, $value);
}
}
/**
* Method to attach a JForm object to the field.
*
* @param \SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
* @return boolean True on success.
*
* @see FormField::setup()
* @since 3.2
*/
public function setup(\SimpleXMLElement $element, $value, $group = null)
{
$result = parent::setup($element, $value, $group);
if ($result === true)
{
$assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id';
$this->authorField = $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by';
$this->asset = $this->form->getValue($assetField) ?: (string) $this->element['asset_id'];
$this->link = (string) $this->element['link'];
$this->width = isset($this->element['width']) ? (int) $this->element['width'] : 800;
$this->height = isset($this->element['height']) ? (int) $this->element['height'] : 500;
$this->preview = (string) $this->element['preview'];
$this->directory = (string) $this->element['directory'];
$this->previewWidth = isset($this->element['preview_width']) ? (int) $this->element['preview_width'] : 200;
$this->previewHeight = isset($this->element['preview_height']) ? (int) $this->element['preview_height'] : 200;
}
return $result;
}
/**
* Method to get the field input markup for a media selector.
* Use attributes to identify specific created_by and asset_id fields
*
* @return string The field input markup.
*
* @since 1.6
*/
protected function getInput()
{
if (empty($this->layout))
{
throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name));
}
return $this->getRenderer($this->layout)->render($this->getLayoutData());
}
/**
* Get the data that is going to be passed to the layout
*
* @return array
*/
public function getLayoutData()
{
// Get the basic field data
$data = parent::getLayoutData();
$asset = $this->asset;
if ($asset === '')
{
$asset = \JFactory::getApplication()->input->get('option');
}
if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value))
{
$this->folder = explode('/', $this->value);
$this->folder = array_diff_assoc($this->folder, explode('/', ComponentHelper::getParams('com_media')->get('image_path', 'images')));
array_pop($this->folder);
$this->folder = implode('/', $this->folder);
}
elseif (file_exists(JPATH_ROOT . '/' . ComponentHelper::getParams('com_media')->get('image_path', 'images') . '/' . $this->directory))
{
$this->folder = $this->directory;
}
else
{
$this->folder = '';
}
$extraData = array(
'asset' => $asset,
'authorField' => $this->authorField,
'authorId' => $this->form->getValue($this->authorField),
'folder' => $this->folder,
'link' => $this->link,
'preview' => $this->preview,
'previewHeight' => $this->previewHeight,
'previewWidth' => $this->previewWidth,
);
return array_merge($data, $extraData);
}
}
| Ezargon/tolteca | libraries/src/Form/Field/MediaField.php | PHP | gpl-2.0 | 6,290 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>CxImage: Decode</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.4 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>Decode</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___decode.html#gb7c333ee47b5049ea05abe22e49512b4">CxImage::LoadResource</a> (HRSRC hRes, DWORD imagetype, HMODULE hModule=NULL)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___decode.html#g040834c93254ae251eb197cc4d871931">CxImage::Load</a> (const TCHAR *filename, DWORD imagetype=0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___decode.html#g1936f430c37cd241cda11765f1f8b78b">CxImage::Decode</a> (FILE *hFile, DWORD imagetype)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___decode.html#g63f55be92ad26908c389c7744ea26847">CxImage::Decode</a> (<a class="el" href="class_cx_file.html">CxFile</a> *hFile, DWORD imagetype)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___decode.html#gdc66153ea4c92f4a4cd8241558eff0cf">CxImage::Decode</a> (BYTE *buffer, DWORD size, DWORD imagetype)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___decode.html#gd294c09c91059374f178a823b88db981">CxImage::CheckFormat</a> (<a class="el" href="class_cx_file.html">CxFile</a> *hFile, DWORD imagetype=0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___decode.html#ga20be4c04817f7c0aeaacfb10dbff98c">CxImage::CheckFormat</a> (BYTE *buffer, DWORD size, DWORD imagetype=0)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga20be4c04817f7c0aeaacfb10dbff98c"></a><!-- doxytag: member="CxImage::CheckFormat" ref="ga20be4c04817f7c0aeaacfb10dbff98c" args="(BYTE *buffer, DWORD size, DWORD imagetype=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool CxImage::CheckFormat </td>
<td>(</td>
<td class="paramtype">BYTE * </td>
<td class="paramname"> <em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>imagetype</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="gd294c09c91059374f178a823b88db981"></a><!-- doxytag: member="CxImage::CheckFormat" ref="gd294c09c91059374f178a823b88db981" args="(CxFile *hFile, DWORD imagetype=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool CxImage::CheckFormat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_cx_file.html">CxFile</a> * </td>
<td class="paramname"> <em>hFile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>imagetype</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Loads an image from <a class="el" href="class_cx_file.html">CxFile</a> object <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hFile,:</em> </td><td>file handle (CxMemFile or CxIOFile), with read access. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>imagetype,:</em> </td><td>file format, default = 0 (CXIMAGE_FORMAT_UNKNOWN) </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>: if imagetype is not 0, the function returns true when imagetype matches the file image format. If imagetype is 0, the function returns true when the file image format is recognized as a supported format. If the returned value is true, use <a class="el" href="group___attributes.html#g10d0836384b6ff4ddced60056d3d2eb4">GetHeight()</a>, <a class="el" href="group___attributes.html#gc3496dfd0959b1c5bb093edc23e68a0e">GetWidth()</a> or <a class="el" href="group___attributes.html#g642ba0bd7bbdb42a3f67d5a97e42434f">GetType()</a> to retrieve the basic image information. </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="ximage_8h.html#b1562bce5b65a54f0baf878db91bafad">ENUM_CXIMAGE_FORMATS</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="gdc66153ea4c92f4a4cd8241558eff0cf"></a><!-- doxytag: member="CxImage::Decode" ref="gdc66153ea4c92f4a4cd8241558eff0cf" args="(BYTE *buffer, DWORD size, DWORD imagetype)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool CxImage::Decode </td>
<td>(</td>
<td class="paramtype">BYTE * </td>
<td class="paramname"> <em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>imagetype</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Loads an image from memory buffer <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>buffer,:</em> </td><td>memory buffer </td></tr>
<tr><td valign="top"></td><td valign="top"><em>size,:</em> </td><td>size of buffer </td></tr>
<tr><td valign="top"></td><td valign="top"><em>imagetype,:</em> </td><td>file format, see ENUM_CXIMAGE_FORMATS </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if everything is ok </dd></dl>
</div>
</div><p>
<a class="anchor" name="g63f55be92ad26908c389c7744ea26847"></a><!-- doxytag: member="CxImage::Decode" ref="g63f55be92ad26908c389c7744ea26847" args="(CxFile *hFile, DWORD imagetype)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool CxImage::Decode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_cx_file.html">CxFile</a> * </td>
<td class="paramname"> <em>hFile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>imagetype</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Loads an image from <a class="el" href="class_cx_file.html">CxFile</a> object <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hFile,:</em> </td><td>file handle (CxMemFile or CxIOFile), with read access. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>imagetype,:</em> </td><td>file format, see ENUM_CXIMAGE_FORMATS </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if everything is ok </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="ximage_8h.html#b1562bce5b65a54f0baf878db91bafad">ENUM_CXIMAGE_FORMATS</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="g1936f430c37cd241cda11765f1f8b78b"></a><!-- doxytag: member="CxImage::Decode" ref="g1936f430c37cd241cda11765f1f8b78b" args="(FILE *hFile, DWORD imagetype)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool CxImage::Decode </td>
<td>(</td>
<td class="paramtype">FILE * </td>
<td class="paramname"> <em>hFile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>imagetype</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Loads an image from file handle. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hFile,:</em> </td><td>file handle, with read access. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>imagetype,:</em> </td><td>file format, see ENUM_CXIMAGE_FORMATS </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if everything is ok </dd></dl>
</div>
</div><p>
<a class="anchor" name="g040834c93254ae251eb197cc4d871931"></a><!-- doxytag: member="CxImage::Load" ref="g040834c93254ae251eb197cc4d871931" args="(const TCHAR *filename, DWORD imagetype=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool CxImage::Load </td>
<td>(</td>
<td class="paramtype">const TCHAR * </td>
<td class="paramname"> <em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>imagetype</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Reads from disk the image in a specific format.<ul>
<li>If decoding fails using the specified image format, the function will try the automatic file format recognition.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>filename,:</em> </td><td>file name </td></tr>
<tr><td valign="top"></td><td valign="top"><em>imagetype,:</em> </td><td>file format, see ENUM_CXIMAGE_FORMATS </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if everything is ok </dd></dl>
</div>
</div><p>
<a class="anchor" name="gb7c333ee47b5049ea05abe22e49512b4"></a><!-- doxytag: member="CxImage::LoadResource" ref="gb7c333ee47b5049ea05abe22e49512b4" args="(HRSRC hRes, DWORD imagetype, HMODULE hModule=NULL)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool CxImage::LoadResource </td>
<td>(</td>
<td class="paramtype">HRSRC </td>
<td class="paramname"> <em>hRes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DWORD </td>
<td class="paramname"> <em>imagetype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">HMODULE </td>
<td class="paramname"> <em>hModule</em> = <code>NULL</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Loads an image from the application resources. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hRes,:</em> </td><td>the resource handle returned by FindResource(). </td></tr>
<tr><td valign="top"></td><td valign="top"><em>imagetype,:</em> </td><td>file format, see ENUM_CXIMAGE_FORMATS. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>hModule,:</em> </td><td>NULL for internal resource, or external application/DLL hinstance returned by LoadLibray. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if everything is ok </dd></dl>
</div>
</div><p>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 31 20:11:32 2008 for CxImage by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>
</body>
</html>
| kenjiuno/ThumbGensPack | src/pdf2bmp2/doc/doxy/html/group___decode.html | HTML | gpl-2.0 | 14,556 |
package tests;
import org.checkerframework.checker.nullness.AbstractNullnessChecker;
import org.checkerframework.framework.test.CheckerFrameworkTest;
import java.io.File;
import org.junit.runners.Parameterized.Parameters;
/**
* JUnit tests for the Nullness checker (that uses the Freedom Before Commitment
* type system for initialization).
*/
public class NullnessFbcTest extends CheckerFrameworkTest {
public NullnessFbcTest(File testFile) {
// TODO: remove forbidnonnullarraycomponents option once it's no
// longer needed. See issues 154, 322, and 433:
// https://github.com/typetools/checker-framework/issues/154
// https://github.com/typetools/checker-framework/issues/322
// https://github.com/typetools/checker-framework/issues/433
super(testFile,
org.checkerframework.checker.nullness.NullnessChecker.class,
"nullness",
"-AcheckPurityAnnotations",
"-Anomsgtext", "-Xlint:deprecation",
"-Alint=forbidnonnullarraycomponents,"
+ AbstractNullnessChecker.LINT_REDUNDANTNULLCOMPARISON);
}
@Parameters
public static String[] getTestDirs() {
return new String[]{"nullness", "initialization/fbc", "all-systems"};
}
}
| jthaine/checker-framework | checker/tests/src/tests/NullnessFbcTest.java | Java | gpl-2.0 | 1,308 |
<?php
/**
* Eighties compatibility check.
*
* Prevents Eighties from running on WordPress versions
* prior to 3.6, since this theme is not meant to
* be backward compatible beyond that and relies
* on many newer functions and markup changes
* introduced in 3.6.
*
* @package Eighties
* @author Justin Kopepasah
*/
/**
* Prevent switching to Eighties on old versions of
* WordPress and switches to the default theme.
*
* @since 1.0.0
* @return void
*/
function eighties_switch_theme() {
switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
unset( $_GET['activated'] );
add_action( 'admin_notices', 'eighties_upgrade_notice' );
}
add_action( 'after_switch_theme', 'eighties_switch_theme' );
/**
* Add message for unsuccessful theme switch.
*
* Prints an update nag after an unsuccessful
* attempt to switch to Eighties on WordPress versions
* prior to 3.6.
*
* @since 1.0.0
* @return void
*/
function eighties_upgrade_notice() {
$message = sprintf( __( 'Eighties requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'eighties' ), $GLOBALS['wp_version'] );
printf( '<div class="error"><p>%s</p></div>', $message );
}
/**
* Prevent the Theme Customizer from being loaded
* on WordPress versions prior to 3.6.
*
* @since 1.0.0
* @return void
*/
function eighties_customize() {
wp_die( sprintf( __( 'Eighties requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), '', array(
'back_link' => true,
) );
}
add_action( 'load-customize.php', 'eighties_customize' );
/**
* Prevent the Theme Preview from being loaded on
* WordPress versions prior to 3.6.
*
* @since 1.0.0
* @return void
*/
function eighties_preview() {
if ( isset( $_GET['preview'] ) ) {
wp_die( sprintf( __( 'Eighties requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ) );
}
}
add_action( 'template_redirect', 'eighties_preview' );
| AwakenStudio/DefenderRescue | wp-content/themes/eighties/inc/compatibility.php | PHP | gpl-2.0 | 2,073 |
<?php
/**
* The template for displaying product category thumbnails within loops.
*
* Override this template by copying it to yourtheme/woocommerce/content-product_cat.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce_loop;
// Store loop count we're currently on
if ( empty( $woocommerce_loop['loop'] ) )
$woocommerce_loop['loop'] = 0;
// Store column count for displaying the grid
if ( empty( $woocommerce_loop['columns'] ) )
$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 4 );
// Increase loop count
$woocommerce_loop['loop']++;
// Extra post classes
$woocommerce_loop['li_class'] = array();
if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] )
$woocommerce_loop['li_class'][] = 'first';
if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] )
$woocommerce_loop['li_class'][] = 'last';
if ( !( isset( $woocommerce_loop['layout'] ) && ! empty( $woocommerce_loop['layout'] ) ) )
$woocommerce_loop['layout'] = yit_get_option( 'shop-layout', 'with-hover' );
// view
if ( !( isset( $woocommerce_loop['view'] ) && ! empty( $woocommerce_loop['view'] ) ) )
$woocommerce_loop['view'] = yit_get_option( 'shop-view', 'grid' );
$woocommerce_loop['li_class'][] = $woocommerce_loop['view'];
// force open hover
$woocommerce_loop['li_class'][] = ( ! yit_get_option( 'shop-open-hover' ) ) ? 'add-hover' : 'force-open';
$woocommerce_loop['li_class'][] = 'product-category';
// open the hover on mobile
if ( yit_get_option( 'responsive-open-hover' ) ) $woocommerce_loop['li_class'][] = 'open-on-mobile';
yit_detect_span_catalog_image(); //automatically add the classes
?>
<li <?php post_class( $woocommerce_loop['li_class'] ); ?>>
<?php do_action( 'woocommerce_before_subcategory', $category ); ?>
<a href="<?php echo get_term_link( $category->slug, 'product_cat' ); ?>">
<?php
/**
* woocommerce_before_subcategory_title hook
*
* @hooked woocommerce_subcategory_thumbnail - 10
*/
do_action( 'woocommerce_before_subcategory_title', $category );
?>
<h3>
<?php
echo $category->name;
if ( $category->count > 0 )
echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class="count">(' . $category->count . ')</mark>', $category );
?>
</h3>
<?php
/**
* woocommerce_after_subcategory_title hook
*/
do_action( 'woocommerce_after_subcategory_title', $category );
?>
</a>
<?php do_action( 'woocommerce_after_subcategory', $category ); ?>
</li> | integrait/wp_ds | wp-content/themes/sistina/woocommerce_2.1.x/content-product_cat.php | PHP | gpl-2.0 | 2,738 |
<?php
/**
* @file
* Contains \Drupal\form_test\Form\FormTestStorageForm.
*/
namespace Drupal\form_test\Form;
use Drupal\Component\Utility\String;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* A multistep form for testing the form storage.
*
* It uses two steps for editing a virtual "thing". Any changes to it are saved
* in the form storage and have to be present during any step. By setting the
* request parameter "cache" the form can be tested with caching enabled, as
* it would be the case, if the form would contain some #ajax callbacks.
*/
class FormTestStorageForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'form_test_storage_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
if ($form_state->isRebuilding()) {
$form_state->setUserInput(array());
}
// Initialize
$storage = $form_state->getStorage();
if (empty($storage)) {
$user_input = $form_state->getUserInput();
if (empty($user_input)) {
$_SESSION['constructions'] = 0;
}
// Put the initial thing into the storage
$storage = [
'thing' => [
'title' => 'none',
'value' => '',
],
];
$form_state->setStorage($storage);
}
// Count how often the form is constructed.
$_SESSION['constructions']++;
drupal_set_message("Form constructions: " . $_SESSION['constructions']);
$form['title'] = array(
'#type' => 'textfield',
'#title' => 'Title',
'#default_value' => $storage['thing']['title'],
'#required' => TRUE,
);
$form['value'] = array(
'#type' => 'textfield',
'#title' => 'Value',
'#default_value' => $storage['thing']['value'],
'#element_validate' => array('::elementValidateValueCached'),
);
$form['continue_button'] = array(
'#type' => 'button',
'#value' => 'Reset',
// Rebuilds the form without keeping the values.
);
$form['continue_submit'] = array(
'#type' => 'submit',
'#value' => 'Continue submit',
'#submit' => array('::continueSubmitForm'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
);
if (\Drupal::request()->get('cache')) {
// Manually activate caching, so we can test that the storage keeps working
// when it's enabled.
$form_state->setCached();
}
return $form;
}
/**
* Form element validation handler for 'value' element.
*
* Tests updating of cached form storage during validation.
*/
public function elementValidateValueCached($element, FormStateInterface $form_state) {
// If caching is enabled and we receive a certain value, change the storage.
// This presumes that another submitted form value triggers a validation error
// elsewhere in the form. Form API should still update the cached form storage
// though.
if (\Drupal::request()->get('cache') && $form_state->getValue('value') == 'change_title') {
$form_state->set(['thing', 'changed'], TRUE);
}
}
/**
* {@inheritdoc}
*/
public function continueSubmitForm(array &$form, FormStateInterface $form_state) {
$form_state->set(['thing', 'title'], $form_state->getValue('title'));
$form_state->set(['thing', 'value'], $form_state->getValue('value'));
$form_state->setRebuild();
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
drupal_set_message("Title: " . String::checkPlain($form_state->getValue('title')));
drupal_set_message("Form constructions: " . $_SESSION['constructions']);
if ($form_state->has(['thing', 'changed'])) {
drupal_set_message("The thing has been changed.");
}
$form_state->setRedirect('<front>');
}
}
| binhdigipro/drupal8 | core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php | PHP | gpl-2.0 | 3,910 |
<?php
namespace Drupal\webform\Plugin\WebformHandler;
use Drupal\Core\Serialization\Yaml;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\WebformHandlerBase;
use Drupal\webform\WebformSubmissionInterface;
use Drupal\webform\WebformTokenManagerInterface;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Webform submission remote post handler.
*
* @WebformHandler(
* id = "remote_post",
* label = @Translation("Remote post"),
* category = @Translation("External"),
* description = @Translation("Posts webform submissions to a URL."),
* cardinality = \Drupal\webform\WebformHandlerInterface::CARDINALITY_UNLIMITED,
* results = \Drupal\webform\WebformHandlerInterface::RESULTS_PROCESSED,
* )
*/
class RemotePostWebformHandler extends WebformHandlerBase {
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The HTTP client to fetch the feed data with.
*
* @var \GuzzleHttp\ClientInterface
*/
protected $httpClient;
/**
* The token manager.
*
* @var \Drupal\webform\WebformTranslationManagerInterface
*/
protected $tokenManager;
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger, ModuleHandlerInterface $module_handler, ClientInterface $http_client, WebformTokenManagerInterface $token_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $logger);
$this->moduleHandler = $module_handler;
$this->httpClient = $http_client;
$this->tokenManager = $token_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('logger.factory')->get('webform.remote_post'),
$container->get('module_handler'),
$container->get('http_client'),
$container->get('webform.token_manager')
);
}
/**
* {@inheritdoc}
*/
public function getSummary() {
$configuration = $this->getConfiguration();
// If the saving of results is disabled clear update and delete URL.
if ($this->getWebform()->getSetting('results_disabled')) {
$configuration['settings']['update_url'] = '';
$configuration['settings']['delete_url'] = '';
}
return [
'#settings' => $configuration['settings'],
] + parent::getSummary();
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
$field_names = array_keys(\Drupal::service('entity_field.manager')->getBaseFieldDefinitions('webform_submission'));
$excluded_data = array_combine($field_names, $field_names);
return [
'type' => 'x-www-form-urlencoded',
'insert_url' => '',
'update_url' => '',
'delete_url' => '',
'excluded_data' => $excluded_data,
'custom_data' => '',
'insert_custom_data' => '',
'update_custom_data' => '',
'delete_custom_data' => '',
'debug' => FALSE,
];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$webform = $this->getWebform();
$results_disabled = $webform->getSetting('results_disabled');
$form['insert_url'] = [
'#type' => 'url',
'#title' => $this->t('Insert URL'),
'#description' => $this->t('The full URL to POST to when a new webform submission is saved. E.g. http://www.mycrm.com/form_insert_handler.php'),
'#required' => TRUE,
'#default_value' => $this->configuration['insert_url'],
];
$form['update_url'] = [
'#type' => 'url',
'#title' => $this->t('Update URL'),
'#description' => $this->t('The full URL to POST to when an existing webform submission is updated. E.g. http://www.mycrm.com/form_insert_handler.php'),
'#default_value' => $this->configuration['update_url'],
'#access' => !$results_disabled,
];
$form['delete_url'] = [
'#type' => 'url',
'#title' => $this->t('Save URL'),
'#description' => $this->t('The full URL to POST to call when a webform submission is deleted. E.g. http://www.mycrm.com/form_delete_handler.php'),
'#default_value' => $this->configuration['delete_url'],
'#access' => !$results_disabled,
];
$form['type'] = [
'#type' => 'select',
'#title' => $this->t('Post type'),
'#description' => $this->t('Use x-www-form-urlencoded if unsure, as it is the default format for HTML webforms. You also have the option to post data in <a href="http://www.json.org/" target="_blank">JSON</a> format.'),
'#options' => [
'x-www-form-urlencoded' => $this->t('x-www-form-urlencoded'),
'json' => $this->t('JSON'),
],
'#required' => TRUE,
'#default_value' => $this->configuration['type'],
];
$form['submission_data'] = [
'#type' => 'details',
'#title' => $this->t('Submission data'),
];
$form['submission_data']['excluded_data'] = [
'#type' => 'webform_excluded_columns',
'#title' => $this->t('Posted data'),
'#title_display' => 'invisible',
'#webform' => $webform,
'#required' => TRUE,
'#parents' => ['settings', 'excluded_data'],
'#default_value' => $this->configuration['excluded_data'],
];
$form['custom_data'] = [
'#type' => 'details',
'#title' => $this->t('Custom data'),
'#description' => $this->t('Custom data will take precedence over submission data. You may use tokens.'),
];
$form['custom_data']['custom_data'] = [
'#type' => 'webform_codemirror',
'#mode' => 'yaml',
'#title' => $this->t('Custom data'),
'#description' => $this->t('Enter custom data that will be included in all remote post requests.'),
'#parents' => ['settings', 'custom_data'],
'#default_value' => $this->configuration['custom_data'],
];
$form['custom_data']['insert_custom_data'] = [
'#type' => 'webform_codemirror',
'#mode' => 'yaml',
'#title' => $this->t('Insert data'),
'#description' => $this->t("Enter custom data that will be included when a new webform submission is saved."),
'#parents' => ['settings', 'insert_custom_data'],
'#states' => [
'visible' => [
[':input[name="settings[update_url]"]' => ['filled' => TRUE]],
'or',
[':input[name="settings[delete_url]"]' => ['filled' => TRUE]],
],
],
'#default_value' => $this->configuration['insert_custom_data'],
];
$form['custom_data']['update_custom_data'] = [
'#type' => 'webform_codemirror',
'#mode' => 'yaml',
'#title' => $this->t('Update data'),
'#description' => $this->t("Enter custom data that will be included when a webform submission is updated."),
'#parents' => ['settings', 'update_custom_data'],
'#states' => ['visible' => [':input[name="settings[update_url]"]' => ['filled' => TRUE]]],
'#default_value' => $this->configuration['update_custom_data'],
];
$form['custom_data']['delete_custom_data'] = [
'#type' => 'webform_codemirror',
'#mode' => 'yaml',
'#title' => $this->t('Delete data'),
'#description' => $this->t("Enter custom data that will be included when a webform submission is deleted."),
'#parents' => ['settings', 'delete_custom_data'],
'#states' => ['visible' => [':input[name="settings[delete_url]"]' => ['filled' => TRUE]]],
'#default_value' => $this->configuration['delete_custom_data'],
];
$form['custom_data']['token_tree_link'] = $this->tokenManager->buildTreeLink();
$form['debug'] = [
'#type' => 'checkbox',
'#title' => $this->t('Enable debugging'),
'#description' => $this->t('If checked, posted submissions will be displayed onscreen to all users.'),
'#return_value' => TRUE,
'#default_value' => $this->configuration['debug'],
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::submitConfigurationForm($form, $form_state);
$values = $form_state->getValues();
foreach ($this->configuration as $name => $value) {
if (isset($values[$name])) {
$this->configuration[$name] = $values[$name];
}
}
}
/**
* {@inheritdoc}
*/
public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
$operation = ($update) ? 'update' : 'insert';
$this->remotePost($operation, $webform_submission);
}
/**
* {@inheritdoc}
*/
public function postDelete(WebformSubmissionInterface $webform_submission) {
$this->remotePost('delete', $webform_submission);
}
/**
* Execute a remote post.
*
* @param string $operation
* The type of webform submission operation to be posted. Can be 'insert',
* 'update', or 'delete'.
* @param \Drupal\webform\WebformSubmissionInterface $webform_submission
* The webform submission to be posted.
*/
protected function remotePost($operation, WebformSubmissionInterface $webform_submission) {
$request_url = $this->configuration[$operation . '_url'];
if (empty($request_url)) {
return;
}
$request_type = $this->configuration['type'];
$request_post_data = $this->getPostData($operation, $webform_submission);
try {
switch ($request_type) {
case 'json':
$response = $this->httpClient->post($request_url, ['json' => $request_post_data]);
break;
case 'x-www-form-urlencoded':
default:
$response = $this->httpClient->post($request_url, ['form_params' => $request_post_data]);
break;
}
}
catch (RequestException $request_exception) {
$message = $request_exception->getMessage();
$response = $request_exception->getResponse();
// If debugging is enabled, display the error message on screen.
$this->debug($message, $operation, $request_url, $request_type, $request_post_data, $response, 'error');
// Log error message.
$context = [
'@form' => $this->getWebform()->label(),
'@operation' => $operation,
'@type' => $request_type,
'@url' => $request_url,
'@message' => $message,
'link' => $this->getWebform()->toLink(t('Edit'), 'handlers-form')->toString(),
];
$this->logger->error('@form webform remote @type post (@operation) to @url failed. @message', $context);
return;
}
// If debugging is enabled, display the request and response.
$this->debug(t('Remote post successful!'), $operation, $request_url, $request_type, $request_post_data, $response, 'warning');
}
/**
* Get a webform submission's post data.
*
* @param string $operation
* The type of webform submission operation to be posted. Can be 'insert',
* 'update', or 'delete'.
* @param \Drupal\webform\WebformSubmissionInterface $webform_submission
* The webform submission to be posted.
*
* @return array
* A webform submission converted to an associative array.
*/
protected function getPostData($operation, WebformSubmissionInterface $webform_submission) {
// Get submission and elements data.
$data = $webform_submission->toArray(TRUE);
// Flatten data.
// Prioritizing elements before the submissions fields.
$data = $data['data'] + $data;
unset($data['data']);
// Excluded selected submission data.
$data = array_diff_key($data, $this->configuration['excluded_data']);
// Append custom data.
if (!empty($this->configuration['custom_data'])) {
$data = Yaml::decode($this->configuration['custom_data']) + $data;
}
// Append operation data.
if (!empty($this->configuration[$operation . '_custom_data'])) {
$data = Yaml::decode($this->configuration[$operation . '_custom_data']) + $data;
}
// Replace tokens.
$data = $this->tokenManager->replace($data, $webform_submission);
return $data;
}
/**
* Display debugging information.
*
* @param string $message
* Message to be displayed.
* @param string $operation
* The operation being performed, can be either insert, update, or delete.
* @param string $request_url
* The remote URL the request is being posted to.
* @param string $request_type
* The type of remote post.
* @param string $request_post_data
* The webform submission data being posted.
* @param \Psr\Http\Message\ResponseInterface|null $response
* The response returned by the remote server.
* @param string $type
* The type of message to be displayed to the end use.
*/
protected function debug($message, $operation, $request_url, $request_type, $request_post_data, ResponseInterface $response = NULL, $type = 'warning') {
if (empty($this->configuration['debug'])) {
return;
}
$build = [];
// Message.
$build['message'] = [
'#markup' => $message,
'#prefix' => '<b>',
'#suffix' => '</b>',
];
// Operation.
$build['operation'] = [
'#type' => 'item',
'#title' => $this->t('Remote operation'),
'#markup' => $operation,
];
// Request.
$build['request_url'] = [
'#type' => 'item',
'#title' => $this->t('Request URL'),
'#markup' => $request_url,
];
$build['request_type'] = [
'#type' => 'item',
'#title' => $this->t('Request type'),
'#markup' => $request_type,
];
$build['request_post_data'] = [
'#type' => 'item',
'#title' => $this->t('Request data'),
'data' => [
'#markup' => htmlspecialchars(Yaml::encode($request_post_data)),
'#prefix' => '<pre>',
'#suffix' => '</pre>',
],
];
$build['returned'] = [
'#markup' => $this->t('...returned...'),
'#prefix' => '<b>',
'#suffix' => '</b>',
];
// Response.
if ($response) {
$build['response_code'] = [
'#type' => 'item',
'#title' => $this->t('Response status code'),
'#markup' => $response->getStatusCode(),
];
$build['response_header'] = [
'#type' => 'details',
'#title' => $this->t('Response header'),
'data' => [
'#markup' => htmlspecialchars(Yaml::encode($response->getHeaders())),
'#prefix' => '<pre>',
'#suffix' => '</pre>',
],
];
$build['response_body'] = [
'#type' => 'details',
'#title' => $this->t('Response body'),
'data' => [
'#markup' => htmlspecialchars($response->getBody()),
'#prefix' => '<pre>',
'#suffix' => '</pre>',
],
];
}
else {
$build['response_code'] = [
'#markup' => t('No response. Please see the recent log messages.'),
'#prefix' => '<p>',
'#suffix' => '</p>',
];
}
drupal_set_message(\Drupal::service('renderer')->renderPlain($build), $type);
}
}
| raidho93/buildrace | modules/webform/src/Plugin/WebformHandler/RemotePostWebformHandler.php | PHP | gpl-2.0 | 15,386 |
#define DSI_VAL2REG(__reg, __fld, __val) \
(((__val) << __reg##_##__fld##_SHIFT) & __reg##_##__fld##_MASK)
#define DSI_REG2VAL(__reg, __fld, __val) \
(((__val) & __reg##_##__fld##_MASK) >> __reg##_##__fld##_SHIFT)
#define DSI_MCTL_INTEGRATION_MODE 0x00000000
#define DSI_MCTL_INTEGRATION_MODE_INT_MODE_EN_SHIFT 0
#define DSI_MCTL_INTEGRATION_MODE_INT_MODE_EN_MASK 0x00000001
#define DSI_MCTL_INTEGRATION_MODE_INT_MODE_EN(__x) \
DSI_VAL2REG(DSI_MCTL_INTEGRATION_MODE, INT_MODE_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL 0x00000004
#define DSI_MCTL_MAIN_DATA_CTL_LINK_EN_SHIFT 0
#define DSI_MCTL_MAIN_DATA_CTL_LINK_EN_MASK 0x00000001
#define DSI_MCTL_MAIN_DATA_CTL_LINK_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, LINK_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_IF1_MODE_SHIFT 1
#define DSI_MCTL_MAIN_DATA_CTL_IF1_MODE_MASK 0x00000002
#define DSI_MCTL_MAIN_DATA_CTL_IF1_MODE_CMD 0
#define DSI_MCTL_MAIN_DATA_CTL_IF1_MODE_VID 1
#define DSI_MCTL_MAIN_DATA_CTL_IF1_MODE_ENUM(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, IF1_MODE, \
DSI_MCTL_MAIN_DATA_CTL_IF1_MODE_##__x)
#define DSI_MCTL_MAIN_DATA_CTL_IF1_MODE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, IF1_MODE, __x)
#define DSI_MCTL_MAIN_DATA_CTL_VID_EN_SHIFT 2
#define DSI_MCTL_MAIN_DATA_CTL_VID_EN_MASK 0x00000004
#define DSI_MCTL_MAIN_DATA_CTL_VID_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, VID_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_TVG_SEL_SHIFT 3
#define DSI_MCTL_MAIN_DATA_CTL_TVG_SEL_MASK 0x00000008
#define DSI_MCTL_MAIN_DATA_CTL_TVG_SEL(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, TVG_SEL, __x)
#define DSI_MCTL_MAIN_DATA_CTL_TBG_SEL_SHIFT 4
#define DSI_MCTL_MAIN_DATA_CTL_TBG_SEL_MASK 0x00000010
#define DSI_MCTL_MAIN_DATA_CTL_TBG_SEL(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, TBG_SEL, __x)
#define DSI_MCTL_MAIN_DATA_CTL_IF1_TE_EN_SHIFT 5
#define DSI_MCTL_MAIN_DATA_CTL_IF1_TE_EN_MASK 0x00000020
#define DSI_MCTL_MAIN_DATA_CTL_IF1_TE_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, IF1_TE_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_IF2_TE_EN_SHIFT 6
#define DSI_MCTL_MAIN_DATA_CTL_IF2_TE_EN_MASK 0x00000040
#define DSI_MCTL_MAIN_DATA_CTL_IF2_TE_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, IF2_TE_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_REG_TE_EN_SHIFT 7
#define DSI_MCTL_MAIN_DATA_CTL_REG_TE_EN_MASK 0x00000080
#define DSI_MCTL_MAIN_DATA_CTL_REG_TE_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, REG_TE_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_READ_EN_SHIFT 8
#define DSI_MCTL_MAIN_DATA_CTL_READ_EN_MASK 0x00000100
#define DSI_MCTL_MAIN_DATA_CTL_READ_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, READ_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_BTA_EN_SHIFT 9
#define DSI_MCTL_MAIN_DATA_CTL_BTA_EN_MASK 0x00000200
#define DSI_MCTL_MAIN_DATA_CTL_BTA_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, BTA_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_DISP_GEN_ECC_SHIFT 10
#define DSI_MCTL_MAIN_DATA_CTL_DISP_GEN_ECC_MASK 0x00000400
#define DSI_MCTL_MAIN_DATA_CTL_DISP_GEN_ECC(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, DISP_GEN_ECC, __x)
#define DSI_MCTL_MAIN_DATA_CTL_DISP_GEN_CHECKSUM_SHIFT 11
#define DSI_MCTL_MAIN_DATA_CTL_DISP_GEN_CHECKSUM_MASK 0x00000800
#define DSI_MCTL_MAIN_DATA_CTL_DISP_GEN_CHECKSUM(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, DISP_GEN_CHECKSUM, __x)
#define DSI_MCTL_MAIN_DATA_CTL_HOST_EOT_GEN_SHIFT 12
#define DSI_MCTL_MAIN_DATA_CTL_HOST_EOT_GEN_MASK 0x00001000
#define DSI_MCTL_MAIN_DATA_CTL_HOST_EOT_GEN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, HOST_EOT_GEN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_DISP_EOT_GEN_SHIFT 13
#define DSI_MCTL_MAIN_DATA_CTL_DISP_EOT_GEN_MASK 0x00002000
#define DSI_MCTL_MAIN_DATA_CTL_DISP_EOT_GEN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, DISP_EOT_GEN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_DLX_REMAP_EN_SHIFT 14
#define DSI_MCTL_MAIN_DATA_CTL_DLX_REMAP_EN_MASK 0x00004000
#define DSI_MCTL_MAIN_DATA_CTL_DLX_REMAP_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, DLX_REMAP_EN, __x)
#define DSI_MCTL_MAIN_DATA_CTL_TE_POLLING_EN_SHIFT 15
#define DSI_MCTL_MAIN_DATA_CTL_TE_POLLING_EN_MASK 0x00008000
#define DSI_MCTL_MAIN_DATA_CTL_TE_POLLING_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_DATA_CTL, TE_POLLING_EN, __x)
#define DSI_MCTL_MAIN_PHY_CTL 0x00000008
#define DSI_MCTL_MAIN_PHY_CTL_LANE2_EN_SHIFT 0
#define DSI_MCTL_MAIN_PHY_CTL_LANE2_EN_MASK 0x00000001
#define DSI_MCTL_MAIN_PHY_CTL_LANE2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_PHY_CTL, LANE2_EN, __x)
#define DSI_MCTL_MAIN_PHY_CTL_FORCE_STOP_MODE_SHIFT 1
#define DSI_MCTL_MAIN_PHY_CTL_FORCE_STOP_MODE_MASK 0x00000002
#define DSI_MCTL_MAIN_PHY_CTL_FORCE_STOP_MODE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_PHY_CTL, FORCE_STOP_MODE, __x)
#define DSI_MCTL_MAIN_PHY_CTL_CLK_CONTINUOUS_SHIFT 2
#define DSI_MCTL_MAIN_PHY_CTL_CLK_CONTINUOUS_MASK 0x00000004
#define DSI_MCTL_MAIN_PHY_CTL_CLK_CONTINUOUS(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_PHY_CTL, CLK_CONTINUOUS, __x)
#define DSI_MCTL_MAIN_PHY_CTL_CLK_ULPM_EN_SHIFT 3
#define DSI_MCTL_MAIN_PHY_CTL_CLK_ULPM_EN_MASK 0x00000008
#define DSI_MCTL_MAIN_PHY_CTL_CLK_ULPM_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_PHY_CTL, CLK_ULPM_EN, __x)
#define DSI_MCTL_MAIN_PHY_CTL_DAT1_ULPM_EN_SHIFT 4
#define DSI_MCTL_MAIN_PHY_CTL_DAT1_ULPM_EN_MASK 0x00000010
#define DSI_MCTL_MAIN_PHY_CTL_DAT1_ULPM_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_PHY_CTL, DAT1_ULPM_EN, __x)
#define DSI_MCTL_MAIN_PHY_CTL_DAT2_ULPM_EN_SHIFT 5
#define DSI_MCTL_MAIN_PHY_CTL_DAT2_ULPM_EN_MASK 0x00000020
#define DSI_MCTL_MAIN_PHY_CTL_DAT2_ULPM_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_PHY_CTL, DAT2_ULPM_EN, __x)
#define DSI_MCTL_MAIN_PHY_CTL_WAIT_BURST_TIME_SHIFT 6
#define DSI_MCTL_MAIN_PHY_CTL_WAIT_BURST_TIME_MASK 0x000003C0
#define DSI_MCTL_MAIN_PHY_CTL_WAIT_BURST_TIME(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_PHY_CTL, WAIT_BURST_TIME, __x)
#define DSI_MCTL_PLL_CTL 0x0000000C
#define DSI_MCTL_PLL_CTL_PLL_MULT_SHIFT 0
#define DSI_MCTL_PLL_CTL_PLL_MULT_MASK 0x000000FF
#define DSI_MCTL_PLL_CTL_PLL_MULT(__x) \
DSI_VAL2REG(DSI_MCTL_PLL_CTL, PLL_MULT, __x)
#define DSI_MCTL_PLL_CTL_PLL_OUT_DIV_SHIFT 8
#define DSI_MCTL_PLL_CTL_PLL_OUT_DIV_MASK 0x00003F00
#define DSI_MCTL_PLL_CTL_PLL_OUT_DIV(__x) \
DSI_VAL2REG(DSI_MCTL_PLL_CTL, PLL_OUT_DIV, __x)
#define DSI_MCTL_PLL_CTL_PLL_IN_DIV_SHIFT 14
#define DSI_MCTL_PLL_CTL_PLL_IN_DIV_MASK 0x0001C000
#define DSI_MCTL_PLL_CTL_PLL_IN_DIV(__x) \
DSI_VAL2REG(DSI_MCTL_PLL_CTL, PLL_IN_DIV, __x)
#define DSI_MCTL_PLL_CTL_PLL_SEL_DIV2_SHIFT 17
#define DSI_MCTL_PLL_CTL_PLL_SEL_DIV2_MASK 0x00020000
#define DSI_MCTL_PLL_CTL_PLL_SEL_DIV2(__x) \
DSI_VAL2REG(DSI_MCTL_PLL_CTL, PLL_SEL_DIV2, __x)
#define DSI_MCTL_PLL_CTL_PLL_OUT_SEL_SHIFT 18
#define DSI_MCTL_PLL_CTL_PLL_OUT_SEL_MASK 0x00040000
#define DSI_MCTL_PLL_CTL_PLL_OUT_SEL_INT_PLL 0
#define DSI_MCTL_PLL_CTL_PLL_OUT_SEL_SYS_PLL 1
#define DSI_MCTL_PLL_CTL_PLL_OUT_SEL_ENUM(__x) \
DSI_VAL2REG(DSI_MCTL_PLL_CTL, PLL_OUT_SEL, \
DSI_MCTL_PLL_CTL_PLL_OUT_SEL_##__x)
#define DSI_MCTL_PLL_CTL_PLL_OUT_SEL(__x) \
DSI_VAL2REG(DSI_MCTL_PLL_CTL, PLL_OUT_SEL, __x)
#define DSI_MCTL_PLL_CTL_PLL_MASTER_SHIFT 31
#define DSI_MCTL_PLL_CTL_PLL_MASTER_MASK 0x80000000
#define DSI_MCTL_PLL_CTL_PLL_MASTER(__x) \
DSI_VAL2REG(DSI_MCTL_PLL_CTL, PLL_MASTER, __x)
#define DSI_MCTL_LANE_STS 0x00000010
#define DSI_MCTL_LANE_STS_CLKLANE_STATE_SHIFT 0
#define DSI_MCTL_LANE_STS_CLKLANE_STATE_MASK 0x00000003
#define DSI_MCTL_LANE_STS_CLKLANE_STATE_START 0
#define DSI_MCTL_LANE_STS_CLKLANE_STATE_IDLE 1
#define DSI_MCTL_LANE_STS_CLKLANE_STATE_HS 2
#define DSI_MCTL_LANE_STS_CLKLANE_STATE_ULPM 3
#define DSI_MCTL_LANE_STS_CLKLANE_STATE_ENUM(__x) \
DSI_VAL2REG(DSI_MCTL_LANE_STS, CLKLANE_STATE, \
DSI_MCTL_LANE_STS_CLKLANE_STATE_##__x)
#define DSI_MCTL_LANE_STS_CLKLANE_STATE(__x) \
DSI_VAL2REG(DSI_MCTL_LANE_STS, CLKLANE_STATE, __x)
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_SHIFT 2
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_MASK 0x0000001C
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_START 0
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_IDLE 1
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_WRITE 2
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_ULPM 3
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_READ 4
#define DSI_MCTL_LANE_STS_DATLANE1_STATE_ENUM(__x) \
DSI_VAL2REG(DSI_MCTL_LANE_STS, DATLANE1_STATE, \
DSI_MCTL_LANE_STS_DATLANE1_STATE_##__x)
#define DSI_MCTL_LANE_STS_DATLANE1_STATE(__x) \
DSI_VAL2REG(DSI_MCTL_LANE_STS, DATLANE1_STATE, __x)
#define DSI_MCTL_LANE_STS_DATLANE2_STATE_SHIFT 5
#define DSI_MCTL_LANE_STS_DATLANE2_STATE_MASK 0x00000060
#define DSI_MCTL_LANE_STS_DATLANE2_STATE_START 0
#define DSI_MCTL_LANE_STS_DATLANE2_STATE_IDLE 1
#define DSI_MCTL_LANE_STS_DATLANE2_STATE_WRITE 2
#define DSI_MCTL_LANE_STS_DATLANE2_STATE_ULPM 3
#define DSI_MCTL_LANE_STS_DATLANE2_STATE_ENUM(__x) \
DSI_VAL2REG(DSI_MCTL_LANE_STS, DATLANE2_STATE, \
DSI_MCTL_LANE_STS_DATLANE2_STATE_##__x)
#define DSI_MCTL_LANE_STS_DATLANE2_STATE(__x) \
DSI_VAL2REG(DSI_MCTL_LANE_STS, DATLANE2_STATE, __x)
#define DSI_MCTL_DPHY_TIMEOUT 0x00000014
#define DSI_MCTL_DPHY_TIMEOUT_CLK_DIV_SHIFT 0
#define DSI_MCTL_DPHY_TIMEOUT_CLK_DIV_MASK 0x0000000F
#define DSI_MCTL_DPHY_TIMEOUT_CLK_DIV(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_TIMEOUT, CLK_DIV, __x)
#define DSI_MCTL_DPHY_TIMEOUT_HSTX_TO_VAL_SHIFT 4
#define DSI_MCTL_DPHY_TIMEOUT_HSTX_TO_VAL_MASK 0x0003FFF0
#define DSI_MCTL_DPHY_TIMEOUT_HSTX_TO_VAL(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_TIMEOUT, HSTX_TO_VAL, __x)
#define DSI_MCTL_DPHY_TIMEOUT_LPRX_TO_VAL_SHIFT 18
#define DSI_MCTL_DPHY_TIMEOUT_LPRX_TO_VAL_MASK 0xFFFC0000
#define DSI_MCTL_DPHY_TIMEOUT_LPRX_TO_VAL(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_TIMEOUT, LPRX_TO_VAL, __x)
#define DSI_MCTL_ULPOUT_TIME 0x00000018
#define DSI_MCTL_ULPOUT_TIME_CKLANE_ULPOUT_TIME_SHIFT 0
#define DSI_MCTL_ULPOUT_TIME_CKLANE_ULPOUT_TIME_MASK 0x000001FF
#define DSI_MCTL_ULPOUT_TIME_CKLANE_ULPOUT_TIME(__x) \
DSI_VAL2REG(DSI_MCTL_ULPOUT_TIME, CKLANE_ULPOUT_TIME, __x)
#define DSI_MCTL_ULPOUT_TIME_DATA_ULPOUT_TIME_SHIFT 9
#define DSI_MCTL_ULPOUT_TIME_DATA_ULPOUT_TIME_MASK 0x0003FE00
#define DSI_MCTL_ULPOUT_TIME_DATA_ULPOUT_TIME(__x) \
DSI_VAL2REG(DSI_MCTL_ULPOUT_TIME, DATA_ULPOUT_TIME, __x)
#define DSI_MCTL_DPHY_STATIC 0x0000001C
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_CLK_SHIFT 0
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_CLK_MASK 0x00000001
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_CLK(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_STATIC, SWAP_PINS_CLK, __x)
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_CLK_SHIFT 1
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_CLK_MASK 0x00000002
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_CLK(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_STATIC, HS_INVERT_CLK, __x)
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_DAT1_SHIFT 2
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_DAT1_MASK 0x00000004
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_DAT1(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_STATIC, SWAP_PINS_DAT1, __x)
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_DAT1_SHIFT 3
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_DAT1_MASK 0x00000008
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_DAT1(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_STATIC, HS_INVERT_DAT1, __x)
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_DAT2_SHIFT 4
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_DAT2_MASK 0x00000010
#define DSI_MCTL_DPHY_STATIC_SWAP_PINS_DAT2(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_STATIC, SWAP_PINS_DAT2, __x)
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_DAT2_SHIFT 5
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_DAT2_MASK 0x00000020
#define DSI_MCTL_DPHY_STATIC_HS_INVERT_DAT2(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_STATIC, HS_INVERT_DAT2, __x)
#define DSI_MCTL_DPHY_STATIC_UI_X4_SHIFT 6
#define DSI_MCTL_DPHY_STATIC_UI_X4_MASK 0x00000FC0
#define DSI_MCTL_DPHY_STATIC_UI_X4(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_STATIC, UI_X4, __x)
#define DSI_MCTL_MAIN_EN 0x00000020
#define DSI_MCTL_MAIN_EN_PLL_START_SHIFT 0
#define DSI_MCTL_MAIN_EN_PLL_START_MASK 0x00000001
#define DSI_MCTL_MAIN_EN_PLL_START(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, PLL_START, __x)
#define DSI_MCTL_MAIN_EN_CKLANE_EN_SHIFT 3
#define DSI_MCTL_MAIN_EN_CKLANE_EN_MASK 0x00000008
#define DSI_MCTL_MAIN_EN_CKLANE_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, CKLANE_EN, __x)
#define DSI_MCTL_MAIN_EN_DAT1_EN_SHIFT 4
#define DSI_MCTL_MAIN_EN_DAT1_EN_MASK 0x00000010
#define DSI_MCTL_MAIN_EN_DAT1_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, DAT1_EN, __x)
#define DSI_MCTL_MAIN_EN_DAT2_EN_SHIFT 5
#define DSI_MCTL_MAIN_EN_DAT2_EN_MASK 0x00000020
#define DSI_MCTL_MAIN_EN_DAT2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, DAT2_EN, __x)
#define DSI_MCTL_MAIN_EN_CLKLANE_ULPM_REQ_SHIFT 6
#define DSI_MCTL_MAIN_EN_CLKLANE_ULPM_REQ_MASK 0x00000040
#define DSI_MCTL_MAIN_EN_CLKLANE_ULPM_REQ(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, CLKLANE_ULPM_REQ, __x)
#define DSI_MCTL_MAIN_EN_DAT1_ULPM_REQ_SHIFT 7
#define DSI_MCTL_MAIN_EN_DAT1_ULPM_REQ_MASK 0x00000080
#define DSI_MCTL_MAIN_EN_DAT1_ULPM_REQ(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, DAT1_ULPM_REQ, __x)
#define DSI_MCTL_MAIN_EN_DAT2_ULPM_REQ_SHIFT 8
#define DSI_MCTL_MAIN_EN_DAT2_ULPM_REQ_MASK 0x00000100
#define DSI_MCTL_MAIN_EN_DAT2_ULPM_REQ(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, DAT2_ULPM_REQ, __x)
#define DSI_MCTL_MAIN_EN_IF1_EN_SHIFT 9
#define DSI_MCTL_MAIN_EN_IF1_EN_MASK 0x00000200
#define DSI_MCTL_MAIN_EN_IF1_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, IF1_EN, __x)
#define DSI_MCTL_MAIN_EN_IF2_EN_SHIFT 10
#define DSI_MCTL_MAIN_EN_IF2_EN_MASK 0x00000400
#define DSI_MCTL_MAIN_EN_IF2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_EN, IF2_EN, __x)
#define DSI_MCTL_MAIN_STS 0x00000024
#define DSI_MCTL_MAIN_STS_PLL_LOCK_SHIFT 0
#define DSI_MCTL_MAIN_STS_PLL_LOCK_MASK 0x00000001
#define DSI_MCTL_MAIN_STS_PLL_LOCK(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, PLL_LOCK, __x)
#define DSI_MCTL_MAIN_STS_CLKLANE_READY_SHIFT 1
#define DSI_MCTL_MAIN_STS_CLKLANE_READY_MASK 0x00000002
#define DSI_MCTL_MAIN_STS_CLKLANE_READY(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, CLKLANE_READY, __x)
#define DSI_MCTL_MAIN_STS_DAT1_READY_SHIFT 2
#define DSI_MCTL_MAIN_STS_DAT1_READY_MASK 0x00000004
#define DSI_MCTL_MAIN_STS_DAT1_READY(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, DAT1_READY, __x)
#define DSI_MCTL_MAIN_STS_DAT2_READY_SHIFT 3
#define DSI_MCTL_MAIN_STS_DAT2_READY_MASK 0x00000008
#define DSI_MCTL_MAIN_STS_DAT2_READY(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, DAT2_READY, __x)
#define DSI_MCTL_MAIN_STS_HSTX_TO_ERR_SHIFT 4
#define DSI_MCTL_MAIN_STS_HSTX_TO_ERR_MASK 0x00000010
#define DSI_MCTL_MAIN_STS_HSTX_TO_ERR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, HSTX_TO_ERR, __x)
#define DSI_MCTL_MAIN_STS_LPRX_TO_ERR_SHIFT 5
#define DSI_MCTL_MAIN_STS_LPRX_TO_ERR_MASK 0x00000020
#define DSI_MCTL_MAIN_STS_LPRX_TO_ERR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, LPRX_TO_ERR, __x)
#define DSI_MCTL_MAIN_STS_CRS_UNTERM_PCK_SHIFT 6
#define DSI_MCTL_MAIN_STS_CRS_UNTERM_PCK_MASK 0x00000040
#define DSI_MCTL_MAIN_STS_CRS_UNTERM_PCK(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, CRS_UNTERM_PCK, __x)
#define DSI_MCTL_MAIN_STS_VRS_UNTERM_PCK_SHIFT 7
#define DSI_MCTL_MAIN_STS_VRS_UNTERM_PCK_MASK 0x00000080
#define DSI_MCTL_MAIN_STS_VRS_UNTERM_PCK(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS, VRS_UNTERM_PCK, __x)
#define DSI_MCTL_DPHY_ERR 0x00000028
#define DSI_MCTL_DPHY_ERR_ERR_ESC_1_SHIFT 6
#define DSI_MCTL_DPHY_ERR_ERR_ESC_1_MASK 0x00000040
#define DSI_MCTL_DPHY_ERR_ERR_ESC_1(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_ESC_1, __x)
#define DSI_MCTL_DPHY_ERR_ERR_ESC_2_SHIFT 7
#define DSI_MCTL_DPHY_ERR_ERR_ESC_2_MASK 0x00000080
#define DSI_MCTL_DPHY_ERR_ERR_ESC_2(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_ESC_2, __x)
#define DSI_MCTL_DPHY_ERR_ERR_SYNCESC_1_SHIFT 8
#define DSI_MCTL_DPHY_ERR_ERR_SYNCESC_1_MASK 0x00000100
#define DSI_MCTL_DPHY_ERR_ERR_SYNCESC_1(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_SYNCESC_1, __x)
#define DSI_MCTL_DPHY_ERR_ERR_SYNCESC_2_SHIFT 9
#define DSI_MCTL_DPHY_ERR_ERR_SYNCESC_2_MASK 0x00000200
#define DSI_MCTL_DPHY_ERR_ERR_SYNCESC_2(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_SYNCESC_2, __x)
#define DSI_MCTL_DPHY_ERR_ERR_CONTROL_1_SHIFT 10
#define DSI_MCTL_DPHY_ERR_ERR_CONTROL_1_MASK 0x00000400
#define DSI_MCTL_DPHY_ERR_ERR_CONTROL_1(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_CONTROL_1, __x)
#define DSI_MCTL_DPHY_ERR_ERR_CONTROL_2_SHIFT 11
#define DSI_MCTL_DPHY_ERR_ERR_CONTROL_2_MASK 0x00000800
#define DSI_MCTL_DPHY_ERR_ERR_CONTROL_2(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_CONTROL_2, __x)
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP0_1_SHIFT 12
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP0_1_MASK 0x00001000
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP0_1(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_CONT_LP0_1, __x)
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP0_2_SHIFT 13
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP0_2_MASK 0x00002000
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP0_2(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_CONT_LP0_2, __x)
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP1_1_SHIFT 14
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP1_1_MASK 0x00004000
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP1_1(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_CONT_LP1_1, __x)
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP1_2_SHIFT 15
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP1_2_MASK 0x00008000
#define DSI_MCTL_DPHY_ERR_ERR_CONT_LP1_2(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR, ERR_CONT_LP1_2, __x)
#define DSI_INT_VID_RDDATA 0x00000030
#define DSI_INT_VID_RDDATA_IF_DATA_SHIFT 0
#define DSI_INT_VID_RDDATA_IF_DATA_MASK 0x0000FFFF
#define DSI_INT_VID_RDDATA_IF_DATA(__x) \
DSI_VAL2REG(DSI_INT_VID_RDDATA, IF_DATA, __x)
#define DSI_INT_VID_RDDATA_IF_VALID_SHIFT 16
#define DSI_INT_VID_RDDATA_IF_VALID_MASK 0x00010000
#define DSI_INT_VID_RDDATA_IF_VALID(__x) \
DSI_VAL2REG(DSI_INT_VID_RDDATA, IF_VALID, __x)
#define DSI_INT_VID_RDDATA_IF_START_SHIFT 17
#define DSI_INT_VID_RDDATA_IF_START_MASK 0x00020000
#define DSI_INT_VID_RDDATA_IF_START(__x) \
DSI_VAL2REG(DSI_INT_VID_RDDATA, IF_START, __x)
#define DSI_INT_VID_RDDATA_IF_FRAME_SYNC_SHIFT 18
#define DSI_INT_VID_RDDATA_IF_FRAME_SYNC_MASK 0x00040000
#define DSI_INT_VID_RDDATA_IF_FRAME_SYNC(__x) \
DSI_VAL2REG(DSI_INT_VID_RDDATA, IF_FRAME_SYNC, __x)
#define DSI_INT_VID_GNT 0x00000034
#define DSI_INT_VID_GNT_IF_STALL_SHIFT 0
#define DSI_INT_VID_GNT_IF_STALL_MASK 0x00000001
#define DSI_INT_VID_GNT_IF_STALL(__x) \
DSI_VAL2REG(DSI_INT_VID_GNT, IF_STALL, __x)
#define DSI_INT_CMD_RDDATA 0x00000038
#define DSI_INT_CMD_RDDATA_IF_DATA_SHIFT 0
#define DSI_INT_CMD_RDDATA_IF_DATA_MASK 0x0000FFFF
#define DSI_INT_CMD_RDDATA_IF_DATA(__x) \
DSI_VAL2REG(DSI_INT_CMD_RDDATA, IF_DATA, __x)
#define DSI_INT_CMD_RDDATA_IF_VALID_SHIFT 16
#define DSI_INT_CMD_RDDATA_IF_VALID_MASK 0x00010000
#define DSI_INT_CMD_RDDATA_IF_VALID(__x) \
DSI_VAL2REG(DSI_INT_CMD_RDDATA, IF_VALID, __x)
#define DSI_INT_CMD_RDDATA_IF_START_SHIFT 17
#define DSI_INT_CMD_RDDATA_IF_START_MASK 0x00020000
#define DSI_INT_CMD_RDDATA_IF_START(__x) \
DSI_VAL2REG(DSI_INT_CMD_RDDATA, IF_START, __x)
#define DSI_INT_CMD_RDDATA_IF_FRAME_SYNC_SHIFT 18
#define DSI_INT_CMD_RDDATA_IF_FRAME_SYNC_MASK 0x00040000
#define DSI_INT_CMD_RDDATA_IF_FRAME_SYNC(__x) \
DSI_VAL2REG(DSI_INT_CMD_RDDATA, IF_FRAME_SYNC, __x)
#define DSI_INT_CMD_GNT 0x0000003C
#define DSI_INT_CMD_GNT_IF_STALL_SHIFT 0
#define DSI_INT_CMD_GNT_IF_STALL_MASK 0x00000001
#define DSI_INT_CMD_GNT_IF_STALL(__x) \
DSI_VAL2REG(DSI_INT_CMD_GNT, IF_STALL, __x)
#define DSI_INT_INTERRUPT_CTL 0x00000040
#define DSI_INT_INTERRUPT_CTL_INT_VAL_SHIFT 0
#define DSI_INT_INTERRUPT_CTL_INT_VAL_MASK 0x00000001
#define DSI_INT_INTERRUPT_CTL_INT_VAL(__x) \
DSI_VAL2REG(DSI_INT_INTERRUPT_CTL, INT_VAL, __x)
#define DSI_CMD_MODE_CTL 0x00000050
#define DSI_CMD_MODE_CTL_IF1_ID_SHIFT 0
#define DSI_CMD_MODE_CTL_IF1_ID_MASK 0x00000003
#define DSI_CMD_MODE_CTL_IF1_ID(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, IF1_ID, __x)
#define DSI_CMD_MODE_CTL_IF2_ID_SHIFT 2
#define DSI_CMD_MODE_CTL_IF2_ID_MASK 0x0000000C
#define DSI_CMD_MODE_CTL_IF2_ID(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, IF2_ID, __x)
#define DSI_CMD_MODE_CTL_IF1_LP_EN_SHIFT 4
#define DSI_CMD_MODE_CTL_IF1_LP_EN_MASK 0x00000010
#define DSI_CMD_MODE_CTL_IF1_LP_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, IF1_LP_EN, __x)
#define DSI_CMD_MODE_CTL_IF2_LP_EN_SHIFT 5
#define DSI_CMD_MODE_CTL_IF2_LP_EN_MASK 0x00000020
#define DSI_CMD_MODE_CTL_IF2_LP_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, IF2_LP_EN, __x)
#define DSI_CMD_MODE_CTL_ARB_MODE_SHIFT 6
#define DSI_CMD_MODE_CTL_ARB_MODE_MASK 0x00000040
#define DSI_CMD_MODE_CTL_ARB_MODE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, ARB_MODE, __x)
#define DSI_CMD_MODE_CTL_ARB_PRI_SHIFT 7
#define DSI_CMD_MODE_CTL_ARB_PRI_MASK 0x00000080
#define DSI_CMD_MODE_CTL_ARB_PRI(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, ARB_PRI, __x)
#define DSI_CMD_MODE_CTL_FIL_VALUE_SHIFT 8
#define DSI_CMD_MODE_CTL_FIL_VALUE_MASK 0x0000FF00
#define DSI_CMD_MODE_CTL_FIL_VALUE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, FIL_VALUE, __x)
#define DSI_CMD_MODE_CTL_TE_TIMEOUT_SHIFT 16
#define DSI_CMD_MODE_CTL_TE_TIMEOUT_MASK 0x03FF0000
#define DSI_CMD_MODE_CTL_TE_TIMEOUT(__x) \
DSI_VAL2REG(DSI_CMD_MODE_CTL, TE_TIMEOUT, __x)
#define DSI_CMD_MODE_STS 0x00000054
#define DSI_CMD_MODE_STS_ERR_NO_TE_SHIFT 0
#define DSI_CMD_MODE_STS_ERR_NO_TE_MASK 0x00000001
#define DSI_CMD_MODE_STS_ERR_NO_TE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS, ERR_NO_TE, __x)
#define DSI_CMD_MODE_STS_ERR_TE_MISS_SHIFT 1
#define DSI_CMD_MODE_STS_ERR_TE_MISS_MASK 0x00000002
#define DSI_CMD_MODE_STS_ERR_TE_MISS(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS, ERR_TE_MISS, __x)
#define DSI_CMD_MODE_STS_ERR_SDI1_UNDERRUN_SHIFT 2
#define DSI_CMD_MODE_STS_ERR_SDI1_UNDERRUN_MASK 0x00000004
#define DSI_CMD_MODE_STS_ERR_SDI1_UNDERRUN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS, ERR_SDI1_UNDERRUN, __x)
#define DSI_CMD_MODE_STS_ERR_SDI2_UNDERRUN_SHIFT 3
#define DSI_CMD_MODE_STS_ERR_SDI2_UNDERRUN_MASK 0x00000008
#define DSI_CMD_MODE_STS_ERR_SDI2_UNDERRUN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS, ERR_SDI2_UNDERRUN, __x)
#define DSI_CMD_MODE_STS_ERR_UNWANTED_RD_SHIFT 4
#define DSI_CMD_MODE_STS_ERR_UNWANTED_RD_MASK 0x00000010
#define DSI_CMD_MODE_STS_ERR_UNWANTED_RD(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS, ERR_UNWANTED_RD, __x)
#define DSI_CMD_MODE_STS_CSM_RUNNING_SHIFT 5
#define DSI_CMD_MODE_STS_CSM_RUNNING_MASK 0x00000020
#define DSI_CMD_MODE_STS_CSM_RUNNING(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS, CSM_RUNNING, __x)
#define DSI_DIRECT_CMD_SEND 0x00000060
#define DSI_DIRECT_CMD_SEND_START_SHIFT 0
#define DSI_DIRECT_CMD_SEND_START_MASK 0xFFFFFFFF
#define DSI_DIRECT_CMD_SEND_START(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_SEND, START, __x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS 0x00000064
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_SHIFT 0
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_MASK 0x00000007
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_WRITE 0
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_READ 1
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_TE_REQ 4
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_TRIG_REQ 5
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_BTA_REQ 6
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_ENUM(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_NAT, \
DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_##__x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_NAT, __x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LONGNOTSHORT_SHIFT 3
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LONGNOTSHORT_MASK 0x00000008
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LONGNOTSHORT(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_LONGNOTSHORT, __x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_SHIFT 8
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_MASK 0x00003F00
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_DCS_SHORT_WRITE_0 5
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_DCS_SHORT_WRITE_1 21
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_DCS_LONG_WRITE 57
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_DCS_READ 6
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_ENUM(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_HEAD, \
DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD_##__x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_HEAD(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_HEAD, __x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_ID_SHIFT 14
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_ID_MASK 0x0000C000
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_ID(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_ID, __x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE_SHIFT 16
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE_MASK 0x001F0000
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_SIZE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_SIZE, __x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LP_EN_SHIFT 21
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LP_EN_MASK 0x00200000
#define DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_LP_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, CMD_LP_EN, __x)
#define DSI_DIRECT_CMD_MAIN_SETTINGS_TRIGGER_VAL_SHIFT 24
#define DSI_DIRECT_CMD_MAIN_SETTINGS_TRIGGER_VAL_MASK 0x0F000000
#define DSI_DIRECT_CMD_MAIN_SETTINGS_TRIGGER_VAL(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_MAIN_SETTINGS, TRIGGER_VAL, __x)
#define DSI_DIRECT_CMD_STS 0x00000068
#define DSI_DIRECT_CMD_STS_CMD_TRANSMISSION_SHIFT 0
#define DSI_DIRECT_CMD_STS_CMD_TRANSMISSION_MASK 0x00000001
#define DSI_DIRECT_CMD_STS_CMD_TRANSMISSION(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, CMD_TRANSMISSION, __x)
#define DSI_DIRECT_CMD_STS_WRITE_COMPLETED_SHIFT 1
#define DSI_DIRECT_CMD_STS_WRITE_COMPLETED_MASK 0x00000002
#define DSI_DIRECT_CMD_STS_WRITE_COMPLETED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, WRITE_COMPLETED, __x)
#define DSI_DIRECT_CMD_STS_TRIGGER_COMPLETED_SHIFT 2
#define DSI_DIRECT_CMD_STS_TRIGGER_COMPLETED_MASK 0x00000004
#define DSI_DIRECT_CMD_STS_TRIGGER_COMPLETED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, TRIGGER_COMPLETED, __x)
#define DSI_DIRECT_CMD_STS_READ_COMPLETED_SHIFT 3
#define DSI_DIRECT_CMD_STS_READ_COMPLETED_MASK 0x00000008
#define DSI_DIRECT_CMD_STS_READ_COMPLETED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, READ_COMPLETED, __x)
#define DSI_DIRECT_CMD_STS_ACKNOWLEDGE_RECEIVED_SHIFT 4
#define DSI_DIRECT_CMD_STS_ACKNOWLEDGE_RECEIVED_MASK 0x00000010
#define DSI_DIRECT_CMD_STS_ACKNOWLEDGE_RECEIVED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, ACKNOWLEDGE_RECEIVED, __x)
#define DSI_DIRECT_CMD_STS_ACKNOWLEDGE_WITH_ERR_RECEIVED_SHIFT 5
#define DSI_DIRECT_CMD_STS_ACKNOWLEDGE_WITH_ERR_RECEIVED_MASK 0x00000020
#define DSI_DIRECT_CMD_STS_ACKNOWLEDGE_WITH_ERR_RECEIVED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, ACKNOWLEDGE_WITH_ERR_RECEIVED, __x)
#define DSI_DIRECT_CMD_STS_TRIGGER_RECEIVED_SHIFT 6
#define DSI_DIRECT_CMD_STS_TRIGGER_RECEIVED_MASK 0x00000040
#define DSI_DIRECT_CMD_STS_TRIGGER_RECEIVED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, TRIGGER_RECEIVED, __x)
#define DSI_DIRECT_CMD_STS_TE_RECEIVED_SHIFT 7
#define DSI_DIRECT_CMD_STS_TE_RECEIVED_MASK 0x00000080
#define DSI_DIRECT_CMD_STS_TE_RECEIVED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, TE_RECEIVED, __x)
#define DSI_DIRECT_CMD_STS_BTA_COMPLETED_SHIFT 8
#define DSI_DIRECT_CMD_STS_BTA_COMPLETED_MASK 0x00000100
#define DSI_DIRECT_CMD_STS_BTA_COMPLETED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, BTA_COMPLETED, __x)
#define DSI_DIRECT_CMD_STS_BTA_FINISHED_SHIFT 9
#define DSI_DIRECT_CMD_STS_BTA_FINISHED_MASK 0x00000200
#define DSI_DIRECT_CMD_STS_BTA_FINISHED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, BTA_FINISHED, __x)
#define DSI_DIRECT_CMD_STS_READ_COMPLETED_WITH_ERR_SHIFT 10
#define DSI_DIRECT_CMD_STS_READ_COMPLETED_WITH_ERR_MASK 0x00000400
#define DSI_DIRECT_CMD_STS_READ_COMPLETED_WITH_ERR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, READ_COMPLETED_WITH_ERR, __x)
#define DSI_DIRECT_CMD_STS_TRIGGER_VAL_SHIFT 11
#define DSI_DIRECT_CMD_STS_TRIGGER_VAL_MASK 0x00007800
#define DSI_DIRECT_CMD_STS_TRIGGER_VAL(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, TRIGGER_VAL, __x)
#define DSI_DIRECT_CMD_STS_ACK_VAL_SHIFT 16
#define DSI_DIRECT_CMD_STS_ACK_VAL_MASK 0xFFFF0000
#define DSI_DIRECT_CMD_STS_ACK_VAL(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS, ACK_VAL, __x)
#define DSI_DIRECT_CMD_RD_INIT 0x0000006C
#define DSI_DIRECT_CMD_RD_INIT_RESET_SHIFT 0
#define DSI_DIRECT_CMD_RD_INIT_RESET_MASK 0xFFFFFFFF
#define DSI_DIRECT_CMD_RD_INIT_RESET(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_INIT, RESET, __x)
#define DSI_DIRECT_CMD_WRDAT0 0x00000070
#define DSI_DIRECT_CMD_WRDAT0_WRDAT0_SHIFT 0
#define DSI_DIRECT_CMD_WRDAT0_WRDAT0_MASK 0x000000FF
#define DSI_DIRECT_CMD_WRDAT0_WRDAT0(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT0, WRDAT0, __x)
#define DSI_DIRECT_CMD_WRDAT0_WRDAT1_SHIFT 8
#define DSI_DIRECT_CMD_WRDAT0_WRDAT1_MASK 0x0000FF00
#define DSI_DIRECT_CMD_WRDAT0_WRDAT1(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT0, WRDAT1, __x)
#define DSI_DIRECT_CMD_WRDAT0_WRDAT2_SHIFT 16
#define DSI_DIRECT_CMD_WRDAT0_WRDAT2_MASK 0x00FF0000
#define DSI_DIRECT_CMD_WRDAT0_WRDAT2(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT0, WRDAT2, __x)
#define DSI_DIRECT_CMD_WRDAT0_WRDAT3_SHIFT 24
#define DSI_DIRECT_CMD_WRDAT0_WRDAT3_MASK 0xFF000000
#define DSI_DIRECT_CMD_WRDAT0_WRDAT3(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT0, WRDAT3, __x)
#define DSI_DIRECT_CMD_WRDAT1 0x00000074
#define DSI_DIRECT_CMD_WRDAT1_WRDAT4_SHIFT 0
#define DSI_DIRECT_CMD_WRDAT1_WRDAT4_MASK 0x000000FF
#define DSI_DIRECT_CMD_WRDAT1_WRDAT4(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT1, WRDAT4, __x)
#define DSI_DIRECT_CMD_WRDAT1_WRDAT5_SHIFT 8
#define DSI_DIRECT_CMD_WRDAT1_WRDAT5_MASK 0x0000FF00
#define DSI_DIRECT_CMD_WRDAT1_WRDAT5(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT1, WRDAT5, __x)
#define DSI_DIRECT_CMD_WRDAT1_WRDAT6_SHIFT 16
#define DSI_DIRECT_CMD_WRDAT1_WRDAT6_MASK 0x00FF0000
#define DSI_DIRECT_CMD_WRDAT1_WRDAT6(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT1, WRDAT6, __x)
#define DSI_DIRECT_CMD_WRDAT1_WRDAT7_SHIFT 24
#define DSI_DIRECT_CMD_WRDAT1_WRDAT7_MASK 0xFF000000
#define DSI_DIRECT_CMD_WRDAT1_WRDAT7(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT1, WRDAT7, __x)
#define DSI_DIRECT_CMD_WRDAT2 0x00000078
#define DSI_DIRECT_CMD_WRDAT2_WRDAT8_SHIFT 0
#define DSI_DIRECT_CMD_WRDAT2_WRDAT8_MASK 0x000000FF
#define DSI_DIRECT_CMD_WRDAT2_WRDAT8(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT2, WRDAT8, __x)
#define DSI_DIRECT_CMD_WRDAT2_WRDAT9_SHIFT 8
#define DSI_DIRECT_CMD_WRDAT2_WRDAT9_MASK 0x0000FF00
#define DSI_DIRECT_CMD_WRDAT2_WRDAT9(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT2, WRDAT9, __x)
#define DSI_DIRECT_CMD_WRDAT2_WRDAT10_SHIFT 16
#define DSI_DIRECT_CMD_WRDAT2_WRDAT10_MASK 0x00FF0000
#define DSI_DIRECT_CMD_WRDAT2_WRDAT10(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT2, WRDAT10, __x)
#define DSI_DIRECT_CMD_WRDAT2_WRDAT11_SHIFT 24
#define DSI_DIRECT_CMD_WRDAT2_WRDAT11_MASK 0xFF000000
#define DSI_DIRECT_CMD_WRDAT2_WRDAT11(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT2, WRDAT11, __x)
#define DSI_DIRECT_CMD_WRDAT3 0x0000007C
#define DSI_DIRECT_CMD_WRDAT3_WRDAT12_SHIFT 0
#define DSI_DIRECT_CMD_WRDAT3_WRDAT12_MASK 0x000000FF
#define DSI_DIRECT_CMD_WRDAT3_WRDAT12(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT3, WRDAT12, __x)
#define DSI_DIRECT_CMD_WRDAT3_WRDAT13_SHIFT 8
#define DSI_DIRECT_CMD_WRDAT3_WRDAT13_MASK 0x0000FF00
#define DSI_DIRECT_CMD_WRDAT3_WRDAT13(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT3, WRDAT13, __x)
#define DSI_DIRECT_CMD_WRDAT3_WRDAT14_SHIFT 16
#define DSI_DIRECT_CMD_WRDAT3_WRDAT14_MASK 0x00FF0000
#define DSI_DIRECT_CMD_WRDAT3_WRDAT14(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT3, WRDAT14, __x)
#define DSI_DIRECT_CMD_WRDAT3_WRDAT15_SHIFT 24
#define DSI_DIRECT_CMD_WRDAT3_WRDAT15_MASK 0xFF000000
#define DSI_DIRECT_CMD_WRDAT3_WRDAT15(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_WRDAT3, WRDAT15, __x)
#define DSI_DIRECT_CMD_RDDAT 0x00000080
#define DSI_DIRECT_CMD_RDDAT_RDDAT0_SHIFT 0
#define DSI_DIRECT_CMD_RDDAT_RDDAT0_MASK 0x000000FF
#define DSI_DIRECT_CMD_RDDAT_RDDAT0(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RDDAT, RDDAT0, __x)
#define DSI_DIRECT_CMD_RDDAT_RDDAT1_SHIFT 8
#define DSI_DIRECT_CMD_RDDAT_RDDAT1_MASK 0x0000FF00
#define DSI_DIRECT_CMD_RDDAT_RDDAT1(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RDDAT, RDDAT1, __x)
#define DSI_DIRECT_CMD_RDDAT_RDDAT2_SHIFT 16
#define DSI_DIRECT_CMD_RDDAT_RDDAT2_MASK 0x00FF0000
#define DSI_DIRECT_CMD_RDDAT_RDDAT2(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RDDAT, RDDAT2, __x)
#define DSI_DIRECT_CMD_RDDAT_RDDAT3_SHIFT 24
#define DSI_DIRECT_CMD_RDDAT_RDDAT3_MASK 0xFF000000
#define DSI_DIRECT_CMD_RDDAT_RDDAT3(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RDDAT, RDDAT3, __x)
#define DSI_DIRECT_CMD_RD_PROPERTY 0x00000084
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_SIZE_SHIFT 0
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_SIZE_MASK 0x0000FFFF
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_SIZE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_PROPERTY, RD_SIZE, __x)
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_ID_SHIFT 16
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_ID_MASK 0x00030000
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_ID(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_PROPERTY, RD_ID, __x)
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_DCSNOTGENERIC_SHIFT 18
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_DCSNOTGENERIC_MASK 0x00040000
#define DSI_DIRECT_CMD_RD_PROPERTY_RD_DCSNOTGENERIC(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_PROPERTY, RD_DCSNOTGENERIC, __x)
#define DSI_DIRECT_CMD_RD_STS 0x00000088
#define DSI_DIRECT_CMD_RD_STS_ERR_FIXED_SHIFT 0
#define DSI_DIRECT_CMD_RD_STS_ERR_FIXED_MASK 0x00000001
#define DSI_DIRECT_CMD_RD_STS_ERR_FIXED(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_FIXED, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_UNCORRECTABLE_SHIFT 1
#define DSI_DIRECT_CMD_RD_STS_ERR_UNCORRECTABLE_MASK 0x00000002
#define DSI_DIRECT_CMD_RD_STS_ERR_UNCORRECTABLE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_UNCORRECTABLE, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_CHECKSUM_SHIFT 2
#define DSI_DIRECT_CMD_RD_STS_ERR_CHECKSUM_MASK 0x00000004
#define DSI_DIRECT_CMD_RD_STS_ERR_CHECKSUM(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_CHECKSUM, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_UNDECODABLE_SHIFT 3
#define DSI_DIRECT_CMD_RD_STS_ERR_UNDECODABLE_MASK 0x00000008
#define DSI_DIRECT_CMD_RD_STS_ERR_UNDECODABLE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_UNDECODABLE, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_RECEIVE_SHIFT 4
#define DSI_DIRECT_CMD_RD_STS_ERR_RECEIVE_MASK 0x00000010
#define DSI_DIRECT_CMD_RD_STS_ERR_RECEIVE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_RECEIVE, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_OVERSIZE_SHIFT 5
#define DSI_DIRECT_CMD_RD_STS_ERR_OVERSIZE_MASK 0x00000020
#define DSI_DIRECT_CMD_RD_STS_ERR_OVERSIZE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_OVERSIZE, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_WRONG_LENGTH_SHIFT 6
#define DSI_DIRECT_CMD_RD_STS_ERR_WRONG_LENGTH_MASK 0x00000040
#define DSI_DIRECT_CMD_RD_STS_ERR_WRONG_LENGTH(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_WRONG_LENGTH, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_MISSING_EOT_SHIFT 7
#define DSI_DIRECT_CMD_RD_STS_ERR_MISSING_EOT_MASK 0x00000080
#define DSI_DIRECT_CMD_RD_STS_ERR_MISSING_EOT(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_MISSING_EOT, __x)
#define DSI_DIRECT_CMD_RD_STS_ERR_EOT_WITH_ERR_SHIFT 8
#define DSI_DIRECT_CMD_RD_STS_ERR_EOT_WITH_ERR_MASK 0x00000100
#define DSI_DIRECT_CMD_RD_STS_ERR_EOT_WITH_ERR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS, ERR_EOT_WITH_ERR, __x)
#define DSI_VID_MAIN_CTL 0x00000090
#define DSI_VID_MAIN_CTL_START_MODE_SHIFT 0
#define DSI_VID_MAIN_CTL_START_MODE_MASK 0x00000003
#define DSI_VID_MAIN_CTL_START_MODE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, START_MODE, __x)
#define DSI_VID_MAIN_CTL_STOP_MODE_SHIFT 2
#define DSI_VID_MAIN_CTL_STOP_MODE_MASK 0x0000000C
#define DSI_VID_MAIN_CTL_STOP_MODE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, STOP_MODE, __x)
#define DSI_VID_MAIN_CTL_VID_ID_SHIFT 4
#define DSI_VID_MAIN_CTL_VID_ID_MASK 0x00000030
#define DSI_VID_MAIN_CTL_VID_ID(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, VID_ID, __x)
#define DSI_VID_MAIN_CTL_HEADER_SHIFT 6
#define DSI_VID_MAIN_CTL_HEADER_MASK 0x00000FC0
#define DSI_VID_MAIN_CTL_HEADER(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, HEADER, __x)
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE_SHIFT 12
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE_MASK 0x00003000
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE_16BITS 0
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE_18BITS 1
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE_18BITS_LOOSE 2
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE_24BITS 3
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE_ENUM(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, VID_PIXEL_MODE, \
DSI_VID_MAIN_CTL_VID_PIXEL_MODE_##__x)
#define DSI_VID_MAIN_CTL_VID_PIXEL_MODE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, VID_PIXEL_MODE, __x)
#define DSI_VID_MAIN_CTL_BURST_MODE_SHIFT 14
#define DSI_VID_MAIN_CTL_BURST_MODE_MASK 0x00004000
#define DSI_VID_MAIN_CTL_BURST_MODE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, BURST_MODE, __x)
#define DSI_VID_MAIN_CTL_SYNC_PULSE_ACTIVE_SHIFT 15
#define DSI_VID_MAIN_CTL_SYNC_PULSE_ACTIVE_MASK 0x00008000
#define DSI_VID_MAIN_CTL_SYNC_PULSE_ACTIVE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, SYNC_PULSE_ACTIVE, __x)
#define DSI_VID_MAIN_CTL_SYNC_PULSE_HORIZONTAL_SHIFT 16
#define DSI_VID_MAIN_CTL_SYNC_PULSE_HORIZONTAL_MASK 0x00010000
#define DSI_VID_MAIN_CTL_SYNC_PULSE_HORIZONTAL(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, SYNC_PULSE_HORIZONTAL, __x)
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_SHIFT 17
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_MASK 0x00060000
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_NULL 0
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_BLANKING 1
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_LP_0 2
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_LP_1 3
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_ENUM(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, REG_BLKLINE_MODE, \
DSI_VID_MAIN_CTL_REG_BLKLINE_MODE_##__x)
#define DSI_VID_MAIN_CTL_REG_BLKLINE_MODE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, REG_BLKLINE_MODE, __x)
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_SHIFT 19
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_MASK 0x00180000
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_NULL 0
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_BLANKING 1
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_LP_0 2
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_LP_1 3
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_ENUM(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, REG_BLKEOL_MODE, \
DSI_VID_MAIN_CTL_REG_BLKEOL_MODE_##__x)
#define DSI_VID_MAIN_CTL_REG_BLKEOL_MODE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, REG_BLKEOL_MODE, __x)
#define DSI_VID_MAIN_CTL_RECOVERY_MODE_SHIFT 21
#define DSI_VID_MAIN_CTL_RECOVERY_MODE_MASK 0x00600000
#define DSI_VID_MAIN_CTL_RECOVERY_MODE(__x) \
DSI_VAL2REG(DSI_VID_MAIN_CTL, RECOVERY_MODE, __x)
#define DSI_VID_VSIZE 0x00000094
#define DSI_VID_VSIZE_VSA_LENGTH_SHIFT 0
#define DSI_VID_VSIZE_VSA_LENGTH_MASK 0x0000003F
#define DSI_VID_VSIZE_VSA_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_VSIZE, VSA_LENGTH, __x)
#define DSI_VID_VSIZE_VBP_LENGTH_SHIFT 6
#define DSI_VID_VSIZE_VBP_LENGTH_MASK 0x00000FC0
#define DSI_VID_VSIZE_VBP_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_VSIZE, VBP_LENGTH, __x)
#define DSI_VID_VSIZE_VFP_LENGTH_SHIFT 12
#define DSI_VID_VSIZE_VFP_LENGTH_MASK 0x000FF000
#define DSI_VID_VSIZE_VFP_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_VSIZE, VFP_LENGTH, __x)
#define DSI_VID_VSIZE_VACT_LENGTH_SHIFT 20
#define DSI_VID_VSIZE_VACT_LENGTH_MASK 0x7FF00000
#define DSI_VID_VSIZE_VACT_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_VSIZE, VACT_LENGTH, __x)
#define DSI_VID_HSIZE1 0x00000098
#define DSI_VID_HSIZE1_HSA_LENGTH_SHIFT 0
#define DSI_VID_HSIZE1_HSA_LENGTH_MASK 0x000003FF
#define DSI_VID_HSIZE1_HSA_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_HSIZE1, HSA_LENGTH, __x)
#define DSI_VID_HSIZE1_HBP_LENGTH_SHIFT 10
#define DSI_VID_HSIZE1_HBP_LENGTH_MASK 0x000FFC00
#define DSI_VID_HSIZE1_HBP_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_HSIZE1, HBP_LENGTH, __x)
#define DSI_VID_HSIZE1_HFP_LENGTH_SHIFT 20
#define DSI_VID_HSIZE1_HFP_LENGTH_MASK 0x7FF00000
#define DSI_VID_HSIZE1_HFP_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_HSIZE1, HFP_LENGTH, __x)
#define DSI_VID_HSIZE2 0x0000009C
#define DSI_VID_HSIZE2_RGB_SIZE_SHIFT 0
#define DSI_VID_HSIZE2_RGB_SIZE_MASK 0x00001FFF
#define DSI_VID_HSIZE2_RGB_SIZE(__x) \
DSI_VAL2REG(DSI_VID_HSIZE2, RGB_SIZE, __x)
#define DSI_VID_BLKSIZE1 0x000000A0
#define DSI_VID_BLKSIZE1_BLKLINE_EVENT_PCK_SHIFT 0
#define DSI_VID_BLKSIZE1_BLKLINE_EVENT_PCK_MASK 0x00001FFF
#define DSI_VID_BLKSIZE1_BLKLINE_EVENT_PCK(__x) \
DSI_VAL2REG(DSI_VID_BLKSIZE1, BLKLINE_EVENT_PCK, __x)
#define DSI_VID_BLKSIZE1_BLKEOL_PCK_SHIFT 13
#define DSI_VID_BLKSIZE1_BLKEOL_PCK_MASK 0x03FFE000
#define DSI_VID_BLKSIZE1_BLKEOL_PCK(__x) \
DSI_VAL2REG(DSI_VID_BLKSIZE1, BLKEOL_PCK, __x)
#define DSI_VID_BLKSIZE2 0x000000A4
#define DSI_VID_BLKSIZE2_BLKLINE_PULSE_PCK_SHIFT 0
#define DSI_VID_BLKSIZE2_BLKLINE_PULSE_PCK_MASK 0x00001FFF
#define DSI_VID_BLKSIZE2_BLKLINE_PULSE_PCK(__x) \
DSI_VAL2REG(DSI_VID_BLKSIZE2, BLKLINE_PULSE_PCK, __x)
#define DSI_VID_PCK_TIME 0x000000A8
#define DSI_VID_PCK_TIME_BLKEOL_DURATION_SHIFT 0
#define DSI_VID_PCK_TIME_BLKEOL_DURATION_MASK 0x00001FFF
#define DSI_VID_PCK_TIME_BLKEOL_DURATION(__x) \
DSI_VAL2REG(DSI_VID_PCK_TIME, BLKEOL_DURATION, __x)
#define DSI_VID_DPHY_TIME 0x000000AC
#define DSI_VID_DPHY_TIME_REG_LINE_DURATION_SHIFT 0
#define DSI_VID_DPHY_TIME_REG_LINE_DURATION_MASK 0x00001FFF
#define DSI_VID_DPHY_TIME_REG_LINE_DURATION(__x) \
DSI_VAL2REG(DSI_VID_DPHY_TIME, REG_LINE_DURATION, __x)
#define DSI_VID_DPHY_TIME_REG_WAKEUP_TIME_SHIFT 13
#define DSI_VID_DPHY_TIME_REG_WAKEUP_TIME_MASK 0x00FFE000
#define DSI_VID_DPHY_TIME_REG_WAKEUP_TIME(__x) \
DSI_VAL2REG(DSI_VID_DPHY_TIME, REG_WAKEUP_TIME, __x)
#define DSI_VID_ERR_COLOR 0x000000B0
#define DSI_VID_ERR_COLOR_COL_RED_SHIFT 0
#define DSI_VID_ERR_COLOR_COL_RED_MASK 0x000000FF
#define DSI_VID_ERR_COLOR_COL_RED(__x) \
DSI_VAL2REG(DSI_VID_ERR_COLOR, COL_RED, __x)
#define DSI_VID_ERR_COLOR_COL_GREEN_SHIFT 8
#define DSI_VID_ERR_COLOR_COL_GREEN_MASK 0x0000FF00
#define DSI_VID_ERR_COLOR_COL_GREEN(__x) \
DSI_VAL2REG(DSI_VID_ERR_COLOR, COL_GREEN, __x)
#define DSI_VID_ERR_COLOR_COL_BLUE_SHIFT 16
#define DSI_VID_ERR_COLOR_COL_BLUE_MASK 0x00FF0000
#define DSI_VID_ERR_COLOR_COL_BLUE(__x) \
DSI_VAL2REG(DSI_VID_ERR_COLOR, COL_BLUE, __x)
#define DSI_VID_ERR_COLOR_PAD_VAL_SHIFT 24
#define DSI_VID_ERR_COLOR_PAD_VAL_MASK 0xFF000000
#define DSI_VID_ERR_COLOR_PAD_VAL(__x) \
DSI_VAL2REG(DSI_VID_ERR_COLOR, PAD_VAL, __x)
#define DSI_VID_VPOS 0x000000B4
#define DSI_VID_VPOS_LINE_POS_SHIFT 0
#define DSI_VID_VPOS_LINE_POS_MASK 0x00000003
#define DSI_VID_VPOS_LINE_POS(__x) \
DSI_VAL2REG(DSI_VID_VPOS, LINE_POS, __x)
#define DSI_VID_VPOS_LINE_VAL_SHIFT 2
#define DSI_VID_VPOS_LINE_VAL_MASK 0x00001FFC
#define DSI_VID_VPOS_LINE_VAL(__x) \
DSI_VAL2REG(DSI_VID_VPOS, LINE_VAL, __x)
#define DSI_VID_HPOS 0x000000B8
#define DSI_VID_HPOS_HORIZONTAL_POS_SHIFT 0
#define DSI_VID_HPOS_HORIZONTAL_POS_MASK 0x00000007
#define DSI_VID_HPOS_HORIZONTAL_POS(__x) \
DSI_VAL2REG(DSI_VID_HPOS, HORIZONTAL_POS, __x)
#define DSI_VID_HPOS_HORIZONTAL_VAL_SHIFT 3
#define DSI_VID_HPOS_HORIZONTAL_VAL_MASK 0x0000FFF8
#define DSI_VID_HPOS_HORIZONTAL_VAL(__x) \
DSI_VAL2REG(DSI_VID_HPOS, HORIZONTAL_VAL, __x)
#define DSI_VID_MODE_STS 0x000000BC
#define DSI_VID_MODE_STS_VSG_RUNNING_SHIFT 0
#define DSI_VID_MODE_STS_VSG_RUNNING_MASK 0x00000001
#define DSI_VID_MODE_STS_VSG_RUNNING(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, VSG_RUNNING, __x)
#define DSI_VID_MODE_STS_ERR_MISSING_DATA_SHIFT 1
#define DSI_VID_MODE_STS_ERR_MISSING_DATA_MASK 0x00000002
#define DSI_VID_MODE_STS_ERR_MISSING_DATA(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, ERR_MISSING_DATA, __x)
#define DSI_VID_MODE_STS_ERR_MISSING_HSYNC_SHIFT 2
#define DSI_VID_MODE_STS_ERR_MISSING_HSYNC_MASK 0x00000004
#define DSI_VID_MODE_STS_ERR_MISSING_HSYNC(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, ERR_MISSING_HSYNC, __x)
#define DSI_VID_MODE_STS_ERR_MISSING_VSYNC_SHIFT 3
#define DSI_VID_MODE_STS_ERR_MISSING_VSYNC_MASK 0x00000008
#define DSI_VID_MODE_STS_ERR_MISSING_VSYNC(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, ERR_MISSING_VSYNC, __x)
#define DSI_VID_MODE_STS_REG_ERR_SMALL_LENGTH_SHIFT 4
#define DSI_VID_MODE_STS_REG_ERR_SMALL_LENGTH_MASK 0x00000010
#define DSI_VID_MODE_STS_REG_ERR_SMALL_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, REG_ERR_SMALL_LENGTH, __x)
#define DSI_VID_MODE_STS_REG_ERR_SMALL_HEIGHT_SHIFT 5
#define DSI_VID_MODE_STS_REG_ERR_SMALL_HEIGHT_MASK 0x00000020
#define DSI_VID_MODE_STS_REG_ERR_SMALL_HEIGHT(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, REG_ERR_SMALL_HEIGHT, __x)
#define DSI_VID_MODE_STS_ERR_BURSTWRITE_SHIFT 6
#define DSI_VID_MODE_STS_ERR_BURSTWRITE_MASK 0x00000040
#define DSI_VID_MODE_STS_ERR_BURSTWRITE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, ERR_BURSTWRITE, __x)
#define DSI_VID_MODE_STS_ERR_LONGWRITE_SHIFT 7
#define DSI_VID_MODE_STS_ERR_LONGWRITE_MASK 0x00000080
#define DSI_VID_MODE_STS_ERR_LONGWRITE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, ERR_LONGWRITE, __x)
#define DSI_VID_MODE_STS_ERR_LONGREAD_SHIFT 8
#define DSI_VID_MODE_STS_ERR_LONGREAD_MASK 0x00000100
#define DSI_VID_MODE_STS_ERR_LONGREAD(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, ERR_LONGREAD, __x)
#define DSI_VID_MODE_STS_ERR_VRS_WRONG_LENGTH_SHIFT 9
#define DSI_VID_MODE_STS_ERR_VRS_WRONG_LENGTH_MASK 0x00000200
#define DSI_VID_MODE_STS_ERR_VRS_WRONG_LENGTH(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, ERR_VRS_WRONG_LENGTH, __x)
#define DSI_VID_MODE_STS_VSG_RECOVERY_SHIFT 10
#define DSI_VID_MODE_STS_VSG_RECOVERY_MASK 0x00000400
#define DSI_VID_MODE_STS_VSG_RECOVERY(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS, VSG_RECOVERY, __x)
#define DSI_VID_VCA_SETTING1 0x000000C0
#define DSI_VID_VCA_SETTING1_MAX_BURST_LIMIT_SHIFT 0
#define DSI_VID_VCA_SETTING1_MAX_BURST_LIMIT_MASK 0x0000FFFF
#define DSI_VID_VCA_SETTING1_MAX_BURST_LIMIT(__x) \
DSI_VAL2REG(DSI_VID_VCA_SETTING1, MAX_BURST_LIMIT, __x)
#define DSI_VID_VCA_SETTING1_BURST_LP_SHIFT 16
#define DSI_VID_VCA_SETTING1_BURST_LP_MASK 0x00010000
#define DSI_VID_VCA_SETTING1_BURST_LP(__x) \
DSI_VAL2REG(DSI_VID_VCA_SETTING1, BURST_LP, __x)
#define DSI_VID_VCA_SETTING2 0x000000C4
#define DSI_VID_VCA_SETTING2_EXACT_BURST_LIMIT_SHIFT 0
#define DSI_VID_VCA_SETTING2_EXACT_BURST_LIMIT_MASK 0x0000FFFF
#define DSI_VID_VCA_SETTING2_EXACT_BURST_LIMIT(__x) \
DSI_VAL2REG(DSI_VID_VCA_SETTING2, EXACT_BURST_LIMIT, __x)
#define DSI_VID_VCA_SETTING2_MAX_LINE_LIMIT_SHIFT 16
#define DSI_VID_VCA_SETTING2_MAX_LINE_LIMIT_MASK 0xFFFF0000
#define DSI_VID_VCA_SETTING2_MAX_LINE_LIMIT(__x) \
DSI_VAL2REG(DSI_VID_VCA_SETTING2, MAX_LINE_LIMIT, __x)
#define DSI_TVG_CTL 0x000000C8
#define DSI_TVG_CTL_TVG_RUN_SHIFT 0
#define DSI_TVG_CTL_TVG_RUN_MASK 0x00000001
#define DSI_TVG_CTL_TVG_RUN(__x) \
DSI_VAL2REG(DSI_TVG_CTL, TVG_RUN, __x)
#define DSI_TVG_CTL_TVG_STOPMODE_SHIFT 1
#define DSI_TVG_CTL_TVG_STOPMODE_MASK 0x00000006
#define DSI_TVG_CTL_TVG_STOPMODE(__x) \
DSI_VAL2REG(DSI_TVG_CTL, TVG_STOPMODE, __x)
#define DSI_TVG_CTL_TVG_MODE_SHIFT 3
#define DSI_TVG_CTL_TVG_MODE_MASK 0x00000018
#define DSI_TVG_CTL_TVG_MODE(__x) \
DSI_VAL2REG(DSI_TVG_CTL, TVG_MODE, __x)
#define DSI_TVG_CTL_TVG_STRIPE_SIZE_SHIFT 5
#define DSI_TVG_CTL_TVG_STRIPE_SIZE_MASK 0x000000E0
#define DSI_TVG_CTL_TVG_STRIPE_SIZE(__x) \
DSI_VAL2REG(DSI_TVG_CTL, TVG_STRIPE_SIZE, __x)
#define DSI_TVG_IMG_SIZE 0x000000CC
#define DSI_TVG_IMG_SIZE_TVG_LINE_SIZE_SHIFT 0
#define DSI_TVG_IMG_SIZE_TVG_LINE_SIZE_MASK 0x00001FFF
#define DSI_TVG_IMG_SIZE_TVG_LINE_SIZE(__x) \
DSI_VAL2REG(DSI_TVG_IMG_SIZE, TVG_LINE_SIZE, __x)
#define DSI_TVG_IMG_SIZE_TVG_NBLINE_SHIFT 16
#define DSI_TVG_IMG_SIZE_TVG_NBLINE_MASK 0x07FF0000
#define DSI_TVG_IMG_SIZE_TVG_NBLINE(__x) \
DSI_VAL2REG(DSI_TVG_IMG_SIZE, TVG_NBLINE, __x)
#define DSI_TVG_COLOR1 0x000000D0
#define DSI_TVG_COLOR1_COL1_RED_SHIFT 0
#define DSI_TVG_COLOR1_COL1_RED_MASK 0x000000FF
#define DSI_TVG_COLOR1_COL1_RED(__x) \
DSI_VAL2REG(DSI_TVG_COLOR1, COL1_RED, __x)
#define DSI_TVG_COLOR1_COL1_GREEN_SHIFT 8
#define DSI_TVG_COLOR1_COL1_GREEN_MASK 0x0000FF00
#define DSI_TVG_COLOR1_COL1_GREEN(__x) \
DSI_VAL2REG(DSI_TVG_COLOR1, COL1_GREEN, __x)
#define DSI_TVG_COLOR1_COL1_BLUE_SHIFT 16
#define DSI_TVG_COLOR1_COL1_BLUE_MASK 0x00FF0000
#define DSI_TVG_COLOR1_COL1_BLUE(__x) \
DSI_VAL2REG(DSI_TVG_COLOR1, COL1_BLUE, __x)
#define DSI_TVG_COLOR2 0x000000D4
#define DSI_TVG_COLOR2_COL2_RED_SHIFT 0
#define DSI_TVG_COLOR2_COL2_RED_MASK 0x000000FF
#define DSI_TVG_COLOR2_COL2_RED(__x) \
DSI_VAL2REG(DSI_TVG_COLOR2, COL2_RED, __x)
#define DSI_TVG_COLOR2_COL2_GREEN_SHIFT 8
#define DSI_TVG_COLOR2_COL2_GREEN_MASK 0x0000FF00
#define DSI_TVG_COLOR2_COL2_GREEN(__x) \
DSI_VAL2REG(DSI_TVG_COLOR2, COL2_GREEN, __x)
#define DSI_TVG_COLOR2_COL2_BLUE_SHIFT 16
#define DSI_TVG_COLOR2_COL2_BLUE_MASK 0x00FF0000
#define DSI_TVG_COLOR2_COL2_BLUE(__x) \
DSI_VAL2REG(DSI_TVG_COLOR2, COL2_BLUE, __x)
#define DSI_TVG_STS 0x000000D8
#define DSI_TVG_STS_TVG_RUNNING_SHIFT 0
#define DSI_TVG_STS_TVG_RUNNING_MASK 0x00000001
#define DSI_TVG_STS_TVG_RUNNING(__x) \
DSI_VAL2REG(DSI_TVG_STS, TVG_RUNNING, __x)
#define DSI_TBG_CTL 0x000000E0
#define DSI_TBG_CTL_TBG_START_SHIFT 0
#define DSI_TBG_CTL_TBG_START_MASK 0x00000001
#define DSI_TBG_CTL_TBG_START(__x) \
DSI_VAL2REG(DSI_TBG_CTL, TBG_START, __x)
#define DSI_TBG_CTL_TBG_HS_REQ_SHIFT 1
#define DSI_TBG_CTL_TBG_HS_REQ_MASK 0x00000002
#define DSI_TBG_CTL_TBG_HS_REQ(__x) \
DSI_VAL2REG(DSI_TBG_CTL, TBG_HS_REQ, __x)
#define DSI_TBG_CTL_TBG_DATA_SEL_SHIFT 2
#define DSI_TBG_CTL_TBG_DATA_SEL_MASK 0x00000004
#define DSI_TBG_CTL_TBG_DATA_SEL(__x) \
DSI_VAL2REG(DSI_TBG_CTL, TBG_DATA_SEL, __x)
#define DSI_TBG_CTL_TBG_MODE_SHIFT 3
#define DSI_TBG_CTL_TBG_MODE_MASK 0x00000018
#define DSI_TBG_CTL_TBG_MODE_1BYTE 0
#define DSI_TBG_CTL_TBG_MODE_2BYTE 1
#define DSI_TBG_CTL_TBG_MODE_BURST_COUNTER 2
#define DSI_TBG_CTL_TBG_MODE_BURST 3
#define DSI_TBG_CTL_TBG_MODE_ENUM(__x) \
DSI_VAL2REG(DSI_TBG_CTL, TBG_MODE, DSI_TBG_CTL_TBG_MODE_##__x)
#define DSI_TBG_CTL_TBG_MODE(__x) \
DSI_VAL2REG(DSI_TBG_CTL, TBG_MODE, __x)
#define DSI_TBG_SETTING 0x000000E4
#define DSI_TBG_SETTING_TBG_DATA_SHIFT 0
#define DSI_TBG_SETTING_TBG_DATA_MASK 0x0000FFFF
#define DSI_TBG_SETTING_TBG_DATA(__x) \
DSI_VAL2REG(DSI_TBG_SETTING, TBG_DATA, __x)
#define DSI_TBG_SETTING_TBG_CPT_SHIFT 16
#define DSI_TBG_SETTING_TBG_CPT_MASK 0x0FFF0000
#define DSI_TBG_SETTING_TBG_CPT(__x) \
DSI_VAL2REG(DSI_TBG_SETTING, TBG_CPT, __x)
#define DSI_TBG_STS 0x000000E8
#define DSI_TBG_STS_TBG_STATUS_SHIFT 0
#define DSI_TBG_STS_TBG_STATUS_MASK 0x00000001
#define DSI_TBG_STS_TBG_STATUS(__x) \
DSI_VAL2REG(DSI_TBG_STS, TBG_STATUS, __x)
#define DSI_MCTL_MAIN_STS_CTL 0x000000F0
#define DSI_MCTL_MAIN_STS_CTL_PLL_LOCK_EN_SHIFT 0
#define DSI_MCTL_MAIN_STS_CTL_PLL_LOCK_EN_MASK 0x00000001
#define DSI_MCTL_MAIN_STS_CTL_PLL_LOCK_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, PLL_LOCK_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_CLKLANE_READY_EN_SHIFT 1
#define DSI_MCTL_MAIN_STS_CTL_CLKLANE_READY_EN_MASK 0x00000002
#define DSI_MCTL_MAIN_STS_CTL_CLKLANE_READY_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, CLKLANE_READY_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_DAT1_READY_EN_SHIFT 2
#define DSI_MCTL_MAIN_STS_CTL_DAT1_READY_EN_MASK 0x00000004
#define DSI_MCTL_MAIN_STS_CTL_DAT1_READY_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, DAT1_READY_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_DAT2_READY_EN_SHIFT 3
#define DSI_MCTL_MAIN_STS_CTL_DAT2_READY_EN_MASK 0x00000008
#define DSI_MCTL_MAIN_STS_CTL_DAT2_READY_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, DAT2_READY_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_HSTX_TO_ERR_EN_SHIFT 4
#define DSI_MCTL_MAIN_STS_CTL_HSTX_TO_ERR_EN_MASK 0x00000010
#define DSI_MCTL_MAIN_STS_CTL_HSTX_TO_ERR_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, HSTX_TO_ERR_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_LPRX_TO_ERR_EN_SHIFT 5
#define DSI_MCTL_MAIN_STS_CTL_LPRX_TO_ERR_EN_MASK 0x00000020
#define DSI_MCTL_MAIN_STS_CTL_LPRX_TO_ERR_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, LPRX_TO_ERR_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_CRS_UNTERM_PCK_ERR_EN_SHIFT 6
#define DSI_MCTL_MAIN_STS_CTL_CRS_UNTERM_PCK_ERR_EN_MASK 0x00000040
#define DSI_MCTL_MAIN_STS_CTL_CRS_UNTERM_PCK_ERR_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, CRS_UNTERM_PCK_ERR_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_VRS_UNTERM_PCK_ERR_EN_SHIFT 7
#define DSI_MCTL_MAIN_STS_CTL_VRS_UNTERM_PCK_ERR_EN_MASK 0x00000080
#define DSI_MCTL_MAIN_STS_CTL_VRS_UNTERM_PCK_ERR_EN(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, VRS_UNTERM_PCK_ERR_EN, __x)
#define DSI_MCTL_MAIN_STS_CTL_PLL_LOCK_EDGE_SHIFT 16
#define DSI_MCTL_MAIN_STS_CTL_PLL_LOCK_EDGE_MASK 0x00010000
#define DSI_MCTL_MAIN_STS_CTL_PLL_LOCK_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, PLL_LOCK_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CTL_CLKLANE_READY_EDGE_SHIFT 17
#define DSI_MCTL_MAIN_STS_CTL_CLKLANE_READY_EDGE_MASK 0x00020000
#define DSI_MCTL_MAIN_STS_CTL_CLKLANE_READY_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, CLKLANE_READY_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CTL_DAT1_READY_EDGE_SHIFT 18
#define DSI_MCTL_MAIN_STS_CTL_DAT1_READY_EDGE_MASK 0x00040000
#define DSI_MCTL_MAIN_STS_CTL_DAT1_READY_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, DAT1_READY_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CTL_DAT2_READY_EDGE_SHIFT 19
#define DSI_MCTL_MAIN_STS_CTL_DAT2_READY_EDGE_MASK 0x00080000
#define DSI_MCTL_MAIN_STS_CTL_DAT2_READY_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, DAT2_READY_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CTL_HSTX_TO_ERR_EDGE_SHIFT 20
#define DSI_MCTL_MAIN_STS_CTL_HSTX_TO_ERR_EDGE_MASK 0x00100000
#define DSI_MCTL_MAIN_STS_CTL_HSTX_TO_ERR_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, HSTX_TO_ERR_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CTL_LPRX_TO_ERR_EDGE_SHIFT 21
#define DSI_MCTL_MAIN_STS_CTL_LPRX_TO_ERR_EDGE_MASK 0x00200000
#define DSI_MCTL_MAIN_STS_CTL_LPRX_TO_ERR_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, LPRX_TO_ERR_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CTL_CRS_UNTERM_PCK_ERR_EDGE_SHIFT 22
#define DSI_MCTL_MAIN_STS_CTL_CRS_UNTERM_PCK_ERR_EDGE_MASK 0x00400000
#define DSI_MCTL_MAIN_STS_CTL_CRS_UNTERM_PCK_ERR_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, CRS_UNTERM_PCK_ERR_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CTL_VRS_UNTERM_PCK_ERR_EDGE_SHIFT 23
#define DSI_MCTL_MAIN_STS_CTL_VRS_UNTERM_PCK_ERR_EDGE_MASK 0x00800000
#define DSI_MCTL_MAIN_STS_CTL_VRS_UNTERM_PCK_ERR_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CTL, VRS_UNTERM_PCK_ERR_EDGE, __x)
#define DSI_CMD_MODE_STS_CTL 0x000000F4
#define DSI_CMD_MODE_STS_CTL_ERR_NO_TE_EN_SHIFT 0
#define DSI_CMD_MODE_STS_CTL_ERR_NO_TE_EN_MASK 0x00000001
#define DSI_CMD_MODE_STS_CTL_ERR_NO_TE_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_NO_TE_EN, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_TE_MISS_EN_SHIFT 1
#define DSI_CMD_MODE_STS_CTL_ERR_TE_MISS_EN_MASK 0x00000002
#define DSI_CMD_MODE_STS_CTL_ERR_TE_MISS_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_TE_MISS_EN, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_SDI1_UNDERRUN_EN_SHIFT 2
#define DSI_CMD_MODE_STS_CTL_ERR_SDI1_UNDERRUN_EN_MASK 0x00000004
#define DSI_CMD_MODE_STS_CTL_ERR_SDI1_UNDERRUN_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_SDI1_UNDERRUN_EN, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_SDI2_UNDERRUN_EN_SHIFT 3
#define DSI_CMD_MODE_STS_CTL_ERR_SDI2_UNDERRUN_EN_MASK 0x00000008
#define DSI_CMD_MODE_STS_CTL_ERR_SDI2_UNDERRUN_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_SDI2_UNDERRUN_EN, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_UNWANTED_RD_EN_SHIFT 4
#define DSI_CMD_MODE_STS_CTL_ERR_UNWANTED_RD_EN_MASK 0x00000010
#define DSI_CMD_MODE_STS_CTL_ERR_UNWANTED_RD_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_UNWANTED_RD_EN, __x)
#define DSI_CMD_MODE_STS_CTL_CSM_RUNNING_EN_SHIFT 5
#define DSI_CMD_MODE_STS_CTL_CSM_RUNNING_EN_MASK 0x00000020
#define DSI_CMD_MODE_STS_CTL_CSM_RUNNING_EN(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, CSM_RUNNING_EN, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_NO_TE_EDGE_SHIFT 16
#define DSI_CMD_MODE_STS_CTL_ERR_NO_TE_EDGE_MASK 0x00010000
#define DSI_CMD_MODE_STS_CTL_ERR_NO_TE_EDGE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_NO_TE_EDGE, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_TE_MISS_EDGE_SHIFT 17
#define DSI_CMD_MODE_STS_CTL_ERR_TE_MISS_EDGE_MASK 0x00020000
#define DSI_CMD_MODE_STS_CTL_ERR_TE_MISS_EDGE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_TE_MISS_EDGE, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_SDI1_UNDERRUN_EDGE_SHIFT 18
#define DSI_CMD_MODE_STS_CTL_ERR_SDI1_UNDERRUN_EDGE_MASK 0x00040000
#define DSI_CMD_MODE_STS_CTL_ERR_SDI1_UNDERRUN_EDGE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_SDI1_UNDERRUN_EDGE, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_SDI2_UNDERRUN_EDGE_SHIFT 19
#define DSI_CMD_MODE_STS_CTL_ERR_SDI2_UNDERRUN_EDGE_MASK 0x00080000
#define DSI_CMD_MODE_STS_CTL_ERR_SDI2_UNDERRUN_EDGE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_SDI2_UNDERRUN_EDGE, __x)
#define DSI_CMD_MODE_STS_CTL_ERR_UNWANTED_RD_EDGE_SHIFT 20
#define DSI_CMD_MODE_STS_CTL_ERR_UNWANTED_RD_EDGE_MASK 0x00100000
#define DSI_CMD_MODE_STS_CTL_ERR_UNWANTED_RD_EDGE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, ERR_UNWANTED_RD_EDGE, __x)
#define DSI_CMD_MODE_STS_CTL_CSM_RUNNING_EDGE_SHIFT 21
#define DSI_CMD_MODE_STS_CTL_CSM_RUNNING_EDGE_MASK 0x00200000
#define DSI_CMD_MODE_STS_CTL_CSM_RUNNING_EDGE(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CTL, CSM_RUNNING_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL 0x000000F8
#define DSI_DIRECT_CMD_STS_CTL_CMD_TRANSMISSION_EN_SHIFT 0
#define DSI_DIRECT_CMD_STS_CTL_CMD_TRANSMISSION_EN_MASK 0x00000001
#define DSI_DIRECT_CMD_STS_CTL_CMD_TRANSMISSION_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, CMD_TRANSMISSION_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_WRITE_COMPLETED_EN_SHIFT 1
#define DSI_DIRECT_CMD_STS_CTL_WRITE_COMPLETED_EN_MASK 0x00000002
#define DSI_DIRECT_CMD_STS_CTL_WRITE_COMPLETED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, WRITE_COMPLETED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_COMPLETED_EN_SHIFT 2
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_COMPLETED_EN_MASK 0x00000004
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_COMPLETED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, TRIGGER_COMPLETED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_EN_SHIFT 3
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_EN_MASK 0x00000008
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, READ_COMPLETED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_RECEIVED_EN_SHIFT 4
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_RECEIVED_EN_MASK 0x00000010
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_RECEIVED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, ACKNOWLEDGE_RECEIVED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_WITH_ERR_EN_SHIFT 5
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_WITH_ERR_EN_MASK 0x00000020
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_WITH_ERR_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, ACKNOWLEDGE_WITH_ERR_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_RECEIVED_EN_SHIFT 6
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_RECEIVED_EN_MASK 0x00000040
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_RECEIVED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, TRIGGER_RECEIVED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_TE_RECEIVED_EN_SHIFT 7
#define DSI_DIRECT_CMD_STS_CTL_TE_RECEIVED_EN_MASK 0x00000080
#define DSI_DIRECT_CMD_STS_CTL_TE_RECEIVED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, TE_RECEIVED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_BTA_COMPLETED_EN_SHIFT 8
#define DSI_DIRECT_CMD_STS_CTL_BTA_COMPLETED_EN_MASK 0x00000100
#define DSI_DIRECT_CMD_STS_CTL_BTA_COMPLETED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, BTA_COMPLETED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_BTA_FINISHED_EN_SHIFT 9
#define DSI_DIRECT_CMD_STS_CTL_BTA_FINISHED_EN_MASK 0x00000200
#define DSI_DIRECT_CMD_STS_CTL_BTA_FINISHED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, BTA_FINISHED_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_WITH_ERR_EN_SHIFT 10
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_WITH_ERR_EN_MASK 0x00000400
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_WITH_ERR_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, READ_COMPLETED_WITH_ERR_EN, __x)
#define DSI_DIRECT_CMD_STS_CTL_CMD_TRANSMISSION_EDGE_SHIFT 16
#define DSI_DIRECT_CMD_STS_CTL_CMD_TRANSMISSION_EDGE_MASK 0x00010000
#define DSI_DIRECT_CMD_STS_CTL_CMD_TRANSMISSION_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, CMD_TRANSMISSION_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_WRITE_COMPLETED_EDGE_SHIFT 17
#define DSI_DIRECT_CMD_STS_CTL_WRITE_COMPLETED_EDGE_MASK 0x00020000
#define DSI_DIRECT_CMD_STS_CTL_WRITE_COMPLETED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, WRITE_COMPLETED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_COMPLETED_EDGE_SHIFT 18
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_COMPLETED_EDGE_MASK 0x00040000
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_COMPLETED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, TRIGGER_COMPLETED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_EDGE_SHIFT 19
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_EDGE_MASK 0x00080000
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, READ_COMPLETED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_RECEIVED_EDGE_SHIFT 20
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_RECEIVED_EDGE_MASK 0x00100000
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_RECEIVED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, ACKNOWLEDGE_RECEIVED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_WITH_ERR_EDGE_SHIFT 21
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_WITH_ERR_EDGE_MASK 0x00200000
#define DSI_DIRECT_CMD_STS_CTL_ACKNOWLEDGE_WITH_ERR_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, ACKNOWLEDGE_WITH_ERR_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_RECEIVED_EDGE_SHIFT 22
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_RECEIVED_EDGE_MASK 0x00400000
#define DSI_DIRECT_CMD_STS_CTL_TRIGGER_RECEIVED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, TRIGGER_RECEIVED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_TE_RECEIVED_EDGE_SHIFT 23
#define DSI_DIRECT_CMD_STS_CTL_TE_RECEIVED_EDGE_MASK 0x00800000
#define DSI_DIRECT_CMD_STS_CTL_TE_RECEIVED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, TE_RECEIVED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_BTA_COMPLETED_EDGE_SHIFT 24
#define DSI_DIRECT_CMD_STS_CTL_BTA_COMPLETED_EDGE_MASK 0x01000000
#define DSI_DIRECT_CMD_STS_CTL_BTA_COMPLETED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, BTA_COMPLETED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_BTA_FINISHED_EDGE_SHIFT 25
#define DSI_DIRECT_CMD_STS_CTL_BTA_FINISHED_EDGE_MASK 0x02000000
#define DSI_DIRECT_CMD_STS_CTL_BTA_FINISHED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, BTA_FINISHED_EDGE, __x)
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_WITH_ERR_EDGE_SHIFT 26
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_WITH_ERR_EDGE_MASK 0x04000000
#define DSI_DIRECT_CMD_STS_CTL_READ_COMPLETED_WITH_ERR_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CTL, READ_COMPLETED_WITH_ERR_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL 0x000000FC
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_FIXED_EN_SHIFT 0
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_FIXED_EN_MASK 0x00000001
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_FIXED_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_FIXED_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNCORRECTABLE_EN_SHIFT 1
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNCORRECTABLE_EN_MASK 0x00000002
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNCORRECTABLE_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_UNCORRECTABLE_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_CHECKSUM_EN_SHIFT 2
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_CHECKSUM_EN_MASK 0x00000004
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_CHECKSUM_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_CHECKSUM_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNDECODABLE_EN_SHIFT 3
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNDECODABLE_EN_MASK 0x00000008
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNDECODABLE_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_UNDECODABLE_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_RECEIVE_EN_SHIFT 4
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_RECEIVE_EN_MASK 0x00000010
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_RECEIVE_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_RECEIVE_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_OVERSIZE_EN_SHIFT 5
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_OVERSIZE_EN_MASK 0x00000020
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_OVERSIZE_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_OVERSIZE_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_WRONG_LENGTH_EN_SHIFT 6
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_WRONG_LENGTH_EN_MASK 0x00000040
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_WRONG_LENGTH_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_WRONG_LENGTH_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_MISSING_EOT_EN_SHIFT 7
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_MISSING_EOT_EN_MASK 0x00000080
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_MISSING_EOT_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_MISSING_EOT_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_EOT_WITH_ERR_EN_SHIFT 8
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_EOT_WITH_ERR_EN_MASK 0x00000100
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_EOT_WITH_ERR_EN(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_EOT_WITH_ERR_EN, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_FIXED_EDGE_SHIFT 16
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_FIXED_EDGE_MASK 0x00010000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_FIXED_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_FIXED_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNCORRECTABLE_EDGE_SHIFT 17
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNCORRECTABLE_EDGE_MASK 0x00020000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNCORRECTABLE_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_UNCORRECTABLE_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_CHECKSUM_EDGE_SHIFT 18
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_CHECKSUM_EDGE_MASK 0x00040000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_CHECKSUM_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_CHECKSUM_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNDECODABLE_EDGE_SHIFT 19
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNDECODABLE_EDGE_MASK 0x00080000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_UNDECODABLE_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_UNDECODABLE_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_RECEIVE_EDGE_SHIFT 20
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_RECEIVE_EDGE_MASK 0x00100000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_RECEIVE_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_RECEIVE_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_OVERSIZE_EDGE_SHIFT 21
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_OVERSIZE_EDGE_MASK 0x00200000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_OVERSIZE_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_OVERSIZE_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_WRONG_LENGTH_EDGE_SHIFT 22
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_WRONG_LENGTH_EDGE_MASK 0x00400000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_WRONG_LENGTH_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_WRONG_LENGTH_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_MISSING_EOT_EDGE_SHIFT 23
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_MISSING_EOT_EDGE_MASK 0x00800000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_MISSING_EOT_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_MISSING_EOT_EDGE, __x)
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_EOT_WITH_ERR_EDGE_SHIFT 24
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_EOT_WITH_ERR_EDGE_MASK 0x01000000
#define DSI_DIRECT_CMD_RD_STS_CTL_ERR_EOT_WITH_ERR_EDGE(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CTL, ERR_EOT_WITH_ERR_EDGE, __x)
#define DSI_VID_MODE_STS_CTL 0x00000100
#define DSI_VID_MODE_STS_CTL_VSG_RUNNING_EN_SHIFT 0
#define DSI_VID_MODE_STS_CTL_VSG_RUNNING_EN_MASK 0x00000001
#define DSI_VID_MODE_STS_CTL_VSG_RUNNING_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, VSG_RUNNING_EN, __x)
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_DATA_EN_SHIFT 1
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_DATA_EN_MASK 0x00000002
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_DATA_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_MISSING_DATA_EN, __x)
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_HSYNC_EN_SHIFT 2
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_HSYNC_EN_MASK 0x00000004
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_HSYNC_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_MISSING_HSYNC_EN, __x)
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_VSYNC_EN_SHIFT 3
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_VSYNC_EN_MASK 0x00000008
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_VSYNC_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_MISSING_VSYNC_EN, __x)
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_LENGTH_EN_SHIFT 4
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_LENGTH_EN_MASK 0x00000010
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_LENGTH_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, REG_ERR_SMALL_LENGTH_EN, __x)
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_HEIGHT_EN_SHIFT 5
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_HEIGHT_EN_MASK 0x00000020
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_HEIGHT_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, REG_ERR_SMALL_HEIGHT_EN, __x)
#define DSI_VID_MODE_STS_CTL_ERR_BURSTWRITE_EN_SHIFT 6
#define DSI_VID_MODE_STS_CTL_ERR_BURSTWRITE_EN_MASK 0x00000040
#define DSI_VID_MODE_STS_CTL_ERR_BURSTWRITE_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_BURSTWRITE_EN, __x)
#define DSI_VID_MODE_STS_CTL_ERR_LONGWRITE_EN_SHIFT 7
#define DSI_VID_MODE_STS_CTL_ERR_LONGWRITE_EN_MASK 0x00000080
#define DSI_VID_MODE_STS_CTL_ERR_LONGWRITE_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_LONGWRITE_EN, __x)
#define DSI_VID_MODE_STS_CTL_ERR_LONGREAD_EN_SHIFT 8
#define DSI_VID_MODE_STS_CTL_ERR_LONGREAD_EN_MASK 0x00000100
#define DSI_VID_MODE_STS_CTL_ERR_LONGREAD_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_LONGREAD_EN, __x)
#define DSI_VID_MODE_STS_CTL_ERR_VRS_WRONG_LENGTH_EN_SHIFT 9
#define DSI_VID_MODE_STS_CTL_ERR_VRS_WRONG_LENGTH_EN_MASK 0x00000200
#define DSI_VID_MODE_STS_CTL_ERR_VRS_WRONG_LENGTH_EN(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_VRS_WRONG_LENGTH_EN, __x)
#define DSI_VID_MODE_STS_CTL_VSG_RUNNING_EDGE_SHIFT 16
#define DSI_VID_MODE_STS_CTL_VSG_RUNNING_EDGE_MASK 0x00010000
#define DSI_VID_MODE_STS_CTL_VSG_RUNNING_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, VSG_RUNNING_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_DATA_EDGE_SHIFT 17
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_DATA_EDGE_MASK 0x00020000
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_DATA_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_MISSING_DATA_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_HSYNC_EDGE_SHIFT 18
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_HSYNC_EDGE_MASK 0x00040000
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_HSYNC_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_MISSING_HSYNC_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_VSYNC_EDGE_SHIFT 19
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_VSYNC_EDGE_MASK 0x00080000
#define DSI_VID_MODE_STS_CTL_ERR_MISSING_VSYNC_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_MISSING_VSYNC_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_LENGTH_EDGE_SHIFT 20
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_LENGTH_EDGE_MASK 0x00100000
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_LENGTH_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, REG_ERR_SMALL_LENGTH_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_HEIGHT_EDGE_SHIFT 21
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_HEIGHT_EDGE_MASK 0x00200000
#define DSI_VID_MODE_STS_CTL_REG_ERR_SMALL_HEIGHT_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, REG_ERR_SMALL_HEIGHT_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_ERR_BURSTWRITE_EDGE_SHIFT 22
#define DSI_VID_MODE_STS_CTL_ERR_BURSTWRITE_EDGE_MASK 0x00400000
#define DSI_VID_MODE_STS_CTL_ERR_BURSTWRITE_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_BURSTWRITE_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_ERR_LONGWRITE_EDGE_SHIFT 23
#define DSI_VID_MODE_STS_CTL_ERR_LONGWRITE_EDGE_MASK 0x00800000
#define DSI_VID_MODE_STS_CTL_ERR_LONGWRITE_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_LONGWRITE_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_ERR_LONGREAD_EDGE_SHIFT 24
#define DSI_VID_MODE_STS_CTL_ERR_LONGREAD_EDGE_MASK 0x01000000
#define DSI_VID_MODE_STS_CTL_ERR_LONGREAD_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_LONGREAD_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_ERR_VRS_WRONG_LENGTH_EDGE_SHIFT 25
#define DSI_VID_MODE_STS_CTL_ERR_VRS_WRONG_LENGTH_EDGE_MASK 0x02000000
#define DSI_VID_MODE_STS_CTL_ERR_VRS_WRONG_LENGTH_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, ERR_VRS_WRONG_LENGTH_EDGE, __x)
#define DSI_VID_MODE_STS_CTL_VSG_RECOVERY_EDGE_SHIFT 26
#define DSI_VID_MODE_STS_CTL_VSG_RECOVERY_EDGE_MASK 0x04000000
#define DSI_VID_MODE_STS_CTL_VSG_RECOVERY_EDGE(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CTL, VSG_RECOVERY_EDGE, __x)
#define DSI_TG_STS_CTL 0x00000104
#define DSI_TG_STS_CTL_TVG_STS_EN_SHIFT 0
#define DSI_TG_STS_CTL_TVG_STS_EN_MASK 0x00000001
#define DSI_TG_STS_CTL_TVG_STS_EN(__x) \
DSI_VAL2REG(DSI_TG_STS_CTL, TVG_STS_EN, __x)
#define DSI_TG_STS_CTL_TBG_STS_EN_SHIFT 1
#define DSI_TG_STS_CTL_TBG_STS_EN_MASK 0x00000002
#define DSI_TG_STS_CTL_TBG_STS_EN(__x) \
DSI_VAL2REG(DSI_TG_STS_CTL, TBG_STS_EN, __x)
#define DSI_TG_STS_CTL_TVG_STS_EDGE_SHIFT 16
#define DSI_TG_STS_CTL_TVG_STS_EDGE_MASK 0x00010000
#define DSI_TG_STS_CTL_TVG_STS_EDGE(__x) \
DSI_VAL2REG(DSI_TG_STS_CTL, TVG_STS_EDGE, __x)
#define DSI_TG_STS_CTL_TBG_STS_EDGE_SHIFT 17
#define DSI_TG_STS_CTL_TBG_STS_EDGE_MASK 0x00020000
#define DSI_TG_STS_CTL_TBG_STS_EDGE(__x) \
DSI_VAL2REG(DSI_TG_STS_CTL, TBG_STS_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL 0x00000108
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_1_EN_SHIFT 6
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_1_EN_MASK 0x00000040
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_1_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_ESC_1_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_2_EN_SHIFT 7
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_2_EN_MASK 0x00000080
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_ESC_2_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_1_EN_SHIFT 8
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_1_EN_MASK 0x00000100
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_1_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_SYNCESC_1_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_2_EN_SHIFT 9
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_2_EN_MASK 0x00000200
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_SYNCESC_2_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_1_EN_SHIFT 10
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_1_EN_MASK 0x00000400
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_1_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONTROL_1_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_2_EN_SHIFT 11
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_2_EN_MASK 0x00000800
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONTROL_2_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_1_EN_SHIFT 12
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_1_EN_MASK 0x00001000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_1_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP0_1_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_2_EN_SHIFT 13
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_2_EN_MASK 0x00002000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP0_2_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_1_EN_SHIFT 14
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_1_EN_MASK 0x00004000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_1_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP1_1_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_2_EN_SHIFT 15
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_2_EN_MASK 0x00008000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_2_EN(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP1_2_EN, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_1_EDGE_SHIFT 22
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_1_EDGE_MASK 0x00400000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_1_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_ESC_1_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_2_EDGE_SHIFT 23
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_2_EDGE_MASK 0x00800000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_ESC_2_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_ESC_2_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_1_EDGE_SHIFT 24
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_1_EDGE_MASK 0x01000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_1_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_SYNCESC_1_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_2_EDGE_SHIFT 25
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_2_EDGE_MASK 0x02000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_SYNCESC_2_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_SYNCESC_2_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_1_EDGE_SHIFT 26
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_1_EDGE_MASK 0x04000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_1_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONTROL_1_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_2_EDGE_SHIFT 27
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_2_EDGE_MASK 0x08000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONTROL_2_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONTROL_2_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_1_EDGE_SHIFT 28
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_1_EDGE_MASK 0x10000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_1_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP0_1_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_2_EDGE_SHIFT 29
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_2_EDGE_MASK 0x20000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP0_2_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP0_2_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_1_EDGE_SHIFT 30
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_1_EDGE_MASK 0x40000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_1_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP1_1_EDGE, __x)
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_2_EDGE_SHIFT 31
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_2_EDGE_MASK 0x80000000
#define DSI_MCTL_DHPY_ERR_CTL_ERR_CONT_LP1_2_EDGE(__x) \
DSI_VAL2REG(DSI_MCTL_DHPY_ERR_CTL, ERR_CONT_LP1_2_EDGE, __x)
#define DSI_MCTL_MAIN_STS_CLR 0x00000110
#define DSI_MCTL_MAIN_STS_CLR_PLL_LOCK_CLR_SHIFT 0
#define DSI_MCTL_MAIN_STS_CLR_PLL_LOCK_CLR_MASK 0x00000001
#define DSI_MCTL_MAIN_STS_CLR_PLL_LOCK_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, PLL_LOCK_CLR, __x)
#define DSI_MCTL_MAIN_STS_CLR_CLKLANE_READY_CLR_SHIFT 1
#define DSI_MCTL_MAIN_STS_CLR_CLKLANE_READY_CLR_MASK 0x00000002
#define DSI_MCTL_MAIN_STS_CLR_CLKLANE_READY_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, CLKLANE_READY_CLR, __x)
#define DSI_MCTL_MAIN_STS_CLR_DAT1_READY_CLR_SHIFT 2
#define DSI_MCTL_MAIN_STS_CLR_DAT1_READY_CLR_MASK 0x00000004
#define DSI_MCTL_MAIN_STS_CLR_DAT1_READY_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, DAT1_READY_CLR, __x)
#define DSI_MCTL_MAIN_STS_CLR_DAT2_READY_CLR_SHIFT 3
#define DSI_MCTL_MAIN_STS_CLR_DAT2_READY_CLR_MASK 0x00000008
#define DSI_MCTL_MAIN_STS_CLR_DAT2_READY_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, DAT2_READY_CLR, __x)
#define DSI_MCTL_MAIN_STS_CLR_HSTX_TO_ERR_CLR_SHIFT 4
#define DSI_MCTL_MAIN_STS_CLR_HSTX_TO_ERR_CLR_MASK 0x00000010
#define DSI_MCTL_MAIN_STS_CLR_HSTX_TO_ERR_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, HSTX_TO_ERR_CLR, __x)
#define DSI_MCTL_MAIN_STS_CLR_LPRX_TO_ERR_CLR_SHIFT 5
#define DSI_MCTL_MAIN_STS_CLR_LPRX_TO_ERR_CLR_MASK 0x00000020
#define DSI_MCTL_MAIN_STS_CLR_LPRX_TO_ERR_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, LPRX_TO_ERR_CLR, __x)
#define DSI_MCTL_MAIN_STS_CLR_CRS_UNTERM_PCK_CLR_SHIFT 6
#define DSI_MCTL_MAIN_STS_CLR_CRS_UNTERM_PCK_CLR_MASK 0x00000040
#define DSI_MCTL_MAIN_STS_CLR_CRS_UNTERM_PCK_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, CRS_UNTERM_PCK_CLR, __x)
#define DSI_MCTL_MAIN_STS_CLR_VRS_UNTERM_PCK_CLR_SHIFT 7
#define DSI_MCTL_MAIN_STS_CLR_VRS_UNTERM_PCK_CLR_MASK 0x00000080
#define DSI_MCTL_MAIN_STS_CLR_VRS_UNTERM_PCK_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_CLR, VRS_UNTERM_PCK_CLR, __x)
#define DSI_CMD_MODE_STS_CLR 0x00000114
#define DSI_CMD_MODE_STS_CLR_ERR_NO_TE_CLR_SHIFT 0
#define DSI_CMD_MODE_STS_CLR_ERR_NO_TE_CLR_MASK 0x00000001
#define DSI_CMD_MODE_STS_CLR_ERR_NO_TE_CLR(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CLR, ERR_NO_TE_CLR, __x)
#define DSI_CMD_MODE_STS_CLR_ERR_TE_MISS_CLR_SHIFT 1
#define DSI_CMD_MODE_STS_CLR_ERR_TE_MISS_CLR_MASK 0x00000002
#define DSI_CMD_MODE_STS_CLR_ERR_TE_MISS_CLR(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CLR, ERR_TE_MISS_CLR, __x)
#define DSI_CMD_MODE_STS_CLR_ERR_SDI1_UNDERRUN_CLR_SHIFT 2
#define DSI_CMD_MODE_STS_CLR_ERR_SDI1_UNDERRUN_CLR_MASK 0x00000004
#define DSI_CMD_MODE_STS_CLR_ERR_SDI1_UNDERRUN_CLR(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CLR, ERR_SDI1_UNDERRUN_CLR, __x)
#define DSI_CMD_MODE_STS_CLR_ERR_SDI2_UNDERRUN_CLR_SHIFT 3
#define DSI_CMD_MODE_STS_CLR_ERR_SDI2_UNDERRUN_CLR_MASK 0x00000008
#define DSI_CMD_MODE_STS_CLR_ERR_SDI2_UNDERRUN_CLR(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CLR, ERR_SDI2_UNDERRUN_CLR, __x)
#define DSI_CMD_MODE_STS_CLR_ERR_UNWANTED_RD_CLR_SHIFT 4
#define DSI_CMD_MODE_STS_CLR_ERR_UNWANTED_RD_CLR_MASK 0x00000010
#define DSI_CMD_MODE_STS_CLR_ERR_UNWANTED_RD_CLR(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CLR, ERR_UNWANTED_RD_CLR, __x)
#define DSI_CMD_MODE_STS_CLR_CSM_RUNNING_CLR_SHIFT 5
#define DSI_CMD_MODE_STS_CLR_CSM_RUNNING_CLR_MASK 0x00000020
#define DSI_CMD_MODE_STS_CLR_CSM_RUNNING_CLR(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_CLR, CSM_RUNNING_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR 0x00000118
#define DSI_DIRECT_CMD_STS_CLR_CMD_TRANSMISSION_CLR_SHIFT 0
#define DSI_DIRECT_CMD_STS_CLR_CMD_TRANSMISSION_CLR_MASK 0x00000001
#define DSI_DIRECT_CMD_STS_CLR_CMD_TRANSMISSION_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, CMD_TRANSMISSION_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_WRITE_COMPLETED_CLR_SHIFT 1
#define DSI_DIRECT_CMD_STS_CLR_WRITE_COMPLETED_CLR_MASK 0x00000002
#define DSI_DIRECT_CMD_STS_CLR_WRITE_COMPLETED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, WRITE_COMPLETED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_TRIGGER_COMPLETED_CLR_SHIFT 2
#define DSI_DIRECT_CMD_STS_CLR_TRIGGER_COMPLETED_CLR_MASK 0x00000004
#define DSI_DIRECT_CMD_STS_CLR_TRIGGER_COMPLETED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, TRIGGER_COMPLETED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_READ_COMPLETED_CLR_SHIFT 3
#define DSI_DIRECT_CMD_STS_CLR_READ_COMPLETED_CLR_MASK 0x00000008
#define DSI_DIRECT_CMD_STS_CLR_READ_COMPLETED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, READ_COMPLETED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_ACKNOWLEDGE_RECEIVED_CLR_SHIFT 4
#define DSI_DIRECT_CMD_STS_CLR_ACKNOWLEDGE_RECEIVED_CLR_MASK 0x00000010
#define DSI_DIRECT_CMD_STS_CLR_ACKNOWLEDGE_RECEIVED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, ACKNOWLEDGE_RECEIVED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_ACKNOWLEDGE_WITH_ERR_RECEIVED_CLR_SHIFT 5
#define DSI_DIRECT_CMD_STS_CLR_ACKNOWLEDGE_WITH_ERR_RECEIVED_CLR_MASK 0x00000020
#define DSI_DIRECT_CMD_STS_CLR_ACKNOWLEDGE_WITH_ERR_RECEIVED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, ACKNOWLEDGE_WITH_ERR_RECEIVED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_TRIGGER_RECEIVED_CLR_SHIFT 6
#define DSI_DIRECT_CMD_STS_CLR_TRIGGER_RECEIVED_CLR_MASK 0x00000040
#define DSI_DIRECT_CMD_STS_CLR_TRIGGER_RECEIVED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, TRIGGER_RECEIVED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_TE_RECEIVED_CLR_SHIFT 7
#define DSI_DIRECT_CMD_STS_CLR_TE_RECEIVED_CLR_MASK 0x00000080
#define DSI_DIRECT_CMD_STS_CLR_TE_RECEIVED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, TE_RECEIVED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_BTA_COMPLETED_CLR_SHIFT 8
#define DSI_DIRECT_CMD_STS_CLR_BTA_COMPLETED_CLR_MASK 0x00000100
#define DSI_DIRECT_CMD_STS_CLR_BTA_COMPLETED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, BTA_COMPLETED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_BTA_FINISHED_CLR_SHIFT 9
#define DSI_DIRECT_CMD_STS_CLR_BTA_FINISHED_CLR_MASK 0x00000200
#define DSI_DIRECT_CMD_STS_CLR_BTA_FINISHED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, BTA_FINISHED_CLR, __x)
#define DSI_DIRECT_CMD_STS_CLR_READ_COMPLETED_WITH_ERR_CLR_SHIFT 10
#define DSI_DIRECT_CMD_STS_CLR_READ_COMPLETED_WITH_ERR_CLR_MASK 0x00000400
#define DSI_DIRECT_CMD_STS_CLR_READ_COMPLETED_WITH_ERR_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_CLR, READ_COMPLETED_WITH_ERR_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR 0x0000011C
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_FIXED_CLR_SHIFT 0
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_FIXED_CLR_MASK 0x00000001
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_FIXED_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_FIXED_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_UNCORRECTABLE_CLR_SHIFT 1
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_UNCORRECTABLE_CLR_MASK 0x00000002
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_UNCORRECTABLE_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_UNCORRECTABLE_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_CHECKSUM_CLR_SHIFT 2
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_CHECKSUM_CLR_MASK 0x00000004
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_CHECKSUM_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_CHECKSUM_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_UNDECODABLE_CLR_SHIFT 3
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_UNDECODABLE_CLR_MASK 0x00000008
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_UNDECODABLE_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_UNDECODABLE_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_RECEIVE_CLR_SHIFT 4
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_RECEIVE_CLR_MASK 0x00000010
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_RECEIVE_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_RECEIVE_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_OVERSIZE_CLR_SHIFT 5
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_OVERSIZE_CLR_MASK 0x00000020
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_OVERSIZE_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_OVERSIZE_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_WRONG_LENGTH_CLR_SHIFT 6
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_WRONG_LENGTH_CLR_MASK 0x00000040
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_WRONG_LENGTH_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_WRONG_LENGTH_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_MISSING_EOT_CLR_SHIFT 7
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_MISSING_EOT_CLR_MASK 0x00000080
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_MISSING_EOT_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_MISSING_EOT_CLR, __x)
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_EOT_WITH_ERR_CLR_SHIFT 8
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_EOT_WITH_ERR_CLR_MASK 0x00000100
#define DSI_DIRECT_CMD_RD_STS_CLR_ERR_EOT_WITH_ERR_CLR(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_CLR, ERR_EOT_WITH_ERR_CLR, __x)
#define DSI_VID_MODE_STS_CLR 0x00000120
#define DSI_VID_MODE_STS_CLR_VSG_STS_CLR_SHIFT 0
#define DSI_VID_MODE_STS_CLR_VSG_STS_CLR_MASK 0x00000001
#define DSI_VID_MODE_STS_CLR_VSG_STS_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, VSG_STS_CLR, __x)
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_DATA_CLR_SHIFT 1
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_DATA_CLR_MASK 0x00000002
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_DATA_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, ERR_MISSING_DATA_CLR, __x)
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_HSYNC_CLR_SHIFT 2
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_HSYNC_CLR_MASK 0x00000004
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_HSYNC_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, ERR_MISSING_HSYNC_CLR, __x)
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_VSYNC_CLR_SHIFT 3
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_VSYNC_CLR_MASK 0x00000008
#define DSI_VID_MODE_STS_CLR_ERR_MISSING_VSYNC_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, ERR_MISSING_VSYNC_CLR, __x)
#define DSI_VID_MODE_STS_CLR_REG_ERR_SMALL_LENGTH_CLR_SHIFT 4
#define DSI_VID_MODE_STS_CLR_REG_ERR_SMALL_LENGTH_CLR_MASK 0x00000010
#define DSI_VID_MODE_STS_CLR_REG_ERR_SMALL_LENGTH_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, REG_ERR_SMALL_LENGTH_CLR, __x)
#define DSI_VID_MODE_STS_CLR_REG_ERR_SMALL_HEIGHT_CLR_SHIFT 5
#define DSI_VID_MODE_STS_CLR_REG_ERR_SMALL_HEIGHT_CLR_MASK 0x00000020
#define DSI_VID_MODE_STS_CLR_REG_ERR_SMALL_HEIGHT_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, REG_ERR_SMALL_HEIGHT_CLR, __x)
#define DSI_VID_MODE_STS_CLR_ERR_BURSTWRITE_CLR_SHIFT 6
#define DSI_VID_MODE_STS_CLR_ERR_BURSTWRITE_CLR_MASK 0x00000040
#define DSI_VID_MODE_STS_CLR_ERR_BURSTWRITE_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, ERR_BURSTWRITE_CLR, __x)
#define DSI_VID_MODE_STS_CLR_ERR_LONGWRITE_CLR_SHIFT 7
#define DSI_VID_MODE_STS_CLR_ERR_LONGWRITE_CLR_MASK 0x00000080
#define DSI_VID_MODE_STS_CLR_ERR_LONGWRITE_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, ERR_LONGWRITE_CLR, __x)
#define DSI_VID_MODE_STS_CLR_ERR_LONGREAD_CLR_SHIFT 8
#define DSI_VID_MODE_STS_CLR_ERR_LONGREAD_CLR_MASK 0x00000100
#define DSI_VID_MODE_STS_CLR_ERR_LONGREAD_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, ERR_LONGREAD_CLR, __x)
#define DSI_VID_MODE_STS_CLR_ERR_VRS_WRONG_LENGTH_CLR_SHIFT 9
#define DSI_VID_MODE_STS_CLR_ERR_VRS_WRONG_LENGTH_CLR_MASK 0x00000200
#define DSI_VID_MODE_STS_CLR_ERR_VRS_WRONG_LENGTH_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, ERR_VRS_WRONG_LENGTH_CLR, __x)
#define DSI_VID_MODE_STS_CLR_VSG_RECOVERY_CLR_SHIFT 10
#define DSI_VID_MODE_STS_CLR_VSG_RECOVERY_CLR_MASK 0x00000400
#define DSI_VID_MODE_STS_CLR_VSG_RECOVERY_CLR(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_CLR, VSG_RECOVERY_CLR, __x)
#define DSI_TG_STS_CLR 0x00000124
#define DSI_TG_STS_CLR_TVG_STS_CLR_SHIFT 0
#define DSI_TG_STS_CLR_TVG_STS_CLR_MASK 0x00000001
#define DSI_TG_STS_CLR_TVG_STS_CLR(__x) \
DSI_VAL2REG(DSI_TG_STS_CLR, TVG_STS_CLR, __x)
#define DSI_TG_STS_CLR_TBG_STS_CLR_SHIFT 1
#define DSI_TG_STS_CLR_TBG_STS_CLR_MASK 0x00000002
#define DSI_TG_STS_CLR_TBG_STS_CLR(__x) \
DSI_VAL2REG(DSI_TG_STS_CLR, TBG_STS_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR 0x00000128
#define DSI_MCTL_DPHY_ERR_CLR_ERR_ESC_1_CLR_SHIFT 6
#define DSI_MCTL_DPHY_ERR_CLR_ERR_ESC_1_CLR_MASK 0x00000040
#define DSI_MCTL_DPHY_ERR_CLR_ERR_ESC_1_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_ESC_1_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_ESC_2_CLR_SHIFT 7
#define DSI_MCTL_DPHY_ERR_CLR_ERR_ESC_2_CLR_MASK 0x00000080
#define DSI_MCTL_DPHY_ERR_CLR_ERR_ESC_2_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_ESC_2_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_SYNCESC_1_CLR_SHIFT 8
#define DSI_MCTL_DPHY_ERR_CLR_ERR_SYNCESC_1_CLR_MASK 0x00000100
#define DSI_MCTL_DPHY_ERR_CLR_ERR_SYNCESC_1_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_SYNCESC_1_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_SYNCESC_2_CLR_SHIFT 9
#define DSI_MCTL_DPHY_ERR_CLR_ERR_SYNCESC_2_CLR_MASK 0x00000200
#define DSI_MCTL_DPHY_ERR_CLR_ERR_SYNCESC_2_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_SYNCESC_2_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONTROL_1_CLR_SHIFT 10
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONTROL_1_CLR_MASK 0x00000400
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONTROL_1_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_CONTROL_1_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONTROL_2_CLR_SHIFT 11
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONTROL_2_CLR_MASK 0x00000800
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONTROL_2_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_CONTROL_2_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP0_1_CLR_SHIFT 12
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP0_1_CLR_MASK 0x00001000
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP0_1_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_CONT_LP0_1_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP0_2_CLR_SHIFT 13
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP0_2_CLR_MASK 0x00002000
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP0_2_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_CONT_LP0_2_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP1_1_CLR_SHIFT 14
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP1_1_CLR_MASK 0x00004000
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP1_1_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_CONT_LP1_1_CLR, __x)
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP1_2_CLR_SHIFT 15
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP1_2_CLR_MASK 0x00008000
#define DSI_MCTL_DPHY_ERR_CLR_ERR_CONT_LP1_2_CLR(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_CLR, ERR_CONT_LP1_2_CLR, __x)
#define DSI_MCTL_MAIN_STS_FLAG 0x00000130
#define DSI_MCTL_MAIN_STS_FLAG_PLL_LOCK_FLAG_SHIFT 0
#define DSI_MCTL_MAIN_STS_FLAG_PLL_LOCK_FLAG_MASK 0x00000001
#define DSI_MCTL_MAIN_STS_FLAG_PLL_LOCK_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, PLL_LOCK_FLAG, __x)
#define DSI_MCTL_MAIN_STS_FLAG_CLKLANE_READY_FLAG_SHIFT 1
#define DSI_MCTL_MAIN_STS_FLAG_CLKLANE_READY_FLAG_MASK 0x00000002
#define DSI_MCTL_MAIN_STS_FLAG_CLKLANE_READY_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, CLKLANE_READY_FLAG, __x)
#define DSI_MCTL_MAIN_STS_FLAG_DAT1_READY_FLAG_SHIFT 2
#define DSI_MCTL_MAIN_STS_FLAG_DAT1_READY_FLAG_MASK 0x00000004
#define DSI_MCTL_MAIN_STS_FLAG_DAT1_READY_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, DAT1_READY_FLAG, __x)
#define DSI_MCTL_MAIN_STS_FLAG_DAT2_READY_FLAG_SHIFT 3
#define DSI_MCTL_MAIN_STS_FLAG_DAT2_READY_FLAG_MASK 0x00000008
#define DSI_MCTL_MAIN_STS_FLAG_DAT2_READY_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, DAT2_READY_FLAG, __x)
#define DSI_MCTL_MAIN_STS_FLAG_HSTX_TO_ERR_FLAG_SHIFT 4
#define DSI_MCTL_MAIN_STS_FLAG_HSTX_TO_ERR_FLAG_MASK 0x00000010
#define DSI_MCTL_MAIN_STS_FLAG_HSTX_TO_ERR_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, HSTX_TO_ERR_FLAG, __x)
#define DSI_MCTL_MAIN_STS_FLAG_LPRX_TO_ERR_FLAG_SHIFT 5
#define DSI_MCTL_MAIN_STS_FLAG_LPRX_TO_ERR_FLAG_MASK 0x00000020
#define DSI_MCTL_MAIN_STS_FLAG_LPRX_TO_ERR_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, LPRX_TO_ERR_FLAG, __x)
#define DSI_MCTL_MAIN_STS_FLAG_CRS_UNTERM_PCK_FLAG_SHIFT 6
#define DSI_MCTL_MAIN_STS_FLAG_CRS_UNTERM_PCK_FLAG_MASK 0x00000040
#define DSI_MCTL_MAIN_STS_FLAG_CRS_UNTERM_PCK_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, CRS_UNTERM_PCK_FLAG, __x)
#define DSI_MCTL_MAIN_STS_FLAG_VRS_UNTERM_PCK_FLAG_SHIFT 7
#define DSI_MCTL_MAIN_STS_FLAG_VRS_UNTERM_PCK_FLAG_MASK 0x00000080
#define DSI_MCTL_MAIN_STS_FLAG_VRS_UNTERM_PCK_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_MAIN_STS_FLAG, VRS_UNTERM_PCK_FLAG, __x)
#define DSI_CMD_MODE_STS_FLAG 0x00000134
#define DSI_CMD_MODE_STS_FLAG_ERR_NO_TE_FLAG_SHIFT 0
#define DSI_CMD_MODE_STS_FLAG_ERR_NO_TE_FLAG_MASK 0x00000001
#define DSI_CMD_MODE_STS_FLAG_ERR_NO_TE_FLAG(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_FLAG, ERR_NO_TE_FLAG, __x)
#define DSI_CMD_MODE_STS_FLAG_ERR_TE_MISS_FLAG_SHIFT 1
#define DSI_CMD_MODE_STS_FLAG_ERR_TE_MISS_FLAG_MASK 0x00000002
#define DSI_CMD_MODE_STS_FLAG_ERR_TE_MISS_FLAG(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_FLAG, ERR_TE_MISS_FLAG, __x)
#define DSI_CMD_MODE_STS_FLAG_ERR_SDI1_UNDERRUN_FLAG_SHIFT 2
#define DSI_CMD_MODE_STS_FLAG_ERR_SDI1_UNDERRUN_FLAG_MASK 0x00000004
#define DSI_CMD_MODE_STS_FLAG_ERR_SDI1_UNDERRUN_FLAG(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_FLAG, ERR_SDI1_UNDERRUN_FLAG, __x)
#define DSI_CMD_MODE_STS_FLAG_ERR_SDI2_UNDERRUN_FLAG_SHIFT 3
#define DSI_CMD_MODE_STS_FLAG_ERR_SDI2_UNDERRUN_FLAG_MASK 0x00000008
#define DSI_CMD_MODE_STS_FLAG_ERR_SDI2_UNDERRUN_FLAG(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_FLAG, ERR_SDI2_UNDERRUN_FLAG, __x)
#define DSI_CMD_MODE_STS_FLAG_ERR_UNWANTED_RD_FLAG_SHIFT 4
#define DSI_CMD_MODE_STS_FLAG_ERR_UNWANTED_RD_FLAG_MASK 0x00000010
#define DSI_CMD_MODE_STS_FLAG_ERR_UNWANTED_RD_FLAG(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_FLAG, ERR_UNWANTED_RD_FLAG, __x)
#define DSI_CMD_MODE_STS_FLAG_CSM_RUNNING_FLAG_SHIFT 5
#define DSI_CMD_MODE_STS_FLAG_CSM_RUNNING_FLAG_MASK 0x00000020
#define DSI_CMD_MODE_STS_FLAG_CSM_RUNNING_FLAG(__x) \
DSI_VAL2REG(DSI_CMD_MODE_STS_FLAG, CSM_RUNNING_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG 0x00000138
#define DSI_DIRECT_CMD_STS_FLAG_CMD_TRANSMISSION_FLAG_SHIFT 0
#define DSI_DIRECT_CMD_STS_FLAG_CMD_TRANSMISSION_FLAG_MASK 0x00000001
#define DSI_DIRECT_CMD_STS_FLAG_CMD_TRANSMISSION_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, CMD_TRANSMISSION_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_WRITE_COMPLETED_FLAG_SHIFT 1
#define DSI_DIRECT_CMD_STS_FLAG_WRITE_COMPLETED_FLAG_MASK 0x00000002
#define DSI_DIRECT_CMD_STS_FLAG_WRITE_COMPLETED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, WRITE_COMPLETED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_TRIGGER_COMPLETED_FLAG_SHIFT 2
#define DSI_DIRECT_CMD_STS_FLAG_TRIGGER_COMPLETED_FLAG_MASK 0x00000004
#define DSI_DIRECT_CMD_STS_FLAG_TRIGGER_COMPLETED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, TRIGGER_COMPLETED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_READ_COMPLETED_FLAG_SHIFT 3
#define DSI_DIRECT_CMD_STS_FLAG_READ_COMPLETED_FLAG_MASK 0x00000008
#define DSI_DIRECT_CMD_STS_FLAG_READ_COMPLETED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, READ_COMPLETED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_ACKNOWLEDGE_RECEIVED_FLAG_SHIFT 4
#define DSI_DIRECT_CMD_STS_FLAG_ACKNOWLEDGE_RECEIVED_FLAG_MASK 0x00000010
#define DSI_DIRECT_CMD_STS_FLAG_ACKNOWLEDGE_RECEIVED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, ACKNOWLEDGE_RECEIVED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_ACKNOWLEDGE_WITH_ERR_RECEIVED_FLAG_SHIFT 5
#define DSI_DIRECT_CMD_STS_FLAG_ACKNOWLEDGE_WITH_ERR_RECEIVED_FLAG_MASK 0x00000020
#define DSI_DIRECT_CMD_STS_FLAG_ACKNOWLEDGE_WITH_ERR_RECEIVED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, ACKNOWLEDGE_WITH_ERR_RECEIVED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_TRIGGER_RECEIVED_FLAG_SHIFT 6
#define DSI_DIRECT_CMD_STS_FLAG_TRIGGER_RECEIVED_FLAG_MASK 0x00000040
#define DSI_DIRECT_CMD_STS_FLAG_TRIGGER_RECEIVED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, TRIGGER_RECEIVED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_TE_RECEIVED_FLAG_SHIFT 7
#define DSI_DIRECT_CMD_STS_FLAG_TE_RECEIVED_FLAG_MASK 0x00000080
#define DSI_DIRECT_CMD_STS_FLAG_TE_RECEIVED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, TE_RECEIVED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_BTA_COMPLETED_FLAG_SHIFT 8
#define DSI_DIRECT_CMD_STS_FLAG_BTA_COMPLETED_FLAG_MASK 0x00000100
#define DSI_DIRECT_CMD_STS_FLAG_BTA_COMPLETED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, BTA_COMPLETED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_BTA_FINISHED_FLAG_SHIFT 9
#define DSI_DIRECT_CMD_STS_FLAG_BTA_FINISHED_FLAG_MASK 0x00000200
#define DSI_DIRECT_CMD_STS_FLAG_BTA_FINISHED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, BTA_FINISHED_FLAG, __x)
#define DSI_DIRECT_CMD_STS_FLAG_READ_COMPLETED_WITH_ERR_FLAG_SHIFT 10
#define DSI_DIRECT_CMD_STS_FLAG_READ_COMPLETED_WITH_ERR_FLAG_MASK 0x00000400
#define DSI_DIRECT_CMD_STS_FLAG_READ_COMPLETED_WITH_ERR_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_STS_FLAG, READ_COMPLETED_WITH_ERR_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG 0x0000013C
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_FIXED_FLAG_SHIFT 0
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_FIXED_FLAG_MASK 0x00000001
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_FIXED_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_FIXED_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_UNCORRECTABLE_FLAG_SHIFT 1
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_UNCORRECTABLE_FLAG_MASK 0x00000002
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_UNCORRECTABLE_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_UNCORRECTABLE_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_CHECKSUM_FLAG_SHIFT 2
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_CHECKSUM_FLAG_MASK 0x00000004
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_CHECKSUM_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_CHECKSUM_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_UNDECODABLE_FLAG_SHIFT 3
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_UNDECODABLE_FLAG_MASK 0x00000008
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_UNDECODABLE_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_UNDECODABLE_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_RECEIVE_FLAG_SHIFT 4
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_RECEIVE_FLAG_MASK 0x00000010
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_RECEIVE_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_RECEIVE_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_OVERSIZE_FLAG_SHIFT 5
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_OVERSIZE_FLAG_MASK 0x00000020
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_OVERSIZE_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_OVERSIZE_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_WRONG_LENGTH_FLAG_SHIFT 6
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_WRONG_LENGTH_FLAG_MASK 0x00000040
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_WRONG_LENGTH_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_WRONG_LENGTH_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_MISSING_EOT_FLAG_SHIFT 7
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_MISSING_EOT_FLAG_MASK 0x00000080
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_MISSING_EOT_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_MISSING_EOT_FLAG, __x)
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_EOT_WITH_ERR_FLAG_SHIFT 8
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_EOT_WITH_ERR_FLAG_MASK 0x00000100
#define DSI_DIRECT_CMD_RD_STS_FLAG_ERR_EOT_WITH_ERR_FLAG(__x) \
DSI_VAL2REG(DSI_DIRECT_CMD_RD_STS_FLAG, ERR_EOT_WITH_ERR_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG 0x00000140
#define DSI_VID_MODE_STS_FLAG_VSG_STS_FLAG_SHIFT 0
#define DSI_VID_MODE_STS_FLAG_VSG_STS_FLAG_MASK 0x00000001
#define DSI_VID_MODE_STS_FLAG_VSG_STS_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, VSG_STS_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_DATA_FLAG_SHIFT 1
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_DATA_FLAG_MASK 0x00000002
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_DATA_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, ERR_MISSING_DATA_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_HSYNC_FLAG_SHIFT 2
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_HSYNC_FLAG_MASK 0x00000004
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_HSYNC_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, ERR_MISSING_HSYNC_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_VSYNC_FLAG_SHIFT 3
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_VSYNC_FLAG_MASK 0x00000008
#define DSI_VID_MODE_STS_FLAG_ERR_MISSING_VSYNC_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, ERR_MISSING_VSYNC_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_REG_ERR_SMALL_LENGTH_FLAG_SHIFT 4
#define DSI_VID_MODE_STS_FLAG_REG_ERR_SMALL_LENGTH_FLAG_MASK 0x00000010
#define DSI_VID_MODE_STS_FLAG_REG_ERR_SMALL_LENGTH_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, REG_ERR_SMALL_LENGTH_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_REG_ERR_SMALL_HEIGHT_FLAG_SHIFT 5
#define DSI_VID_MODE_STS_FLAG_REG_ERR_SMALL_HEIGHT_FLAG_MASK 0x00000020
#define DSI_VID_MODE_STS_FLAG_REG_ERR_SMALL_HEIGHT_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, REG_ERR_SMALL_HEIGHT_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_ERR_BURSTWRITE_FLAG_SHIFT 6
#define DSI_VID_MODE_STS_FLAG_ERR_BURSTWRITE_FLAG_MASK 0x00000040
#define DSI_VID_MODE_STS_FLAG_ERR_BURSTWRITE_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, ERR_BURSTWRITE_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_ERR_LONGWRITE_FLAG_SHIFT 7
#define DSI_VID_MODE_STS_FLAG_ERR_LONGWRITE_FLAG_MASK 0x00000080
#define DSI_VID_MODE_STS_FLAG_ERR_LONGWRITE_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, ERR_LONGWRITE_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_ERR_LONGREAD_FLAG_SHIFT 8
#define DSI_VID_MODE_STS_FLAG_ERR_LONGREAD_FLAG_MASK 0x00000100
#define DSI_VID_MODE_STS_FLAG_ERR_LONGREAD_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, ERR_LONGREAD_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_ERR_VRS_WRONG_LENGTH_FLAG_SHIFT 9
#define DSI_VID_MODE_STS_FLAG_ERR_VRS_WRONG_LENGTH_FLAG_MASK 0x00000200
#define DSI_VID_MODE_STS_FLAG_ERR_VRS_WRONG_LENGTH_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, ERR_VRS_WRONG_LENGTH_FLAG, __x)
#define DSI_VID_MODE_STS_FLAG_VSG_RECOVERY_FLAG_SHIFT 10
#define DSI_VID_MODE_STS_FLAG_VSG_RECOVERY_FLAG_MASK 0x00000400
#define DSI_VID_MODE_STS_FLAG_VSG_RECOVERY_FLAG(__x) \
DSI_VAL2REG(DSI_VID_MODE_STS_FLAG, VSG_RECOVERY_FLAG, __x)
#define DSI_TG_STS_FLAG 0x00000144
#define DSI_TG_STS_FLAG_TVG_STS_FLAG_SHIFT 0
#define DSI_TG_STS_FLAG_TVG_STS_FLAG_MASK 0x00000001
#define DSI_TG_STS_FLAG_TVG_STS_FLAG(__x) \
DSI_VAL2REG(DSI_TG_STS_FLAG, TVG_STS_FLAG, __x)
#define DSI_TG_STS_FLAG_TBG_STS_FLAG_SHIFT 1
#define DSI_TG_STS_FLAG_TBG_STS_FLAG_MASK 0x00000002
#define DSI_TG_STS_FLAG_TBG_STS_FLAG(__x) \
DSI_VAL2REG(DSI_TG_STS_FLAG, TBG_STS_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG 0x00000148
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_ESC_1_FLAG_SHIFT 6
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_ESC_1_FLAG_MASK 0x00000040
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_ESC_1_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_ESC_1_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_ESC_2_FLAG_SHIFT 7
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_ESC_2_FLAG_MASK 0x00000080
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_ESC_2_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_ESC_2_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_SYNCESC_1_FLAG_SHIFT 8
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_SYNCESC_1_FLAG_MASK 0x00000100
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_SYNCESC_1_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_SYNCESC_1_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_SYNCESC_2_FLAG_SHIFT 9
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_SYNCESC_2_FLAG_MASK 0x00000200
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_SYNCESC_2_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_SYNCESC_2_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONTROL_1_FLAG_SHIFT 10
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONTROL_1_FLAG_MASK 0x00000400
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONTROL_1_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_CONTROL_1_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONTROL_2_FLAG_SHIFT 11
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONTROL_2_FLAG_MASK 0x00000800
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONTROL_2_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_CONTROL_2_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP0_1_FLAG_SHIFT 12
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP0_1_FLAG_MASK 0x00001000
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP0_1_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_CONT_LP0_1_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP0_2_FLAG_SHIFT 13
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP0_2_FLAG_MASK 0x00002000
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP0_2_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_CONT_LP0_2_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP1_1_FLAG_SHIFT 14
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP1_1_FLAG_MASK 0x00004000
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP1_1_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_CONT_LP1_1_FLAG, __x)
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP1_2_FLAG_SHIFT 15
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP1_2_FLAG_MASK 0x00008000
#define DSI_MCTL_DPHY_ERR_FLAG_ERR_CONT_LP1_2_FLAG(__x) \
DSI_VAL2REG(DSI_MCTL_DPHY_ERR_FLAG, ERR_CONT_LP1_2_FLAG, __x)
#define DSI_DPHY_LANES_TRIM 0x00000150
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_DAT1_SHIFT 0
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_DAT1_MASK 0x00000003
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_DAT1(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_SKEW_DAT1, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_CD_OFF_DAT1_SHIFT 2
#define DSI_DPHY_LANES_TRIM_DPHY_CD_OFF_DAT1_MASK 0x00000004
#define DSI_DPHY_LANES_TRIM_DPHY_CD_OFF_DAT1(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_CD_OFF_DAT1, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_DAT1_SHIFT 3
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_DAT1_MASK 0x00000008
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_DAT1(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_HSTX_SLEWRATE_UP_DAT1, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_DAT1_SHIFT 4
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_DAT1_MASK 0x00000010
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_DAT1(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_HSTX_SLEWRATE_DOWN_DAT1, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_DAT1_SHIFT 5
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_DAT1_MASK 0x00000020
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_DAT1(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_TEST_RESERVED_1_DAT1, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_CLK_SHIFT 6
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_CLK_MASK 0x000000C0
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_CLK(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_SKEW_CLK, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_LP_RX_VIL_CLK_SHIFT 8
#define DSI_DPHY_LANES_TRIM_DPHY_LP_RX_VIL_CLK_MASK 0x00000300
#define DSI_DPHY_LANES_TRIM_DPHY_LP_RX_VIL_CLK(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_LP_RX_VIL_CLK, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_LP_TX_SLEWRATE_CLK_SHIFT 10
#define DSI_DPHY_LANES_TRIM_DPHY_LP_TX_SLEWRATE_CLK_MASK 0x00000C00
#define DSI_DPHY_LANES_TRIM_DPHY_LP_TX_SLEWRATE_CLK(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_LP_TX_SLEWRATE_CLK, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_SPECS_90_81B_SHIFT 12
#define DSI_DPHY_LANES_TRIM_DPHY_SPECS_90_81B_MASK 0x00001000
#define DSI_DPHY_LANES_TRIM_DPHY_SPECS_90_81B_0_81 0
#define DSI_DPHY_LANES_TRIM_DPHY_SPECS_90_81B_0_90 1
#define DSI_DPHY_LANES_TRIM_DPHY_SPECS_90_81B_ENUM(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_SPECS_90_81B, \
DSI_DPHY_LANES_TRIM_DPHY_SPECS_90_81B_##__x)
#define DSI_DPHY_LANES_TRIM_DPHY_SPECS_90_81B(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_SPECS_90_81B, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_CLK_SHIFT 13
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_CLK_MASK 0x00002000
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_CLK(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_HSTX_SLEWRATE_UP_CLK, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_CLK_SHIFT 14
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_CLK_MASK 0x00004000
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_CLK(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_HSTX_SLEWRATE_DOWN_CLK, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_CLK_SHIFT 15
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_CLK_MASK 0x00008000
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_CLK(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_TEST_RESERVED_1_CLK, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_DAT2_SHIFT 16
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_DAT2_MASK 0x00030000
#define DSI_DPHY_LANES_TRIM_DPHY_SKEW_DAT2(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_SKEW_DAT2, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_DAT2_SHIFT 18
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_DAT2_MASK 0x00040000
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_UP_DAT2(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_HSTX_SLEWRATE_UP_DAT2, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_DAT2_SHIFT 19
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_DAT2_MASK 0x00080000
#define DSI_DPHY_LANES_TRIM_DPHY_HSTX_SLEWRATE_DOWN_DAT2(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_HSTX_SLEWRATE_DOWN_DAT2, __x)
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_DAT2_SHIFT 20
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_DAT2_MASK 0x00100000
#define DSI_DPHY_LANES_TRIM_DPHY_TEST_RESERVED_1_DAT2(__x) \
DSI_VAL2REG(DSI_DPHY_LANES_TRIM, DPHY_TEST_RESERVED_1_DAT2, __x)
#define DSI_ID_REG 0x00000FF0
#define DSI_ID_REG_Y_SHIFT 0
#define DSI_ID_REG_Y_MASK 0x0000000F
#define DSI_ID_REG_Y(__x) \
DSI_VAL2REG(DSI_ID_REG, Y, __x)
#define DSI_ID_REG_X_SHIFT 4
#define DSI_ID_REG_X_MASK 0x000000F0
#define DSI_ID_REG_X(__x) \
DSI_VAL2REG(DSI_ID_REG, X, __x)
#define DSI_ID_REG_H_SHIFT 8
#define DSI_ID_REG_H_MASK 0x00000300
#define DSI_ID_REG_H(__x) \
DSI_VAL2REG(DSI_ID_REG, H, __x)
#define DSI_ID_REG_PRODUCT_ID_SHIFT 10
#define DSI_ID_REG_PRODUCT_ID_MASK 0x0003FC00
#define DSI_ID_REG_PRODUCT_ID(__x) \
DSI_VAL2REG(DSI_ID_REG, PRODUCT_ID, __x)
#define DSI_ID_REG_VENDOR_ID_SHIFT 18
#define DSI_ID_REG_VENDOR_ID_MASK 0xFFFC0000
#define DSI_ID_REG_VENDOR_ID(__x) \
DSI_VAL2REG(DSI_ID_REG, VENDOR_ID, __x)
#define DSI_IP_CONF 0x00000FF4
#define DSI_IP_CONF_FIFO_SIZE_SHIFT 0
#define DSI_IP_CONF_FIFO_SIZE_MASK 0x0000003F
#define DSI_IP_CONF_FIFO_SIZE(__x) \
DSI_VAL2REG(DSI_IP_CONF, FIFO_SIZE, __x)
| oschmidt/kernel_I8160P | drivers/video/mcde/dsilink_regs.h | C | gpl-2.0 | 110,380 |
/*
* $Id: dbt_util.c,v 1.3 2004/08/24 08:58:26 janakj Exp $
*
* DBText library
*
* Copyright (C) 2001-2003 FhG Fokus
*
* This file is part of ser, a free SIP server.
*
* ser 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
*
* For a license to use the ser software under conditions
* other than those described here, or to purchase support for this
* software, please contact iptel.org by e-mail at the following addresses:
* [email protected]
*
* ser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* DBText library
*
* 2003-01-30 created by Daniel
*
*/
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include "dbt_util.h"
/**
*
*/
int dbt_is_database(str *_s)
{
DIR *dirp = NULL;
char buf[512];
if(!_s || !_s->s || _s->len <= 0 || _s->len > 510)
return 0;
strncpy(buf, _s->s, _s->len);
buf[_s->len] = 0;
dirp = opendir(buf);
if(!dirp)
return 0;
closedir(dirp);
return 1;
}
| rhuitl/uClinux | user/ser/modules/dbtext/dbt_util.c | C | gpl-2.0 | 1,529 |
#CC = gcc
#AR = ar
#DEBUG = -ggdb3 #-DDEBUGTAC
#DEBUG = -s -O -m486
#CFLAGS = -pipe -fPIC -I../include $(DEBUG)
CFLAGS += -fPIC -I../include
LIBRARY = libtac.a
LIBSRCS = connect.c \
header.c \
version.c \
xalloc.c \
messages.c \
hdr_check.c \
attrib.c \
crypt.c \
magic.c \
md5.c \
author_s.c \
author_r.c \
authen_s.c \
authen_r.c \
acct_r.c \
acct_s.c
LIBOBJS = connect.o \
header.o \
version.o \
xalloc.o \
messages.o \
hdr_check.o \
attrib.o \
crypt.o \
magic.o \
md5.o \
author_s.o \
author_r.o \
authen_s.o \
authen_r.o \
acct_r.o \
acct_s.o
.c.o:
$(CC) $(CFLAGS) -c $<
$(LIBRARY): $(LIBOBJS) Makefile
$(AR) rc $(LIBRARY) $(LIBOBJS)
ranlib $(LIBRARY)
clean:
rm -f core $(LIBRARY) $(LIBOBJS)
| rhuitl/uClinux | user/pam_tacplus/libtac/lib/Makefile | Makefile | gpl-2.0 | 800 |
/*
* PROJECT: ReactOS Sound System "MME Buddy" Library
* LICENSE: GPL - See COPYING in the top level directory
* FILE: lib/drivers/sound/mmebuddy/deviceinstance.c
*
* PURPOSE: Manages instances of sound devices.
*
* PROGRAMMERS: Andrew Greenwood ([email protected])
*/
#include "precomp.h"
/*
Restrain ourselves from flooding the kernel device!
*/
#define SOUND_KERNEL_BUFFER_COUNT 10
#define SOUND_KERNEL_BUFFER_SIZE 16384
MMRESULT
AllocateSoundDeviceInstance(
OUT PSOUND_DEVICE_INSTANCE* SoundDeviceInstance)
{
PSOUND_DEVICE_INSTANCE NewInstance;
VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance );
/* Allocate memory for the new instance */
NewInstance = AllocateStruct(SOUND_DEVICE_INSTANCE);
if ( ! NewInstance )
return MMSYSERR_NOMEM;
/* Use default frame size */
NewInstance->FrameSize = SOUND_KERNEL_BUFFER_SIZE;
/* Use default buffer count */
NewInstance->BufferCount = SOUND_KERNEL_BUFFER_COUNT;
/* Provide the caller with the new instance pointer */
*SoundDeviceInstance = NewInstance;
return MMSYSERR_NOERROR;
}
VOID
FreeSoundDeviceInstance(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
{
/*
Device is marked as invalid by now, but we can still do some sanity
checking.
*/
SND_ASSERT( SoundDeviceInstance->Thread == NULL );
ZeroMemory(SoundDeviceInstance, sizeof(SOUND_DEVICE_INSTANCE));
FreeMemory(SoundDeviceInstance);
}
BOOLEAN
IsValidSoundDeviceInstance(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
{
PSOUND_DEVICE SoundDevice;
PSOUND_DEVICE_INSTANCE CurrentInstance;
if ( ! SoundDeviceInstance )
return FALSE;
/* GetSoundDeviceFromInstance would send us into a recursive loop... */
SoundDevice = SoundDeviceInstance->Device;
SND_ASSERT(SoundDevice);
CurrentInstance = SoundDevice->HeadInstance;
while ( CurrentInstance )
{
if ( CurrentInstance == SoundDeviceInstance )
return TRUE;
CurrentInstance = CurrentInstance->Next;
}
return FALSE;
}
MMRESULT
ListSoundDeviceInstance(
IN PSOUND_DEVICE SoundDevice,
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
{
VALIDATE_MMSYS_PARAMETER( IsValidSoundDevice(SoundDevice) );
VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance );
SND_TRACE(L"Listing sound device instance\n");
if ( ! SoundDevice->HeadInstance )
{
/* First entry - assign to head and tail */
SoundDevice->HeadInstance = SoundDeviceInstance;
SoundDevice->TailInstance = SoundDeviceInstance;
}
else
{
/* Attach to the end */
SoundDevice->TailInstance->Next = SoundDeviceInstance;
SoundDevice->TailInstance = SoundDeviceInstance;
}
return MMSYSERR_NOERROR;
}
MMRESULT
UnlistSoundDeviceInstance(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
{
MMRESULT Result;
PSOUND_DEVICE SoundDevice;
PSOUND_DEVICE_INSTANCE CurrentInstance, PreviousInstance;
VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
SND_TRACE(L"Unlisting sound device instance\n");
Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice);
SND_ASSERT( MMSUCCESS(Result) );
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
PreviousInstance = NULL;
CurrentInstance = SoundDevice->HeadInstance;
while ( CurrentInstance )
{
if ( CurrentInstance == SoundDeviceInstance )
{
if ( ! PreviousInstance )
{
/* This is the head node */
SoundDevice->HeadInstance = SoundDevice->HeadInstance->Next;
}
else
{
/* There are nodes before this one - cut ours out */
PreviousInstance->Next = CurrentInstance->Next;
}
if ( ! CurrentInstance->Next )
{
/* This is the tail node */
SoundDevice->TailInstance = PreviousInstance;
}
}
PreviousInstance = CurrentInstance;
CurrentInstance = CurrentInstance->Next;
}
return MMSYSERR_NOERROR;
}
MMRESULT
CreateSoundDeviceInstance(
IN PSOUND_DEVICE SoundDevice,
OUT PSOUND_DEVICE_INSTANCE* SoundDeviceInstance)
{
MMRESULT Result;
PMMFUNCTION_TABLE FunctionTable;
SND_TRACE(L"Creating a sound device instance\n");
VALIDATE_MMSYS_PARAMETER( IsValidSoundDevice(SoundDevice) );
VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance != NULL );
Result = AllocateSoundDeviceInstance(SoundDeviceInstance);
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
/* Get the "open" routine from the function table, and validate it */
Result = GetSoundDeviceFunctionTable(SoundDevice, &FunctionTable);
if ( ! MMSUCCESS(Result) )
{
FreeSoundDeviceInstance(*SoundDeviceInstance);
return TranslateInternalMmResult(Result);
}
if ( FunctionTable->Open == NULL )
{
FreeSoundDeviceInstance(*SoundDeviceInstance);
return MMSYSERR_NOTSUPPORTED;
}
/* Set up the members of the structure */
(*SoundDeviceInstance)->Next = NULL;
(*SoundDeviceInstance)->Device = SoundDevice;
(*SoundDeviceInstance)->Handle = NULL;
(*SoundDeviceInstance)->Thread = NULL;
(*SoundDeviceInstance)->WinMM.Handle = INVALID_HANDLE_VALUE;
(*SoundDeviceInstance)->WinMM.ClientCallback = 0;
(*SoundDeviceInstance)->WinMM.ClientCallbackInstanceData = 0;
(*SoundDeviceInstance)->WinMM.Flags = 0;
/* Initialise the members of the struct used by the sound thread */
(*SoundDeviceInstance)->HeadWaveHeader = NULL;
(*SoundDeviceInstance)->TailWaveHeader = NULL;
(*SoundDeviceInstance)->OutstandingBuffers = 0;
(*SoundDeviceInstance)->LoopsRemaining = 0;
/* Create the streaming thread (TODO - is this for wave only?) */
Result = CreateSoundThread(&(*SoundDeviceInstance)->Thread);
if ( ! MMSUCCESS(Result) )
{
FreeSoundDeviceInstance(*SoundDeviceInstance);
return TranslateInternalMmResult(Result);
}
/* Add the instance to the list */
Result = ListSoundDeviceInstance(SoundDevice, *SoundDeviceInstance);
if ( ! MMSUCCESS(Result) )
{
FreeSoundDeviceInstance(*SoundDeviceInstance);
return TranslateInternalMmResult(Result);
}
/* Try and open the device */
Result = FunctionTable->Open(SoundDevice, (&(*SoundDeviceInstance)->Handle));
if ( ! MMSUCCESS(Result) )
{
UnlistSoundDeviceInstance(*SoundDeviceInstance);
FreeSoundDeviceInstance(*SoundDeviceInstance);
return TranslateInternalMmResult(Result);
}
return MMSYSERR_NOERROR;
}
MMRESULT
DestroySoundDeviceInstance(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
{
MMRESULT Result;
PMMFUNCTION_TABLE FunctionTable;
PSOUND_DEVICE SoundDevice;
PVOID Handle;
SND_TRACE(L"Destroying a sound device instance\n");
VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice);
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
Result = GetSoundDeviceInstanceHandle(SoundDeviceInstance, &Handle);
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
/* Get the "close" routine from the function table, and validate it */
Result = GetSoundDeviceFunctionTable(SoundDevice, &FunctionTable);
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
SND_ASSERT( FunctionTable->Close );
if ( FunctionTable->Close == NULL )
{
/* This indicates bad practice, really! If you can open, why not close?! */
return MMSYSERR_NOTSUPPORTED;
}
/* Stop the streaming thread */
if ( SoundDeviceInstance->Thread )
{
Result = DestroySoundThread(SoundDeviceInstance->Thread);
SND_ASSERT( MMSUCCESS(Result) ); /* It should succeed! */
if ( ! MMSUCCESS(Result ) )
{
return TranslateInternalMmResult(Result);
}
}
/* Blank this out here */
SoundDeviceInstance->Thread = NULL;
/* Try and close the device */
Result = FunctionTable->Close(SoundDeviceInstance, Handle);
SND_ASSERT( MMSUCCESS(Result) ); /* It should succeed! */
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
/* Drop it from the list */
Result = UnlistSoundDeviceInstance(SoundDeviceInstance);
SND_ASSERT( MMSUCCESS(Result) ); /* It should succeed! */
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
FreeSoundDeviceInstance(SoundDeviceInstance);
return MMSYSERR_NOERROR;
}
MMRESULT
DestroyAllSoundDeviceInstances(
IN PSOUND_DEVICE SoundDevice)
{
MMRESULT Result;
PSOUND_DEVICE_INSTANCE SoundDeviceInstance, NextDeviceInstance;
SoundDeviceInstance = SoundDevice->HeadInstance;
while ( SoundDeviceInstance )
{
NextDeviceInstance = SoundDeviceInstance->Next;
Result = DestroySoundDeviceInstance(SoundDeviceInstance);
SND_ASSERT( MMSUCCESS(Result) );
SoundDeviceInstance = NextDeviceInstance;
}
return MMSYSERR_NOERROR;
}
MMRESULT
GetSoundDeviceFromInstance(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
OUT PSOUND_DEVICE* SoundDevice)
{
VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
VALIDATE_MMSYS_PARAMETER( SoundDevice );
*SoundDevice = SoundDeviceInstance->Device;
return MMSYSERR_NOERROR;
}
MMRESULT
GetSoundDeviceInstanceHandle(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
OUT PVOID* Handle)
{
VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
VALIDATE_MMSYS_PARAMETER( Handle );
*Handle = SoundDeviceInstance->Handle;
return MMSYSERR_NOERROR;
}
MMRESULT
SetSoundDeviceInstanceMmeData(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
IN HDRVR MmeHandle,
IN DWORD_PTR ClientCallback,
IN DWORD_PTR ClientCallbackData,
IN DWORD Flags)
{
VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
SND_TRACE(L"Setting MME data - handle %x, callback %x, instance data %x, flags %x\n",
MmeHandle, ClientCallback, ClientCallbackData, Flags);
SoundDeviceInstance->WinMM.Handle = MmeHandle;
SoundDeviceInstance->WinMM.ClientCallback = ClientCallback;
SoundDeviceInstance->WinMM.ClientCallbackInstanceData = ClientCallbackData;
SoundDeviceInstance->WinMM.Flags = Flags;
return MMSYSERR_NOERROR;
}
| sunnyden/reactos | sdk/lib/drivers/sound/mmebuddy/deviceinstance.c | C | gpl-2.0 | 10,774 |
#!/bin/bash
set -e
SYMBOLS=$1
SYMBOLS_FILE=$2
DEPS=`cat "$SRCROOT/$PRODUCT_NAME.ios"`
DEPS=${DEPS//library /-l}
DEPS=${DEPS//framework /-framework }
if [ "$SYMBOLS" != "" ]; then
SYMBOLS="-Wl,-exported_symbol -Wl,${SYMBOLS// / -Wl,-exported_symbol -Wl,}"
fi
if [ -e "$SYMBOLS_FILE" ]; then
SYMBOLS+="-Wl,-exported_symbols_list $SYMBOLS_FILE"
fi
if [ "$STATIC_DEPS" != "" ]; then
DEPS=$STATIC_DEPS
fi
if [ -e $PLATFORM_DEVELOPER_BIN_DIR/g++ ]; then
BIN_DIR=$PLATFORM_DEVELOPER_BIN_DIR
else
BIN_DIR=$DEVELOPER_BIN_DIR
fi
# MW-2011-09-19: Updated to build universal binary version of lcext - by passing
# the process through g++ we get it all for free!
# MW-2013-06-26: [[ CloneAndRun ]] When in 'Debug' mode, don't strip all global symbols.
if [ $CONFIGURATION = "Debug" ]; then
STRIP_OPTIONS="-Wl,-r"
else
STRIP_OPTIONS="-Wl,-r -Wl,-x"
fi
# SN-2015-02019: [[ Bug 14625 ]] We build and link each arch separately, and lipo them
# togother once it's done.
# We still want to produce dylibs for the simulator
if [ "$EFFECTIVE_PLATFORM_NAME" = "-iphonesimulator" ]; then
BUILD_DYLIB=1
else
BUILD_DYLIB=0
fi
# SN-2015-02-19: [[ Bug 14625 ]] Xcode only create FAT headers from iOS SDK 7.0
FAT_INFO=$(otool -fv "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" | grep "Fat headers" || true)
if [ -z "$FAT_INFO" -o $BUILD_DYLIB -eq 1 ]; then
# We set the minimum iOS or simulator version
if [ $BUILD_DYLIB -eq 1 ]; then
MIN_OS_VERSION="-mios-simulator-version-min=5.1.1"
else
MIN_OS_VERSION="-miphoneos-version-min=5.1.1"
fi
ARCHS="-arch ${ARCHS// / -arch }"
if [ $BUILD_DYLIB -eq 1 ]; then
$BIN_DIR/g++ -stdlib=libc++ -dynamiclib ${ARCHS} $MIN_OS_VERSION -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dylib" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -dead_strip -Wl,-x $SYMBOLS $DEPS
fi
if [ $? -ne 0 ]; then
exit $?
fi
$BIN_DIR/g++ -stdlib=libc++ -nodefaultlibs $STRIP_OPTIONS ${ARCHS} $MIN_OS_VERSION -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,"$SRCROOT/$PRODUCT_NAME.ios" -Wl,-exported_symbol -Wl,___libinfoptr_$PRODUCT_NAME $STATIC_DEPS
if [ $? -ne 0 ]; then
exit $?
fi
else
# Only executed if the binaries have a FAT header, and we need an architecture-specific
# linking
LCEXT_FILE_LIST=""
DYLIB_FILE_LIST=""
# Link architecture-specifically the libraries
for ARCH in $(echo $ARCHS | tr " " "\n")
do
LCEXT_FILE="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext_${ARCH}"
DYLIB_FILE="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dylib_${ARCH}"
# arm64 is only from iOS 7.0.0
if [ ${ARCH} = "arm64" -o ${ARCH} = "x86_64" ]; then
MIN_VERSION="7.0.0"
else
MIN_VERSION="5.1.1"
fi
if [ $BUILD_DYLIB -eq 1 ]; then
OUTPUT=$($BIN_DIR/g++ -stdlib=libc++ -dynamiclib -arch ${ARCH} -miphoneos-version-min=${MIN_VERSION} -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "${DYLIB_FILE}" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -dead_strip -Wl,-x $SYMBOLS $DEPS)
if [ $? -ne 0 ]; then
echo "Linking ""${DYLIB_FILE}""failed:"
echo $OUTPUT
exit $?
fi
fi
OUTPUT=$($BIN_DIR/g++ -stdlib=libc++ -nodefaultlibs $STRIP_OPTIONS -arch ${ARCH} -miphoneos-version-min=${MIN_VERSION} -isysroot $SDKROOT -L"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME" -o "${LCEXT_FILE}" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,"$SRCROOT/$PRODUCT_NAME.ios" -Wl,-exported_symbol -Wl,___libinfoptr_$PRODUCT_NAME $STATIC_DEPS)
if [ $? -ne 0 ]; then
echo "Linking ""${LCEXT_FILE}""failed:"
echo $OUTPUT
exit $?
fi
LCEXT_FILE_LIST+=" ${LCEXT_FILE}"
DYLIB_FILE_LIST+=" ${DYLIB_FILE}"
done
# Lipo the generated libs
lipo -create ${LCEXT_FILE_LIST} -output "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext"
# Cleanup the lcext_$ARCH files generated
rm ${LCEXT_FILE_LIST}
if [ $BUILD_DYLIB -eq 1 ]; then
lipo -create ${DYLIB_FILE_LIST} -output "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.dylib"
rm ${DYLIB_FILE_LIST}
fi
fi
if [ $BUILD_DYLIB -eq 1 ]; then
ln -sf "$PRODUCT_NAME.dylib" "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.ios-extension"
else
ln -sf "$PRODUCT_NAME.lcext" "$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.ios-extension"
fi
| PaulMcClernan/livecode | tools/build-extension-ios.sh | Shell | gpl-3.0 | 4,365 |
๏ปฟ#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright ยฉ 2007-2015 ShareX Developers
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.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using ShareX.UploadersLib.Properties;
using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace ShareX.UploadersLib.HelperClasses
{
internal class CertFileNameEditor : FileNameEditor
{
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
if (context == null || provider == null)
{
return base.EditValue(context, provider, value);
}
using (OpenFileDialog dlg = new OpenFileDialog())
{
dlg.Title = Resources.CertFileNameEditor_EditValue_Browse_for_a_certificate_file___;
dlg.Filter = "Certification (*.cer)|*.cer";
if (dlg.ShowDialog() == DialogResult.OK)
{
value = dlg.FileName;
}
}
return value;
}
}
} | Upload/ShareX | ShareX.UploadersLib/HelperClasses/CertFileNameEditor.cs | C# | gpl-3.0 | 1,976 |
Array.new(3).s
| plexus/.emacs.d | rcodetools-0.8.5.0/test/data/attic/completion_class_info-input.rb | Ruby | gpl-3.0 | 15 |
๏ปฟ//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Votations.NSurvey.WebAdmin.NSurveyAdmin {
public partial class DataImport {
/// <summary>
/// MessageLabel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label MessageLabel;
/// <summary>
/// DataImportTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal DataImportTitle;
/// <summary>
/// importFilelabel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label importFilelabel;
/// <summary>
/// fupDataFile control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.FileUpload fupDataFile;
/// <summary>
/// dataSelectionLabel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label dataSelectionLabel;
/// <summary>
/// rbAll control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RadioButton rbAll;
/// <summary>
/// rbSelRange control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RadioButton rbSelRange;
/// <summary>
/// importFromLabel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label importFromLabel;
/// <summary>
/// txtFrom control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFrom;
/// <summary>
/// importTolabel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label importTolabel;
/// <summary>
/// txtTo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtTo;
/// <summary>
/// btnImport control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnImport;
}
}
| samdubey/surveyproject_main_public | SurveyWAP/NSurveyAdmin/DataImport.aspx.designer.cs | C# | gpl-3.0 | 4,364 |
package org.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* The XMLTokener extends the JSONTokener to provide additional methods
* for the parsing of XML texts.
* @author JSON.org
* @version 2010-01-30
*/
public class XMLTokener extends JSONTokener {
/** The table of entity values. It initially contains Character values for
* amp, apos, gt, lt, quot.
*/
public static final java.util.HashMap entity;
static {
entity = new java.util.HashMap(8);
entity.put("amp", XML.AMP);
entity.put("apos", XML.APOS);
entity.put("gt", XML.GT);
entity.put("lt", XML.LT);
entity.put("quot", XML.QUOT);
}
/**
* Construct an XMLTokener from a string.
* @param s A source string.
*/
public XMLTokener(String s) {
super(s);
}
/**
* Get the text in the CDATA block.
* @return The string up to the <code>]]></code>.
* @throws JSONException If the <code>]]></code> is not found.
*/
public String nextCDATA() throws JSONException {
char c;
int i;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
if (end()) {
throw syntaxError("Unclosed CDATA");
}
sb.append(c);
i = sb.length() - 3;
if (i >= 0 && sb.charAt(i) == ']' &&
sb.charAt(i + 1) == ']' && sb.charAt(i + 2) == '>') {
sb.setLength(i);
return sb.toString();
}
}
}
/**
* Get the next XML outer token, trimming whitespace. There are two kinds
* of tokens: the '<' character which begins a markup tag, and the content
* text between markup tags.
*
* @return A string, or a '<' Character, or null if there is no more
* source text.
* @throws JSONException
*/
public Object nextContent() throws JSONException {
char c;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new StringBuffer();
for (;;) {
if (c == '<' || c == 0) {
back();
return sb.toString().trim();
}
if (c == '&') {
sb.append(nextEntity(c));
} else {
sb.append(c);
}
c = next();
}
}
/**
* Return the next entity. These entities are translated to Characters:
* <code>& ' > < "</code>.
* @param a An ampersand character.
* @return A Character or an entity String if the entity is not recognized.
* @throws JSONException If missing ';' in XML entity.
*/
public Object nextEntity(char a) throws JSONException {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (Character.isLetterOrDigit(c) || c == '#') {
sb.append(Character.toLowerCase(c));
} else if (c == ';') {
break;
} else {
throw syntaxError("Missing ';' in XML entity: &" + sb);
}
}
String s = sb.toString();
Object e = entity.get(s);
return e != null ? e : a + s + ";";
}
/**
* Returns the next XML meta token. This is used for skipping over <!...>
* and <?...?> structures.
* @return Syntax characters (<code>< > / = ! ?</code>) are returned as
* Character, and strings and names are returned as Boolean. We don't care
* what the values actually are.
* @throws JSONException If a string is not properly closed or if the XML
* is badly structured.
*/
public Object nextMeta() throws JSONException {
char c;
char q;
do {
c = next();
} while (Character.isWhitespace(c));
switch (c) {
case 0:
throw syntaxError("Misshaped meta tag");
case '<':
return XML.LT;
case '>':
return XML.GT;
case '/':
return XML.SLASH;
case '=':
return XML.EQ;
case '!':
return XML.BANG;
case '?':
return XML.QUEST;
case '"':
case '\'':
q = c;
for (;;) {
c = next();
if (c == 0) {
throw syntaxError("Unterminated string");
}
if (c == q) {
return Boolean.TRUE;
}
}
default:
for (;;) {
c = next();
if (Character.isWhitespace(c)) {
return Boolean.TRUE;
}
switch (c) {
case 0:
case '<':
case '>':
case '/':
case '=':
case '!':
case '?':
case '"':
case '\'':
back();
return Boolean.TRUE;
}
}
}
}
/**
* Get the next XML Token. These tokens are found inside of angle
* brackets. It may be one of these characters: <code>/ > = ! ?</code> or it
* may be a string wrapped in single quotes or double quotes, or it may be a
* name.
* @return a String or a Character.
* @throws JSONException If the XML is not well formed.
*/
public Object nextToken() throws JSONException {
char c;
char q;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
switch (c) {
case 0:
throw syntaxError("Misshaped element");
case '<':
throw syntaxError("Misplaced '<'");
case '>':
return XML.GT;
case '/':
return XML.SLASH;
case '=':
return XML.EQ;
case '!':
return XML.BANG;
case '?':
return XML.QUEST;
// Quoted string
case '"':
case '\'':
q = c;
sb = new StringBuffer();
for (;;) {
c = next();
if (c == 0) {
throw syntaxError("Unterminated string");
}
if (c == q) {
return sb.toString();
}
if (c == '&') {
sb.append(nextEntity(c));
} else {
sb.append(c);
}
}
default:
// Name
sb = new StringBuffer();
for (;;) {
sb.append(c);
c = next();
if (Character.isWhitespace(c)) {
return sb.toString();
}
switch (c) {
case 0:
return sb.toString();
case '>':
case '/':
case '=':
case '!':
case '?':
case '[':
case ']':
back();
return sb.toString();
case '<':
case '"':
case '\'':
throw syntaxError("Bad character in a name");
}
}
}
}
/**
* Skip characters until past the requested string.
* If it is not found, we are left at the end of the source with a result of false.
* @param to A string to skip past.
* @throws JSONException
*/
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int n = to.length();
char[] circle = new char[n];
/*
* First fill the circle buffer with as many characters as are in the
* to string. If we reach an early end, bail.
*/
for (i = 0; i < n; i += 1) {
c = next();
if (c == 0) {
return false;
}
circle[i] = c;
}
/*
* We will loop, possibly for all of the remaining characters.
*/
for (;;) {
j = offset;
b = true;
/*
* Compare the circle buffer with the to string.
*/
for (i = 0; i < n; i += 1) {
if (circle[j] != to.charAt(i)) {
b = false;
break;
}
j += 1;
if (j >= n) {
j -= n;
}
}
/*
* If we exit the loop with b intact, then victory is ours.
*/
if (b) {
return true;
}
/*
* Get the next character. If there isn't one, then defeat is ours.
*/
c = next();
if (c == 0) {
return false;
}
/*
* Shove the character in the circle buffer and advance the
* circle offset. The offset is mod n.
*/
circle[offset] = c;
offset += 1;
if (offset >= n) {
offset -= n;
}
}
}
}
| sergeyk93/tdai-finalproject | src/org/json/XMLTokener.java | Java | gpl-3.0 | 10,299 |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { getResponseData, getErrorCount } from '../../../utils';
import HoverPaper from '../../atoms/hover-paper';
import HR from '../../atoms/hr';
import ResponseTable from '../../cels/response-table';
import LayerSelect from '../../cels/layer-select';
import styles from './styles';
import actions from './actions';
const mapStateToProps = (state) => ({
errorNumber: state.wsLayerError.response,
interval: state.interval.interval,
response: state.wsLayerResponse.response,
timestamp: state.interval.timestamp,
owsService: state.wsService.service,
});
@connect(mapStateToProps, actions)
class WSLayerAnalytics extends React.Component {
static propTypes = {
errorNumber: PropTypes.object,
getErrors: PropTypes.func.isRequired,
getResponses: PropTypes.func.isRequired,
interval: PropTypes.number,
resetErrors: PropTypes.func.isRequired,
resetResponses: PropTypes.func.isRequired,
response: PropTypes.object,
timestamp: PropTypes.instanceOf(Date),
owsService: PropTypes.string,
}
constructor(props) {
super(props);
this.get = (layer, interval = this.props.interval, owsService = this.props.owsService) => {
this.setState({ layer });
this.props.getErrors(interval, layer, owsService);
this.props.getResponses(interval, layer, owsService);
};
this.reset = () => {
this.props.resetErrors();
this.props.resetResponses();
};
}
componentWillReceiveProps({ timestamp, owsService, interval }) {
if ((timestamp !== this.props.timestamp || owsService !== this.props.owsService)
&& this.state && this.state.layer) {
this.get(this.state.layer, interval, owsService);
}
}
componentWillUnmount() {
this.reset();
}
render() {
let average = 0;
let max = 0;
let requests = 0;
[
average,
max,
requests,
] = getResponseData(this.props.response);
const errorNumber = getErrorCount(this.props.errorNumber);
return (
<HoverPaper style={styles.content}>
<div style={styles.header}>
<h3>W*S Layers Analytics</h3>
<LayerSelect onChange={this.get} />
</div>
<HR />
<ResponseTable
average={average}
max={max}
requests={requests}
errorNumber={errorNumber}
/>
</HoverPaper>
);
}
}
export default WSLayerAnalytics;
| ppasq/geonode | geonode/monitoring/frontend/src/components/organisms/ws-layers-analytics/index.js | JavaScript | gpl-3.0 | 2,499 |
<?php
/* Copyright (C) 2005-2014 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2012 Regis Houssin <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \defgroup deplacement Module trips
* \brief Module pour gerer les deplacements et notes de frais
* \file htdocs/core/modules/modDeplacement.class.php
* \ingroup deplacement
* \brief Fichier de description et activation du module Deplacement et notes de frais
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* Class to describe and enable module Deplacement
*/
class modDeplacement extends DolibarrModules
{
/**
* Constructor. Define names, constants, directories, boxes, permissions
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
global $conf, $user;
$this->db = $db;
$this->numero = 75 ;
$this->family = "hr";
$this->module_position = 41;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des notes de frais et deplacements"; // Si traduction Module75Desc non trouvee
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'dolibarr_deprecated';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = "trip";
// Data directories to create when module is enabled
$this->dirs = array();
// Config pages
$this->config_page_url = array();
$this->langfiles = array("companies","trips");
// Dependancies
$this->depends = array();
$this->requiredby = array();
// Constants
$this->const = array();
// Boxes
$this->boxes = array();
// Permissions
$this->rights = array();
$this->rights_class = 'deplacement';
$this->rights[1][0] = 171;
$this->rights[1][1] = 'Lire ses notes de frais et deplacements et celles de sa hierarchy';
$this->rights[1][2] = 'r';
$this->rights[1][3] = 1;
$this->rights[1][4] = 'lire';
$this->rights[2][0] = 172;
$this->rights[2][1] = 'Creer/modifier une note de frais et deplacements';
$this->rights[2][2] = 'w';
$this->rights[2][3] = 0;
$this->rights[2][4] = 'creer';
$this->rights[3][0] = 173;
$this->rights[3][1] = 'Supprimer les notes de frais et deplacements';
$this->rights[3][2] = 'd';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'supprimer';
$this->rights[4][0] = 174;
$this->rights[4][1] = 'Lire toutes les notes de frais';
$this->rights[4][2] = 'd';
$this->rights[4][3] = 0;
$this->rights[4][4] = 'readall';
$this->rights[5][0] = 178;
$this->rights[5][1] = 'Exporter les notes de frais et deplacements';
$this->rights[5][2] = 'd';
$this->rights[5][3] = 0;
$this->rights[5][4] = 'export';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
$r=0;
$r++;
$this->export_code[$r]='trips_'.$r;
$this->export_label[$r]='ListTripsAndExpenses';
$this->export_permission[$r]=array(array("deplacement","export"));
$this->export_fields_array[$r]=array('u.login'=>'Login','u.lastname'=>'Lastname','u.firstname'=>'Firstname','d.rowid'=>"TripId",'d.type'=>"Type",'d.km'=>"FeesKilometersOrAmout",'d.dated'=>"Date",'d.note_private'=>'NotePrivate','d.note_public'=>'NotePublic','s.nom'=>'ThirdParty');
$this->export_TypeFields_array[$r]=array('u.rowid'=>'List:user:name','u.login'=>'Text','u.lastname'=>'Text','u.firstname'=>'Text','d.type'=>"Text",'d.km'=>"Numeric",'d.dated'=>"Date",'d.note_private'=>'Text','d.note_public'=>'Text','s.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text');
$this->export_entities_array[$r]=array('u.login'=>'user','u.lastname'=>'user','u.firstname'=>'user','d.rowid'=>"trip",'d.type'=>"trip",'d.km'=>"trip",'d.dated'=>"trip",'d.note_private'=>'trip','d.note_public'=>'trip','s.nom'=>'company');
$this->export_dependencies_array[$r]=array('trip'=>'d.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u';
$this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'deplacement as d';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON d.fk_soc = s.rowid';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid';
$this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement',1).')';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR d.fk_soc IS NULL)';
if (! empty($user)) // Not defined during migration process
{
$childids = $user->getAllChildIds();
$childids[]=$user->id;
if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')';
}
}
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function init($options='')
{
// Permissions
$this->remove($options);
$sql = array();
return $this->_init($sql,$options);
}
}
| philippe-opendsi/dolibarr | htdocs/core/modules/modDeplacement.class.php | PHP | gpl-3.0 | 6,442 |
url: http://sanskrit.inria.fr/cgi-bin/SKT/sktreader?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=vyaaptirasti;topic=;abs=f;allSol=2;mode=p;cpts=<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Sanskrit Reader Companion</title>
<meta name="author" content="Gérard Huet">
<meta property="dc:datecopyrighted" content="2016">
<meta property="dc:rightsholder" content="Gérard Huet">
<meta name="keywords" content="dictionary,sanskrit,heritage,dictionnaire,sanscrit,india,inde,indology,linguistics,panini,digital humanities,cultural heritage,computational linguistics,hypertext lexicon">
<link rel="stylesheet" type="text/css" href="http://sanskrit.inria.fr/DICO/style.css" media="screen,tv">
<link rel="shortcut icon" href="http://sanskrit.inria.fr/IMAGES/favicon.ico">
<script type="text/javascript" src="http://sanskrit.inria.fr/DICO/utf82VH.js"></script>
</head>
<body class="chamois_back">
<br><h1 class="title">The Sanskrit Reader Companion</h1>
<table class="chamois_back" border="0" cellpadding="0%" cellspacing="15pt" width="100%">
<tr><td>
<p align="center">
<div class="latin16"><a class="green" href="/cgi-bin/SKT/sktgraph?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=vyaaptirasti;topic=;abs=f;cpts=;mode=g">✓</a> Show Summary of Solutions
</p>
Input:
<span class="red16">vyāptirasti</span><hr>
<br>
Sentence:
<span class="deva16" lang="sa">व्याप्तिरस्ति</span><br>
may be analysed as:</div><br>
<hr>
<span class="blue">Solution 1 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=vyaaptirasti;topic=;abs=f;cpts=;mode=p;n=1">✓</a></span><br>
[ <span class="blue" title="0"><b>vyāptiḥ</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/62.html#vyaapti"><i>vyāpti</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">ḥ</span><span class="green">|</span><span class="magenta">a</span><span class="blue"> → </span><span class="red">ra</span>⟩]
<br>
[ <span class="blue" title="7"><b>asti</b></span><table class="carmin_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ pr. [2] ac. sg. 3 }[<a class="navy" href="http://sanskrit.inria.fr/DICO/7.html#as#1"><i>as_1</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="magenta">1</span><span class="blue"> solution</span><span class="blue"> kept among </span><span class="magenta">1</span><br>
<br>
<hr>
<br>
<br>
</td></tr></table>
<table class="pad60">
<tr><td></td></tr></table>
<div class="enpied">
<table class="bandeau"><tr><td>
<a href="http://ocaml.org"><img src="http://sanskrit.inria.fr/IMAGES/ocaml.gif" alt="Le chameau Ocaml" height="50"></a>
</td><td>
<table class="center">
<tr><td>
<a href="http://sanskrit.inria.fr/index.fr.html"><b>Top</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html"><b>Index</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html#stemmer"><b>Stemmer</b></a> |
<a href="http://sanskrit.inria.fr/DICO/grammar.fr.html"><b>Grammar</b></a> |
<a href="http://sanskrit.inria.fr/DICO/sandhi.fr.html"><b>Sandhi</b></a> |
<a href="http://sanskrit.inria.fr/DICO/reader.fr.html"><b>Reader</b></a> |
<a href="http://sanskrit.inria.fr/faq.fr.html"><b>Help</b></a> |
<a href="http://sanskrit.inria.fr/portal.fr.html"><b>Portal</b></a>
</td></tr><tr><td>
© Gérard Huet 1994-2016</td></tr></table></td><td>
<a href="http://www.inria.fr/"><img src="http://sanskrit.inria.fr/IMAGES/logo_inria.png" alt="Logo Inria" height="50"></a>
<br></td></tr></table></div>
</body>
</html>
| sanskritiitd/sanskrit | uohCorpus.fil/uoh/uoh.filteredcorpus.txt_output/nyayasara-ext.txt.out.dict_9253_inr.html | HTML | gpl-3.0 | 3,773 |
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
#include "spice.h"
#include <stdio.h>
#include "iferrmsg.h"
#include "util.h"
#include "inpdefs.h"
#include "strext.h"
#include "suffix.h"
/*ARGSUSED*/
char *
INPdomodel(ckt,image,tab)
GENERIC *ckt;
card *image;
INPtables *tab;
{
char *modname;
int type;
int lev;
char *typename;
char *err = (char *)NULL;
char *line;
line = image->line;
INPgetTok(&line,&modname,1); /* throw away '.model' */
INPgetTok(&line,&modname,1);
INPinsert(&modname,tab);
INPgetTok(&line,&typename,1);
if( (strcmp(typename,"npn") == 0)||(strcmp(typename,"pnp")==0) ) {
type = INPtypelook("BJT");
if(type < 0) {
err = INPmkTemp("Device type BJT not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if(strcmp(typename,"d") == 0) {
type = INPtypelook("Diode");
if(type < 0) {
err = INPmkTemp("Device type Diode not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if( (strcmp(typename,"njf") == 0) || (strcmp(typename,"pjf") == 0)){
type = INPtypelook("JFET");
if(type < 0) {
err = INPmkTemp("Device type JFET not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if( (strcmp(typename,"nmf") == 0) || (strcmp(typename,"pmf")==0) ) {
type = INPtypelook("MES");
if(type < 0) {
err = INPmkTemp("Device type MES not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if(strcmp(typename,"urc") == 0) {
type = INPtypelook("URC");
if(type < 0) {
err = INPmkTemp("Device type URC not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if( (strcmp(typename,"nmos")==0) || (strcmp(typename,"pmos")==0) ) {
err = INPfindLev(line,&lev);
switch(lev) {
case 0:
case 1:
type = INPtypelook("Mos1");
if(type < 0) {
err = INPmkTemp(
"Device type MOS1 not available in this binary\n");
}
break;
case 2:
type = INPtypelook("Mos2");
if(type < 0) {
err = INPmkTemp(
"Device type MOS2 not available in this binary\n");
}
break;
case 3:
type = INPtypelook("Mos3");
if(type < 0) {
err = INPmkTemp(
"Device type MOS3 not available in this binary\n");
}
break;
case 4:
type = INPtypelook("BSIM1");
if(type < 0) {
err = INPmkTemp(
"Device type BSIM1 not available in this binary\n");
}
break;
case 5:
type = INPtypelook("BSIM2");
if(type < 0) {
err = INPmkTemp(
"Device type BSIM2 not available in this binary\n");
}
break;
case 6:
type = INPtypelook("Mos6");
if(type < 0) {
err = INPmkTemp(
"Device type MOS6 not available in this binary\n");
}
break;
case 8:
type = INPtypelook("BSIM3");
if(type < 0) {
err = INPmkTemp(
"Device type BSIM3 not available in this binary\n");
}
break;
case 9:
type = INPtypelook("B3SOI");
if(type < 0) {
err = INPmkTemp(
"Device type yak! B3SOI not available in this binary\n");
}
break;
case 10:
type = INPtypelook("B4SOI");
if(type < 0) {
err = INPmkTemp(
"Device type yak! B4SOI not available in this binary\n");
}
break;
case 14:
type = INPtypelook("BSIM4");
if(type < 0) {
err = INPmkTemp(
"Device type BSIM3 not available in this binary\n");
}
break;
case 15:
type = INPtypelook("BSIM5");
if(type < 0) {
err = INPmkTemp(
"Device type BSIM3 not available in this binary\n");
}
break;
case 16:
type = INPtypelook("BSIM6");
if(type < 0) {
err = INPmkTemp(
"Placeholder: Device type BSIM6 not available in this binary\n");
}
break;
case 19:
type = INPtypelook("HiSIM1");
if(type < 0) {
err = INPmkTemp(
"Placeholder: Device type BSIM6 not available in this binary\n");
}
break;
default: /* Use level 17 or higher levels for the other models */
err = INPmkTemp(
"Only MOS device levels 1-20 are supported in this binary\n");
break;
}
INPmakeMod(modname,type,image);
} else if(strcmp(typename,"r") == 0) {
type = INPtypelook("Resistor");
if(type < 0) {
err = INPmkTemp(
"Device type Resistor not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if(strcmp(typename,"c") == 0) {
type = INPtypelook("Capacitor");
if(type < 0) {
err = INPmkTemp(
"Device type Capacitor not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if(strcmp(typename,"sw") == 0) {
type = INPtypelook("Switch");
if(type < 0) {
err = INPmkTemp(
"Device type Switch not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if(strcmp(typename,"csw") == 0) {
type = INPtypelook("CSwitch");
if(type < 0) {
err = INPmkTemp(
"Device type CSwitch not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else if(strcmp(typename,"ltra") == 0) {
type = INPtypelook("LTRA");
if(type < 0) {
err = INPmkTemp(
"Device type LTRA not available in this binary\n");
}
INPmakeMod(modname,type,image);
} else {
type = -1;
err = (char *)MALLOC(35 + strlen(typename));
(void)sprintf(err,"unknown model type %s - ignored\n",typename);
}
return(err);
}
| sksavant/gnucap | models-bsim/BSIMSOI4p2/inpdomod.c | C | gpl-3.0 | 7,088 |
<?php
/**
* Kunena Component
* @package Kunena.Administrator.Template
* @subpackage Config
*
* @copyright (C) 2008 - 2015 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.kunena.org
**/
defined ( '_JEXEC' ) or die ();
/** @var KunenaAdminViewConfig $this */
?>
<div id="kunena" class="admin override">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="j-sidebar-container" class="span2">
<div id="sidebar">
<div class="sidebar-nav"><?php include KPATH_ADMIN.'/template/joomla25/common/menu.php'; ?></div>
</div>
</div>
<div id="j-main-container" class="span10">
<form action="<?php echo KunenaRoute::_('administrator/index.php?option=com_kunena') ?>" method="post" id="adminForm" name="adminForm">
<input type="hidden" name="view" value="config" />
<input type="hidden" name="task" value="" />
<?php echo JHtml::_( 'form.token' ) ?>
<div class="data-container">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_basics" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_BASICS'); ?></a></li>
<li><a href="#tab_frontend" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_FRONTEND'); ?></a></li>
<li><a href="#tab_users" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_USERS'); ?></a></li>
<li><a href="#tab_security" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_SECURITY'); ?></a></li>
<li><a href="#tab_avatars" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_AVATARS'); ?></a></li>
<li><a href="#tab_uploads" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_UPLOADS'); ?></a></li>
<li><a href="#tab_ranking" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_RANKING'); ?></a></li>
<li><a href="#tab_bbcode" data-toggle="tab"><?php echo JText::_('COM_KUNENA_A_BBCODE'); ?></a></li>
<li><a href="#tab_rss" data-toggle="tab"><?php echo JText::_('COM_KUNENA_ADMIN_RSS'); ?></a></li>
<li><a href="#tab_extra" data-toggle="tab"><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_EXTRA'); ?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_basics">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_BASIC_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_BOARD_TITLE') ?></td>
<td><input type="text" name="cfg_board_title" value="<?php echo $this->escape ( $this->config->board_title ) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_BOARD_TITLE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_EMAIL') ?></td>
<td><input type="text" name="cfg_email" value="<?php echo $this->escape($this->config->email) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_EMAIL_DESC2') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SEND_EMAILS') ?></td>
<td><?php echo $this->lists ['send_emails'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SEND_EMAILS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_BOARD_OFFLINE') ?></td>
<td><?php echo $this->lists ['board_offline'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_BOARD_OFFLINE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_BOARD_OFFLINE_MES') ?></td>
<td colspan="2">
<textarea name="cfg_offline_message" rows="3" cols="50"><?php echo $this->escape ( $this->config->offline_message ) ?></textarea>
</td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_KUNENA_SESSION_TIMEOUT') ?>
</td>
<td><input type="text"
name="cfg_sessiontimeout"
value="<?php echo $this->escape($this->config->sessiontimeout);
?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_KUNENA_SESSION_TIMEOUT_DESC') ?>
</td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS') ?></td>
<td><?php echo $this->lists ['enablerss'] ?></td>
<td><img src="<?php echo JUri::base(true) ?>/components/com_kunena/media/icons/small/livemarks.png" alt="" /> <?php echo JText::_('COM_KUNENA_A_RSS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_DEBUG_MODE') ?></td>
<td><?php echo $this->lists ['debug'] ?></td>
<td><?php echo JText::_('COM_KUNENA_DEBUG_MODE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_FALLBACK_ENGLISH') ?></td>
<td><?php echo $this->lists ['fallback_english'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CFG_FALLBACK_ENGLISH_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_TIME_TO_CREATEPAGE') ?></td>
<td><?php echo $this->lists ['time_to_create_page'] ?></td>
<td><?php echo JText::_('COM_KUNENA_TIME_TO_CREATEPAGE_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_SEO_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_SEF') ?></td>
<td><?php echo $this->lists ['sef'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SEF_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_ACCESS_COMPONENT') ?></td>
<td><?php echo $this->lists ['access_component'] ?></td>
<td><?php echo JText::sprintf('COM_KUNENA_CFG_ACCESS_COMPONENT_DESC', $this->lists ['componentUrl'], JText::_('JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND')) ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_LEGACY_URLS') ?></td>
<td><?php echo $this->lists ['legacy_urls'] ?></td>
<td><?php echo JText::sprintf('COM_KUNENA_CFG_LEGACY_URLS_DESC', $this->lists['legacy_urls_version'], $this->lists['legacy_urls_desc']) ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_CACHING_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_CACHE') ?></td>
<td><?php echo $this->lists ['cache'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CFG_CACHE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_CACHE_TIME') ?></td>
<td><?php echo $this->lists ['cache_time'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CFG_CACHE_TIME_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_frontend">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_LOOKS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_THREADS') ?></td>
<td><input type="text" name="cfg_threads_per_page" value="<?php echo $this->escape($this->config->threads_per_page) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_THREADS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_MESSAGES') ?></td>
<td><input type="text" name="cfg_messages_per_page" value="<?php echo $this->escape($this->config->messages_per_page) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_MESSAGES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_MESSAGES_SEARCH') ?></td>
<td><input type="text" name="cfg_messages_per_page_search" value="<?php echo $this->escape($this->config->messages_per_page_search) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_MESSAGES_DESC_SEARCH') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_HISTORY') ?></td>
<td><?php echo $this->lists ['showhistory'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_HISTORY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_HISTLIM') ?></td>
<td><input type="text" name="cfg_historylimit" value="<?php echo $this->escape($this->config->historylimit) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_HISTLIM_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_POST_DATEFORMAT') ?></td>
<td><?php echo $this->lists ['post_dateformat'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CFG_POST_DATEFORMAT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_POST_DATEFORMAT_HOVER') ?></td>
<td><?php echo $this->lists ['post_dateformat_hover'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CFG_POST_DATEFORMAT_HOVER_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SHOWNEW') ?></td>
<td><?php echo $this->lists ['shownew'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SHOWNEW_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_SHOW_ANNOUNCEMENT') ?></td>
<td><?php echo $this->lists ['showannouncement'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SHOW_ANNOUNCEMENT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_SHOW_AVATAR_ON_CAT') ?></td>
<td><?php echo $this->lists ['avataroncat'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SHOW_AVATAR_ON_CAT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_LISTCAT_SHOW_MODERATORS') ?></td>
<td><?php echo $this->lists ['listcat_show_moderators'] ?></td>
<td><?php echo JText::_('COM_KUNENA_LISTCAT_SHOW_MODERATORS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CATIMAGEPATH') ?></td>
<td><input type="text" name="cfg_catimagepath" value="<?php echo $this->escape($this->config->catimagepath) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_CATIMAGEPATH_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_SHOW_CHILD_CATEGORY_ON_LIST') ?></td>
<td><?php echo $this->lists ['showchildcaticon'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SHOW_CHILD_CATEGORY_ON_LIST_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_TAWIDTH') ?></td>
<td><input type="text" name="cfg_rtewidth" value="<?php echo $this->escape($this->config->rtewidth) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_TAWIDTH_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_TAHEIGHT') ?></td>
<td><input type="text" name="cfg_rteheight" value="<?php echo $this->escape($this->config->rteheight) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_TAHEIGHT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_FORUM_JUMP') ?></td>
<td><?php echo $this->lists ['enableforumjump'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_FORUM_JUMP_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_REPORT') ?></td>
<td><?php echo $this->lists ['reportmsg'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_REPORT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_ORDERING_SYSTEM') ?></td>
<td><?php echo $this->lists ['ordering_system'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_REPORT_ORDERING_SYSTEM_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_HIDE_IP') ?></td>
<td><?php echo $this->lists ['hide_ip'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_HIDE_IP_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_LATESTCATEGORY_IN') ?></td>
<td><?php echo $this->lists ['latestcategory_in'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_LATESTCATEGORY_IN_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_LATESTCATEGORY') ?></td>
<td><?php echo $this->lists ['latestcategory'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_LATESTCATEGORY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_TOPICICONS') ?></td>
<td><?php echo $this->lists ['topicicons'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_TOPCIICONS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_ENABLELIGHTBOX') ?></td>
<td><?php echo $this->lists ['lightbox'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_ENABLELIGHTBOX_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_SHOW_TOPICS_FROM_LAST_TIME') ?></td>
<td><?php echo $this->lists ['show_list_time'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_SHOW_TOPICS_FROM_LAST_TIME_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_USER_SESSIONS_TYPE') ?></td>
<td><?php echo $this->lists ['show_session_type'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_SESSIONS_TYPE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_USER_SESSIONS_START_TIME') ?></td>
<td><input type="text" name="cfg_show_session_starttime" value="<?php echo $this->escape($this->config->show_session_starttime) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_SESSIONS_START_TIME_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_WAY_COUNT_USERS_USERLIST') ?></td>
<td><?php echo $this->lists ['userlist_count_users'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_WAY_COUNT_USERS_USERLIST_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_TOPIC_LAYOUT') ?></td>
<td><?php echo $this->lists ['topic_layout'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_TOPIC_LAYOUT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_ENABLE_THREADED_LAYOUTS') ?></td>
<td><?php echo $this->lists ['enable_threaded_layouts'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_ENABLE_THREADED_LAYOUTS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_PICKUP_CATEGORY') ?></td>
<td><?php echo $this->lists ['pickup_category'] ?></td>
<td><?php echo JText::_('COM_KUNENA_PICKUP_CATEGORY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_ARTICLE_DISPLAY') ?></td>
<td><?php echo $this->lists ['article_display'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_ARTICLE_DISPLAY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_DEFAULT_SORT') ?></td>
<td><?php echo $this->lists ['default_sort'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CFG_DEFAULT_SORT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CFG_SEARCH_TIME') ?></td>
<td><?php echo $this->lists ['searchtime'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CFG_SEARCH_TIME_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ALLOW_CHANGE_SUBJECT_REPLIES_LABEL') ?></td>
<td><?php echo $this->lists ['allow_change_subject'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ALLOW_CHANGE_SUBJECT_REPLIES_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_LENGTHS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SUBJECTLENGTH') ?></td>
<td><input type="text" name="cfg_maxsubject" value="<?php echo $this->escape($this->config->maxsubject) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_SUBJECTLENGTH_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SIGNATURE') ?></td>
<td><input type="text" name="cfg_maxsig" value="<?php echo $this->escape($this->config->maxsig) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_SIGNATURE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_PESONNALTEXT') ?></td>
<td><input type="text" name="cfg_maxpersotext" value="<?php echo $this->escape($this->config->maxpersotext) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_PESONNALTEXT_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_users">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_USER_RELATED') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_DISPLAY_NAME') ?></td>
<td><?php echo $this->lists ['username'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_USERNAME_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_ASK_EMAIL') ?></td>
<td><?php echo $this->lists ['askemail'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_ASK_EMAIL_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SHOWMAIL') ?></td>
<td><?php echo $this->lists ['showemail'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SHOWMAIL_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_USERSTATS') ?></td>
<td><?php echo $this->lists ['showuserstats'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_USERSTATS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_KARMA') ?></td>
<td><?php echo $this->lists ['showkarma'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_KARMA_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_THANKYOU') ?></td>
<td><?php echo $this->lists ['showthankyou'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_THANKYOU_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_DISPLAY_THANKYOU_NUMBERS') ?></td>
<td><input type="text" name="cfg_thankyou_max" class="ksm-field" value="<?php echo $this->escape($this->config->thankyou_max) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_DISPLAY_THANKYOU_NUMBERS') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_USER_EDIT') ?></td>
<td><?php echo $this->lists ['useredit'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_USER_EDIT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_USER_EDIT_TIME') ?></td>
<td><input type="text" name="cfg_useredittime" value="<?php echo $this->escape($this->config->useredittime) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_USER_EDIT_TIME_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_USER_EDIT_TIMEGRACE') ?></td>
<td><input type="text" name="cfg_useredittimegrace" value="<?php echo $this->escape($this->config->useredittimegrace) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_USER_EDIT_TIMEGRACE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_USER_MARKUP') ?></td>
<td><?php echo $this->lists ['editmarkup'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_USER_MARKUP_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_FAVORITES') ?></td>
<td><?php echo $this->lists ['allowfavorites'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_FAVORITES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_GHOSTMESSAGE') ?></td>
<td><?php echo $this->lists ['boxghostmessage'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_GHOSTMESSAGE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SHOWBANNEDREASON_PROFILE') ?></td>
<td><?php echo $this->lists ['showbannedreason'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SHOWBANNEDREASON_PROFILE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_DISPLAY_IMGFILES_TAB_MANAGEMENT_PROFILE') ?></td>
<td><?php echo $this->lists ['show_imgfiles_manage_profile'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_DISPLAY_IMGFILES_TAB_MANAGEMENT_PROFILE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_USER_CAN_SEND_OWN_REPORT') ?></td>
<td><?php echo $this->lists ['user_report'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_USER_CAN_SEND_OWN_REPORT_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_SUBSCRIPTIONS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS') ?></td>
<td><?php echo $this->lists ['allowsubscriptions'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_MAILFULL') ?></td>
<td><?php echo $this->lists ['mailfull'] ?></td>
<td><?php echo JText::_('COM_KUNENA_MAILFULL_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_CATEGORY_SUBSCRIPTIONS') ?></td>
<td><?php echo $this->lists ['category_subscriptions'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_CATEGORY_SUBSCRIPTIONS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_TOPIC_SUBSCRIPTIONS') ?></td>
<td><?php echo $this->lists ['topic_subscriptions'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_TOPIC_SUBSCRIPTIONS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_SUBSCRIPTIONSCHECKED') ?></td>
<td><?php echo $this->lists ['subscriptionschecked'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SUBSCRIPTIONSCHECKED_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_RECIPIENT_COUNT') ?></td>
<td><?php echo JHtml::_('select.integerlist',0, 100, 5, 'cfg_email_recipient_count', null, $this->escape($this->config->email_recipient_count)) ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_RECIPIENT_COUNT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_RECIPIENT_PRIVACY') ?></td>
<td><?php echo $this->lists ['email_recipient_privacy'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_RECIPIENT_PRIVACY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_VISIBLE_ADDRESS') ?></td>
<td><input type="text" name="cfg_email_visible_address" value="<?php echo $this->escape($this->config->email_visible_address) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_SUBSCRIPTIONS_EMAIL_VISIBLE_ADDRESS_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_security">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_SECURITY_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_PUBWRITE') ?></td>
<td><?php echo $this->lists ['pubwrite'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_PUBWRITE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_HOLD_GUEST_POSTS') ?></td>
<td><?php echo $this->lists ['hold_guest_posts'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_HOLD_GUEST_POSTS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_ALLOWED') ?></td>
<td><?php echo $this->lists ['userlist_allowed'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_ALLOWED_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_PUBPROFILE') ?></td>
<td><?php echo $this->lists ['pubprofile'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_PUBPROFILE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_REGISTERED_ONLY') ?></td>
<td><?php echo $this->lists ['regonly'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_REG_ONLY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_HOLD_NEWUSERS_POSTS') ?></td>
<td><input type="text" name="cfg_hold_newusers_posts" class="ksm-field" value="<?php echo $this->escape($this->config->hold_newusers_posts) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_HOLD_NEWUSERS_POSTS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_DELETEMESSAGE') ?></td>
<td><?php echo $this->lists ['userdeletetmessage'] ?> </td>
<td><?php echo JText::_('COM_KUNENA_A_DELETEMESSAGE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_MOD_SEE_DELETED') ?></td>
<td><?php echo $this->lists ['mod_see_deleted'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_MOD_SEE_DELETED_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_FLOOD') ?></td>
<td><input type="text" name="cfg_floodprotection" value="<?php echo $this->escape($this->config->floodprotection) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_FLOOD_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_MAILMOD') ?></td>
<td><?php echo $this->lists ['mailmod'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_MAILMOD_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_MAILADMIN') ?></td>
<td><?php echo $this->lists ['mailadmin'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_MAILADMIN_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IP_TRACKING') ?></td>
<td><?php echo $this->lists ['iptracking'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_IP_TRACKING_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_STATSLINK_ALLOWED') ?></td>
<td><?php echo $this->lists ['statslink_allowed'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_STATSLINK_ALLOWED_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_MAX_LINKS') ?></td>
<td><input type="text" name="cfg_max_links" value="<?php echo $this->escape ( $this->config->max_links ) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_MAX_LINKS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_TEASER') ?></td>
<td><?php echo $this->lists ['teaser'] ?></td>
<td><?php echo JText::_('COM_KUNENA_TEASER_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_CAPTCHA_CONFIGURATION') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_CAPTCHA_FOR_WHO_TITLE') ?></td>
<td><?php echo $this->lists ['captcha'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_CAPTCHA_FOR_WHO_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_CAPTCHA_POST_LIMIT') ?></td>
<td><input type="text" name="cfg_captcha_post_limit" class="ksm-field" value="<?php echo $this->escape($this->config->captcha_post_limit) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_CAPTCHA_POST_LIMIT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RECAPTCHA_PUBLICKEY') ?></td>
<td><input type="text" name="cfg_recaptcha_publickey" class="ksm-field-large" value="<?php echo $this->escape($this->config->recaptcha_publickey) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_RECAPTCHA_PUBLICKEY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RECAPTCHA_PRIVATEKEY') ?></td>
<td><input type="text" name="cfg_recaptcha_privatekey" class="ksm-field-large" value="<?php echo $this->escape($this->config->recaptcha_privatekey) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_RECAPTCHA_PRIVATEKEY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RECAPTCHA_THEME') ?></td>
<td><?php echo $this->lists ['recaptcha_theme'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RECAPTCHA_THEME_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_STOP_FORUM_SPAM_CONFIGURATION') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_STOP_FORUM_SPAM_KEY') ?></td>
<td><input type="text" name="cfg_stopforumspam_key" class="ksm-field-large" value="<?php echo $this->escape($this->config->stopforumspam_key) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_STOP_FORUM_SPAM_KEY_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_avatars">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_AVATAR_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_AVATARUPLOAD') ?></td>
<td><?php echo $this->lists ['allowavatarupload'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_AVATARUPLOAD_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_AVATARGALLERY') ?></td>
<td><?php echo $this->lists ['allowavatargallery'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_AVATARGALLERY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_AVSIZE') ?></td>
<td><input type="text" name="cfg_avatarsize" class="ksm-field" value="<?php echo $this->escape($this->config->avatarsize) ?>" /> kB</td>
<td></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_AVATAR_QUALITY') ?></td>
<td class="nowrap"><input type="text" name="cfg_avatarquality" class="ksm-field" value="<?php echo $this->escape($this->config->avatarquality) ?>" /> %</td>
<td></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_AVATAR_RESIZE_METHOD') ?></td>
<td><?php echo $this->lists ['avatarresizemethod'] ?></td>
<td></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_AVATAR_CROP') ?></td>
<td><?php echo $this->lists ['avatarcrop'] ?></td>
<td></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_uploads">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_ATTACHMENTS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_ATTACHMENT_LIMIT') ?></td>
<td><input type="text" name="cfg_attachment_limit" value="<?php echo $this->escape($this->config->attachment_limit) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_ATTACHMENT_LIMIT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_ATTACHMENT_PROTECTION') ?></td>
<td><?php echo $this->lists ['attachment_protection'] ?></td>
<td><?php echo JText::sprintf('COM_KUNENA_A_ATTACHMENT_PROTECTION_DESC', JUri::root(false) . 'media/kunena/attachments/image.png') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_IMAGE') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMAGE_UPLOAD') ?></td>
<td><?php echo $this->lists ['image_upload'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_IMAGE_UPLOAD_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_SHOWIMGFORGUEST') ?></td>
<td><?php echo $this->lists ['showimgforguest'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SHOWIMGFORGUEST_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMAGEALLOWEDTYPES') ?></td>
<td><input type="text" name="cfg_imagetypes" value="<?php echo $this->escape($this->config->imagetypes) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_IMAGEALLOWEDTYPES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMAGECHECKMIMETYPES') ?></td>
<td><?php echo $this->lists ['checkmimetypes'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_IMAGECHECKMIMETYPES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMAGEALLOWEDMIMETYPES') ?></td>
<td><input type="text" name="cfg_imagemimetypes" value="<?php echo $this->escape($this->config->imagemimetypes) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_IMAGEALLOWEDMIMETYPES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMGSIZE') ?></td>
<td><input type="text" name="cfg_imagesize" class="ksm-field" value="<?php echo $this->escape($this->config->imagesize) ?>" /> kB</td>
<td>
<?php
echo JText::sprintf('COM_KUNENA_A_IMGSIZE_DESC',
ini_get('post_max_size'), ini_get('upload_max_filesize'),
function_exists('php_ini_loaded_file') ? php_ini_loaded_file() : '')
?>
</td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMGWIDTH') ?></td>
<td><input type="text" name="cfg_imagewidth" class="ksm-field" value="<?php echo $this->escape($this->config->imagewidth) ?>" /> px</td>
<td><?php echo JText::_('COM_KUNENA_A_IMGWIDTH_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMGHEIGHT') ?></td>
<td><input type="text" name="cfg_imageheight" class="ksm-field" value="<?php echo $this->escape($this->config->imageheight) ?>" /> px</td>
<td><?php echo JText::_('COM_KUNENA_A_IMGHEIGHT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMGTHUMBWIDTH') ?></td>
<td><input type="text" name="cfg_thumbwidth" class="ksm-field" value="<?php echo $this->escape($this->config->thumbwidth) ?>" /> px</td>
<td><?php echo JText::_('COM_KUNENA_A_IMGTHUMBWIDTH_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMGTHUMBHEIGHT') ?></td>
<td><input type="text" class="ksm-field" name="cfg_thumbheight" value="<?php echo $this->escape($this->config->thumbheight) ?>" /> px</td>
<td><?php echo JText::_('COM_KUNENA_A_IMGTHUMBHEIGHT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_IMGQUALITY') ?></td>
<td><input type="text" name="cfg_imagequality" class="ksm-field" value="<?php echo $this->escape($this->config->imagequality) ?>" /> %</td>
<td><?php echo JText::_('COM_KUNENA_A_IMGQUALITY_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_FILE') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_FILE_UPLOAD') ?></td>
<td><?php echo $this->lists ['file_upload'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_FILE_UPLOAD_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_SHOWFILEFORGUEST') ?></td>
<td><?php echo $this->lists ['showfileforguest'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SHOWFILEFORGUEST_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_FILEALLOWEDTYPES') ?></td>
<td><input type="text" name="cfg_filetypes" value="<?php echo $this->escape($this->config->filetypes) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_FILEALLOWEDTYPES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_FILESIZE') ?></td>
<td><input type="text" name="cfg_filesize" class="ksm-field" value="<?php echo $this->escape($this->config->filesize) ?>" /> <?php echo JText::_('COM_KUNENA_A_FILESIZE_KB') ?></td>
<td>
<?php
echo JText::sprintf('COM_KUNENA_A_FILESIZE_DESC',
ini_get('post_max_size'), ini_get('upload_max_filesize'),
function_exists('php_ini_loaded_file') ? php_ini_loaded_file() : '')
?>
</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_ranking">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_RANKING_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RANKING') ?></td>
<td><?php echo $this->lists ['showranking'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RANKING_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RANKINGIMAGES') ?></td>
<td><?php echo $this->lists ['rankimages'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RANKINGIMAGES_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_bbcode">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_BBCODE_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_DISEMOTICONS') ?></td>
<td><?php echo $this->lists ['disemoticons'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_DISEMOTICONS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SHOWSPOILERTAG') ?></td>
<td><?php echo $this->lists ['showspoilertag'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SHOWSPOILERTAG_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SHOWVIDEOTAG') ?></td>
<td><?php echo $this->lists ['showvideotag'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SHOWVIDEOTAG_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SHOWEBAYTAG') ?></td>
<td><?php echo $this->lists ['showebaytag'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SHOWEBAYTAG_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_TRIMLONGURLS') ?></td>
<td><?php echo $this->lists ['trimlongurls'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_TRIMLONGURLS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_TRIMLONGURLSFRONT') ?></td>
<td><input type="text" name="cfg_trimlongurlsfront" value="<?php echo $this->escape($this->config->trimlongurlsfront) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_TRIMLONGURLSFRONT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_TRIMLONGURLSBACK') ?></td>
<td><input type="text" name="cfg_trimlongurlsback" value="<?php echo $this->escape($this->config->trimlongurlsback) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_TRIMLONGURLSBACK_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_AUTOLINK') ?></td>
<td><?php echo $this->lists ['autolink'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_AUTOLINK_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_AUTOEMBEDYOUTUBE') ?></td>
<td><?php echo $this->lists ['autoembedyoutube'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_AUTOEMBEDYOUTUBE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_AUTOEMBEDEBAY') ?></td>
<td><?php echo $this->lists ['autoembedebay'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_AUTOEMBEDEBAY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_HIGHLIGHTCODE') ?></td>
<td><?php echo $this->lists ['highlightcode'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_HIGHLIGHTCODE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_COM_A_BBCODE_IMG_SECURE') ?></td>
<td><?php echo $this->lists ['bbcode_img_secure'] ?></td>
<td><?php echo JText::_('COM_KUNENA_COM_A_BBCODE_IMG_SECURE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_EBAYLANGUAGECODE') ?></td>
<td><?php echo $this->lists ['ebay_language'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_EBAYLANGUAGECODE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_EBAY_AFFILIATE_ID') ?></td>
<td><input type="text" name="cfg_ebay_affiliate_id" value="<?php echo $this->escape($this->config->ebay_affiliate_id) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_EBAY_AFFILIATE_ID_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_EBAY_API_KEY_LABEL') ?></td>
<td><input type="text" name="cfg_ebay_api_key" value="<?php echo $this->escape($this->config->ebay_api_key) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_EBAY_API_KEY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_TWITTER_API_CONSUMER_KEY_LABEL') ?></td>
<td><input type="text" name="cfg_twitter_consumer_key" value="<?php echo $this->escape($this->config->twitter_consumer_key) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_TWITTER_API_CONSUMER_KEY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_TWITTER_API_CONSUMER_SECRET_LABEL') ?></td>
<td><input type="text" name="cfg_twitter_consumer_secret" value="<?php echo $this->escape($this->config->twitter_consumer_secret) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_CONFIGURATION_TWITTER_API_CONSUMER_SECRET_DESC') ?></td>
</tr>
<?php /*
// TODO: If you uncomment this feature, please remove forced disable from the KunenaConfig class.
<tr>
<td><?php echo JText::_('COM_KUNENA_A_KEYWORDS') ?></td>
<td><?php echo $this->lists ['keywords'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_KEYWORDS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_USER_KEYWORDS') ?></td>
<td><?php echo $this->lists ['userkeywords'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_USER_KEYWORDS_DESC') ?></td>
</tr>
*/ ?>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_rss">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_ADMIN_RSS_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_TYPE') ?></td>
<td><?php echo $this->lists ['rss_type'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_TYPE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_SPEC') ?></td>
<td><?php echo $this->lists ['rss_specification'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_SPEC_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_TIMELIMIT') ?></td>
<td><?php echo $this->lists ['rss_timelimit'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_TIMELIMIT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_LIMIT') ?></td>
<td><input type="text" name="cfg_rss_limit" value="<?php echo $this->escape($this->config->rss_limit) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_LIMIT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_INCLUDED_CATEGORIES') ?></td>
<td><input type="text" name="cfg_rss_included_categories" value="<?php echo $this->escape($this->config->rss_included_categories) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_INCLUDED_CATEGORIES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_EXCLUDED_CATEGORIES') ?></td>
<td><input type="text" name="cfg_rss_excluded_categories" value="<?php echo $this->escape($this->config->rss_excluded_categories) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_EXCLUDED_CATEGORIES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_ALLOW_HTML') ?></td>
<td><?php echo $this->lists ['rss_allow_html'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_ALLOW_HTML_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_AUTHOR_FORMAT') ?></td>
<td><?php echo $this->lists ['rss_author_format'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_AUTHOR_FORMAT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_AUTHOR_IN_TITLE') ?></td>
<td><?php echo $this->lists ['rss_author_in_title'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_AUTHOR_IN_TITLE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_CONFIG_RSS_CHARACTERS_COUNT') ?></td>
<td><?php echo $this->lists ['rss_word_count'] ?></td>
<td><?php echo JText::_('COM_KUNENA_CONFIG_RSS_CHARACTERS_COUNT_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_OLD_TITLES') ?></td>
<td><?php echo $this->lists ['rss_old_titles'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_OLD_TITLES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_CACHE') ?></td>
<td><?php echo $this->lists ['rss_cache'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_CACHE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_RSS_FEEDBURNER_URL') ?></td>
<td><input type="text" class="ksm-field-large" name="cfg_rss_feedburner_url" value="<?php echo $this->escape($this->config->rss_feedburner_url) ?>"/></td>
<td><?php echo JText::_('COM_KUNENA_A_RSS_FEEDBURNER_URL_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
<div class="tab-pane" id="tab_extra">
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_SETTINGS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_ROWS') ?></td>
<td><input type="text" name="cfg_userlist_rows" value="<?php echo $this->escape($this->config->userlist_rows) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_ROWS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_USERONLINE') ?></td>
<td><?php echo $this->lists ['userlist_online'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_USERONLINE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_AVATAR') ?></td>
<td><?php echo $this->lists ['userlist_avatar'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_USERLIST_AVATAR_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_POSTS') ?></td>
<td><?php echo $this->lists ['userlist_posts'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_POSTS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_KARMA') ?></td>
<td><?php echo $this->lists ['userlist_karma'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_KARMA_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_EMAIL') ?></td>
<td><?php echo $this->lists ['userlist_email'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_EMAIL_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_JOINDATE') ?></td>
<td><?php echo $this->lists ['userlist_joindate'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_JOINDATE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_LASTVISITDATE') ?></td>
<td><?php echo $this->lists ['userlist_lastvisitdate'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_LASTVISITDATE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_HITS') ?></td>
<td><?php echo $this->lists ['userlist_userhits'] ?></td>
<td><?php echo JText::_('COM_KUNENA_ADMIN_CONFIG_USERLIST_HITS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_SHOW_SUPERADMINS_IN_USERLIST') ?></td>
<td><?php echo $this->lists ['superadmin_userlist'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_SHOW_SUPERADMINS_IN_USERLIST_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_STATS') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_SHOWWHOIS') ?></td>
<td><?php echo $this->lists ['showwhoisonline'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SHOWWHOISDESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_SHOWSTATS') ?></td>
<td><?php echo $this->lists ['showstats'] ?></td>
<td><?php echo JText::_('COM_KUNENA_SHOWSTATSDESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_STATSGENERAL') ?></td>
<td><?php echo $this->lists ['showgenstats'] ?></td>
<td><?php echo JText::_('COM_KUNENA_STATSGENERALDESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_USERSTATS') ?></td>
<td><?php echo $this->lists ['showpopuserstats'] ?></td>
<td><?php echo JText::_('COM_KUNENA_USERSTATSDESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_USERNUM') ?></td>
<td><input type="text" name="cfg_popusercount" value="<?php echo $this->escape($this->config->popusercount) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_USERNUM') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_USERPOPULAR') ?></td>
<td><?php echo $this->lists ['showpopsubjectstats'] ?></td>
<td><?php echo JText::_('COM_KUNENA_USERPOPULARDESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_NUMPOP') ?></td>
<td><input type="text" name="cfg_popsubjectcount" value="<?php echo $this->escape($this->config->popsubjectcount) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_NUMPOP') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_POLLSSTATS') ?></td>
<td><?php echo $this->lists ['showpoppollstats'] ?></td>
<td><?php echo JText::_('COM_KUNENA_POLLSTATSDESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_POLLSPOP') ?></td>
<td><input type="text" name="cfg_poppollscount" value="<?php echo $this->escape($this->config->poppollscount) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_POLLSPOP') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_THANKSSTATS') ?></td>
<td><?php echo $this->lists ['showpopthankyoustats'] ?></td>
<td><?php echo JText::_('COM_KUNENA_THANKSSTATSDESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_THANKSPOP') ?></td>
<td><input type="text" name="cfg_popthankscount" value="<?php echo $this->escape($this->config->popthankscount) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_THANKSPOP') ?></td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_KUNENA_A_POLL_TITLE') ?></legend>
<table class="table table-striped">
<thead>
<tr>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_TITLE') ?></th>
<th width="25%"><?php echo JText::_('COM_KUNENA_TABLEHEAD_OPTION') ?></th>
<th><?php echo JText::_('COM_KUNENA_TABLEHEAD_DESCRIPTION') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_POLL_ENABLED') ?></td>
<td><?php echo $this->lists ['pollenabled'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_ENABLED_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_POLL_NUMBER_OPTIONS') ?></td>
<td><input type="text" name="cfg_pollnboptions" value="<?php echo $this->escape($this->config->pollnboptions) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_POLL_NUMBER_OPTIONS_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_POLL_TIME_VOTES') ?></td>
<td><input type="text" name="cfg_polltimebtvotes" value="<?php echo $this->escape($this->config->polltimebtvotes) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_POLL_TIME_VOTES_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_POLL_NUMBER_VOTES_BY_USER') ?></td>
<td><input type="text" name="cfg_pollnbvotesbyuser" value="<?php echo $this->escape($this->config->pollnbvotesbyuser) ?>" /></td>
<td><?php echo JText::_('COM_KUNENA_A_POLL_NUMBER_VOTES_BY_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_POLL_ALLOW_ONE_VOTE') ?></td>
<td><?php echo $this->lists ['pollallowvoteone'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_POLL_ALLOW_ONE_VOTE_DESC') ?></td>
</tr>
<tr>
<td><?php echo JText::_('COM_KUNENA_A_POLL_SHOW_USER_LIST') ?></td>
<td><?php echo $this->lists ['pollresultsuserslist'] ?></td>
<td><?php echo JText::_('COM_KUNENA_A_POLL_SHOW_USER_LIST_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
</div>
</div>
</div>
</div>
</form>
<?php //Load the setting comfirmation box form. ?>
<?php echo $this->loadTemplateFile('setting'); ?>
</div>
<div class="pull-right small">
<?php echo KunenaVersion::getLongVersionHTML(); ?>
</div>
</div>
</div>
</div>
</div>
| saurabh18/Kunena-Forum | components/com_kunena/admin/template/joomla25/config/default.php | PHP | gpl-3.0 | 68,293 |
/*! default extra styles no changes */
| chbpku/rpi.sessdsa | ไปฃ็ /11 ๅคๅ่ฝ็ฏฎ็่ฎกๅๅจ/stream/RPi_Cam_Web_Interface/www/css/es_Default.css | CSS | gpl-3.0 | 39 |
<?php
$user =& User::singleton();
if (!$user->hasPermission('dataquery_view')) {
header("HTTP/1.1 403 Forbidden");
exit;
}
require_once __DIR__ . '/../../../vendor/autoload.php';
$client = new NDB_Client();
$client->makeCommandLine();
$client->initialize(__DIR__ . "/../../../project/config.xml");
header("Content-Type: application/json");
$cdb = CouchDB::singleton();
$docID = $_REQUEST['DocID'];
$results = $cdb->getDoc(
$docID
);
print json_encode($results);
?>
| jstirling91/Loris | modules/dataquery/ajax/GetDoc.php | PHP | gpl-3.0 | 484 |
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2010 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage antispam
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2010 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
/**
* Base class for spam traps. Defines no evaluation schemes, so its
* is_spam() method will always return false.
*/
class NoneSpamTrap {
public function __construct($fields) {
$this->fields = $fields;
}
public function is_spam($threshold=3) {
// if no spam score threshold is defined, never call something spam
if (empty($threshold)) {
return false;
}
$score = 0;
foreach ($this->fields as $field) {
$method = 'evaluate_' . $field['type'];
if (method_exists($this, $method)) {
$score += $this->$method($field['value']);
}
}
if ($score > $threshold) {
return true;
}
return false;
}
public function has_blacklisted_urls($string) {
return false;
}
}
| eireford/mahara | htdocs/lib/antispam/NoneSpamTrap.php | PHP | gpl-3.0 | 1,952 |
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef _dbug_h
#define _dbug_h
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(DBUG_OFF) && !defined(_lint)
extern int _db_on_,_no_db_;
extern FILE *_db_fp_;
extern char *_db_process_;
extern int _db_keyword_(const char *keyword);
extern int _db_strict_keyword_(const char *keyword);
extern void _db_setjmp_(void);
extern void _db_longjmp_(void);
extern void _db_push_(const char *control);
extern void _db_pop_(void);
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
const char **_sfunc_,const char **_sfile_,
uint *_slevel_, char ***);
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
uint *_slevel_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...));
extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
uint length);
extern void _db_output_(uint flag);
extern void _db_lock_file(void);
extern void _db_unlock_file(void);
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
char **_db_framep_; \
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
&_db_framep_)
#define DBUG_LEAVE \
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
#define DBUG_EXECUTE(keyword,a1) \
{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
#define DBUG_PRINT(keyword,arglist) \
{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
#define DBUG_PUSH(a1) _db_push_ (a1)
#define DBUG_POP() _db_pop_ ()
#define DBUG_PROCESS(a1) (_db_process_ = a1)
#define DBUG_FILE (_db_fp_)
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
#define DBUG_DUMP(keyword,a1,a2)\
{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
#define DEBUGGER_ON _no_db_=0
#define DBUG_LOCK_FILE { _db_lock_file(); }
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
#define DBUG_OUTPUT(A) { _db_output_(A); }
#define DBUG_ASSERT(A) assert(A)
#define DBUG_EXECUTE_IF(keyword,a1) \
{if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}}
#else /* No debugger */
#define DBUG_ENTER(a1)
#define DBUG_RETURN(a1) return(a1)
#define DBUG_VOID_RETURN return
#define DBUG_EXECUTE(keyword,a1) {}
#define DBUG_EXECUTE_IF(keyword,a1) {}
#define DBUG_PRINT(keyword,arglist) {}
#define DBUG_PUSH(a1) {}
#define DBUG_POP() {}
#define DBUG_PROCESS(a1) {}
#define DBUG_FILE (stderr)
#define DBUG_SETJMP setjmp
#define DBUG_LONGJMP longjmp
#define DBUG_DUMP(keyword,a1,a2) {}
#define DBUG_IN_USE 0
#define DEBUGGER_OFF
#define DEBUGGER_ON
#define DBUG_LOCK_FILE
#define DBUG_UNLOCK_FILE
#define DBUG_OUTPUT(A)
#define DBUG_ASSERT(A) {}
#endif
#ifdef __cplusplus
}
#endif
#endif
| yefeiisme/temp | code/share/header/mysql/windows/my_dbug.h | C | gpl-3.0 | 3,779 |
.combo {
display: inline-block;
white-space: nowrap;
margin: 0;
padding: 0;
border-width: 1px;
border-style: solid;
overflow: hidden;
vertical-align: middle;
}
.combo .combo-text {
font-size: 12px;
border: 0px;
margin: 0;
padding: 0px 2px;
vertical-align: baseline;
}
.combo-arrow {
width: 18px;
height: 20px;
overflow: hidden;
display: inline-block;
vertical-align: top;
cursor: pointer;
opacity: 0.6;
filter: alpha(opacity=60);
}
.combo-arrow-hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
.combo-panel {
overflow: auto;
}
.combo-arrow {
background: url('images/combo_arrow.png') no-repeat center center;
}
.combo-panel {
background-color: #ffffff;
}
.combo {
border-color: #D3D3D3;
background-color: #fff;
}
.combo-arrow {
background-color: #f3f3f3;
}
.combo-arrow-hover {
background-color: #e2e2e2;
}
.combo-arrow:hover {
background-color: #e2e2e2;
}
.combo .textbox-icon-disabled:hover {
cursor: default;
}
.textbox-invalid {
border-color: #ffa8a8;
background-color: #fff3f3;
}
| alickyao/MonkeyProject | src/website/Areas/Admin/Content/theme/gray/combo.css | CSS | gpl-3.0 | 1,116 |
/*
Copyright 2005-2010 Jakub Kruszona-Zawadzki, Gemius SA.
This file is part of MooseFS.
MooseFS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
MooseFS 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 MooseFS. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CHARTSDATA_H_
#define _CHARTSDATA_H_
#include <stdio.h>
#include <inttypes.h>
int chartsdata_init ();
#endif
| ops-baidu/shadow-mfs | mfsshadowmaster/chartsdata.h | C | gpl-3.0 | 786 |
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* AbstractFileBasedStopwords.java
* Copyright (C) 2014 University of Waikato, Hamilton, New Zealand
*/
package weka.core.stopwords;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.Vector;
import weka.core.Option;
import weka.core.Utils;
/**
* Ancestor for file-based stopword schemes.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision: 10982 $
*/
public abstract class AbstractFileBasedStopwords
extends AbstractStopwords {
/** for serialization. */
private static final long serialVersionUID = -8568762652879773063L;
/** a file containing stopwords. */
protected File m_Stopwords = new File(System.getProperty("user.dir"));
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration<Option> listOptions() {
Vector<Option> result = new Vector<Option>();
Enumeration<Option> enm = super.listOptions();
while (enm.hasMoreElements())
result.add(enm.nextElement());
result.addElement(new Option(
"\t" + stopwordsTipText() + "\n"
+ "\t(default: .)",
"stopwords", 1, "-stopwords <file>"));
return result.elements();
}
/**
* Parses a given list of options.
*
* @param options the list of options as an array of strings
* @throws Exception if an option is not supported
*/
@Override
public void setOptions(String[] options) throws Exception {
String tmpStr;
tmpStr = Utils.getOption("stopwords", options);
if (tmpStr.isEmpty())
setStopwords(new File("."));
else
setStopwords(new File(tmpStr));
super.setOptions(options);
}
/**
* Gets the current settings of the Classifier.
*
* @return an array of strings suitable for passing to setOptions
*/
@Override
public String[] getOptions() {
List<String> options = new ArrayList<String>(Arrays.asList(super.getOptions()));
options.add("-stopwords");
options.add(getStopwords().toString());
return options.toArray(new String[options.size()]);
}
/**
* Sets the file containing the stopwords, null or a directory unset the
* stopwords.
*
* @param value the file containing the stopwords
*/
public void setStopwords(File value) {
if (value == null) {
value = new File(System.getProperty("user.dir"));
}
m_Stopwords = value;
reset();
}
/**
* returns the file used for obtaining the stopwords, if the file represents a
* directory then the default ones are used.
*
* @return the file containing the stopwords
*/
public File getStopwords() {
return m_Stopwords;
}
/**
* Returns the tip text for this property.
*
* @return tip text for this property suitable for displaying in the
* explorer/experimenter gui
*/
public abstract String stopwordsTipText();
/**
* Reads in the stopwords file, line by line (trimmed).
* Returns an empty list if not existing or a directory.
*
* @return the content of the file
*/
protected List<String> read() {
List<String> result;
String line;
BufferedReader reader;
result = new ArrayList<String>();
if (m_Stopwords.exists() && !m_Stopwords.isDirectory()) {
reader = null;
try {
reader = new BufferedReader(new FileReader(m_Stopwords));
while ((line = reader.readLine()) != null)
result.add(line.trim());
}
catch (Exception e) {
error("Failed to read stopwords file '" + m_Stopwords + "'!");
e.printStackTrace();
}
finally {
if (reader != null) {
try {
reader.close();
}
catch (Exception ex) {
// ignored
}
}
}
}
return result;
}
}
| mydzigear/weka.kmeanspp.silhouette_score | src/weka/core/stopwords/AbstractFileBasedStopwords.java | Java | gpl-3.0 | 4,561 |
๏ปฟ#Region "Microsoft.VisualBasic::c3350a4c5a4d9cbbdbe5ed02e0cac093, Microsoft.VisualBasic.Core\src\ApplicationServices\Parallel\Threads\ThreadPool.vb"
' Author:
'
' asuka ([email protected])
' xie ([email protected])
' xieguigang ([email protected])
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' /********************************************************************************/
' Summaries:
' Class ThreadPool
'
' Properties: FullCapacity, NumOfThreads, WorkingThreads
'
' Constructor: (+2 Overloads) Sub New
'
' Function: GetAvaliableThread, GetStatus, Start, ToString
'
' Sub: [Exit], allocate, (+2 Overloads) Dispose, OperationTimeOut, RunTask
' Structure __taskInvoke
'
' Function: Run
'
'
'
'
' /********************************************************************************/
#End Region
Imports System.Runtime.CompilerServices
Imports System.Threading
Imports Microsoft.VisualBasic.Linq
Imports Microsoft.VisualBasic.Parallel.Linq
Imports Microsoft.VisualBasic.Parallel.Tasks
Imports Microsoft.VisualBasic.Serialization.JSON
Imports TaskBinding = Microsoft.VisualBasic.ComponentModel.Binding(Of System.Action, System.Action(Of Long))
Namespace Parallel.Threads
''' <summary>
''' ไฝฟ็จๅคๆก็บฟ็จๆฅๆง่กไปปๅก้ๅ๏ผๆจ่ๅจ็ผๅWebๆๅกๅจ็ๆถๅไฝฟ็จ่ฟไธชๆจกๅๆฅๆง่กไปปๅก
''' </summary>
Public Class ThreadPool : Implements IDisposable
ReadOnly threads As TaskQueue(Of Long)()
''' <summary>
''' ไธดๆถ็ๅฅๆ็ผๅญ
''' </summary>
ReadOnly pendings As New Queue(Of TaskBinding)(capacity:=10240)
''' <summary>
''' ็บฟ็จๆฑ ไนไธญ็็บฟ็จๆฐ้
''' </summary>
''' <returns></returns>
Public ReadOnly Property NumOfThreads As Integer
<MethodImpl(MethodImplOptions.AggressiveInlining)>
Get
Return threads.Length
End Get
End Property
''' <summary>
''' ่ฟๅๅฝๅๆญฃๅจๅคไบๅทฅไฝ็ถๆ็็บฟ็จๆฐ้
''' </summary>
''' <returns></returns>
Public ReadOnly Property WorkingThreads As Integer
Get
Dim n As Integer
For Each t In threads
If t.Tasks > 0 Then
n += 1
End If
Next
Return n
End Get
End Property
'''' <summary>
'''' Returns the server load.
'''' </summary>
'''' <returns></returns>
'Public ReadOnly Property ServerLoad As Double
' Get
' Dim works# = WorkingThreads / NumOfThreads
' Dim CPU_load# = Win32.TaskManager.ProcessUsage
' Dim load# = works * CPU_load
' Return load
' End Get
'End Property
''' <summary>
''' ๆฏๅฆๆๆ็็บฟ็จ้ฝๆฏๅคไบๅทฅไฝ็ถๆ็
''' </summary>
''' <returns></returns>
Public ReadOnly Property FullCapacity As Boolean
<MethodImpl(MethodImplOptions.AggressiveInlining)>
Get
Return WorkingThreads = threads.Length
End Get
End Property
Sub New(maxThread As Integer)
threads = New TaskQueue(Of Long)(maxThread) {}
For i As Integer = 0 To threads.Length - 1
threads(i) = New TaskQueue(Of Long)
Next
End Sub
Sub New()
Me.New(LQuerySchedule.Recommended_NUM_THREADS)
End Sub
Public Function Start() As ThreadPool
Call ParallelExtension.RunTask(AddressOf allocate)
Return Me
End Function
''' <summary>
''' ่ทๅๅฝๅ็่ฟไธช็บฟ็จๆฑ ๅฏน่ฑก็็ถๆ็ๆ่ฆไฟกๆฏ
''' </summary>
''' <returns></returns>
Public Function GetStatus() As Dictionary(Of String, String)
Dim out As New Dictionary(Of String, String)
Call out.Add(NameOf(Me.FullCapacity), FullCapacity)
Call out.Add(NameOf(Me.NumOfThreads), NumOfThreads)
Call out.Add(NameOf(Me.WorkingThreads), WorkingThreads)
Call out.Add(NameOf(Me.pendings), pendings.Count)
For Each t As SeqValue(Of TaskQueue(Of Long)) In threads.SeqIterator
With t.value
Call out.Add("thread___" & t.i & "___" & .uid, .Tasks)
End With
Next
Return out
End Function
''' <summary>
''' ไฝฟ็จ็บฟ็จๆฑ ้้ข็็ฉบ้ฒ็บฟ็จๆฅๆง่กไปปๅก
''' </summary>
''' <param name="task"></param>
''' <param name="callback">ๅ่ฐๅฝๆฐ้้ข็ๅๆฐๆฏไปปๅก็ๆง่ก็ๆถ้ด้ฟๅบฆ</param>
Public Sub RunTask(task As Action, Optional callback As Action(Of Long) = Nothing)
Dim pends As New TaskBinding With {
.Bind = task,
.Target = callback
}
SyncLock pendings
Call pendings.Enqueue(pends)
End SyncLock
End Sub
Public Sub OperationTimeOut(task As Action, timeout As Integer)
Dim done As Boolean = False
Call RunTask(task, Sub() done = True)
For i As Integer = 0 To timeout
If done Then
Exit For
Else
Thread.Sleep(1)
End If
Next
End Sub
Private Sub allocate()
Do While Not Me.disposedValue
SyncLock pendings
If pendings.Count > 0 Then
Dim task As TaskBinding = pendings.Dequeue
Dim h As Func(Of Long) = AddressOf New __taskInvoke With {.task = task.Bind}.Run
Dim callback As Action(Of Long) = task.Target
Call GetAvaliableThread.Enqueue(h, callback) ' ๅฝ็บฟ็จๆฑ ้้ข็็บฟ็จๆฐ้้ๅธธๅค็ๆถๅ๏ผ่ฟไธชไบไปถไผๅ้ฟ๏ผๆไปฅ่ฎฒๅ้
็ไปฃ็ ๅ็ฌๆพๅจ็บฟ็จ้้ขๆง่ก๏ผไปฅๆ็ฅwebๆๅกๅจ็ๅๅบๆ็
Else
Call Thread.Sleep(1)
End If
End SyncLock
Loop
End Sub
Private Structure __taskInvoke
Dim task As Action
''' <summary>
''' ไธๆธ
ๆฅๆฏไธๆฏๅ ไธบlambdaๆ้ฎ้ข๏ผๆไปฅๅฏผ่ด่ฎกๆถๅจๆฒกๆๆญฃๅธธ็ๅทฅไฝ๏ผๆไปฅๅจ่ฟ้ไฝฟ็จๅ
้จ็ฑปๆฅๅทฅไฝ
''' </summary>
''' <returns></returns>
Public Function Run() As Long
Dim time& = App.NanoTime
Call task()
Return App.NanoTime - time
End Function
End Structure
''' <summary>
''' ่ฟไธชๅฝๆฐๆปๆฏไผ่ฟๅไธไธช็บฟ็จๅฏน่ฑก็
'''
''' + ๅฝๆ็ฉบ้ฒ็็บฟ็จ๏ผไผ่ฟๅ็ฌฌไธไธช็ฉบ้ฒ็็บฟ็จ
''' + ๅฝๆฒกๆ็ฉบ้ฒ็็บฟ็จ๏ผๅไผ่ฟๅไปปๅก้ๅๆ็ญ็็บฟ็จ
''' </summary>
''' <returns></returns>
Private Function GetAvaliableThread() As TaskQueue(Of Long)
Dim [short] As TaskQueue(Of Long) = threads.First
For Each t In threads
If Not t.RunningTask Then
Return t
Else
If [short].Tasks > t.Tasks Then
[short] = t
End If
End If
Next
Return [short]
End Function
Public Overrides Function ToString() As String
Return threads.GetJson
End Function
Public Sub [Exit]()
For Each task In threads
Call task.Dispose()
Next
End Sub
#Region "IDisposable Support"
Private disposedValue As Boolean ' To detect redundant calls
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
Call [Exit]()
End If
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
Dispose(True)
' TODO: uncomment the following line if Finalize() is overridden above.
' GC.SuppressFinalize(Me)
End Sub
#End Region
End Class
End Namespace
| SMRUCC/GCModeller | src/runtime/sciBASIC#/Microsoft.VisualBasic.Core/src/ApplicationServices/Parallel/Threads/ThreadPool.vb | Visual Basic | gpl-3.0 | 10,133 |
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
// *** BROWSER VERSION ***
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);
// Note: On IE, start of appVersion return 3 or 4
// which supposedly is the version of Netscape it is compatible with.
// So we look for the real version further on in the string
var iePos = appVer.indexOf('msie');
if (iePos !=-1) {
is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
is_major = parseInt(is_minor);
}
var is_getElementById = (document.getElementById) ? "true" : "false"; // 001121-abk
var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk
var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk
var is_gecko = ((navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
var is_gver = 0;
if (is_gecko) is_gver=navigator.productSub;
var is_moz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
(agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) &&
(agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) &&
(is_gecko) &&
((navigator.vendor=="")||(navigator.vendor=="Mozilla")));
if (is_moz) {
var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
if(!(is_moz_ver)) {
is_moz_ver = agt.indexOf('rv:');
is_moz_ver = agt.substring(is_moz_ver+3);
is_paren = is_moz_ver.indexOf(')');
is_moz_ver = is_moz_ver.substring(0,is_paren);
}
is_minor = is_moz_ver;
is_major = parseInt(is_moz_ver);
}
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
&& (!(is_moz)));
// Netscape6 is mozilla/5 + Netscape6/6.0!!!
// Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
// Changed this to use navigator.vendor/vendorSub - dmr 060502
// var nav6Pos = agt.indexOf('netscape6');
// if (nav6Pos !=-1) {
if ((navigator.vendor)&&
((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
(is_nav)) {
is_major = parseInt(navigator.vendorSub);
// here we need is_minor as a valid float for testing. We'll
// revert to the actual content before printing the result.
is_minor = parseFloat(navigator.vendorSub);
}
var is_opera = (agt.indexOf("opera") != -1);
/* var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk
*/ var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr
/* var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128
var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr
*/
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && is_minor >= 4); // changed to is_minor for
// consistency - dmr, 011001
var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
(agt.indexOf("; nav") != -1)) );
var is_nav6 = (is_nav && is_major==6); // new 010118 mhp
var is_nav6up = (is_nav && is_minor >= 6) // new 010118 mhp
var is_nav5 = (is_nav && is_major == 5 && !is_nav6); // checked for ns6
var is_nav5up = (is_nav && is_minor >= 5);
var is_nav7 = (is_nav && is_major == 7);
var is_nav7up = (is_nav && is_minor >= 7);
var is_ie = ((iePos!=-1) && (!is_opera));
var is_ie3 = (is_ie && (is_major < 4));
// var is_ie4 = (is_ie && is_major == 4);
var is_ie4up = (is_ie && is_minor >= 4);
var is_ie5 = (is_ie && is_major == 5);
var is_ie5up = (is_ie && is_minor >= 5);
var is_ie5_5 = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk
var is_ie5_5up =(is_ie && is_minor >= 5.5); // 020128 new - abk
var is_ie6 = (is_ie && is_major == 6);
var is_ie6up = (is_ie && is_minor >= 6);
// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
// or if this is the first browser window opened. Thus the
// variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
/* var is_aol = (agt.indexOf("aol") != -1);
var is_aol3 = (is_aol && is_ie3);
var is_aol4 = (is_aol && is_ie4);
var is_aol5 = (agt.indexOf("aol 5") != -1);
var is_aol6 = (agt.indexOf("aol 6") != -1);
var is_aol7 = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1));
var is_aol8 = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1));
var is_webtv = (agt.indexOf("webtv") != -1);
*/
// new 020128 - abk
/* var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1));
var is_AOLTV = is_TVNavigator;
*/
/* var is_hotjava = (agt.indexOf("hotjava") != -1);
var is_hotjava3 = (is_hotjava && (is_major == 3));
var is_hotjava3up = (is_hotjava && (is_major >= 3));
*/
// end new
// *** JAVASCRIPT VERSION CHECK ***
// Useful to workaround Nav3 bug in which Nav3
// loads <SCRIPT LANGUAGE="JavaScript1.2">.
// updated 020131 by dragle
var is_js;
if (is_nav2 || is_ie3) is_js = 1.0;
else if (is_nav3) is_js = 1.1;
// else if (is_opera5up) is_js = 1.3; // 020214 - dmr
else if (is_opera) is_js = 1.1;
/* else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
else if (is_nav5 && !(is_nav6)) is_js = 1.4;
else if (is_hotjava3up) is_js = 1.4; // new 020128 - abk
else if (is_nav6up) is_js = 1.5;
*/
// NOTE: In the future, update this code when newer versions of JS
// are released. For now, we try to provide some upward compatibility
// so that future versions of Nav and IE will show they are at
// *least* JS 1.x capable. Always check for JS version compatibility
// with > or >=.
else if (is_nav && (is_major > 5)) is_js = 1.4;
else if (is_ie && (is_major > 5)) is_js = 1.3;
else if (is_moz) is_js = 1.5;
// what about ie6 and ie6up for js version? abk
// HACK: no idea for other browsers; always check for JS version
// with > or >=
else is_js = 0.0;
// HACK FOR IE5 MAC = js vers = 1.4 (if put inside if/else jumps out at 1.3)
if ((agt.indexOf("mac")!=-1) && is_ie5up) is_js = 1.4; // 020128 - abk
// Done with is_minor testing; revert to real for N6/7
if (is_nav6up) {
is_minor = navigator.vendorSub;
}
// *** PLATFORM ***
var is_win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
// NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
// Win32, so you can't distinguish between Win95 and WinNT.
// var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
// is this a 16 bit compiled version?
/*var is_win16 = ((agt.indexOf("win16")!=-1) ||
(agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
(agt.indexOf("windows 16-bit")!=-1) );
var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
(agt.indexOf("windows 16-bit")!=-1));*/
/*var is_winme = ((agt.indexOf("win 9x 4.90")!=-1)); // new 020128 - abk
var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1) || (agt.indexOf("windows 2000")!=-1)); // 020214 - dmr
var is_winxp = ((agt.indexOf("windows nt 5.1")!=-1) || (agt.indexOf("windows xp")!=-1)); // 020214 - dmr*/
// NOTE: Reliable detection of Win98 may not be possible. It appears that:
// - On Nav 4.x and before you'll get plain "Windows" in userAgent.
// - On Mercury client, the 32-bit version will return "Win98", but
// the 16-bit version running on Win98 will still return "Win95".
/* var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
var is_win32 = (is_win95 || is_winnt || is_win98 ||
((is_major >= 4) && (navigator.platform == "Win32")) ||
(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
var is_os2 = ((agt.indexOf("os/2")!=-1) ||
(navigator.appVersion.indexOf("OS/2")!=-1) ||
(agt.indexOf("ibm-webexplorer")!=-1));
*/
var is_mac = (agt.indexOf("mac")!=-1);
if (is_mac) { is_win = !is_mac; } // dmr - 06/20/2002
var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) ||
(agt.indexOf("68000")!=-1)));
var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) ||
(agt.indexOf("powerpc")!=-1)));
var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
/* var is_sun = (agt.indexOf("sunos")!=-1);
var is_sun4 = (agt.indexOf("sunos 4")!=-1);
var is_sun5 = (agt.indexOf("sunos 5")!=-1);
var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
var is_irix = (agt.indexOf("irix") !=-1); // SGI
var is_irix5 = (agt.indexOf("irix 5") !=-1);
var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
var is_hpux = (agt.indexOf("hp-ux")!=-1);
var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
var is_aix = (agt.indexOf("aix") !=-1); // IBM
var is_aix1 = (agt.indexOf("aix 1") !=-1);
var is_aix2 = (agt.indexOf("aix 2") !=-1);
var is_aix3 = (agt.indexOf("aix 3") !=-1);
var is_aix4 = (agt.indexOf("aix 4") !=-1);
var is_linux = (agt.indexOf("inux")!=-1);
var is_sco = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
var is_unixware = (agt.indexOf("unix_system_v")!=-1);
var is_mpras = (agt.indexOf("ncr")!=-1);
var is_reliant = (agt.indexOf("reliantunix")!=-1);
var is_dec = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
(agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
(agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
var is_sinix = (agt.indexOf("sinix")!=-1);
var is_freebsd = (agt.indexOf("freebsd")!=-1);
var is_bsd = (agt.indexOf("bsd")!=-1);
var is_unix = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux ||
is_sco ||is_unixware || is_mpras || is_reliant ||
is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);
var is_vms = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
*/// additional checks, abk
var is_anchors = (document.anchors) ? "true":"false";
var is_regexp = (window.RegExp) ? "true":"false";
var is_option = (window.Option) ? "true":"false";
var is_all = (document.all) ? "true":"false";
// cookies - 990624 - abk
document.cookie = "cookies=true";
var is_cookie = (document.cookie) ? "true" : "false";
var is_images = (document.images) ? "true":"false";
var is_layers = (document.layers) ? "true":"false"; // gecko m7 bug?
// new doc obj tests 990624-abk
var is_forms = (document.forms) ? "true" : "false";
var is_links = (document.links) ? "true" : "false";
var is_frames = (window.frames) ? "true" : "false";
var is_screen = (window.screen) ? "true" : "false";
// java
var is_java = (navigator.javaEnabled());
// Flash checking code based adapted from Doc JavaScript information;
// see http://webref.com/js/column84/2.html
var is_Flash = false;
var is_FlashVersion = 0;
if ((is_nav||is_opera||is_moz)||
(is_mac&&is_ie5up)) {
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"] &&
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin) {
is_Flash = true;
is_FlashVersion = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
}
}
/* if (is_win&&is_ie4up)
{
document.write(
'<scr' + 'ipt language=VBScript>' + '\n' +
'Dim hasPlayer, playerversion' + '\n' +
'hasPlayer = false' + '\n' +
'playerversion = 10' + '\n' +
'Do While playerversion > 0' + '\n' +
'On Error Resume Next' + '\n' +
'hasPlayer = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerversion)))' + '\n' +
'If hasPlayer = true Then Exit Do' + '\n' +
'playerversion = playerversion - 1' + '\n' +
'Loop' + '\n' +
'is_FlashVersion = playerversion' + '\n' +
'is_Flash = hasPlayer' + '\n' +
'<\/sc' + 'ript>'
);
}
*/ | paintballrefjosh/MaNGOSWebV4 | templates/sunwell/js/detection.js | JavaScript | gpl-3.0 | 13,790 |
#
# status of a Hold transaction
package ILS::Transaction::Hold;
use warnings;
use strict;
use ILS;
use ILS::Transaction;
use C4::Reserves; # AddReserve
use C4::Members; # GetMember
use C4::Biblio; # GetBiblioFromItemNumber GetBiblioItemByBiblioNumber
use parent qw(ILS::Transaction);
our $VERSION = 3.07.00.049;
my %fields = (
expiration_date => 0,
pickup_location => undef,
constraint_type => undef,
);
sub new {
my $class = shift;
my $self = $class->SUPER::new();
foreach my $element (keys %fields) {
$self->{_permitted}->{$element} = $fields{$element};
}
@{$self}{keys %fields} = values %fields;
return bless $self, $class;
}
sub queue_position {
my $self = shift;
return $self->item->hold_queue_position($self->patron->id);
}
sub do_hold {
my $self = shift;
unless ($self->{patron}) {
$self->screen_msg('do_hold called with undefined patron');
$self->ok(0);
return $self;
}
my $borrower = GetMember( 'cardnumber'=>$self->{patron}->id);
unless ($borrower) {
$self->screen_msg('No borrower matches cardnumber "' . $self->{patron}->id . '".');
$self->ok(0);
return $self;
}
my $bib = GetBiblioFromItemNumber(undef, $self->{item}->id);
unless ($bib) {
$self->screen_msg('No biblio record matches barcode "' . $self->{item}->id . '".');
$self->ok(0);
return $self;
}
my $branch = ($self->pickup_location || $self->{patron}->branchcode);
unless ($branch) {
$self->screen_msg('No branch specified (or found w/ patron).');
$self->ok(0);
return $self;
}
my $bibno = $bib->{biblionumber};
AddReserve($branch, $borrower->{borrowernumber},
$bibno, 'a', GetBiblioItemByBiblioNumber($bibno)) ;
# unfortunately no meaningful return value
$self->ok(1);
return $self;
}
sub drop_hold {
my $self = shift;
unless ($self->{patron}) {
$self->screen_msg('drop_hold called with undefined patron');
$self->ok(0);
return $self;
}
my $borrower = GetMember( 'cardnumber'=>$self->{patron}->id);
unless ($borrower) {
$self->screen_msg('No borrower matches cardnumber "' . $self->{patron}->id . '".');
$self->ok(0);
return $self;
}
my $bib = GetBiblioFromItemNumber(undef, $self->{item}->id);
CancelReserve({
biblionumber => $bib->{biblionumber},
itemnumber => $self->{item}->id,
borrowernumber => $borrower->{borrowernumber}
});
$self->ok(1);
return $self;
}
sub change_hold {
my $self = shift;
unless ($self->{patron}) {
$self->screen_msg('change_hold called with undefined patron');
$self->ok(0);
return $self;
}
my $borrower = GetMember( 'cardnumber'=>$self->{patron}->id);
unless ($borrower) {
$self->screen_msg('No borrower matches cardnumber "' . $self->{patron}->id . '".');
$self->ok(0);
return $self;
}
my $bib = GetBiblioFromItemNumber(undef, $self->{item}->id);
unless ($bib) {
$self->screen_msg('No biblio record matches barcode "' . $self->{item}->id . '".');
$self->ok(0);
return $self;
}
my $branch = ($self->pickup_location || $self->{patron}->branchcode);
unless ($branch) {
$self->screen_msg('No branch specified (or found w/ patron).');
$self->ok(0);
return $self;
}
my $bibno = $bib->{biblionumber};
ModReserve({ biblionumber => $bibno, borrowernumber => $borrower->{borrowernumber}, branchcode => $branch });
$self->ok(1);
return $self;
}
1;
__END__
| KohaSuomi/kohasuomi | C4/SIP/ILS/Transaction/Hold.pm | Perl | gpl-3.0 | 3,343 |
#ifndef BOOST_MPL_POP_FRONT_HPP_INCLUDED
#define BOOST_MPL_POP_FRONT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-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)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Source: /cvsroot/boost/boost/boost/mpl/pop_front.hpp,v $
// $Date: 2004/09/02 15:40:42 $
// $Revision: 1.4 $
#include <boost/mpl/pop_front_fwd.hpp>
#include <boost/mpl/aux_/pop_front_impl.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
>
struct pop_front
: pop_front_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,pop_front,(Sequence))
};
BOOST_MPL_AUX_NA_SPEC(1, pop_front)
}}
#endif // BOOST_MPL_POP_FRONT_HPP_INCLUDED
| kbogert/madp-win | src/boost/boost/mpl/pop_front.hpp | C++ | gpl-3.0 | 1,066 |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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.
//
// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'plagiarism', language 'zh_cn', branch 'MOODLE_25_STABLE'
*
* @package plagiarism
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['availableplugins'] = 'ๅฏ็จๆไปถ';
$string['configenableplagiarism'] = '่ฟๅฐๅ
่ฎธ็ฎก็ๅ้
็ฝฎๆ่ขญๆไปถ๏ผๅฆๆๅทฒๅฎ่ฃ
๏ผ';
$string['configplagiarismplugins'] = '่ฏท้ๆฉๆจ่ฆ้
็ฝฎ็ๆ่ขญๆไปถ';
$string['enableplagiarism'] = 'ๅฏ็จๆ่ขญๆไปถ';
$string['manageplagiarism'] = '็ฎก็ๆ่ขญๆไปถ';
$string['nopluginsinstalled'] = 'ๆฒกๆๅฎ่ฃ
ไปปไฝๆ่ขญๆไปถ';
$string['plagiarism'] = 'ๅๆ่ขญ';
| jamesclickap/taiwanlife_web | lang/zh_cn/plagiarism.php | PHP | gpl-3.0 | 1,421 |
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @file test/core/core_type_mat2x4.cpp
/// @date 2008-08-31 / 2014-11-25
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#include <glm/vector_relational.hpp>
#include <glm/mat2x4.hpp>
#include <vector>
static int test_operators()
{
glm::mat2x4 l(1.0f);
glm::mat2x4 m(1.0f);
glm::vec2 u(1.0f);
glm::vec4 v(1.0f);
float x = 1.0f;
glm::vec4 a = m * u;
glm::vec2 b = v * m;
glm::mat2x4 n = x / m;
glm::mat2x4 o = m / x;
glm::mat2x4 p = x * m;
glm::mat2x4 q = m * x;
bool R = m != q;
bool S = m == l;
return (S && !R) ? 0 : 1;
}
int test_ctr()
{
int Error(0);
#if(GLM_HAS_INITIALIZER_LISTS)
glm::mat2x4 m0(
glm::vec4(0, 1, 2, 3),
glm::vec4(4, 5, 6, 7));
glm::mat2x4 m1{0, 1, 2, 3, 4, 5, 6, 7};
glm::mat2x4 m2{
{0, 1, 2, 3},
{4, 5, 6, 7}};
for(glm::length_t i = 0; i < m0.length(); ++i)
Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1;
for(glm::length_t i = 0; i < m1.length(); ++i)
Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1;
std::vector<glm::mat2x4> v1{
{0, 1, 2, 3, 4, 5, 6, 7},
{0, 1, 2, 3, 4, 5, 6, 7}
};
std::vector<glm::mat2x4> v2{
{
{ 0, 1, 2, 3},
{ 4, 5, 6, 7}
},
{
{ 0, 1, 2, 3},
{ 4, 5, 6, 7}
}
};
#endif//GLM_HAS_INITIALIZER_LISTS
return Error;
}
int main()
{
int Error = 0;
Error += test_ctr();
Error += test_operators();
return Error;
}
| Khillasaurus/DASGameEngine | root/Libraries/glm/glm-0.9.6.1/test/core/core_type_mat2x4.cpp | C++ | gpl-3.0 | 2,827 |
๏ปฟ#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright ยฉ 2007-2015 ShareX Developers
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.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
// Credits: https://github.com/BallisticLingonberries
// API Information: https://docs.pushbullet.com/http/
using Newtonsoft.Json;
using ShareX.HelpersLib;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
namespace ShareX.UploadersLib.FileUploaders
{
public sealed class Pushbullet : FileUploader
{
public PushbulletSettings Config { get; private set; }
public Pushbullet(PushbulletSettings config)
{
Config = config;
}
private const string
wwwPushesURL = "https://www.pushbullet.com/pushes",
apiURL = "https://api.pushbullet.com/v2",
apiGetDevicesURL = apiURL + "/devices",
apiSendPushURL = apiURL + "/pushes",
apiRequestFileUploadURL = apiURL + "/upload-request";
public UploadResult PushFile(Stream stream, string fileName)
{
NameValueCollection headers = CreateAuthenticationHeader(Config.UserAPIKey, "");
Dictionary<string, string> pushArgs, upArgs = new Dictionary<string, string>();
upArgs.Add("file_name", fileName);
string uploadRequest = SendRequest(HttpMethod.POST, apiRequestFileUploadURL, upArgs, headers);
if (uploadRequest == null) return null;
PushbulletResponseFileUpload fileInfo = JsonConvert.DeserializeObject<PushbulletResponseFileUpload>(uploadRequest);
if (fileInfo == null) return null;
pushArgs = upArgs;
upArgs = new Dictionary<string, string>();
upArgs.Add("awsaccesskeyid", fileInfo.data.awsaccesskeyid);
upArgs.Add("acl", fileInfo.data.acl);
upArgs.Add("key", fileInfo.data.key);
upArgs.Add("signature", fileInfo.data.signature);
upArgs.Add("policy", fileInfo.data.policy);
upArgs.Add("content-type", fileInfo.data.content_type);
UploadResult uploadResult = UploadData(stream, fileInfo.upload_url, fileName, "file", upArgs);
if (uploadResult == null) return null;
pushArgs.Add("device_iden", Config.CurrentDevice.Key);
pushArgs.Add("type", "file");
pushArgs.Add("file_url", fileInfo.file_url);
pushArgs.Add("body", "Sent via ShareX");
string pushResult = SendRequest(HttpMethod.POST, apiSendPushURL, pushArgs, headers);
if (pushResult == null) return null;
PushbulletResponsePush push = JsonConvert.DeserializeObject<PushbulletResponsePush>(pushResult);
if (push != null)
uploadResult.URL = wwwPushesURL + "?push_iden=" + push.iden;
return uploadResult;
}
private string Push(string pushType, string valueType, string value, string title)
{
NameValueCollection headers = CreateAuthenticationHeader(Config.UserAPIKey, "");
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("device_iden", Config.CurrentDevice.Key);
args.Add("type", pushType);
args.Add("title", title);
args.Add(valueType, value);
if (valueType != "body")
{
if (pushType == "link")
args.Add("body", value);
else
args.Add("body", "Sent via ShareX");
}
string response = SendRequest(HttpMethod.POST, apiSendPushURL, args, headers);
if (response == null) return null;
PushbulletResponsePush push = JsonConvert.DeserializeObject<PushbulletResponsePush>(response);
if (push != null)
return wwwPushesURL + "?push_iden=" + push.iden;
return null;
}
public string PushNote(string note, string title)
{
return Push("note", "body", note, title);
}
public string PushLink(string link, string title)
{
return Push("link", "url", link, title);
}
public override UploadResult Upload(Stream stream, string fileName)
{
if (string.IsNullOrEmpty(Config.UserAPIKey)) throw new Exception("Missing API key.");
if (Config.CurrentDevice == null) throw new Exception("No device set to push to.");
if (string.IsNullOrEmpty(Config.CurrentDevice.Key)) throw new Exception("Missing device key.");
return PushFile(stream, fileName);
}
public List<PushbulletDevice> GetDeviceList()
{
NameValueCollection headers = CreateAuthenticationHeader(Config.UserAPIKey, "");
string response = SendRequest(HttpMethod.GET, apiGetDevicesURL, headers: headers);
PushbulletResponseDevices devicesResponse = JsonConvert.DeserializeObject<PushbulletResponseDevices>(response);
if (devicesResponse != null && devicesResponse.devices != null)
return devicesResponse.devices.Select(x => new PushbulletDevice { Key = x.iden, Name = x.nickname }).ToList();
return new List<PushbulletDevice>();
}
private class PushbulletResponseDevices
{
public List<PushbulletResponseDevice> devices { get; set; }
}
private class PushbulletResponseDevice
{
public string iden { get; set; }
public string nickname { get; set; }
}
private class PushbulletResponsePush
{
public string iden { get; set; }
public string device_iden { get; set; }
public PushbulletResponsePushData data { get; set; }
public long created { get; set; }
}
private class PushbulletResponsePushData
{
public string type { get; set; }
public string title { get; set; }
public string body { get; set; }
}
private class PushbulletResponseFileUpload
{
public string file_type { get; set; }
public string file_name { get; set; }
public string file_url { get; set; }
public string upload_url { get; set; }
public PushbulletResponseFileUploadData data { get; set; }
}
private class PushbulletResponseFileUploadData
{
public string awsaccesskeyid { get; set; }
public string acl { get; set; }
public string key { get; set; }
public string signature { get; set; }
public string policy { get; set; }
[JsonProperty("content-type")]
public string content_type { get; set; }
}
}
public class PushbulletDevice
{
public string Key { get; set; }
public string Name { get; set; }
}
public class PushbulletSettings
{
public string UserAPIKey = string.Empty;
public List<PushbulletDevice> DeviceList = new List<PushbulletDevice>();
public int SelectedDevice = 0;
public PushbulletDevice CurrentDevice
{
get
{
if (DeviceList.IsValidIndex(SelectedDevice))
return DeviceList[SelectedDevice];
return null;
}
}
}
} | Upload/ShareX | ShareX.UploadersLib/FileUploaders/Pushbullet.cs | C# | gpl-3.0 | 8,346 |
<?php
/** Gagauz (Gagauz)
*
* See MessagesQqq.php for message documentation incl. usage of parameters
* To improve a translation please visit http://translatewiki.net
*
* @ingroup Language
* @file
*
* @author Andrijko Z.
* @author Cuman
* @author Emperyan
* @author Reedy
*/
$fallback = 'tr';
$messages = array(
# User preference toggles
'tog-underline' => 'Baalantฤฑlarฤฑn altฤฑnฤฑ รงiz',
'tog-highlightbroken' => 'Boล baalantฤฑlarฤฑ <a href="" class="new">bu formada</a> (alternativa: bu formada<a href="" class="internal">?</a>) gรถster.',
'tog-justify' => 'Paragraflarฤฑ dรผz',
'tog-hideminor' => 'Kรผรงรผk diiลmรคkleri "Bitki diiลmรคkler" sayfasฤฑnda sakla',
'tog-extendwatchlist' => 'ฤฐlerlemiล bakmaa listasฤฑ',
'tog-usenewrc' => 'ฤฐlerlemiล bitki diiลmรคkler listasฤฑ (JavaScript uymรชรชr)',
'tog-numberheadings' => 'Baลlฤฑklara avtomatik nomer yaz',
'tog-showtoolbar' => 'Diiลmรคk yapar kรคnรค yardฤฑmcฤฑ tuลlarฤฑ gรถster. (JavaScript)',
'tog-editondblclick' => 'Sayfayฤฑ รงift tuลlayarak diiลtirmรครค baลla (JavaScript)',
'tog-editsection' => 'Bรถlรผmleri [diiลtir] baalantฤฑlarฤฑlan diiลtirmรครค hakkฤฑ ver',
'tog-editsectiononrightclick' => 'Bรถlรผm baลlฤฑฤฑna saa tuลla basarak bรถlรผmรผ dรผzmรครค izin ver.(JavaScript)',
'tog-showtoc' => 'ฤฐรงindรคkiler tabliศasฤฑnฤฑ dรผz<br />(3-tรคn รงok baลlฤฑฤฑ olan sayfalar iรงin)',
'tog-rememberpassword' => 'Parolu hatฤฑrla',
'tog-editwidth' => 'Diiลtirmรครค eri brauzer pencerรคsi bรผรผklรผktรค olsun',
'tog-watchcreations' => 'Yarattฤฑฤฑm sayfalarฤฑ bakmaa listama ekle',
'tog-watchdefault' => 'Diiลmรคk yapฤฑlan sayfayฤฑ bakmaa listasฤฑna ekle',
'tog-watchmoves' => 'Bakmaa listama ekle o sayfalarฤฑ angฤฑlarฤฑnฤฑ taลฤฑdฤฑm',
'tog-watchdeletion' => 'Sildiim sayfalarฤฑ bakmaa listama ekle',
'tog-minordefault' => "Hepsi diiลmรคkleri 'kรผรงรผk diiลmรคk' olarak nฤฑลanna",
'tog-previewontop' => 'รni siiri diiลtirmรครค pencerรคsi รผstรผnde gรถster',
'tog-previewonfirst' => 'ฤฐlk kerรค diiลtirรคr kรคnรค รถn siiri gรถster',
'tog-nocache' => 'Sayfalarฤฑ keล etmรครค yasakla',
'tog-enotifwatchlistpages' => 'Sayfa diiลรคr kรคnรค bana e-mail gรถnder',
'tog-enotifusertalkpages' => 'Kullanฤฑcฤฑ sayfamda diiลmรคk olar kana bana e-mail gรถnder',
'tog-enotifminoredits' => 'Sayfalardaki kรผรงรผk diiลmรคklerdรค dรค bana e-mail gรถnder',
'tog-enotifrevealaddr' => 'Bildirmรครค maillerinde e-mail adresimi gรถster.',
'tog-shownumberswatching' => 'ฤฐzlรครคn kullanฤฑcฤฑ sayฤฑsฤฑn gรถster',
'tog-fancysig' => 'รii imza (ฤฐmzanฤฑz gรถrรผner nesoy onu yukarda belirttiniz. Sayfanฤฑza avtomatik baalantฤฑ yaratฤฑlmaycรชk)',
'tog-externaleditor' => 'Dรผzmรครค baลka editor programmasฤฑlan yap',
'tog-externaldiff' => 'Karลฤฑlaลtฤฑrmaklarฤฑ dฤฑล programmalan yap.',
'tog-showjumplinks' => '"Git" baalantฤฑsฤฑn iลlet',
'tog-uselivepreview' => 'Tez cannฤฑ รถn siiri kullan (JavaScript) (รชksperimental)',
'tog-forceeditsummary' => 'Bana haber ver ne zaman ani kฤฑsa annatmanฤฑ boล braacam',
'tog-watchlisthideown' => 'Bakmaa listamdan benim diiลmรคklerimi sakla',
'tog-watchlisthidebots' => 'Bakmaa listamdan bot diiลmรคklerini sakla',
'tog-watchlisthideminor' => 'Bakmaa listamdan kรผรงรผk diiลmรคkleri sakla',
'tog-ccmeonemails' => 'Bana da gรถnder o e-maillerin kopiyalarฤฑnฤฑ angฤฑlarฤฑnฤฑ รผbรผr kullanฤฑcฤฑlara gรถnderdim',
'tog-diffonly' => 'Sayfanฤฑn iรงersindรคkini diil lรคazฤฑm gรถstermรครค iki versiyanฤฑ karลฤฑlaลtฤฑrarak',
'underline-always' => 'Dayma',
'underline-never' => 'Hiรง bir zaman',
'underline-default' => 'Brauzer karar kabletsin',
# Dates
'sunday' => 'Pazar',
'monday' => 'Pazertesi',
'tuesday' => 'Salฤฑ',
'wednesday' => 'รarลamba',
'thursday' => 'Perลembรค',
'friday' => 'Cumaa',
'saturday' => 'Cumartesi',
'sun' => 'Paz',
'mon' => 'Pzt',
'tue' => 'Sal',
'wed' => 'รar',
'thu' => 'Per',
'fri' => 'Cumaa',
'sat' => 'Cts',
'january' => 'Yanvar',
'february' => 'Fevral',
'march' => 'Marta',
'april' => 'Aprel',
'may_long' => 'May',
'june' => 'ฤฐyรผn',
'july' => 'ฤฐyรผl',
'august' => 'Avgust',
'september' => 'Sentรคbri',
'october' => 'Oktรคbri',
'november' => 'Noyabri',
'december' => 'Dekabri',
'january-gen' => 'Bรผรผk ay',
'february-gen' => 'Kรผรงรผk ay',
'march-gen' => 'Baba Marta',
'april-gen' => 'รiรงek ay',
'may-gen' => 'Hederlez',
'june-gen' => 'Kirez ay',
'july-gen' => 'Orak ay',
'august-gen' => 'Harman ay',
'september-gen' => 'Ceviz ay',
'october-gen' => 'Canavar ay',
'november-gen' => 'Kasฤฑm ay',
'december-gen' => 'Kฤฑrฤฑm ay',
'jan' => 'Yan',
'feb' => 'Fev',
'mar' => 'Mar',
'apr' => 'Apr',
'may' => 'May',
'jun' => 'ฤฐyn',
'jul' => 'ฤฐyl',
'aug' => 'Avg',
'sep' => 'Sen',
'oct' => 'Okt',
'nov' => 'Noy',
'dec' => 'Dek',
# Categories related messages
'pagecategories' => 'Sayfa {{PLURAL:$1|kategoriyasฤฑ|kategoriyalarฤฑ}}',
'category_header' => '"$1" kategoriyasฤฑndaki sayfalar',
'subcategories' => 'Alt kategoriyalar',
'category-media-header' => '"$1" kategoriyasฤฑndaki media',
'category-empty' => "''Bu kategoriyada henez bulunmรชรชr bir yazฤฑ yaki media.''",
'hidden-categories' => '{{PLURAL:$1|Saklฤฑ kategoriyalar|Saklฤฑ kategoriyalar}}',
'category-subcat-count' => '{{PLURAL:$2|Bu kategoriyaa girer sadรค aลaadaki alt kategoriya.|Bu kategoriya hepsi $2 kategoriyadan {{PLURAL:$1|alt kategoriya|$1 alt kategoriya}}a saab}}',
'category-article-count' => '{{PLURAL:$2|Bu kategoriyaa girer sadรค aลaadaki sayfa.|Hepsi $2 den, aลaadaki {{PLURAL:$1|sayfa|$1 sayfa}} bu kategoriyadan.}}',
'listingcontinuesabbrev' => '(devam)',
'mainpagetext' => "'''MediaWiki baลarฤฑlan kuruldu.'''",
'mainpagedocfooter' => "Vikilรคn iล uurunda bilgi almaa iรงin [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] sayfasฤฑna bakฤฑnฤฑz
== Eni baลlayanlar iรงin ==
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]",
'about' => 'Uurunda',
'article' => 'Yazฤฑ',
'newwindow' => '(eni bir pencerรคdรค aรงฤฑlรชr)',
'cancel' => 'Ret',
'moredotdotdot' => 'Taa...',
'mypage' => 'Benim sayfam',
'mytalk' => 'Sรถzleลmรคk sayfam',
'anontalk' => 'Bu IP-nin konuลmalarฤฑ',
'navigation' => 'Saytda yol bulmaa',
'and' => ' hem',
# Cologne Blue skin
'qbfind' => 'Bul',
'qbbrowse' => 'Taramaa',
'qbedit' => 'Diiลtir',
'qbpageoptions' => 'Bu sayfa',
'qbpageinfo' => 'Kontekst',
'qbmyoptions' => 'Sayfalarฤฑm',
'qbspecialpages' => 'Maasus sayfalar',
'faq' => 'SSS',
'faqpage' => 'Project:SSS',
'errorpagetitle' => 'Yannฤฑล',
'returnto' => '$1 dรถn.',
'tagline' => '{{SITENAME}} saydฤฑndan',
'help' => 'Yardฤฑm',
'search' => 'Ara',
'searchbutton' => 'Ara',
'go' => 'Git',
'searcharticle' => 'Git',
'history' => 'Sayfanฤฑn istoriyasฤฑ',
'history_short' => 'ฤฐstoriya',
'updatedmarker' => 'bitki geliลimdรคn sora enilenmiล',
'info_short' => 'Bilgi',
'printableversion' => 'Tiparlanacรชk versiya',
'permalink' => 'Bitki haline baalantฤฑ',
'print' => 'Tiparla',
'edit' => 'Diiลtir',
'create' => 'Eni yazฤฑ yarat',
'editthispage' => 'Sayfayฤฑ diiลtir',
'delete' => 'Sil',
'deletethispage' => 'Sayfayฤฑ sil',
'undelete_short' => '$1 diiลmรคk geeri gelsin',
'protect' => 'Korunmak altฤฑna al',
'protect_change' => 'Diiลtir',
'protectthispage' => 'Sayfayฤฑ korunmak altฤฑna al',
'unprotect' => 'Korunmayฤฑ kaldฤฑr',
'unprotectthispage' => 'Sayfa korunmaanฤฑ kaldฤฑr',
'newpage' => 'Eni sayfa',
'talkpage' => 'Sayfayฤฑ diskussiya et',
'talkpagelinktext' => 'Konuลmaa',
'specialpage' => 'Maasus Sayfa',
'personaltools' => 'Personal instrumentlรคr',
'postcomment' => 'Yorum ekle',
'articlepage' => 'Yazฤฑya bak',
'talk' => 'Dartฤฑลma',
'views' => 'Gรถrรผnรผลler',
'toolbox' => 'ฤฐnstrumentlรคr',
'userpage' => 'Kullanฤฑcฤฑ sayfasฤฑnฤฑ gรถster',
'projectpage' => 'Proekt sayfasฤฑna bak',
'imagepage' => 'Resim sayfasฤฑn gรถster',
'mediawikipage' => 'Mesaj sayfasฤฑnฤฑ gรถster',
'templatepage' => 'ลablon sayfasฤฑn gรถster',
'viewhelppage' => 'Yardฤฑm sayfasฤฑna bak',
'categorypage' => 'Kategoriya sayfasฤฑnฤฑ gรถster',
'viewtalkpage' => 'Konuลmaa sayfasฤฑna git',
'otherlanguages' => 'รbรผr diller',
'redirectedfrom' => '($1 sayfasฤฑnnan yรถnnendirildi)',
'redirectpagesub' => 'Yรถnnendirme sayfasฤฑ',
'lastmodifiedat' => 'Bu sayfa bitki kerรค $2, $1 datasฤฑnda enilendi.',
'viewcount' => 'Bu sayfaya {{PLURAL:$1|bir|$1 }} kerรค girildi.',
'protectedpage' => 'Korunmaklฤฑ sayfa',
'jumpto' => 'Git hem:',
'jumptonavigation' => 'kullan',
'jumptosearch' => 'ara',
# All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage) and the disambiguation template definition (see disambiguations).
'aboutsite' => '{{SITENAME}} iรงin',
'aboutpage' => 'Project:Uurunda',
'copyright' => 'ฤฐรงersindeki $1 altฤฑnda.',
'copyrightpage' => '{{ns:project}}:Avtorluk haklarฤฑ',
'currentevents' => 'Hergรผnkรผ sluรงaylar',
'currentevents-url' => 'Project:Hergรผnkรผ sluรงaylar',
'disclaimers' => 'Cuvapรงฤฑlฤฑk reti',
'disclaimerpage' => 'Project:Genel cuvapรงฤฑlฤฑk reti',
'edithelp' => 'Nesoy var nicรค diiลtirmรครค?',
'edithelppage' => 'Help:Nesoy var nicรค sayfa diiลtirmรครค',
'helppage' => 'Help:ฤฐรงindekilรคr',
'mainpage' => 'Baล yaprak',
'mainpage-description' => 'Baล yaprak',
'policy-url' => 'Project:Politika',
'portal' => 'Topluluk portalฤฑ',
'portal-url' => 'Project:Topluluk portalฤฑ',
'privacy' => 'Saklamaa politikasฤฑ',
'privacypage' => 'Project:Saklamaa politikasฤฑ',
'badaccess' => 'ฤฐzin kusurluu',
'badaccess-group0' => 'Bu iลlemi yapmaa kuvediniz yok.',
'badaccess-groups' => 'O iลlem ani yapmaa neetlendiniz var nicรค yapฤฑlsฤฑn sadรค {{PLURAL:$2|gruppa|gruppalarฤฑnnan}} birinin kullanฤฑcฤฑlarฤฑ tarafฤฑnnan: $1.',
'versionrequired' => 'MediaWiki-nin $1 versiyasฤฑ lรคazฤฑm',
'versionrequiredtext' => 'MediaWiki-nin $1 versiyasฤฑ lรคazฤฑm bu sayfayฤฑ kullanmaa deyni. Bak [[Special:Version|versiya sayfasฤฑ]].',
'ok' => 'TAMAN',
'retrievedfrom' => 'Alฤฑndฤฑ "$1"dรคn',
'youhavenewmessages' => 'Var eni <u>$1</u>. ($2)',
'newmessageslink' => 'eni mesajlar',
'newmessagesdifflink' => 'Bitki diiลmรคk',
'youhavenewmessagesmulti' => "$1'de eni mesajฤฑnฤฑz var.",
'editsection' => 'diiลtir',
'editold' => 'diiลtir',
'editlink' => 'diiลtir',
'viewsourcelink' => 'Geliniri gรถr',
'editsectionhint' => 'Diiลtirilen bรถlรผm: $1',
'toc' => 'ฤฐรงindekilรคr',
'showtoc' => 'gรถster',
'hidetoc' => 'sakla',
'thisisdeleted' => '$1 gรถrmรครค yaki geeri getirmรครค isteermisiniz?',
'viewdeleted' => '$1 gรถr?',
'restorelink' => 'silinmiล $1 diiลmรคk',
'feedlinks' => 'Beslemรครค:',
'feed-invalid' => 'Yannฤฑล beslemรครค tipi.',
'site-rss-feed' => '$1 RSS Feed',
'site-atom-feed' => '$1 Atom Feed',
'page-rss-feed' => '"$1" RSS lenta',
'page-atom-feed' => '"$1" Atom beslemรครค',
'red-link-title' => '$1 (sayfa yok)',
# Short words for each namespace, by default used in the namespace tab in monobook
'nstab-main' => 'Yazฤฑ',
'nstab-user' => 'kullanฤฑcฤฑ sayfasฤฑ',
'nstab-media' => 'Media',
'nstab-special' => 'Maasus yaprak',
'nstab-project' => 'Proekt sayfasฤฑ',
'nstab-image' => 'Fayl',
'nstab-mediawiki' => 'Mesaj',
'nstab-template' => 'ลablon',
'nstab-help' => 'Yardฤฑm',
'nstab-category' => 'Kategoriya',
# Main script and global functions
'nosuchaction' => 'Bรถlรค bir iลlem yok',
'nosuchactiontext' => 'URL tarafฤฑnnan tanฤฑnan iลlem Viki tarafฤฑnnan kabledilmedi.',
'nosuchspecialpage' => 'Bu adda bir maasus sayfa yok',
'nospecialpagetext' => 'Bir maasus sayfaya girdiniz angฤฑsฤฑ bulunmรชรชr. Var olan hepsi maasus sayfalarฤฑ yakฤฑลรชr sizรค gรถrmรครค [[Special:SpecialPages|{{int:specialpages}}]] sayfasฤฑnda.',
# General errors
'error' => 'Kusurluk',
'databaseerror' => 'Data bazasฤฑ kusurluu',
'readonly' => 'Data bazasฤฑ kilitlendi',
'missing-article' => 'Yok nicรค bulunsun "$1" $2 adlฤฑ sayfadan teksti angฤฑsฤฑ istenerdi bulunsun.
Bu hal var nasฤฑl peydalansฤฑn aรงan sayfa olรชr geรงmiล reviziyasฤฑ o sayfanฤฑn angฤฑsฤฑ silindi.
Herliim sebep diilsรค bu, bekim karลฤฑlaลtฤฑnฤฑz bir yannฤฑลlan angฤฑsฤฑ yapฤฑldฤฑ aรงan programma yazฤฑldฤฑ.
Yalvarรชrฤฑz benneyiniz URL - i hem raport ediniz bunu bir [[Special:ListUsers/sysop|izmetliyรค]]',
'missingarticle-rev' => '(reviziya#: $1)',
'internalerror' => 'ฤฐรง yannฤฑล',
'internalerror_info' => 'ฤฐรง yannฤฑล: $1',
'filecopyerror' => '"$1" "$2" faylฤฑna kopiyalanameer.',
'filerenameerror' => '"$1" faylฤฑn adฤฑ "$2" adฤฑna diiลtirilemeer.',
'filedeleteerror' => '"$1" faylฤฑ silinemedi.',
'filenotfound' => '"$1" faylฤฑ bulunamadฤฑ.',
'badtitle' => 'Yannฤฑล yazฤฑ adฤฑ',
'badtitletext' => 'Girilen sayfa adฤฑ beki yannฤฑล beki de boล, yaki geรงersiz neรงin ki diller arasฤฑ baalantฤฑ yaki vikiler arasฤฑ baalantฤฑ iรงerer. Var nicรค iรงindรค olsun bir yaki taa รงok nฤฑลan angฤฑlarฤฑ yasak baลlฤฑklarda kullanฤฑlsฤฑn.',
'viewsource' => 'Geliniri gรถr',
'viewsourcefor' => '$1 iรงin',
'protectedpagetext' => 'Bu sayfa diiลtirmรคmรครค deyni kilitlendi.',
'viewsourcetext' => 'Var nicรค gรถrmรครค hem kopiya etmรครค bu yapraa gelinirini:',
# Login and logout pages
'logouttext' => 'Sessiyayฤฑ kapattฤฑnฤฑz.
ลindi var nicรค devam etmรครค kullanmaa {{SITENAME}} saytฤฑnฤฑ kimlik gรถstermedรคn yaki [[Special:UserLogin|enidรคn sessiya aรงmaa]] (ister hep o kullanฤฑcฤฑ adฤฑylan, ister baลka bir kullanฤฑcฤฑ adฤฑylan). O zamana kadar ani web brauzerinizin keลi temizlenecek bir takฤฑm sayfalar var nicรค gรถrรผnsรผn sansฤฑn sessiya hep aรงฤฑk.',
'welcomecreation' => '== Hoล geldiniz $1! ==
Esapฤฑnฤฑz aรงฤฑldฤฑ. Unutmayฤฑn [[Special:Preferences|{{SITENAME}} preferences]] seรงimnerin diiลtirmรครค.',
'yourname' => 'Kullanฤฑcฤฑ adฤฑnฤฑz',
'yourpassword' => 'Parol',
'yourpasswordagain' => 'Parolu enidรคn yaz',
'remembermypassword' => 'Parolu hatฤฑrla.',
'yourdomainname' => 'Domen adฤฑnฤฑz',
'login' => 'Gir',
'nav-login-createaccount' => 'Gir / esap yarat',
'loginprompt' => "Bak: {{SITENAME}} saytฤฑnda sessiya aรงmaa iรงin tarayฤฑcฤฑnฤฑzda lรคazฤฑm cookies aktivat olsun. <br />
Kullanฤฑcฤฑ adฤฑnฤฑz '''var nicรค iรงersin'''gagauzรงa nฤฑลan, boลluk . Savaลฤฑn kullanฤฑcฤฑ adฤฑnฤฑza e-mail adresi '''girmemรครค'''.",
'userlogin' => 'Gir / esap yarat',
'logout' => 'Sessiyanฤฑ kapat',
'userlogout' => 'Oturmaa kapat',
'notloggedin' => 'Sessiya diil aรงฤฑk',
'nologin' => "Henez aza olmadฤฑnฤฑz? '''$1'''.",
'nologinlink' => 'Esap yarat',
'createaccount' => 'Eni esap aรง',
'gotaccount' => "Taa ilerdรค esap aรงtฤฑnฤฑzmฤฑ? '''$1'''.",
'gotaccountlink' => 'Herliim ilerdรคn esap aรงtฤฑysanฤฑz girin bu baalantฤฑdan.',
'createaccountmail' => 'e-maillan',
'badretype' => 'Parollar angฤฑlarฤฑnฤฑ girdiniz uymรชรชr.',
'userexists' => 'Kullanฤฑcฤฑ adฤฑ ani girdiniz kullanฤฑlรชr. Yalvarรชrฤฑz farklฤฑ bir kullanฤฑcฤฑ adฤฑ seรงin.',
'loginerror' => 'Sessiya aรงmaa yannฤฑลฤฑ.',
'noname' => 'Geรงerli bir kullanฤฑcฤฑ adฤฑ girmediniz.',
'loginsuccesstitle' => 'Sessiya baลarฤฑlan aรงฤฑldฤฑ',
'loginsuccess' => '{{SITENAME}} saytฤฑnda "$1" kullanฤฑcฤฑ adฤฑlan sessiya aรงtฤฑnฤฑz.',
'nosuchuser' => 'Burada "$1" adlฤฑ kullanฤฑcฤฑ yok. Yokla bir taa nesoy yazdฤฑn, yaki eni esap yarat.',
'nosuchusershort' => 'Burada "<nowiki>$1</nowiki>" adlฤฑ kullanฤฑcฤฑ yok. Yoklayฤฑn ani ad nesoy yazฤฑldฤฑ.',
'nouserspecified' => 'Lรคazฤฑm bir kullanฤฑcฤฑ adฤฑ gรถstermรครค.',
'wrongpassword' => 'Parolu yannฤฑล girdiniz. Yalvarerรชz tekrar denรคmรครค.',
'wrongpasswordempty' => 'Boล parol girdiniz. Yalvarerez tekrar denรคmรครค.',
'passwordtooshort' => 'Parolunuz รงok kฤฑsa. En az $1 bukva hem/yaki ศifra lรคazฤฑm olsun.',
'mailmypassword' => 'Gรถnder bana e-maillรคn eni bir parol',
'passwordremindertitle' => '{{SITENAME}} saytฤฑndan parol hatฤฑrlatฤฑcฤฑsฤฑ.',
'passwordremindertext' => '$1 IP adresinnรคn (beki siz) istendi {{SERVERNAME}} iรงin eni bir {{SITENAME}} ($4) parolu gรถndermรครค.
"$2" nikli kullanฤฑcฤฑnฤฑn eni parolu: "$3"
Lรคazฤฑm sessiya aรงmaa hem parolu diiลtirmรครค.
Herliim istemeersiniz parolu diiลtirmรครค, yaki vaz geรงtiniz neรงin ki parolu hatฤฑrladฤฑnฤฑz bu haberi ignor edin hem devam edin kullanmaa eski parolu.',
'noemail' => '"$1" adlฤฑ kullanฤฑcฤฑ iรงin registrat olmuล e-mail adresi yok.',
'passwordsent' => '"$1" adฤฑna registrat olmuล e-mail adresine eni bir parol gรถnderildi. Lรผtfen, lรคazฤฑm aรงmaa oturmaa ne zaman bunu aldฤฑnฤฑz.',
'blocked-mailpassword' => 'Neรงin ki ฤฐP adresiniz kรถsteklendi, eni parol gรถnderilmรคk iลlemi yapฤฑlmรชรชr.',
'eauthentsent' => 'Registrat olunan adresa doorulamak kodlan e-mail gรถnderildi.
O zamana kadar ani e-maildaki instrukศiyalar yapฤฑlmaycรชk hem doorulanmaycรชk ki o adres sizin, baลka e-mail gรถnderilmeycek.',
'mailerror' => 'E-mail gรถndermรคk yannฤฑลฤฑ: $1',
'acct_creation_throttle_hit' => '$1 kullanฤฑcฤฑ esap aรงtฤฑnฤฑz. Taa รงok yok nicรค aรงasฤฑnฤฑz.',
'emailauthenticated' => 'E-mail adresiniz $2 $3 datasฤฑnda doorulandฤฑ.',
'emailconfirmlink' => 'E-mail adresinizi doorulayฤฑn',
'accountcreated' => 'Esap aรงฤฑldฤฑ',
'accountcreatedtext' => '$1 iรงin bir kullanฤฑcฤฑ esapฤฑ aรงฤฑldฤฑ.',
'createaccount-title' => '{{SITENAME}} iรงin esap aรงฤฑlฤฑลฤฑ',
'loginlanguagelabel' => 'Dil: $1',
# Password reset dialog
'retypenew' => 'Eni parolu tekrar girin',
'resetpass_forbidden' => 'Saytฤฑnda parol yok nicรค diiลtirilsin',
# Edit page toolbar
'bold_sample' => 'Kalฤฑn tekst',
'bold_tip' => 'Kalฤฑn tekst',
'italic_sample' => 'ฤฐtalik tekst',
'italic_tip' => 'ฤฐtalik tekst',
'link_sample' => 'Sayfanฤฑn adฤฑ',
'link_tip' => 'ฤฐรง baalantฤฑ',
'extlink_sample' => 'http://www.example.com adres adฤฑ',
'extlink_tip' => 'Dฤฑล baalantฤฑ (Unutmayฤฑn adresin รถnรผne http:// koymaa)',
'headline_sample' => 'Baลlฤฑk teksti',
'headline_tip' => '2. dรผzey baลlฤฑk',
'math_sample' => 'Matematik-formulanฤฑ-koyun',
'math_tip' => 'Matematik formula (LaTeX formatฤฑnda)',
'nowiki_sample' => 'Serbest format yazฤฑnฤฑzฤฑ buraya yazฤฑnฤฑz',
'nowiki_tip' => 'Wiki formatlamasฤฑnฤฑ ignor et',
'image_tip' => 'Pรคtret eklemรครค',
'media_tip' => 'Faylฤฑna baalantฤฑ',
'sig_tip' => 'ฤฐmzanฤฑz hem data',
'hr_tip' => 'Gorizontal liniya (รงok sฤฑk kullanmayฤฑn)',
# Edit pages
'summary' => 'Kฤฑsaca:',
'subject' => 'Konu/baลlฤฑk:',
'minoredit' => 'Kรผรงรผk diiลilmรคkler',
'watchthis' => 'Bak bu sayfaa',
'savearticle' => 'Sayfayฤฑ registrat et',
'preview' => 'รn siir',
'showpreview' => 'รn siiri gรถster',
'showlivepreview' => 'Cannฤฑ รถn siir',
'showdiff' => 'Diiลilmรคkleri gรถster',
'anoneditwarning' => 'Sessiya aรงmadฤฑnฤฑz deyni yazฤฑnฤฑn diiลmรคk istoriyasฤฑna diil nik, IP adresiniz registrat olunacรชk.',
'summary-preview' => 'รn siir รถzeti:',
'subject-preview' => 'Konu/baลlฤฑk รถn siiri:',
'blockedtitle' => 'Kullanฤฑcฤฑ kรถsteklendi.',
'blockedtext' => 'Kullanฤฑcฤฑ adฤฑnฤฑz yaki parolunuz $1 tarafฤฑndan kรถsteklendi.
Sizi kรถstek edรคn รถnderci: $1. Kรถstek sebebi: \'\'$2\'\'.
Eer dรผลรผnรผrsรผnรผz ani kรถstek diil dooru o sebeptรคn angฤฑsฤฑ belirtildi, var nicรค konuลmaa bu situaศiyanฤฑ $1lan yaki baลka bir [[{{MediaWiki:Grouppage-sysop}}|รถnderci]]lรคn.
Herliim girmediniz [[Special:Preferences|seรงimner]] bรถlรผmรผnde geรงerli bir e-mail adresi, yok nicรค kullanmaa "Kullanฤฑcฤฑya e-mail gรถnder" seรงimini.
ลindi IP adresiniz $3. Yalvarรชrรชz bu adresi belirtmรครค her angฤฑ bir sorgu yapar kana.',
'blockednoreason' => 'hiรง bir sebep belirtilmedi',
'blockedoriginalsource' => "'''$1''' sayfasฤฑn kaynak teksti aลaada:",
'whitelistedittitle' => 'Lรครคzฤฑm aรงmaa sessiya diiลmรคk yapmaa deyni',
'whitelistedittext' => 'Diiลmรคk yapmaa iรงin $1.',
'nosuchsectiontitle' => 'Bรถlรค bรถlรผm yok',
'loginreqtitle' => 'Lรครคazฤฑm sessiya aรงmaa',
'loginreqlink' => 'sessiya aรง',
'loginreqpagetext' => 'Lรครคzฤฑm $1 gรถrmรครค รผbรผr sayfalarฤฑ.',
'accmailtitle' => 'Parol gรถnderildi.',
'accmailtext' => '[[User talk:$1|$1]] kullanฤฑcฤฑsฤฑn parolu $2 adresine gรถnderildi.',
'newarticle' => '(Eni)',
'newarticletext' => "Henez var olmayan bir sayfaya konulmuล baalantฤฑya tuลladฤฑnฤฑz. Bu sayfayฤฑ yaratmaa deyni aลaadaki tekst kutusunu kullanฤฑnฤฑz. Bilgi iรงin [[{{MediaWiki:Helppage}}|yardฤฑm sayfasฤฑna]] bakฤฑnฤฑz. Herliim buraya yannฤฑล geldiniz, lรคazฤฑm tuลlamaa programฤฑnฤฑzฤฑn '''Geeri''' tuลuna.",
'noarticletext' => 'Bu sayfa boล.
Bu baลlฤฑฤฑ [[Special:Search/{{PAGENAME}}|var nicรค aramaa]] รผbรผr sayfalarda yaki bu sayfayฤฑ siz <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} ilgili gรผnlรผkleri arayabilir], ya [{{fullurl:{{FULLPAGENAME}}|action=edit}} var nicรค yazmaa]</span>.',
'updated' => '(Enilendi)',
'previewnote' => "'''Bu saadรค bir รถn siir, hem diiลmรคkler henez korunmadฤฑ!'''",
'editing' => '"$1" sayfasฤฑn diiลtirersiniz',
'editingsection' => '"$1" sayfasฤฑnda bรถlรผm diiลtirersiniz',
'editingcomment' => '$1 sayfasฤฑna yorum ekleersiniz.',
'editconflict' => 'Diiลmรคk konflikti: $1',
'yourtext' => 'Sizin tekstiniz',
'storedversion' => 'Saklanmฤฑล tekst',
'yourdiff' => 'Farklar',
'copyrightwarning' => "'''Bakฤฑnฤฑz:''' {{SITENAME}} saytฤฑna yapฤฑlan hepsi eklemรคkler hem diiลmรคkler lรคazฤฑm olsun <i>$2</i>
liศenziyasฤฑ ลartlarฤฑ iรงindรค (detallar iรงin $1'a bakฤฑnฤฑz).
Herliim istemeersiniz ani sizin tekstlรคr serbest yayฤฑlsฤฑn hem diiลtirilsin รผbรผr kullanฤฑcฤฑlar tarafฤฑnnan, onnarฤฑ erleลtirmeyniz buraya.<br />
Hem siz garantiyada bulunรชrsiniz ani eklemรคklerin avtorusunuz, yaki onnarฤฑ kopiya ettiniz kaynaktan angฤฑsฤฑ izin verer teksti serbest yaymaa hem diiลtirmรครค.<br />
'''<center>AVTORLUK KORUNMAK HAKKILAN KORUNMAYAN MATERฤฐALLAR EKLEMEYNฤฐZ!</center>'''",
'longpagewarning' => "'''BAK: Bu sayfanฤฑn รถlรงรผsรผ $1 kilobayt; รถlรงรผsรผ 32 kb-a yakฤฑn yaki onnan รงok sayfalar bir takฤฑm brauzerlรคrdรค var nicรค yannฤฑล gรถrรผnsรผn. Savaลรชnฤฑz onu bรถlรผmnerรค ayฤฑrmaa.'''",
'templatesused' => 'Bu sayfada kullanฤฑlan {{PLURAL:$1|ลablon|ลablonlar}}:',
'templatesusedpreview' => '{{PLURAL:$1|ลablon|ลablonnar}} ani bu รถn siirdรค kullanฤฑldฤฑ:',
'templatesusedsection' => 'Bu bรถlรผmde kullanฤฑlan {{PLURAL:$1|ลablon|ลablonlar}}:',
'template-protected' => '(korumaa)',
'template-semiprotected' => '(yarฤฑ-korunmaa)',
'hiddencategories' => 'Bu sayfa {{PLURAL:$1|1 saklฤฑ kategoriyaya|$1 saklฤฑ kategoriyaya}} baalฤฑ:',
'nocreatetext' => '{{SITENAME}} eni yazฤฑlar yaratmaa yasaklandฤฑ.
Sizรค yakฤฑลรชr geeri dรถnmรครค hem dรผzmรครค var olan yapraa, yaki [[Special:UserLogin|sessiya aรงmaa yaki esap yaratmaa]].',
'permissionserrors' => 'ฤฐzin yannฤฑลlarฤฑ',
'permissionserrorstext-withaction' => 'Aลaadaki {{PLURAL:$1|sebep|sebepler}}รค deyni yok $2 kuvediniz:',
'recreate-moveddeleted-warn' => "'''Bak: Siz yarattฤฑnฤฑz o sayfayฤฑ angฤฑsฤฑ ilerdรคn silindi.'''
Lรคazฤฑm dรผลรผnmรครค bu sayfayฤฑ redaktat etmรครค devam etmรครค deyni.
Sayfanฤฑn silmรครค jurnalฤฑ raatlฤฑk iรงin yazฤฑlรชr burada:",
# Account creation failure
'cantcreateaccounttitle' => 'Yok nicรค esap yaratฤฑlsฤฑn',
# History pages
'viewpagelogs' => 'Bu yaprak iรงin jurnallarฤฑ gรถster',
'currentrev' => 'ลindiki versiya',
'currentrev-asof' => '$1 sayfanฤฑn ลindiki halฤฑ',
'revisionasof' => 'Sayfanฤฑn $1 datasฤฑndaki hali',
'revision-info' => '$1; $2 datalฤฑ versiya',
'previousrevision' => 'โ ฤฐlerki hali',
'nextrevision' => 'Geerki hali โ',
'currentrevisionlink' => 'en bitki halini gรถster',
'cur' => 'fark',
'next' => 'geeriki',
'last' => 'bitki',
'page_first' => 'ilk',
'page_last' => 'bitki',
'histlegend' => "Fark seรงimi: 2 versiyanฤฑn angฤฑsฤฑnฤฑ isteersiniz karลฤฑlaลtฤฑrmaa, รถnรผndeki kutucaa tuลlayฤฑp, enter'a basฤฑn yaki tuลlayฤฑn butona angฤฑsฤฑ sayfanฤฑn en altฤฑnda bulunรชr.<br />
Nฤฑลannar: (bitki) = ลindiki versiyalan aradaki fark,
(ilerki) = bir ilerki versiyalan aradaki fark, K = kรผรงรผk diiลmรคk",
'history-fieldset-title' => 'Geรงmiลรค bak',
'histfirst' => 'En eski',
'histlast' => 'En eni',
'historysize' => '({{PLURAL:$1|1 bayt|$1 bayt}})',
'historyempty' => '(boล)',
# Revision feed
'history-feed-title' => 'Diiลmรคk istoriyasฤฑ',
'history-feed-item-nocomment' => ' $2de $1',
# Revision deletion
'rev-deleted-comment' => '(yorum silindi)',
'rev-deleted-user' => '(kullanฤฑcฤฑ adฤฑ silindi)',
'rev-deleted-event' => '(giriล silindi)',
'rev-delundel' => 'gรถster/sakla',
'revdel-restore' => 'Gรถrรผmรผ diiลtir',
# History merging
'mergehistory-from' => 'Kaynak sayfasฤฑ:',
'mergehistory-into' => 'Yรถn sayfasฤฑ:',
# Merge log
'revertmerge' => 'Ayฤฑr',
# Diffs
'history-title' => '"$1" yapraฤฑn istoriyasฤฑ',
'difference' => '(Versiyalar arasฤฑ farklar)',
'lineno' => '$1. liniya:',
'compareselectedversions' => 'Karลฤฑlaลtฤฑr versiyalarฤฑ ani seรงildi',
'editundo' => 'geeri al',
'diff-multi' => '({{PLURAL:$1|Ara versiya|$1 ara versiyalar}} gรถsterilmedi.)',
# Search results
'searchresults' => 'Aaramak rezultatlarฤฑ',
'searchresults-title' => '"$1" iรงin aaramak rezultatlarฤฑ',
'searchresulttext' => '{{SITENAME}} iรงindรค aaramaa deyni bilgi almaa iรงin var nicรค bakmaa [[{{MediaWiki:Helppage}}|{{int:help}}]] sayfasฤฑna.',
'searchsubtitle' => '\'\'\'[[:$1]]\'\'\' iรงin aaradฤฑnฤฑz. ([[Special:Prefixindex/$1|hepsi sayfalar angฤฑlarฤฑ baลlรชรชr "$1"]], [[Special:WhatLinksHere/$1|hepsi sayfalar angฤฑlarฤฑ baalฤฑ "$1"]])',
'searchsubtitleinvalid' => 'Aranรชr: "$1"',
'notitlematches' => 'Hiรง bir baลlฤฑkta yok nicรค bulunsun',
'notextmatches' => ' Hiรง bir baลlฤฑkta yok nicรค bulunsun',
'prevn' => 'ilerki {{PLURAL:$1|$1}}',
'nextn' => 'geeriki {{PLURAL:$1|$1}}',
'viewprevnext' => '($1 {{int:pipe-separator}} $2) ($3).',
'searchhelp-url' => 'Help:ฤฐรงindekilรคr',
'search-result-size' => '$1 ({{PLURAL:$2|1 laf|$2 laf}})',
'search-redirect' => '(gรถndermรครค $1)',
'search-section' => '(bรถlรผm $1)',
'search-suggest' => 'โ ฤฐstediniz demรครค: $1',
'search-interwiki-caption' => 'Kardaล proyektlรคr',
'search-interwiki-default' => '$1 rezultatlar:',
'search-interwiki-more' => '(taa รงok)',
'search-mwsuggest-enabled' => 'tekliflerlรคn',
'search-mwsuggest-disabled' => 'tekliflersiz',
'nonefound' => "'''Bennemรคk''': Sadรค kimi ad erleri sessizcรค aaranรชr.
Aaramaanฤฑzฤฑn รถnรผnรค ''all:'' prefiksini koyun da deneyin hepsi iรงlii aaramaa deyni (sรถzleลmรคk sayfalarฤฑ, ลablonlar h.b.pay alarak), yaki kullanฤฑnฤฑz beenilรคn prefiksi sansฤฑn er adฤฑ.",
'powersearch' => 'Geliลmiล arama',
'powersearch-legend' => 'Geliลmiล arama',
'powersearch-ns' => 'Ad erlerindรค aara:',
'powersearch-redir' => 'Yรถnnendirmรคkler listasฤฑ',
'powersearch-field' => 'Aara',
# Preferences page
'preferences' => 'Seรงimner',
'mypreferences' => 'Seรงimnerim',
'skin-preview' => 'รn siir',
'youremail' => 'E-mail adresiniz*',
'username' => 'Kullanฤฑcฤฑ adฤฑ:',
'uid' => 'Registraศiya nomeri:',
'yourrealname' => 'Haliz adฤฑnฤฑz:',
'yourlanguage' => 'Dil:',
'yournick' => 'Nik',
'badsig' => 'Geรงersiz รงii imza; HTML etiketlerini yoklayฤฑn.',
'badsiglength' => 'Kullanฤฑcฤฑ adฤฑ รงok uzun; lรครคzฤฑm olsun $1 simvol altฤฑnda.',
'email' => 'E-mail',
'prefs-help-realname' => '* Aslฤฑ ad (istemรครค baalฤฑ): herliim seรงersรคniz aslฤฑ adฤฑ vermรครค, iลinize gรถrรค sizin iรงin kullanฤฑlacรชk.',
'prefs-help-email-required' => 'E-mail adres istenildi.',
# User rights
'editinguser' => "'''[[User:$1|$1]]''' sayfasฤฑnฤฑ diiลtirersiniz ([[User talk:$1|{{int:talkpagelinktext}}]] | [[Special:Contributions/$1|{{int:contribslink}}]])",
# Groups
'group-sysop' => 'Administratorlar',
'grouppage-sysop' => '{{ns:project}}:รnderciler',
# User rights log
'rightslog' => 'Kullanฤฑcฤฑ haklarฤฑ jurnalฤฑ',
# Associated actions - in the sentence "You do not have permission to X"
'action-edit' => 'Sayfaa diiลtir',
# Recent changes
'nchanges' => '$1 {{PLURAL:$1|diiลtir|diiลtir}}',
'recentchanges' => 'Bitki diiลikmรคklรคr',
'recentchanges-legend' => 'Bitki diiลlรคr opลฃiyalarฤฑ',
'recentchanges-feed-description' => 'Bu lentalan en bitki diiลmรคkleri vikiyรค yaz.',
'rcnote' => "$4 datasฤฑ hem saat $5 iรงin bitki {{PLURAL:$2|1 gรผndรค|'''$2''' gรผndรค}} yapฤฑlan, {{PLURAL:$1|'''1'''diiล|'''$1''' diiล}}",
'rcnotefrom' => "'''$2''' datasฤฑnnan bรผรผne kadar yapฤฑlan diiลmรคkler aลaada (en รงok '''$1''' yazฤฑ gรถsteriler).",
'rclistfrom' => 'Gรถster diiลmรคkleri ani $1 datasฤฑndan beeri yapฤฑldฤฑ',
'rcshowhideminor' => 'kรผรงรผk diiลilmรคklรคri $1',
'rcshowhidebots' => 'botlarฤฑ $1',
'rcshowhideliu' => 'registrat olmuล kullanฤฑcฤฑlarฤฑ $1',
'rcshowhideanons' => 'anonim kullanฤฑcฤฑlarฤฑ $1',
'rcshowhidepatr' => 'bakฤฑlmฤฑล diiลmรคkleri $1',
'rcshowhidemine' => 'diiลmรคklerimi $1',
'rclinks' => 'Gรถster bitki $1 diiลmรคklii ani yapฤฑldฤฑ $2 gรผndรค;<br /> $3',
'diff' => 'fark',
'hist' => 'geรงmiล',
'hide' => 'sakla',
'show' => 'Gรถster',
'minoreditletter' => 'K',
'newpageletter' => 'E',
'boteditletter' => 'b',
'rc-enhanced-expand' => 'Detallarฤฑ gรถster (JavaScript lรครคzฤฑm)',
'rc-enhanced-hide' => 'Detallarฤฑ sakla',
# Recent changes linked
'recentchangeslinked' => 'ฤฐlgili diiลilmรคklรคr',
'recentchangeslinked-feed' => 'ฤฐlgili diiลilmรคklรคr',
'recentchangeslinked-toolbox' => 'ฤฐlgili diiลilmรคklรคr',
'recentchangeslinked-title' => '"$1" ilgili diiลmรคklรคr',
'recentchangeslinked-noresult' => 'Baalantฤฑlฤฑ sayfalarda verilmiล devirde diiลmรคk olmadฤฑ.',
'recentchangeslinked-summary' => "Bu maasus sayfa baalantฤฑlฤฑ sayfalardaki diiลmรคkleri sayรชr.
Sizin bakmaa [[Special:Watchlist|listasฤฑndaki]] sayfalar verildi '''kalฤฑn''' bukvalarnan.",
'recentchangeslinked-page' => 'Yaprak adฤฑ:',
'recentchangeslinked-to' => 'Bu sayfa erinรค verilen sayfaa baalฤฑ sayfalarฤฑ gรถster',
# Upload
'upload' => 'Fayl รผkle',
'uploadbtn' => 'Fayl รผkle',
'uploadlogpage' => 'Fayl รผklemรคk jurnallarฤฑ',
'uploadedimage' => 'รklenen: "[[$1]]"',
# Special:ListFiles
'listfiles' => 'Pรคtret listasฤฑ',
# File description page
'file-anchor-link' => 'Fayl',
'filehist' => 'Fayl istoriyasฤฑ',
'filehist-help' => 'Fayl istoriyasฤฑn gรถrmรครค deyni Gรผn/Zaman bรถlรผmรผndeki datalarฤฑ tฤฑklayฤฑnฤฑz.',
'filehist-current' => 'ลindiki',
'filehist-datetime' => 'Gรผn/Zaman',
'filehist-thumb' => 'Kรผรงรผk resim',
'filehist-thumbtext' => '$1 versiyasฤฑ iรงin kรผรงรผltรผlmรผล halฤฑ',
'filehist-user' => 'Kullanฤฑcฤฑ',
'filehist-dimensions' => 'Masลtablar',
'filehist-filesize' => 'Fayl รถlรงรผleri',
'filehist-comment' => 'Kommentariya',
'imagelinks' => 'Mediya faylฤฑna baalantฤฑ',
'linkstoimage' => 'Bu fayla {{PLURAL:$1|page links|$1 pages link}} baalantฤฑsฤฑ olan sayfalar:',
'nolinkstoimage' => 'Yok sayfalar ani bu fayla baalฤฑ.',
'sharedupload' => 'Bu fayl $1 รผklendi ortak kullanmak erinรค hem var nicรค kullanฤฑlsฤฑn รผbรผr proektlรคrdรค.',
'uploadnewversion-linktext' => 'Eni fayl รผkle',
# MIME search
'mimesearch' => 'MIME arayฤฑลฤฑ',
# List redirects
'listredirects' => 'Yรถnnendirmรคkler listasฤฑ',
# Unused templates
'unusedtemplates' => 'Kullanฤฑlmayan ลablonlar',
# Random page
'randompage' => 'Razgele sayfa',
# Random redirect
'randomredirect' => 'Razgele yรถnnendirmรคk',
# Statistics
'statistics' => 'ฤฐstatistikalar',
'statistics-header-pages' => 'Sayfa istatistikalarฤฑ',
'statistics-header-edits' => 'Diiลmรคkleri istatistikalarฤฑ',
'statistics-header-views' => 'Resim istatikalarฤฑ',
'statistics-header-users' => 'Kullanฤฑcฤฑ istatistikalarฤฑ',
'statistics-header-hooks' => 'Baลka istatistakalar',
'statistics-articles' => 'Yazฤฑlar',
'statistics-pages' => 'Yapraklar',
'statistics-pages-desc' => 'Vikipediyadaki hepsi sayfalar, dartฤฑลma sayfalarฤฑ, uur sayfalarฤฑ',
'statistics-files' => 'รklenmiล dosyeler',
'statistics-edits' => '{{SITENAME}} kurulmaa beeri yapmaa sayfa diiลmรคkleri',
'statistics-edits-average' => 'Her yapraktaki diiลmรคklerin sayฤฑsฤฑ',
'statistics-views-total' => 'Hepsi resimlรคr',
'statistics-views-peredit' => 'Diiลmรคk baลฤฑna resimlรคr',
'statistics-users' => 'Registratlฤฑ [[Special:ListUsers|kullanฤฑcฤฑlar]]',
'statistics-users-active' => 'Aktivli kullanฤฑcฤฑlar',
'statistics-users-active-desc' => 'Bitki {{PLURAL:$1|gรผn|$1 gรผnde}} รงalฤฑลmaa yapmaa kullanฤฑcฤฑlar',
'statistics-mostpopular' => 'En anฤฑlmฤฑล yazฤฑlar',
'disambiguations' => 'Maana aydฤฑnnatmak yapraklarฤฑ',
'doubleredirects' => 'ฤฐki kerรค yรถnnendirmeler',
'brokenredirects' => 'Var olmayan yazฤฑya yapฤฑlmฤฑล yรถnnendirmeler',
'withoutinterwiki' => 'Baลka dillerรค baalantฤฑsฤฑ olmayan sayfalar',
'fewestrevisions' => 'En az dรผzennemรคk yapฤฑlmฤฑล sayfalar',
# Miscellaneous special pages
'nbytes' => '$1 {{PLURAL:$1|bayt|baytฤฑ}}',
'nlinks' => '$1 {{PLURAL:$1|baalantฤฑ|baalantฤฑ}}',
'nmembers' => '$1 {{PLURAL:$1|aza|azaler}}',
'lonelypages' => 'Sayfalar ani yok kendisinรค hiรง baalantฤฑ',
'uncategorizedpages' => 'Kategorizaศiya olunmamฤฑศ sayfalar',
'uncategorizedcategories' => 'Kategorizaศiya olunmamฤฑล kategoriyalar',
'uncategorizedimages' => 'Her angฤฑ bir kategoriyada olmayan pรคtretler',
'uncategorizedtemplates' => 'ลablonnar angฤฑlarฤฑ kategorizaศiya olunmadฤฑ',
'unusedcategories' => 'Kullanฤฑlmayan kategoriyalar',
'unusedimages' => 'Kullanฤฑlmayan pรคtretler',
'wantedcategories' => 'Kategoriyalar ani istener',
'wantedpages' => 'ฤฐstenen sayfalar',
'mostlinked' => 'En fazlฤฑ baalantฤฑ verilmiล sayfalar',
'mostlinkedcategories' => 'Kategoriyalar angฤฑlarฤฑnda var en รงok yazฤฑ',
'mostlinkedtemplates' => 'En รงok kullanฤฑlan ลablonlar',
'mostcategories' => 'En รงok kategoriyalฤฑ sayfalar',
'mostimages' => 'En รงok kullanฤฑlan pรคtretler',
'mostrevisions' => 'Yapraklar ani en รงok diiลtirildi',
'prefixindex' => 'Prefiks indeks yapraklar',
'shortpages' => 'Kฤฑsa sayfalar',
'longpages' => 'Uzun sayfalar',
'deadendpages' => 'Baลka sayfalara baalantฤฑsฤฑz sayfalar',
'protectedpages' => 'Korunma altฤฑndaki sayfalar',
'listusers' => 'Kullanฤฑcฤฑ listasฤฑ',
'newpages' => 'Eni sayfalar',
'ancientpages' => 'En bitki diiลmรคk datasฤฑ en eski olan yazฤฑlar',
'move' => 'Aadฤฑnฤฑ diiลtir',
'movethispage' => 'Sayfayฤฑ taลฤฑ',
'pager-newer-n' => '{{PLURAL:$1|1 taa eni|$1 taa eni}}',
'pager-older-n' => '{{PLURAL:$1|1 taa eski|$1 taa eski}}',
# Book sources
'booksources' => 'Kaynak kiyatlar',
'booksources-search-legend' => 'Kiyat kaynaklarฤฑnฤฑ aara',
'booksources-go' => 'Git',
# Special:Log
'specialloguserlabel' => 'Kullanฤฑcฤฑ:',
'speciallogtitlelabel' => 'Yazฤฑ adฤฑ:',
'log' => 'Jurnallar',
'all-logs-page' => 'Hepsi jurnallar',
# Special:AllPages
'allpages' => 'Hepsi sayfalar',
'alphaindexline' => '$1den $2e',
'nextpage' => 'Geeriki sayfa ($1)',
'prevpage' => 'ฤฐlerki sayfa ($1)',
'allpagesfrom' => 'Listaya dรผzmรครค baลlanฤฑlacรชk bukvalar:',
'allpagesto' => 'Listaya dรผzmรครค baลlanฤฑlacรชk bukvalar:',
'allarticles' => 'Hepsi yazฤฑlar',
'allpagessubmit' => 'Git',
'allpagesprefix' => 'Gรถsterin sayfalarฤฑ angฤฑlarฤฑ รงekeder bukvalarlan ani buraya yazdฤฑnฤฑz:',
# Special:Categories
'categories' => 'Kategoriyalar',
# Special:LinkSearch
'linksearch' => 'ฤฐรง baalantlar',
# Special:Log/newusers
'newuserlogpage' => 'Eni kullanฤฑcฤฑ bennemรคkleri',
'newuserlog-create-entry' => 'Eni kullanฤฑcฤฑ esabฤฑ',
# Special:ListGroupRights
'listgrouprights-members' => '(azalarฤฑn listasฤฑ)',
# E-mail user
'emailuser' => 'Gรถnder bu kullanฤฑcฤฑya bir e-mail',
# Watchlist
'watchlist' => 'Bakmaa listam',
'mywatchlist' => 'Bakmaa listam',
'watchlistfor' => "('''$1''' iรงin)",
'addedwatch' => 'Bakmaa listasฤฑna registrat edildi.',
'addedwatchtext' => '"<nowiki>$1</nowiki>" adlฤฑ sayfa [[Special:Watchlist|bakmaa listanฤฑza]] registrat olundu.
Gelecektรค, bu sayfaya hem ilgili konuลmaa sayfasฤฑna yapฤฑlacรชk diiลmรคkler burada yazฤฑlacรชk.
[[Special:RecentChanges|Bitki diiลmรคkler listasฤฑ]] baลlฤฑฤฑ altฤฑnda yazฤฑlacรชk kalฤฑn bukvalarnan neรงin ki kolayca seรงilsin.
Ne zaman neetlendiniz sayfayฤฑ bakmaa listasฤฑnnan รงฤฑkarmaa tuลlayฤฑn "sayfaya bakmaa durgun" baalantฤฑsฤฑna.',
'removedwatch' => 'Bakmaa listanฤฑzdan silindi',
'removedwatchtext' => '"[[:$1]]" yapraฤฑ siir [[Special:Watchlist|listanฤฑzdan]] silindi.',
'watch' => 'Bak',
'watchthispage' => 'Bak bu sayfaya',
'unwatch' => 'Durgun sayfa izlemรครค',
'watchlist-details' => 'Diil konuลmaa sayfalarฤฑ {{PLURAL:$1|$1 sayfa|$1 sayfa}} bakmaa listanฤฑzda.',
'wlshowlast' => 'Bitki $1 saati $2 gรผnรผ gรถster $3',
'watchlist-options' => 'ฤฐzlemรคk listasฤฑ opลฃiyalarฤฑ',
# Displayed when you click the "watch" button and it is in the process of watching
'watching' => 'Bakฤฑlรชr...',
'unwatching' => 'Durgundurulรชr...',
# Delete
'deletepage' => 'Sayfayฤฑ sil',
'historywarning' => 'Bak: O sayfa angฤฑsฤฑnฤฑ isteersiniz silmรครค istoriyasฤฑ var:',
'confirmdeletetext' => 'Bu sayfayฤฑ yaki faylฤฑ silersiniz hepsi istoriyasฤฑlan bilรค.
Lรผtfen doorulayฤฑn ani siz neetlenersiniz bunu yapmaa, annรชรชrsiniz onun rezultatlarฤฑnฤฑ hem inanรชrsiniz ani bu [[{{MediaWiki:Policy-url}}|Silmรครค kanonnarฤฑna]] uyรชr.',
'actioncomplete' => 'ฤฐลlik tamannandฤฑ.',
'deletedtext' => '"<nowiki>$1</nowiki>" silindi.
Yakฤฑn zamanda silinenleri gรถrmรครค deyni: $2.',
'deletedarticle' => '"[[$1]]" silindi',
'dellogpage' => 'Silmรครค jurnalฤฑ',
'deletecomment' => 'Sebep',
'deleteotherreason' => 'Baลka/ek sebep:',
'deletereasonotherlist' => 'Baลka sebep',
# Rollback
'rollbacklink' => 'eski halinรค dรถn',
# Protect
'protectlogpage' => 'Korunmak jurnalฤฑ',
'protectedarticle' => '"[[$1]]" korunmak altฤฑna alฤฑndฤฑ',
'modifiedarticleprotection' => '"[[$1]]" iรงin korumak yolu diiลtirildi',
'prot_1movedto2' => '[[$1]] sayfasฤฑn eni adฤฑ: [[$2]]',
'protect-legend' => 'Korunmaa doorula',
'protectcomment' => 'Sebep',
'protectexpiry' => 'Bitmรครค datasฤฑ:',
'protect_expiry_invalid' => 'Yannฤฑล bitmรครค datasฤฑ.',
'protect_expiry_old' => 'Bitmรครค datasฤฑ geรงti.',
'protect-text' => "Var nicรค gรถrmรครค hem diiลtirmรครค buradan '''<nowiki>$1</nowiki>''' sayfasฤฑn korunmaa dรผzeyini.",
'protect-locked-access' => "Sizin esapฤฑn yok izni yazฤฑnฤฑn korunmak dรผzeyini diiลtirmรครค.
Burada bitki seรงimner '''$1''' yazฤฑ diiลtirmรครค deyni:",
'protect-cascadeon' => 'Bu sayfa ลindi korunรชr onuลtan ani girer {{PLURAL:$1|aลaadaki sayfaa, angฤฑsฤฑna|||aลaadaki sayfalara, angฤฑlarฤฑna}} konuldu kaskad korunmak. Sizรค yakฤฑลรชr diiลtirin bu sayfanฤฑn korunmak dรผzeyin, ama bu etkilemez kaskad korunmaa.',
'protect-default' => 'Kabletmรครค hepsi kullanฤฑcฤฑlarฤฑ',
'protect-fallback' => ' "$1" izin iste',
'protect-level-autoconfirmed' => 'Registrat olmamฤฑล kullanฤฑcฤฑlarฤฑ kรถstekle',
'protect-level-sysop' => 'sadรคcรค รถnderciler',
'protect-summary-cascade' => 'kaskad',
'protect-expiring' => 'bitmรครค datasฤฑ $1 (UTC)',
'protect-cascade' => 'Bu sayfaya girรคn sayfalarฤฑ koru (kaskad korunmaa)',
'protect-cantedit' => 'Siz bu yazฤฑnฤฑn korunmak dรผzeyin bilmรคrsiniz diiลtirmรครค, neรงin ki sizin onu dรผzmรครค izniniz yok.',
'protect-expiry-options' => '1 saat:1 hour,1 gรผn:1 day,1 afta:1 week,2 afta:2 weeks,1 ay:1 month,3 ay:3 months,6 ay:6 months,1 yฤฑl:1 year,zamansฤฑz:infinite',
'restriction-type' => 'ฤฐzin:',
'restriction-level' => 'Yasaklama dรผzeyi:',
# Undelete
'undeletebtn' => 'Geeri getir!',
'undeletelink' => 'Gรถster/geeri getir',
'undeletedarticle' => '[[$1]] geeri getirildi.',
# Namespace form on various pages
'namespace' => 'Er adฤฑ:',
'invert' => 'Seรงilmiล dฤฑลฤฑndakileri gรถster',
'blanknamespace' => '(Baล)',
# Contributions
'contributions' => 'Kullanฤฑcฤฑnฤฑn katฤฑlmaklarฤฑ',
'contributions-title' => '$1 iรงin kullanฤฑcฤฑ katฤฑlmaklarฤฑ',
'mycontris' => 'Katฤฑlmaklarฤฑm',
'contribsub2' => '$1 ($2)',
'uctop' => '(bitki)',
'month' => 'Ay:',
'year' => 'Yฤฑl:',
'sp-contributions-newbies' => 'Sadรค eni esap aรงan kullanฤฑcฤฑlarฤฑn katฤฑlmaklarฤฑnฤฑ gรถster',
'sp-contributions-newbies-sub' => 'Eni kullanฤฑcฤฑlara deyni',
'sp-contributions-blocklog' => 'Kรถstek jurnalฤฑ',
'sp-contributions-talk' => 'Konuลmaa',
'sp-contributions-search' => 'Katฤฑlmaklarฤฑ aara',
'sp-contributions-username' => 'IP adres yaki kullanฤฑcฤฑ adฤฑ',
'sp-contributions-submit' => 'Ara',
# What links here
'whatlinkshere' => 'Baalantฤฑlar sayfaa',
'whatlinkshere-title' => '$1 baalantฤฑsฤฑ olan sayfalar',
'whatlinkshere-page' => 'Yaprak:',
'linkshere' => "Buraya baalantฤฑsฤฑ var olan sayfalar '''[[:$1]]''':",
'nolinkshere' => "Yok buraya baalanan sayfa '''[[:$1]]'''.",
'isredirect' => 'yรถnnendirmรคk sayfasฤฑ',
'istemplate' => 'eklemรครค',
'isimage' => 'fayl baalantฤฑsฤฑ',
'whatlinkshere-prev' => '{{PLURAL:$1|ilerki|ilerki $1}}',
'whatlinkshere-next' => '{{PLURAL:$1|ilerki|ilerki $1}}',
'whatlinkshere-links' => 'โ links',
'whatlinkshere-hideredirs' => 'enidรคn gรถndermรครค $1',
'whatlinkshere-hidetrans' => 'Eklemรครค $1',
'whatlinkshere-hidelinks' => 'baalantฤฑlarฤฑ $1',
'whatlinkshere-filters' => 'Filtralar',
# Block/unblock
'blockip' => 'Bu kullanฤฑcฤฑya kรถstek ol',
'ipboptions' => '2 saat:2 hours,1 gรผn:1 day,3 gรผn:3 days, 1 afta:1 week, 2 afta:2 weeks, 1 ay:1 month, 3 ay:3 months, 6 ay:6 months, 1 yฤฑl:1 year, zamansฤฑz:infinite',
'ipblocklist' => 'Kรถstekli kullanฤฑcฤฑlar hem IP adresleri listasฤฑ',
'blocklink' => 'kรถstek ol',
'unblocklink' => 'kรถstek kaldฤฑr',
'change-blocklink' => 'kรถstรครค diiลtir',
'contribslink' => 'yardฤฑmnar',
'blocklogpage' => 'Kรถstek jurnalฤฑ',
'blocklogentry' => '[[$1]] sebep $2 $3 durduruldu',
'unblocklogentry' => '$1 kullanฤฑcฤฑya kรถstek kaldฤฑrฤฑldฤฑ',
'block-log-flags-nocreate' => 'esap yaratmaa kรถsteklendi',
# Move page
'move-page-legend' => 'Ad diiลmรคklii',
'movepagetext' => "Aลaadaki formayฤฑ kullanฤฑlarak var nicรค sayfanฤฑn adฤฑn diiลtirin, onnan bilรค hepsi diiลtirmรครค jurnalฤฑ eni ada aktarฤฑlacรชk.
Eski ad eni ada yรถnnendirmรคk olacรชk.
Eski baลlaa baalantฤฑlar [[Special:DoubleRedirects|diiลmeycek]] รงift yaki yannฤฑล [[Special:BrokenRedirects|yรถnnendirmรคkleri]].
Lรคazฤฑm inanmaa ani baalantฤฑlar genรค dรค gรถsterer orayฤฑ nerรค lรคazฤฑm gรถstersin.
Herliim ilerdรคn eni adda sayfa vardฤฑ, ad diiลmรครค '''yapฤฑlmaycรชk'''.
Bu o maana verer ani eer yannฤฑล olarak adฤฑnฤฑ diiลtirdiniz siz var nicรค dรถndรผrรผn sayfayฤฑ eski adฤฑna.
'''BAK!'''
Bu ad diiลmรครค var nicรค duursun masลtablฤฑ hem beklenmeyรคn rezultatlar ''populyar'' sayfalar iรงin ;
onuลtan devam etmedรคn ileri lรคazฤฑm inanmaa ani annรชรชrsiniz hepsi olacรชk rezultatlarฤฑ.",
'movepagetalktext' => "Birleลtirilmiล konuลmaa sayfasฤฑn, herliim varsa,
avtomatik adฤฑ diiลtirilecek, '''o haller dฤฑลฤฑnda, ne zaman:'''
*Eni adda konuลmaa sayfasฤฑ taa varsa,
*Alttaki kutucuu seรงmedinizsรค .
Bu hallerdรค lรคazฤฑm kendiniz ellรคn sayfalarฤฑ aktarmaa yaki birleลtirmรครค.",
'movearticle' => 'Eski ad',
'newtitle' => 'Eni ad',
'move-watch' => 'Bak bu sayfaya',
'movepagebtn' => 'Adฤฑ diiลtir',
'pagemovedsub' => 'Ad diiลmรคk tamannandฤฑ.',
'movepage-moved' => '\'\'\'"$1", "$2" sayfasฤฑna taลฤฑndฤฑ\'\'\'',
'articleexists' => 'Bu adda bir sayfa bulunรชr yaki o ad geรงersiz angฤฑsฤฑnฤฑ seรงtiniz.
Yalvarรชrรชz baลka bir ad seรงmรครค.',
'talkexists' => "'''Bu sayfa kendisi baลarฤฑlan aktarฤฑldฤฑ, ama konuลmaa sayfasฤฑ aktarฤฑlamadฤฑ neรงin ki eni ad altฤฑnda bulunรชr taa birisi. Yalvarรชrรชz onnarฤฑ ellรคn birleลtirmรครค.'''",
'movedto' => 'taลฤฑndฤฑ:',
'movetalk' => 'Varsa hem aktar "konuลmaa" sayfasฤฑnฤฑ.',
'1movedto2' => '[[$1]] sayfasฤฑn eni adฤฑ: [[$2]]',
'1movedto2_redir' => '[[$1]] baลlaa [[$2]] sayfasฤฑna gรถnderildi',
'movelogpage' => 'Ad diiลmรคk jurnalฤฑ',
'movereason' => 'Sebep',
'revertmove' => 'geeri al',
# Export
'export' => 'Sayfa registrat et',
# Namespace 8 related
'allmessages' => 'Sistema tekstleri',
# Thumbnails
'thumbnail-more' => 'Bรผรผt',
'thumbnail_error' => 'รn siir yaratฤฑlar kana yannฤฑล: $1',
# Import log
'importlogpage' => 'Fayl aktarmaa jurnalฤฑ',
# Tooltip help for the actions
'tooltip-pt-userpage' => 'Kullanฤฑcฤฑ sayfam',
'tooltip-pt-mytalk' => 'Sรถzleลmรคk sayfam',
'tooltip-pt-preferences' => 'Seรงimnerim',
'tooltip-pt-watchlist' => 'ฤฐzlemรครค aldฤฑฤฑm sayfalar',
'tooltip-pt-mycontris' => 'Yaptฤฑฤฑm katฤฑlmaklarฤฑn listasฤฑ',
'tooltip-pt-login' => 'Sessiya aรงmanฤฑz islรครค, ama diil zorlu.',
'tooltip-pt-logout' => 'Sistemadan รงฤฑk',
'tooltip-ca-talk' => 'ฤฐรงindekilรคrlรคn ilgili dรผลรผnmรคk sรถlรค',
'tooltip-ca-edit' => 'Bu yapraฤฑ var nicรค diiลtirin. Kaydetmeden ileri รถn siir etmรครค unutmayฤฑn.',
'tooltip-ca-addsection' => 'Bu diskussiya iรงin kommentariya ekleyin',
'tooltip-ca-viewsource' => 'Bu sayfa korunmak altฤฑnda. Gelinir kodunu sadรค var nicรค gรถrรผnรผz. Yok nicรค diiลtirmรครค.',
'tooltip-ca-history' => 'Bu sayfanฤฑn geรงmiล versiyalarฤฑ.',
'tooltip-ca-protect' => 'Bu sayfayฤฑ kolla',
'tooltip-ca-delete' => 'Sayfayฤฑ sil',
'tooltip-ca-move' => 'Sayfanฤฑn adฤฑnฤฑ diiลtir',
'tooltip-ca-watch' => 'Bu sayfanฤฑ ekle bakmaa listasฤฑna',
'tooltip-ca-unwatch' => 'Brakฤฑn bu sayfaa bakmaa',
'tooltip-search' => '{{SITENAME}} iรงindรค ara',
'tooltip-search-go' => 'Herliim varsa, git salt bu adlฤฑ bir sayfaa',
'tooltip-search-fulltext' => 'Bu tekst iรงin sayfalarฤฑ aara',
'tooltip-n-mainpage' => 'Dรถnรผn baล yapraa',
'tooltip-n-mainpage-description' => 'Dรถnรผn baล yapraa',
'tooltip-n-portal' => 'Proyekt uurunda, ne nรคndรค, nelรคr var nicรค yapmaa',
'tooltip-n-currentevents' => 'ลindiki sluรงaylar uurunda bitki bilgiler',
'tooltip-n-recentchanges' => 'Bitki diiลmรคklรคr listasฤฑ angฤฑlarฤฑ Vikidรค yapฤฑldฤฑ.',
'tooltip-n-randompage' => 'Razgele bir yazฤฑya gidin',
'tooltip-n-help' => 'Yardฤฑm almaa deyni',
'tooltip-t-whatlinkshere' => 'Baลka viki sayfalarฤฑn listasฤฑ angฤฑlarฤฑ bu sayfaa baalantฤฑ verdi',
'tooltip-t-recentchangeslinked' => 'Bu sayfaa baalฤฑ sayfalardaki bitki diiลler',
'tooltip-feed-rss' => 'Bu sayfa iรงin RSS beslemรครค',
'tooltip-feed-atom' => 'Bu sayfa iรงin atom beslemรครค',
'tooltip-t-contributions' => 'Kullanฤฑcฤฑnฤฑn katฤฑlmak listasฤฑnฤฑ gรถr',
'tooltip-t-emailuser' => 'Bu kullanฤฑcฤฑ iรงin e-mail gรถnder',
'tooltip-t-upload' => 'Fayllarฤฑ รผkle',
'tooltip-t-specialpages' => 'Hepsi maasus yapraklarฤฑn listasฤฑnฤฑ gรถster',
'tooltip-t-print' => 'Bu sayfanฤฑn tiparlanmaa uygun versiyasฤฑ',
'tooltip-t-permalink' => 'Sayfanฤฑn bu versiyasฤฑna deyni dayma baalantฤฑ',
'tooltip-ca-nstab-main' => 'Yazฤฑya bak',
'tooltip-ca-nstab-user' => 'Kullanฤฑcฤฑ sayfasฤฑn gรถster',
'tooltip-ca-nstab-special' => 'Bu maasus sayfa olduuna deyni yok nasฤฑl yapmaa diiลler.',
'tooltip-ca-nstab-project' => 'Proekt sayfasฤฑn gรถster',
'tooltip-ca-nstab-image' => 'Pรคtret sayfasฤฑn gรถster',
'tooltip-ca-nstab-template' => 'ลablonu gรถster',
'tooltip-ca-nstab-help' => 'Tฤฑkla yardฤฑm sayfasฤฑn gรถrmรครค',
'tooltip-ca-nstab-category' => 'Kategoriya sayfasฤฑn gรถster',
'tooltip-minoredit' => 'Kรผรงรผk diiลmรคk olarak nฤฑลanna',
'tooltip-save' => 'Diiลmรคklรคri registrat et',
'tooltip-preview' => 'รn siir; korunmaa vermedรคn bunu kullanฤฑn hem gรถzden geรงirin!',
'tooltip-diff' => 'Diiลmeklรคri gรถsterer ani tekstรค yaptฤฑnฤฑz.',
'tooltip-compareselectedversions' => 'Seรงilmiล iki versiya arasฤฑndaki farklarฤฑ gรถster.',
'tooltip-watch' => 'Sayfayฤฑ bakmaa listana ekle',
'tooltip-rollback' => '"Geeri dรถnรผm" tek tฤฑklamaylan bu sayfaa son katฤฑm yapanฤฑn diiลlerini geeri dรถndรผrer',
'tooltip-undo' => '"Geeri git" bu diiลi var nasฤฑl geeri dรถndรผrsรผn hem aรงsฤฑn diiล formunu ileri izlemรครค modunda.
รzet iรงin bir sebep eklemรครค izin verer',
# Browsing diffs
'previousdiff' => 'โ ฤฐlerki versiyalan aradaki fark',
'nextdiff' => 'Geerki versiyalan aradaki fark โ',
# Media information
'file-info-size' => '($1 ร $2 piksel, fayl รถlรงรผsรผ: $3, MIME tipi: $4)',
'file-nohires' => '<small>Taa รผรผksek aydฤฑnnฤฑklฤฑ versiya bulunmรชรชr.</small>',
'svg-long-desc' => '(SVG faylฤฑ, nominal $1 ร $2 piksel, fayl รถlรงรผsรผ: $3)',
'show-big-image' => 'Taman aydฤฑnnฤฑk',
'show-big-image-thumb' => '<small>รn siir รถlรงรผsรผ: $1 ร $2 piksel</small>',
# Special:NewFiles
'newimages' => 'Eni pรคtretler',
# Bad image list
'bad_image_list' => 'Bu format lรคazฤฑm olsun sansฤฑn aลaada:
Sadรค listadaki รชlementlarรค (* nฤฑลannan รงekedรคn liniyalar) bakฤฑlacรชk.
Liniyadaki seftรค baalantฤฑ lรคazฤฑm olsun koymaa yasak resim iรงin baalantฤฑ.
Hep o liniyadaki รผbรผr baalantฤฑlara bakฤฑlacรชk sansฤฑn bir maasus hal, ani onnar o yazฤฑlar angฤฑsฤฑna resim var nicรค koymaa.',
# Metadata
'metadata' => 'Pรคtret detallarฤฑ',
'metadata-help' => 'Fayla girer รงok vakit ศifralฤฑ kamera yaki skanerlรคn eklenรคn ek bilgiler.
Herliim fayl diiลtirildi yaratฤฑlฤฑลtan sora, bir takฤฑm parametrlรคr var nicรค kalsฤฑn bu resimdรคn farklฤฑ.',
'metadata-expand' => 'Detallarฤฑ gรถster',
'metadata-collapse' => 'Detallarฤฑ gรถsterme',
'metadata-fields' => 'Bu listadaki meta bilgilerin eri, resim sayfasฤฑnda sormadan gรถsterilecek, รผbรผrleri saklanacรชk.
* make
* model
* datetimeoriginal
* exposuretime
* fnumber
* isospeedratings
* focallength',
# External editor support
'edit-externally' => 'Kompyuterinizdรคki uygulamaklarlan faylฤฑ dรผz',
'edit-externally-help' => 'Taa รงok bilgi iรงin var nicรค bakmaa metadaki [http://www.mediawiki.org/wiki/Manual:External_editors dฤฑล uygulama instrumentlรคri] (angliyรงa) sayfasฤฑna.',
# 'all' in various places, this might be different for inflected languages
'watchlistall2' => 'Hepsini gรถster',
'namespacesall' => 'Hepsi',
'monthsall' => 'hepsi',
# Watchlist editing tools
'watchlisttools-view' => 'ฤฐlgili diiลmรคkleri gรถster',
'watchlisttools-edit' => 'Siir listasฤฑnฤฑ gรถr hem dรผzelt',
'watchlisttools-raw' => 'Ham siir listasฤฑnฤฑ dรผz',
# Special:Version
'version' => 'Versiya',
# Special:SpecialPages
'specialpages' => 'Maasus sayfalar',
);
| hendrysuwanda/101dev | tools/mediawiki/languages/messages/MessagesGag.php | PHP | gpl-3.0 | 56,005 |
#!/usr/bin/env python
from tools.multiclass_shared import prepare_data
[traindat, label_traindat, testdat, label_testdat] = prepare_data(False)
parameter_list = [[traindat,testdat,label_traindat,label_testdat,2.1,1,1e-5],[traindat,testdat,label_traindat,label_testdat,2.2,1,1e-5]]
def classifier_multilabeloutputliblinear (fm_train_real=traindat,fm_test_real=testdat,label_train_multiclass=label_traindat,label_test_multiclass=label_testdat,width=2.1,C=1,epsilon=1e-5):
from shogun import RealFeatures, MulticlassLabels, MultilabelLabels
from shogun import MulticlassLibLinear
feats_train=RealFeatures(fm_train_real)
feats_test=RealFeatures(fm_test_real)
labels=MulticlassLabels(label_train_multiclass)
classifier = MulticlassLibLinear(C,feats_train,labels)
classifier.train()
label_pred = classifier.apply_multilabel_output(feats_test,2)
out = label_pred.get_labels()
#print out
return out
if __name__=='__main__':
print('MultilabelOutputLibLinear')
classifier_multilabeloutputliblinear(*parameter_list[0])
| micmn/shogun | examples/undocumented/python/classifier_multilabeloutputliblinear.py | Python | gpl-3.0 | 1,029 |
<?php
namespace app\modules\shop\controllers;
use app\modules\core\behaviors\DisableRobotIndexBehavior;
use app\modules\shop\models\UserPreferences;
use Yii;
use yii\web\Controller;
use yii\web\Response;
class UserPreferencesController extends Controller
{
public function behaviors()
{
return [
[
'class' => DisableRobotIndexBehavior::className(),
]
];
}
public function actionSet($key, $value)
{
Yii::$app->response->format = Response::FORMAT_JSON;
$preferences = UserPreferences::preferences();
$preferences->setAttributes([$key=>$value]);
return $preferences->validate();
}
}
| Mirocow/dotplant2 | application/modules/shop/controllers/UserPreferencesController.php | PHP | gpl-3.0 | 696 |
/*
* TextLayoutHelper.h
* created for Marathon: Aleph One <http://source.bungie.org/>
Copyright (C) 2001 and beyond by Woody Zenfell, III
and the "Aleph One" developers.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This license is contained in the file "COPYING",
which is included with this source code; it is available online at
http://www.gnu.org/licenses/gpl.html
* The code in this file is licensed to you under the GNU GPL. As the copyright holder,
* however, I reserve the right to use this code as I see fit, without being bound by the
* GPL's terms. This exemption is not intended to apply to modified versions of this file -
* if I were to use a modified version, I would be a licensee of whomever modified it, and
* thus must observe the GPL terms.
*
* TextLayoutHelper assists with laying out a set of non-overlapping rectangles. It's not
* as smart or as general as it could be, but it works.
*
* Created by woody on Thu Nov 08 2001.
*/
#ifndef TEXTLAYOUTHELPER_H
#define TEXTLAYOUTHELPER_H
// should eventually use list and some other sort mechanism, probably, for cheaper insertions.
#include <vector>
using namespace std;
class TextLayoutHelper {
public:
TextLayoutHelper();
~TextLayoutHelper();
// Remove all reservations
void removeAllReservations();
// Reserve a place for the rectangle given. Returns the smallest bottom that will not overlap previous reservations.
int reserveSpaceFor(int inLeft, unsigned int inWidth, int inLowestBottom, unsigned int inHeight);
protected:
struct ReservationEnd;
struct Reservation;
typedef vector<ReservationEnd> CollectionOfReservationEnds;
CollectionOfReservationEnds mReservationEnds;
};
struct TextLayoutHelper::ReservationEnd {
int mHorizontalCoordinate;
TextLayoutHelper::Reservation* mReservation;
bool mStartOfReservation;
};
struct TextLayoutHelper::Reservation {
int mBottom;
int mTop;
};
#endif//TEXTLAYOUTHELPER_H
| 0x7F800000/Aleph-NONE | Source_Files/RenderOther/TextLayoutHelper.h | C | gpl-3.0 | 2,461 |
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#
# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT =
endif
# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti
endif
# Enable this if you want the linker to remove unused code and data
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif
# Linker extra options here.
ifeq ($(USE_LDOPT),)
USE_LDOPT =
endif
# Enable this if you want link time optimizations (LTO)
ifeq ($(USE_LTO),)
USE_LTO = yes
endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = yes
endif
# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no
endif
# If enabled, this option makes the build process faster by not compiling
# modules not used in the current configuration.
ifeq ($(USE_SMART_BUILD),)
USE_SMART_BUILD = yes
endif
#
# Build global options
##############################################################################
##############################################################################
# Architecture or project specific options
#
# Stack size to be allocated to the Cortex-M process stack. This stack is
# the stack used by the main() thread.
ifeq ($(USE_PROCESS_STACKSIZE),)
USE_PROCESS_STACKSIZE = 0x400
endif
# Stack size to the allocated to the Cortex-M main/exceptions stack. This
# stack is used for processing interrupts and exceptions.
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
USE_EXCEPTIONS_STACKSIZE = 0x400
endif
# Enables the use of FPU (no, softfp, hard).
ifeq ($(USE_FPU),)
USE_FPU = no
endif
#
# Architecture or project specific options
##############################################################################
##############################################################################
# Project, sources and paths
#
# Define project name here
PROJECT = ch
# Imported source files and paths
CHIBIOS = ../../../..
# Licensing files.
include $(CHIBIOS)/os/license/license.mk
# Startup files.
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32L4xx/platform.mk
include $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_L476RG/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Other files (optional).
#include $(CHIBIOS)/test/lib/test.mk
#include $(CHIBIOS)/test/rt/rt_test.mk
#include $(CHIBIOS)/test/oslib/oslib_test.mk
# Define linker script file here
LDSCRIPT= $(STARTUPLD)/STM32L476xG.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(ALLCSRC) \
$(TESTSRC) \
main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CPPSRC = $(ALLCPPSRC)
# C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(ALLASMSRC)
ASMXSRC = $(ALLXASMSRC)
INCDIR = $(ALLINC) $(TESTINC)
#
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
MCU = cortex-m4
#TRGT = arm-elf-
TRGT = arm-none-eabi-
CC = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
# runtime support makes code size explode.
LD = $(TRGT)gcc
#LD = $(TRGT)g++
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
AR = $(TRGT)ar
OD = $(TRGT)objdump
SZ = $(TRGT)size
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
# Define C++ warning options here
CPPWARN = -Wall -Wextra -Wundef
#
# Compiler settings
##############################################################################
##############################################################################
# Start of user section
#
# List all user C define here, like -D_DEBUG=1
UDEFS =
# Define ASM defines here
UADEFS =
# List all user directories here
UINCDIR =
# List the user directory to look for the libraries here
ULIBDIR =
# List all user libraries here
ULIBS =
#
# End of user defines
##############################################################################
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk
| mihadyuk/ChibiOS | testhal/STM32/STM32L4xx/GPT-ADC/Makefile | Makefile | gpl-3.0 | 6,016 |
# This dockerfile creates a container of a truly basic DIRAC installation which contains only the DIRAC externals.
# The sole purpose of this container is for developing (and testing) DIRAC "stuff that run",
# meaning DIRAC components like agents and services. Instructions in ...
# THIS IS A WORK IN PROGRESS
# TODO:
# verify about certificates
# correct openssl_config URL location
# lcgBundle now fix version
# start mySQL + install/start ElasticSearch (?) + install/start ActiveMQ (?) or better use docker-compose
#
# CC7 as base (the latest tag doesn't work!)
FROM cern/cc7-base:20170113
MAINTAINER Federico Stagni <[email protected]>
# Create DIRAC dirs
RUN mkdir -p /opt/dirac/DIRAC && \
mkdir -p /opt/dirac/etc/grid-security/certificates && \
mkdir -p /opt/dirac/user && \
cd /opt/dirac
# Installing DIRAC in /opt/dirac
RUN \
cd /opt/dirac && \
curl -L -o dirac-install https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/Core/scripts/dirac-install.py && \
chmod +x dirac-install && \
./dirac-install -r v6r20 -t server -i 27 -g v14r1 && \
rm -rf /opt/dirac/.installCache && \
rm dirac-install
# Copying in ENTRYPOINT script (for running DIRAC scripts directly, e.g. dirac-service)
COPY dockerEntrypoint.sh /opt/dirac/dockerEntrypoint.sh
RUN chmod 755 /opt/dirac/dockerEntrypoint.sh
ENTRYPOINT [ "/opt/dirac/dockerEntrypoint.sh" ]
# Create self-signed host certificate from auto-generated CA
WORKDIR /opt/dirac/etc/grid-security
RUN source /opt/dirac/bashrc && openssl genrsa -out hostkey.pem 2048
RUN curl -L -o openssl_config https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/tests/openssl_config_DIRACDockerDevBox && \
source /opt/dirac/bashrc && \
openssl req -new -x509 -key hostkey.pem -out hostcert.pem -days 365 -config openssl_config && \
cp hostcert.pem certificates/ && \
cp hostkey.pem certificates/
# Now generating the user credentials, which would need to be used for connecting to DIRAC components running here
WORKDIR /opt/dirac/user
RUN curl -L -o openssl_config_usr https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/tests/openssl_config_DIRACDockerDevBox_usr
RUN sed -i 's/DIRACDockerDevBox/ciuser/g' openssl_config_usr
RUN source /opt/dirac/bashrc && \
openssl genrsa -out client.key 1024 && \
openssl req -key client.key -new -out client.req -config openssl_config_usr
# This is a little hack to make OpenSSL happy...
RUN echo 00 > file.srl
RUN source /opt/dirac/bashrc && \
openssl x509 -req -in client.req \
-CA /opt/dirac/etc/grid-security/hostcert.pem \
-CAkey /opt/dirac/etc/grid-security/hostkey.pem \
-CAserial /opt/dirac/user/file.srl \
-out /opt/dirac/user/client.pem
# Copy the script so that when logging interactively the environment is correct
RUN cp /opt/dirac/bashrc /root/.bashrc
# Just standard working dir
WORKDIR /opt/dirac/
| arrabito/DIRAC | container/Dockerfile | Dockerfile | gpl-3.0 | 2,911 |
/*
* Androzic - android navigation client that uses OziExplorer maps (ozf2, ozfx3).
* Copyright (C) 2010-2012 Andrey Novikov <http://andreynovikov.info/>
*
* This file is part of Androzic application.
*
* Androzic 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.
* Androzic 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 Androzic. If not, see <http://www.gnu.org/licenses/>.
*/
package com.androzic.track;
import com.androzic.Androzic;
import com.androzic.R;
import com.androzic.data.Track;
import com.androzic.ui.ColorButton;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.Toast;
public class TrackProperties extends Activity
{
private Track track;
private TextView name;
//private TextView description;
private CheckBox show;
private ColorButton color;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.act_track_properties);
int index = getIntent().getExtras().getInt("INDEX");
Androzic application = (Androzic) getApplication();
track = application.getTrack(index);
name = (TextView) findViewById(R.id.name_text);
name.setText(track.name);
/*
description = (TextView) findViewById(R.id.description_text);
description.setText(track.description);
*/
show = (CheckBox) findViewById(R.id.show_check);
show.setChecked(track.show);
color = (ColorButton) findViewById(R.id.color_button);
color.setColor(track.color, getResources().getColor(R.color.currenttrack));
Button save = (Button) findViewById(R.id.done_button);
save.setOnClickListener(saveOnClickListener);
Button cancel = (Button) findViewById(R.id.cancel_button);
cancel.setOnClickListener(new OnClickListener() { public void onClick(View v) { finish(); } });
}
private OnClickListener saveOnClickListener = new OnClickListener()
{
public void onClick(View v)
{
try
{
track.name = name.getText().toString();
//track.description = description.getText().toString();
track.show = show.isChecked();
track.color = color.getColor();
setResult(Activity.RESULT_OK);
finish();
}
catch (Exception e)
{
Toast.makeText(getBaseContext(), "Error saving track", Toast.LENGTH_LONG).show();
}
}
};
@Override
protected void onDestroy()
{
super.onDestroy();
track = null;
name = null;
show = null;
color = null;
}
}
| shagraths/androzic | src/com/androzic/track/TrackProperties.java | Java | gpl-3.0 | 3,293 |
python POVME2_GUI.py
| j-wags/POVME | POVME_version_for_paper_do_not_modify/POVME2.Windows.bat | Batchfile | gpl-3.0 | 21 |
<?php
// $Id: search-results.tpl.php,v 1.7 2010/08/18 18:40:50 dries Exp $
/**
* @file
* Default theme implementation for displaying search results.
*
* This template collects each invocation of theme_search_result(). This and
* the child template are dependent to one another sharing the markup for
* definition lists.
*
* Note that modules may implement their own search type and theme function
* completely bypassing this template.
*
* Available variables:
* - $search_results: All results as it is rendered through
* search-result.tpl.php
* - $module: The machine-readable name of the module (tab) being searched, such
* as "node" or "user".
*
*
* @see template_preprocess_search_results()
*/
?>
<!--<div class="search-results-number">Current search found 3,714 items for test term</div>-->
<?php if ($search_results) : ?>
<div class="search-results <?php print $module; ?>-results">
<?php print $search_results; ?>
</div>
<?php print $pager; ?>
<?php else : ?>
<h2><?php print t('Your search yielded no results');?></h2>
<?php print search_help('search#noresults', drupal_help_arg()); ?>
<?php endif; ?>
| diraol/Amigos-da-Poli | sites/all/themes/openpublic_eu/templates/search-results.tpl.php | PHP | gpl-3.0 | 1,149 |
odoo.define('website_event_track_quiz.event.quiz', function (require) {
'use strict';
var publicWidget = require('web.public.widget');
var core = require('web.core');
var session = require('web.session');
var utils = require('web.utils');
var QWeb = core.qweb;
var _t = core._t;
/**
* This widget is responsible of displaying quiz questions and propositions. Submitting the quiz will fetch the
* correction and decorate the answers according to the result. Error message can be displayed.
*
* This widget can be attached to DOM rendered server-side by `gamification_quiz.`
*
*/
var Quiz = publicWidget.Widget.extend({
template: 'quiz.main',
xmlDependencies: ['/website_event_track_quiz/static/src/xml/quiz_templates.xml'],
events: {
"click .o_quiz_quiz_answer": '_onAnswerClick',
"click .o_quiz_js_quiz_submit": '_submitQuiz',
"click .o_quiz_js_quiz_reset": '_onClickReset',
},
/**
* @override
* @param {Object} parent
* @param {Object} data holding all the container information
* @param {Object} quizData : quiz data to display
*/
init: function (parent, data, quizData) {
this._super.apply(this, arguments);
this.track = _.defaults(data, {
id: 0,
name: '',
eventId: '',
completed: false,
isMember: false,
progressBar: false,
isEventUser: false,
repeatable: false
});
this.quiz = quizData || false;
if (this.quiz) {
this.quiz.questionsCount = quizData.questions.length;
}
this.isMember = data.isMember || false;
this.userId = session.user_id;
this.redirectURL = encodeURIComponent(document.URL);
},
/**
* @override
*/
willStart: function () {
var defs = [this._super.apply(this, arguments)];
if (!this.quiz) {
defs.push(this._fetchQuiz());
}
return Promise.all(defs);
},
/**
* Overridden to add custom rendering behavior upon start of the widget.
*
* If the user has answered the quiz before having joined the course, we check
* his answers (saved into his session) here as well.
*
* @override
*/
start: function () {
var self = this;
return this._super.apply(this, arguments).then(function () {
self._renderValidationInfo();
});
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
_alertShow: function (alertCode) {
var message = _t('There was an error validating this quiz.');
if (alertCode === 'quiz_incomplete') {
message = _t('All questions must be answered !');
} else if (alertCode === 'quiz_done') {
message = _t('This quiz is already done. Retaking it is not possible.');
}
this.displayNotification({
type: 'warning',
title: _t('Quiz validation error'),
message: message,
sticky: true
});
},
/**
* @private
* Decorate the answers according to state
*/
_disableAnswers: function () {
this.$('.o_quiz_js_quiz_question').addClass('completed-disabled');
this.$('input[type=radio]').prop('disabled', true);
},
/**
* @private
* Decorate the answers according to state
*/
_enableAnswers: function() {
this.$('.o_quiz_js_quiz_question').removeClass('completed-disabled');
this.$('input[type=radio]').prop('disabled', false);
},
/**
* Get all the questions ID from the displayed Quiz
* @returns {Array}
* @private
*/
_getQuestionsIds: function () {
return this.$('.o_quiz_js_quiz_question').map(function () {
return $(this).data('question-id');
}).get();
},
/**
* Get the quiz answers filled in by the User
*
* @private
*/
_getQuizAnswers: function () {
return this.$('input[type=radio]:checked').map(function (index, element) {
return parseInt($(element).val());
}).get();
},
/**
* Decorate the answer inputs according to the correction and adds the answer comment if
* any.
*
* @private
*/
_renderAnswersHighlightingAndComments: function () {
var self = this;
this.$('.o_quiz_js_quiz_question').each(function () {
var $question = $(this);
var questionId = $question.data('questionId');
var answer = self.quiz.answers[questionId];
$question.find('a.o_quiz_quiz_answer').each(function () {
var $answer = $(this);
$answer.find('i.fa').addClass('d-none');
if ($answer.find('input[type=radio]').is(':checked')) {
if (answer.is_correct) {
$answer.find('i.fa-check-circle').removeClass('d-none');
} else {
$answer.find('label input').prop('checked', false);
$answer.find('i.fa-times-circle').removeClass('d-none');
}
if (answer.awarded_points > 0) {
var $badge = QWeb.render('quiz.badge', {'answer': answer});
$answer.append($badge);
}
} else {
$answer.find('i.fa-circle').removeClass('d-none');
}
});
var $list = $question.find('.list-group');
var $comment = QWeb.render('quiz.comment', {'answer': answer});
$list.append($comment);
});
},
/*
* @private
* Update validation box (karma, buttons) according to widget state
*/
_renderValidationInfo: function () {
var $validationElem = this.$('.o_quiz_js_quiz_validation');
$validationElem.html(
QWeb.render('quiz.validation', {'widget': this})
);
},
/**
* Remove the answer decorators
*/
_resetQuiz: function () {
this.$('.o_quiz_js_quiz_question').each(function () {
var $question = $(this);
$question.find('a.o_quiz_quiz_answer').each(function () {
var $answer = $(this);
$answer.find('i.fa').addClass('d-none');
$answer.find('i.fa-circle').removeClass('d-none');
$answer.find('span.badge').remove();
$answer.find('input[type=radio]').prop('checked', false);
});
var $info = $question.find('.o_quiz_quiz_answer_info');
$info.remove();
});
this.track.completed = false;
this._enableAnswers();
this._renderValidationInfo();
},
/**
* Submit a quiz and get the correction. It will display messages
* according to quiz result.
*
* @private
*/
_submitQuiz: function () {
var self = this;
return this._rpc({
route: '/event_track/quiz/submit',
params: {
event_id: self.track.eventId,
track_id: self.track.id,
answer_ids: this._getQuizAnswers(),
}
}).then(function (data) {
if (data.error) {
self._alertShow(data.error);
} else {
self.quiz = _.extend(self.quiz, data);
self.quiz.quizPointsGained = data.quiz_points;
if (data.quiz_completed) {
self._disableAnswers();
self.track.completed = data.quiz_completed;
}
self._renderAnswersHighlightingAndComments();
self._renderValidationInfo();
if (data.visitor_uuid) {
utils.set_cookie('visitor_uuid', data.visitor_uuid);
}
}
return Promise.resolve(data);
});
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* When clicking on an answer, this one should be marked as "checked".
*
* @private
* @param OdooEvent ev
*/
_onAnswerClick: function (ev) {
ev.preventDefault();
if (!this.track.completed) {
$(ev.currentTarget).find('input[type=radio]').prop('checked', true);
}
},
/**
* Resets the completion of the track so the user can take
* the quiz again
*
* @private
*/
_onClickReset: function () {
this._rpc({
route: '/event_track/quiz/reset',
params: {
event_id: this.track.eventId,
track_id: this.track.id
}
}).then(this._resetQuiz.bind(this));
},
});
publicWidget.registry.Quiz = publicWidget.Widget.extend({
selector: '.o_quiz_main',
//----------------------------------------------------------------------
// Public
//----------------------------------------------------------------------
/**
* @override
* @param {Object} parent
*/
start: function () {
var self = this;
this.quizWidgets = [];
var defs = [this._super.apply(this, arguments)];
this.$('.o_quiz_js_quiz').each(function () {
var data = $(this).data();
data.quizData = {
questions: self._extractQuestionsAndAnswers(),
sessionAnswers: data.sessionAnswers || [],
quizKarmaMax: data.quizKarmaMax,
quizKarmaWon: data.quizKarmaWon,
quizKarmaGain: data.quizKarmaGain,
quizPointsGained: data.quizPointsGained,
quizAttemptsCount: data.quizAttemptsCount,
};
defs.push(new Quiz(self, data, data.quizData).attachTo($(this)));
});
return Promise.all(defs);
},
//----------------------------------------------------------------------
// Private
//---------------------------------------------------------------------
/**
* Extract data from exiting DOM rendered server-side, to have the list of questions with their
* relative answers.
* This method should return the same format as /gamification_quiz/quiz/get controller.
*
* @return {Array<Object>} list of questions with answers
*/
_extractQuestionsAndAnswers: function () {
var questions = [];
this.$('.o_quiz_js_quiz_question').each(function () {
var $question = $(this);
var answers = [];
$question.find('.o_quiz_quiz_answer').each(function () {
var $answer = $(this);
answers.push({
id: $answer.data('answerId'),
text: $answer.data('text'),
});
});
questions.push({
id: $question.data('questionId'),
title: $question.data('title'),
answer_ids: answers,
});
});
return questions;
},
});
return Quiz;
});
| jeremiahyan/odoo | addons/website_event_track_quiz/static/src/js/event_quiz.js | JavaScript | gpl-3.0 | 11,329 |
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: game_sa/CPhysicalSA.h
* PURPOSE: Header file for physical object entity base class
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#pragma once
#include <game/CPhysical.h>
#include "CEntitySA.h"
#include <CVector.h>
#define FUNC_GetMoveSpeed 0x404460
#define FUNC_GetTurnSpeed 0x470030
#define FUNC_ProcessCollision 0x54DFB0
#define FUNC_AttachEntityToEntity 0x54D570
#define FUNC_DetatchEntityFromEntity 0x5442F0
#define FUNC_CPhysical_AddToMovingList 0x542800
#define FUNC_CPhysical_RemoveFromMovingList 0x542860
#define PHYSICAL_MAXNOOFCOLLISIONRECORDS 6
#define PHYSICAL_MAXMASS 99999.0
class CPhysicalSAInterface : public CEntitySAInterface
{
public:
float pad1; // 56
uint32 pad2; // 60
uint32 b0x01 : 1; // 64
uint32 bApplyGravity : 1;
uint32 bDisableFriction : 1;
uint32 bCollidable : 1;
uint32 b0x10 : 1;
uint32 bDisableMovement : 1;
uint32 b0x40 : 1;
uint32 b0x80 : 1;
uint32 bSubmergedInWater : 1; // 65
uint32 bOnSolidSurface : 1;
uint32 bBroken : 1;
uint32 b0x800 : 1; // ref @ 0x6F5CF0
uint32 b0x1000 : 1; //
uint32 bDontApplySpeed : 1; //
uint32 b0x4000 : 1; //
uint32 b0x8000 : 1; //
uint32 b0x10000 : 1; // 66
uint32 b0x20000 : 1; // ref @ CPhysical__processCollision
uint32 bBulletProof : 1;
uint32 bFireProof : 1;
uint32 bCollisionProof : 1;
uint32 bMeeleProof : 1;
uint32 bInvulnerable : 1;
uint32 bExplosionProof : 1;
uint32 b0x1000000 : 1; // 67
uint32 bAttachedToEntity : 1;
uint32 b0x4000000 : 1;
uint32 bTouchingWater : 1;
uint32 bEnableCollision : 1;
uint32 bDestroyed : 1;
uint32 b0x40000000 : 1;
uint32 b0x80000000 : 1;
CVector m_vecLinearVelocity; // 68
CVector m_vecAngularVelocity; // 80
CVector m_vecCollisionLinearVelocity; // 92
CVector m_vecCollisionAngularVelocity; // 104
CVector m_vecOffsetUnk5; // 116
CVector m_vecOffsetUnk6; // 128
float m_fMass; // 140
float m_fTurnMass; // 144
float m_pad1; // 148
float m_fAirResistance; // 152
float m_fElasticity; // 156
float m_fBuoyancyConstant; // 160
CVector m_vecCenterOfMass; // 164
uint32* m_pCollisionList; // 176
uint32* m_pMovingList; // 180
uint8 m_ucColFlag1; // 184
uint8 m_ucCollisionState; // 185
uint8 m_ucCollisionContactSurfaceType; // 186
uint8 m_ucColFlag4; // 187
CEntity* pLastContactedEntity[4]; // 188
float m_field_cc; // 204
float m_pad4c; // 208
float m_pad4d; // 212
float m_fDamageImpulseMagnitude; // 216
CEntitySAInterface* m_pCollidedEntity; // 220
CVector m_vecCollisionImpactVelocity; // 224
CVector m_vecCollisionPosition; // 236
uint16 m_usPieceType; // 248
uint16 m_pad3; // 250
CEntitySAInterface* m_pAttachedEntity; // 252
CVector m_vecAttachedOffset; // 256
CVector m_vecAttachedRotation; // 268
CVector m_vecUnk; // 280
uint32 m_pad4; // 292
class CPtrNodeDoubleLink* m_pControlCodeNodeLink; // 296
float m_fLighting; // 300
float m_fLighting2; // 304
class CShadowDataSA* m_pShadowData; // 308
CRect* GetBoundRect_(CRect* pRect);
static void StaticSetHooks();
};
static_assert(sizeof(CPhysicalSAInterface) == 0x138, "Invalid size for CPhysicalSAInterface");
class CPhysicalSA : public virtual CPhysical, public virtual CEntitySA
{
public:
virtual void RestoreLastGoodPhysicsState();
CVector* GetMoveSpeed(CVector* vecMoveSpeed);
CVector* GetTurnSpeed(CVector* vecTurnSpeed);
CVector* GetMoveSpeedInternal(CVector* vecMoveSpeed);
CVector* GetTurnSpeedInternal(CVector* vecTurnSpeed);
void SetMoveSpeed(CVector* vecMoveSpeed);
void SetTurnSpeed(CVector* vecTurnSpeed);
float GetMass();
void SetMass(float fMass);
float GetTurnMass();
void SetTurnMass(float fTurnMass);
float GetAirResistance();
void SetAirResistance(float fAirResistance);
float GetElasticity();
void SetElasticity(float fElasticity);
float GetBuoyancyConstant();
void SetBuoyancyConstant(float fBuoyancyConstant);
void GetCenterOfMass(CVector& vecCenterOfMass);
void SetCenterOfMass(CVector& vecCenterOfMass);
void ProcessCollision();
void AddToMovingList();
float GetDamageImpulseMagnitude();
void SetDamageImpulseMagnitude(float fMagnitude);
CEntity* GetDamageEntity();
void SetDamageEntity(CEntity* pEntity);
void ResetLastDamage();
CEntity* GetAttachedEntity();
void AttachEntityToEntity(CPhysical& Entity, const CVector& vecPosition, const CVector& vecRotation);
void DetachEntityFromEntity(float fUnkX, float fUnkY, float fUnkZ, bool bUnk);
void GetAttachedOffsets(CVector& vecPosition, CVector& vecRotation);
void SetAttachedOffsets(CVector& vecPosition, CVector& vecRotation);
virtual bool InternalAttachEntityToEntity(DWORD dwEntityInterface, const CVector* vecPosition, const CVector* vecRotation);
float GetLighting();
void SetLighting(float fLighting);
void SetFrozen(bool bFrozen);
/*
VOID SetMassMultiplier(FLOAT fMassMultiplier);
FLOAT GetMassMultiplier();
BOOL GetExtraHeavy();
VOID SetExtraHeavy(BOOL bExtraHeavy);
BOOL GetDoGravity();
VOID SetDoGravity(BOOL bDoGravity);
BOOL GetInfiniteMass();
VOID SetInfiniteMass(BOOL bInfiniteMass);
BOOL GetPositionFrozen();
VOID SetPositionFrozen(BOOL bPositionFrozen);
BYTE GetLastMaterialToHaveBeenStandingOn();
BYTE GetLevel();
VOID SetLevel(BYTE LivesInThisLevel);*/
};
| multitheftauto/mtasa-blue | Client/game_sa/CPhysicalSA.h | C | gpl-3.0 | 7,958 |
<?php
// vars
global $post;
// get options
$options = $this->get_acf_options($post->ID);
?>
<table class="acf_input widefat" id="acf_options">
<tr>
<td class="label">
<label for=""><?php _e("Order No.",'acf'); ?></label>
<p class="description"><?php _e("Field groups are created in order <br />from lowest to highest.",'acf'); ?></p>
</td>
<td>
<?php
$this->create_field(array(
'type' => 'text',
'name' => 'menu_order',
'value' => $post->menu_order,
));
?>
</td>
</tr>
<tr>
<td class="label">
<label for=""><?php _e("Position",'acf'); ?></label>
</td>
<td>
<?php
$this->create_field(array(
'type' => 'radio',
'name' => 'options[position]',
'value' => $options['position'],
'choices' => array(
'normal' => __("Normal",'acf'),
'side' => __("Side",'acf'),
)
));
?>
</td>
</tr>
<tr>
<td class="label">
<label for="post_type"><?php _e("Style",'acf'); ?></label>
</td>
<td>
<?php
$this->create_field(array(
'type' => 'radio',
'name' => 'options[layout]',
'value' => $options['layout'],
'choices' => array(
'default' => __("Standard Metabox",'acf'),
'no_box' => __("No Metabox",'acf'),
)
));
?>
</td>
</tr>
<tr>
<td class="label">
<label for="post_type"><?php _e("Hide on screen",'acf'); ?></label>
<p class="description"><?php _e("<b>Select</b> items to <b>hide</b> them from the edit screen",'acf'); ?></p>
<p class="description"><?php _e("If multiple field groups appear on an edit screen, the first field group's options will be used. (the one with the lowest order number)",'acf'); ?></p>
</td>
<td>
<?php
$this->create_field(array(
'type' => 'checkbox',
'name' => 'options[hide_on_screen]',
'value' => $options['hide_on_screen'],
'choices' => array(
'the_content' => __("Content Editor",'acf'),
'excerpt' => __("Excerpt"),
'custom_fields' => __("Custom Fields"),
'discussion' => __("Discussion"),
'comments' => __("Comments"),
'slug' => __("Slug"),
'author' => __("Author"),
'format' => __("Format"),
'featured_image' => __("Featured Image")
)
));
?>
</td>
</tr>
</table> | matthewheck/wcp-stuff | wp-content/plugins/advanced-custom-fields/core/admin/meta_box_options.php | PHP | gpl-3.0 | 2,274 |
<?php
/* Copyright (C) 2005 Patrick Rouillon <[email protected]>
* Copyright (C) 2005-2009 Destailleur Laurent <[email protected]>
* Copyright (C) 2005-2012 Regis Houssin <[email protected]>
* Copyright (C) 2011-2012 Philippe Grand <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/facture/contact.php
* \ingroup facture
* \brief Onglet de gestion des contacts des factures
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$langs->load("bills");
$langs->load("companies");
$id = (GETPOST('id')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref = GETPOST('ref','alpha');
$lineid = GETPOST('lineid','int');
$socid = GETPOST('socid','int');
$action = GETPOST('action','alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'facture', $id);
$object = new Facture($db);
/*
* Ajout d'un nouveau contact
*/
if ($action == 'addcontact' && $user->rights->facture->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid','int') : GETPOST('contactid','int'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->facture->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->facture->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
/*
* View
*/
llxHeader('', $langs->trans("Bill"), "Facture");
$form = new Form($db);
$formcompany = new FormCompany($db);
$contactstatic=new Contact($db);
$userstatic=new User($db);
/* *************************************************************************** */
/* */
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id, $ref) > 0)
{
$object->fetch_thirdparty();
$head = facture_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), 0, 'bill');
/*
* Facture synthese pour rappel
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
print '<td colspan="3">';
$morehtmlref='';
$discount=new DiscountAbsolute($db);
$result=$discount->fetch(0,$object->id);
if ($result > 0)
{
$morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')';
}
if ($result < 0)
{
dol_print_error('',$discount->error);
}
print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
print '</td></tr>';
// Ref customer
print '<tr><td width="20%">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('RefCustomer');
print '</td>';
print '</tr></table>';
print '</td>';
print '<td colspan="5">';
print $object->ref_client;
print '</td></tr>';
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1,'compta').'</td></tr>';
print "</table>";
print '</div>';
print '<br>';
// Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
foreach($dirtpls as $reldir)
{
$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break;
}
}
else
{
// Record not found
print "ErrorRecordNotFound";
}
}
llxFooter();
$db->close();
?> | woakes070048/crm-php | htdocs/facture/contact.php | PHP | gpl-3.0 | 5,741 |
/*
* Copyright (C) 2015, Simon Fuhrmann
* TU Darmstadt - Graphics, Capture and Massively Parallel Computing
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the LICENSE.txt file for details.
*/
#ifndef MATH_MATRIX_TOOLS_HEADER
#define MATH_MATRIX_TOOLS_HEADER
#include <algorithm>
#include "math/defines.h"
#include "math/matrix.h"
#include "math/vector.h"
MATH_NAMESPACE_BEGIN
/**
* Creates a symmetric projection matrix as used in OpenGL.
* Values in the frustum are mapped to the unit cube. The frustum
* near plane is defined by z-near, right and top values, the far-plane
* is located at z-far.
*/
template <typename T>
Matrix<T,4,4>
matrix_gl_projection (T const& znear, T const& zfar,
T const& top, T const& right);
/**
* Creates a symmetric inverse projection matrix as used in OpenGL.
*/
template <typename T>
Matrix<T,4,4>
matrix_inverse_gl_projection (T const& znear, T const& zfar,
T const& top, T const& right);
/**
* Creates a view transformation matrix for camera parameters given
* as camera position, normalized viewing direction, and normalized
* up-vector.
*/
template <typename T>
Matrix<T,4,4>
matrix_viewtrans (Vector<T,3> const& campos,
Vector<T,3> const& viewdir, Vector<T,3> const& upvec);
/**
* Creates an inverse view transformation matrix.
*/
template <typename T>
Matrix<T,4,4>
matrix_inverse_viewtrans (Vector<T,3> const& campos,
Vector<T,3> const& viewdir, Vector<T,3> const& upvec);
/**
* Inverts a transformation matrix.
*/
template <typename T>
Matrix<T,4,4>
matrix_invert_trans (Matrix<T,4,4> const& mat);
/**
* Sets the given square matrix to the identity matrix.
* The function returns a reference to the given matrix.
*/
template <typename T, int N>
Matrix<T,N,N>&
matrix_set_identity (Matrix<T,N,N>* mat);
/**
* Sets the given square matrix of dimension 'n' to the identity matrix.
* The function returns the argument pointer.
*/
template <typename T>
T*
matrix_set_identity (T* mat, int n);
/**
* Returns true if and only if the given matrix is the identity matrix.
*/
template <typename T, int N>
bool
matrix_is_identity (Matrix<T,N,N> const& mat, T const& epsilon = T(0));
/**
* Returns a diagonal matrix from the given vector.
*/
template <typename T, int N>
Matrix<T,N,N>
matrix_from_diagonal (math::Vector<T,N> const& v);
/**
* Sets the diagonal elements of the given matrix.
*/
template <typename T, int N>
Matrix<T,N,N>&
matrix_set_diagonal (Matrix<T,N,N>& mat, T const* diag);
/**
* Checks whether the input matrix is a diagonal matrix. This is done by
* testing if all non-diagonal entries are zero (up to some epsilon).
*/
template <typename T>
bool
matrix_is_diagonal (T* const mat, int rows, int cols, T const& epsilon = T(0));
/**
* Returns the diagonal elements of the matrix as a vector.
*/
template <typename T, int N>
Vector<T,N>
matrix_get_diagonal (Matrix<T,N,N> const& mat);
/**
* Calculates the determinant of the given matrix.
* This is specialized for 1x1, 2x2, 3x3 and 4x4 matrices only.
*/
template <typename T, int N>
T
matrix_determinant (Matrix<T,N,N> const& mat);
/**
* Calculates the inverse of the given matrix.
* This is specialized for 1x1, 2x2, 3x3 and 4x4 matrices only.
*/
template <typename T, int N>
Matrix<T,N,N>
matrix_inverse (Matrix<T,N,N> const& mat);
/**
* Calculates the inverse of the given matrix given its determinant.
* This is specialized for 1x1, 2x2 and 3x3 matrices only.
*/
template <typename T, int N>
Matrix<T,N,N>
matrix_inverse (Matrix<T,N,N> const& mat, T const& det);
/**
* Computes the 3x3 rotation matrix from axis and angle notation.
*/
template <typename T>
Matrix<T,3,3>
matrix_rotation_from_axis_angle (Vector<T,3> const& axis, T const& angle);
/**
* In-place transpose of a dynamically sized dense matrix.
* The resulting matrix has number of rows and columns exchanged.
*/
template <typename T>
void
matrix_transpose (T const* mat, int rows, int cols);
/**
* Matrix multiplication of dynamically sized dense matrices.
* R = A * B where A is MxN, B is NxL and R is MxL. Compexity: O(n*n*n).
*/
template <typename T>
void
matrix_multiply (T const* mat_a, int rows_a, int cols_a,
T const* mat_b, int cols_b, T* mat_res);
/**
* Swaps the rows r1 and r2 of matrix mat with dimension rows, cols.
*/
template <typename T>
void
matrix_swap_rows (T* mat, int rows, int cols, int r1, int r2);
/**
* Swaps the columns c1 and c2 of matrix mat with dimension rows, cols.
*/
template <typename T>
void
matrix_swap_columns (T* const mat, int rows, int cols, int c1, int c2);
/**
* Rotates the entries of the given matrix by 180 degrees in-place.
*/
template <typename T, int N>
void
matrix_rotate_180_inplace (Matrix<T, N, N>* mat_a);
/**
* Rotates the entries of the given matrix by 180 degrees.
*/
template <typename T, int N>
Matrix<T, N, N>
matrix_rotate_180 (Matrix<T, N, N> const& mat_a);
MATH_NAMESPACE_END
/* ------------------------ Implementation ------------------------ */
MATH_NAMESPACE_BEGIN
template <typename T>
Matrix<T,4,4>
matrix_gl_projection (T const& znear, T const& zfar,
T const& top, T const& right)
{
Matrix<T,4,4> proj(0.0f);
proj(0,0) = znear / right;
proj(1,1) = znear / top;
proj(2,2) = -(zfar + znear) / (zfar - znear);
proj(2,3) = T(-2) * zfar * znear / (zfar - znear);
proj(3,2) = -1;
return proj;
}
template <typename T>
Matrix<T,4,4>
matrix_inverse_gl_projection (T const& znear, T const& zfar,
T const& top, T const& right)
{
Matrix<T,4,4> iproj(0.0f);
iproj(0,0) = right / znear;
iproj(1,1) = top / znear;
iproj(2,3) = -1;
iproj(3,2) = (zfar - znear) / (T(-2) * zfar * znear);
iproj(3,3) = -(zfar + znear) / (T(-2) * zfar * znear);
return iproj;
}
template <typename T>
Matrix<T,4,4>
matrix_viewtrans (Vector<T,3> const& campos,
Vector<T,3> const& viewdir, Vector<T,3> const& upvec)
{
/* Normalize x in case upvec is not perpendicular to viewdir. */
Vector<T,3> z(-viewdir);
Vector<T,3> x(upvec.cross(z).normalized());
Vector<T,3> y(z.cross(x));
Matrix<T,4,4> m;
m(0,0) = x[0]; m(0,1) = x[1]; m(0,2) = x[2]; m(0,3) = 0.0f;
m(1,0) = y[0]; m(1,1) = y[1]; m(1,2) = y[2]; m(1,3) = 0.0f;
m(2,0) = z[0]; m(2,1) = z[1]; m(2,2) = z[2]; m(2,3) = 0.0f;
m(3,0) = 0.0f; m(3,1) = 0.0f; m(3,2) = 0.0f; m(3,3) = 1.0f;
Vector<T,3> t(-campos);
m(0,3) = m(0,0) * t[0] + m(0,1) * t[1] + m(0,2) * t[2];
m(1,3) = m(1,0) * t[0] + m(1,1) * t[1] + m(1,2) * t[2];
m(2,3) = m(2,0) * t[0] + m(2,1) * t[1] + m(2,2) * t[2];
return m;
}
template <typename T>
Matrix<T,4,4>
matrix_inverse_viewtrans (Vector<T,3> const& campos,
Vector<T,3> const& viewdir, Vector<T,3> const& upvec)
{
Vector<T,3> z(-viewdir);
Vector<T,3> x(upvec.cross(z).normalized());
Vector<T,3> y(z.cross(x));
Matrix<T,4,4> m;
m(0,0) = x[0]; m(0,1) = y[0]; m(0,2) = z[0]; m(0,3) = campos[0];
m(1,0) = x[1]; m(1,1) = y[1]; m(1,2) = z[1]; m(1,3) = campos[1];
m(2,0) = x[2]; m(2,1) = y[2]; m(2,2) = z[2]; m(2,3) = campos[2];
m(3,0) = 0.0f; m(3,1) = 0.0f; m(3,2) = 0.0f; m(3,3) = 1.0f;
return m;
}
template <typename T>
Matrix<T,4,4>
matrix_invert_trans (Matrix<T,4,4> const& mat)
{
Matrix<T,4,4> ret(0.0f);
/* Transpose rotation. */
ret[0] = mat[0]; ret[1] = mat[4]; ret[2] = mat[8];
ret[4] = mat[1]; ret[5] = mat[5]; ret[6] = mat[9];
ret[8] = mat[2]; ret[9] = mat[6]; ret[10] = mat[10];
/* Invert translation. */
ret[3] = -(ret[0] * mat[3] + ret[1] * mat[7] + ret[2] * mat[11]);
ret[7] = -(ret[4] * mat[3] + ret[5] * mat[7] + ret[6] * mat[11]);
ret[11] = -(ret[8] * mat[3] + ret[9] * mat[7] + ret[10] * mat[11]);
ret[15] = 1.0f;
return ret;
}
template <typename T, int N>
Matrix<T,N,N>&
matrix_set_identity (Matrix<T,N,N>* mat)
{
mat->fill(T(0));
for (int i = 0; i < N * N; i += N + 1)
(*mat)[i] = T(1);
return *mat;
}
template <typename T>
T*
matrix_set_identity (T* mat, int n)
{
int const len = n * n;
std::fill(mat, mat + len, T(0));
for (int i = 0; i < len; i += n + 1)
mat[i] = T(1);
return mat;
}
template <typename T, int N>
bool
matrix_is_identity (Matrix<T,N,N> const& mat, T const& epsilon)
{
for (int y = 0, i = 0; y < N; ++y)
for (int x = 0; x < N; ++x, ++i)
if ((x == y && !MATH_EPSILON_EQ(mat[i], T(1), epsilon))
|| (x != y && !MATH_EPSILON_EQ(mat[i], T(0), epsilon)))
return false;
return true;
}
template <typename T, int N>
Matrix<T,N,N>
matrix_from_diagonal (math::Vector<T,N> const& v)
{
Matrix<T,N,N> mat;
std::fill(*mat, *mat + N*N, T(0));
for (int i = 0, j = 0; i < N*N; i += N+1, j += 1)
mat[i] = v[j];
return mat;
}
template <typename T, int N>
Matrix<T,N,N>&
matrix_set_diagonal (Matrix<T,N,N>& mat, T const* diag)
{
for (int i = 0, j = 0; i < N*N; i += N+1, j += 1)
mat[i] = diag[j];
return mat;
}
template <typename T, int N>
Vector<T,N>
matrix_get_diagonal (Matrix<T,N,N> const& mat)
{
Vector<T,N> diag;
for (int i = 0, j = 0; i < N*N; i += N+1, j += 1)
diag[j] = mat[i];
return diag;
}
template <typename T>
inline T
matrix_determinant (Matrix<T,1,1> const& mat)
{
return mat[0];
}
template <typename T>
inline T
matrix_determinant (Matrix<T,2,2> const& mat)
{
return mat[0] * mat[3] - mat[1] * mat [2];
}
template <typename T>
inline T
matrix_determinant (Matrix<T,3,3> const& m)
{
return m[0] * m[4] * m[8] + m[1] * m[5] * m[6] + m[2] * m[3] * m[7]
- m[2] * m[4] * m[6] - m[1] * m[3] * m[8] - m[0] * m[5] * m[7];
}
template <typename T>
T
matrix_determinant (Matrix<T,4,4> const& m)
{
return m[0] * (m[5] * m[10] * m[15] - m[5] * m[11] * m[14]
- m[9] * m[6] * m[15] + m[9] * m[7] * m[14]
+ m[13] * m[6] * m[11] - m[13] * m[7] * m[10])
//
+ m[1] * (-m[4] * m[10] * m[15] + m[4] * m[11] * m[14]
+ m[8] * m[6] * m[15] - m[8] * m[7] * m[14]
- m[12] * m[6] * m[11] + m[12] * m[7] * m[10])
//
+ m[2] * (m[4] * m[9] * m[15] - m[4] * m[11] * m[13]
- m[8] * m[5] * m[15] + m[8] * m[7] * m[13]
+ m[12] * m[5] * m[11] - m[12] * m[7] * m[9])
//
+ m[3] * (-m[4] * m[9] * m[14] + m[4] * m[10] * m[13]
+ m[8] * m[5] * m[14] - m[8] * m[6] * m[13]
- m[12] * m[5] * m[10] + m[12] * m[6] * m[9]);
}
template <typename T>
inline Matrix<T,1,1>
matrix_inverse (Matrix<T,1,1> const& mat)
{
return matrix_inverse(mat, matrix_determinant(mat));
}
template <typename T>
inline Matrix<T,2,2>
matrix_inverse (Matrix<T,2,2> const& mat)
{
return matrix_inverse(mat, matrix_determinant(mat));
}
template <typename T>
inline Matrix<T,3,3>
matrix_inverse (Matrix<T,3,3> const& m)
{
return matrix_inverse(m, matrix_determinant(m));
}
template <typename T>
Matrix<T,1,1>
matrix_inverse (Matrix<T,1,1> const& /*mat*/, T const& det)
{
Matrix<T,1,1> ret(T(1));
return ret / det;
}
template <typename T>
Matrix<T,2,2>
matrix_inverse (Matrix<T,2,2> const& mat, T const& det)
{
Matrix<T,2,2> ret;
ret[0] = mat[3]; ret[1] = -mat[1];
ret[2] = -mat[2]; ret[3] = mat[0];
return ret / det;
}
template <typename T>
Matrix<T,3,3>
matrix_inverse (Matrix<T,3,3> const& m, T const& det)
{
Matrix<T,3,3> ret;
ret[0] = m[4] * m[8] - m[5] * m[7];
ret[1] = m[2] * m[7] - m[1] * m[8];
ret[2] = m[1] * m[5] - m[2] * m[4];
ret[3] = m[5] * m[6] - m[3] * m[8];
ret[4] = m[0] * m[8] - m[2] * m[6];
ret[5] = m[2] * m[3] - m[0] * m[5];
ret[6] = m[3] * m[7] - m[4] * m[6];
ret[7] = m[1] * m[6] - m[0] * m[7];
ret[8] = m[0] * m[4] - m[1] * m[3];
return ret / det;
}
template <typename T>
Matrix<T,4,4>
matrix_inverse (Matrix<T,4,4> const& m)
{
Matrix<T,4,4> ret;
ret[0] = m[5] * m[10] * m[15] - m[5] * m[11] * m[14] - m[9] * m[6] * m[15]
+ m[9] * m[7] * m[14] + m[13] * m[6] * m[11] - m[13] * m[7] * m[10];
ret[1] = -m[1] * m[10] * m[15] + m[1] * m[11] * m[14] + m[9] * m[2] * m[15]
- m[9] * m[3] * m[14] - m[13] * m[2] * m[11] + m[13] * m[3] * m[10];
ret[2] = m[1] * m[6] * m[15] - m[1] * m[7] * m[14] - m[5] * m[2] * m[15]
+ m[5] * m[3] * m[14] + m[13] * m[2] * m[7] - m[13] * m[3] * m[6];
ret[3] = -m[1] * m[6] * m[11] + m[1] * m[7] * m[10] + m[5] * m[2] * m[11]
- m[5] * m[3] * m[10] - m[9] * m[2] * m[7] + m[9] * m[3] * m[6];
ret[4] = -m[4] * m[10] * m[15] + m[4] * m[11] * m[14] + m[8] * m[6] * m[15]
- m[8] * m[7] * m[14] - m[12] * m[6] * m[11] + m[12] * m[7] * m[10];
ret[5] = m[0] * m[10] * m[15] - m[0] * m[11] * m[14] - m[8] * m[2] * m[15]
+ m[8] * m[3] * m[14] + m[12] * m[2] * m[11] - m[12] * m[3] * m[10];
ret[6] = -m[0] * m[6] * m[15] + m[0] * m[7] * m[14] + m[4] * m[2] * m[15]
- m[4] * m[3] * m[14] - m[12] * m[2] * m[7] + m[12] * m[3] * m[6];
ret[7] = m[0] * m[6] * m[11] - m[0] * m[7] * m[10] - m[4] * m[2] * m[11]
+ m[4] * m[3] * m[10] + m[8] * m[2] * m[7] - m[8] * m[3] * m[6];
ret[8] = m[4] * m[9] * m[15] - m[4] * m[11] * m[13] - m[8] * m[5] * m[15]
+ m[8] * m[7] * m[13] + m[12] * m[5] * m[11] - m[12] * m[7] * m[9];
ret[9] = -m[0] * m[9] * m[15] + m[0] * m[11] * m[13] + m[8] * m[1] * m[15]
- m[8] * m[3] * m[13] - m[12] * m[1] * m[11] + m[12] * m[3] * m[9];
ret[10] = m[0] * m[5] * m[15] - m[0] * m[7] * m[13] - m[4] * m[1] * m[15]
+ m[4] * m[3] * m[13] + m[12] * m[1] * m[7] - m[12] * m[3] * m[5];
ret[11] = -m[0] * m[5] * m[11] + m[0] * m[7] * m[9] + m[4] * m[1] * m[11]
- m[4] * m[3] * m[9] - m[8] * m[1] * m[7] + m[8] * m[3] * m[5];
ret[12] = -m[4] * m[9] * m[14] + m[4] * m[10] * m[13] + m[8] * m[5] * m[14]
- m[8] * m[6] * m[13] - m[12] * m[5] * m[10] + m[12] * m[6] * m[9];
ret[13] = m[0] * m[9] * m[14] - m[0] * m[10] * m[13] - m[8] * m[1] * m[14]
+ m[8] * m[2] * m[13] + m[12] * m[1] * m[10] - m[12] * m[2] * m[9];
ret[14] = -m[0] * m[5] * m[14] + m[0] * m[6] * m[13] + m[4] * m[1] * m[14]
- m[4] * m[2] * m[13] - m[12] * m[1] * m[6] + m[12] * m[2] * m[5];
ret[15] = m[0] * m[5] * m[10] - m[0] * m[6] * m[9] - m[4] * m[1] * m[10]
+ m[4] * m[2] * m[9] + m[8] * m[1] * m[6] - m[8] * m[2] * m[5];
T det = m[0] * ret[0] + m[1] * ret[4] + m[2] * ret[8] + m[3] * ret[12];
return ret / det;
}
template <typename T>
Matrix<T,3,3>
matrix_rotation_from_axis_angle (Vector<T,3> const& axis, T const& angle)
{
/*
* http://en.wikipedia.org/wiki/Rotation_matrix
* #Rotation_matrix_from_axis_and_angle
*/
T const ca = std::cos(angle);
T const sa = std::sin(angle);
T const omca = T(1) - ca;
math::Matrix<T, 3, 3> rot;
rot[0] = ca + MATH_POW2(axis[0]) * omca;
rot[1] = axis[0] * axis[1] * omca - axis[2] * sa;
rot[2] = axis[0] * axis[2] * omca + axis[1] * sa;
rot[3] = axis[1] * axis[0] * omca + axis[2] * sa;
rot[4] = ca + MATH_POW2(axis[1]) * omca;
rot[5] = axis[1] * axis[2] * omca - axis[0] * sa;
rot[6] = axis[2] * axis[0] * omca - axis[1] * sa;
rot[7] = axis[2] * axis[1] * omca + axis[0] * sa;
rot[8] = ca + MATH_POW2(axis[2]) * omca;
return rot;
}
template <typename T>
void
matrix_transpose (T* mat, int rows, int cols)
{
/* Create a temporary copy of the matrix. */
T* tmp = new T[rows * cols];
std::copy(mat, mat + rows * cols, tmp);
/* Transpose matrix elements. */
for (int iter = 0, col = 0; col < cols; ++col)
for (int row = 0; row < rows; ++row, ++iter)
mat[iter] = tmp[row * cols + col];
delete[] tmp;
}
template <typename T>
void
matrix_multiply (T const* mat_a, int rows_a, int cols_a,
T const* mat_b, int cols_b, T* mat_res)
{
std::fill(mat_res, mat_res + rows_a * cols_b, T(0));
for (int j = 0; j < cols_b; ++j)
{
for (int i = 0; i < rows_a; ++i)
{
int const ica = i * cols_a;
int const icb = i * cols_b;
for (int k = 0; k < cols_a; ++k)
mat_res[icb + j] += mat_a[ica + k] * mat_b[k * cols_b + j];
}
}
}
template <typename T>
bool
matrix_is_diagonal (T* const mat, int rows, int cols, T const& epsilon)
{
for (int y = 0; y < rows; ++y)
{
for (int x = 0; x < y && x < cols; ++x)
if (!MATH_EPSILON_EQ(T(0), mat[y * cols + x], epsilon))
return false;
for (int x = y + 1; x < cols; ++x)
if (!MATH_EPSILON_EQ(T(0), mat[y * cols + x], epsilon))
return false;
}
return true;
}
template <typename T>
void
matrix_swap_columns (T* mat, int rows, int cols, int c1, int c2)
{
for (int i = 0; i < rows; ++i, c1 += cols, c2 += cols)
std::swap(mat[c1], mat[c2]);
}
template <typename T>
void
matrix_swap_rows (T* mat, int /*rows*/, int cols, int r1, int r2)
{
r1 = cols * r1;
r2 = cols * r2;
for (int i = 0; i < cols; ++i, ++r1, ++r2)
std::swap(mat[r1], mat[r2]);
}
template <typename T, int N>
void
matrix_rotate_180_inplace (Matrix<T, N, N>* mat_a)
{
for (int i = 0, j = N * N - 1; i < j; ++i, --j)
std::swap((*mat_a)[i], (*mat_a)[j]);
}
template <typename T, int N>
Matrix<T, N, N>
matrix_rotate_180 (Matrix<T, N, N> const& mat_a)
{
Matrix<T, N, N> ret = mat_a;
matrix_rotate_180_inplace(&ret);
return ret;
}
MATH_NAMESPACE_END
#endif /* MATH_MATRIX_TOOLS_HEADER */
| keksberg/mve | libs/math/matrix_tools.h | C | gpl-3.0 | 17,527 |
#ifndef BOOST_ATOMIC_DETAIL_CAS32WEAK_HPP
#define BOOST_ATOMIC_DETAIL_CAS32WEAK_HPP
// 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)
//
// Copyright (c) 2011 Helge Bahmann
#include <cstddef>
#include <boost/cstdint.hpp>
#include <boost/memory_order.hpp>
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/base.hpp>
#ifdef BOOST_ATOMIC_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
namespace atomics {
namespace detail {
/* integral types */
template<typename T, bool Sign>
class base_atomic<T, int, 1, Sign> {
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
typedef uint32_t storage_type;
public:
explicit base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
platform_fence_before(success_order);
storage_type expected_s = (storage_type) expected;
storage_type desired_s = (storage_type) desired;
bool success = platform_cmpxchg32(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
expected = (value_type) expected_s;
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, int, 2, Sign> {
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
typedef uint32_t storage_type;
public:
explicit base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
platform_fence_before(success_order);
storage_type expected_s = (storage_type) expected;
storage_type desired_s = (storage_type) desired;
bool success = platform_cmpxchg32(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
expected = (value_type) expected_s;
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, int, 4, Sign> {
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
public:
explicit base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
platform_fence_before(success_order);
bool success = platform_cmpxchg32(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
value_type v_;
};
/* pointer types */
template<bool Sign>
class base_atomic<void *, void *, 4, Sign> {
typedef base_atomic this_type;
typedef void * value_type;
typedef ptrdiff_t difference_type;
public:
explicit base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
platform_fence_before(success_order);
bool success = platform_cmpxchg32(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
value_type v_;
};
template<typename T, bool Sign>
class base_atomic<T *, void *, 4, Sign> {
typedef base_atomic this_type;
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
explicit base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
platform_fence_before(success_order);
bool success = platform_cmpxchg32(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
value_type
fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_POINTER_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
value_type v_;
};
/* generic types */
template<typename T, bool Sign>
class base_atomic<T, void, 1, Sign> {
typedef base_atomic this_type;
typedef T value_type;
typedef uint32_t storage_type;
public:
explicit base_atomic(value_type const& v) : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
base_atomic(void) {}
void
store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = tmp;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
value_type v;
memcpy(&v, &tmp, sizeof(value_type));
return v;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg32(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, void, 2, Sign> {
typedef base_atomic this_type;
typedef T value_type;
typedef uint32_t storage_type;
public:
explicit base_atomic(value_type const& v) : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
base_atomic(void) {}
void
store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = tmp;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
value_type v;
memcpy(&v, &tmp, sizeof(value_type));
return v;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg32(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, void, 4, Sign> {
typedef base_atomic this_type;
typedef T value_type;
typedef uint32_t storage_type;
public:
explicit base_atomic(value_type const& v) : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
base_atomic(void) {}
void
store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = tmp;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
value_type v;
memcpy(&v, &tmp, sizeof(value_type));
return v;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg32(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile
{
for(;;) {
value_type tmp = expected;
if (compare_exchange_weak(tmp, desired, success_order, failure_order))
return true;
if (tmp != expected) {
expected = tmp;
return false;
}
}
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
private:
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
storage_type v_;
};
}
}
}
#endif
| alexisVallet/animation-character-identification | vendors/boost/include/boost/atomic/detail/cas32weak.hpp | C++ | gpl-3.0 | 26,281 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML style="overflow:auto;">
<HEAD>
<meta name="generator" content="JDiff v1.1.0">
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
android.app.Activity
</TITLE>
<link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" />
<noscript>
<style type="text/css">
body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
<style type="text/css">
</style>
</HEAD>
<BODY>
<!-- Start of nav bar -->
<a name="top"></a>
<div id="header" style="margin-bottom:0;padding-bottom:0;">
<div id="headerLeft">
<a href="../../../../index.html" tabindex="-1" target="_top"><img src="../../../../assets/images/bg_logo.png" alt="Android Developers" /></a>
</div>
<div id="headerRight">
<div id="headerLinks">
<!-- <img src="/assets/images/icon_world.jpg" alt="" /> -->
<span class="text">
<!-- <a href="#">English</a> | -->
<nobr><a href="http://developer.android.com" target="_top">Android Developers</a> | <a href="http://www.android.com" target="_top">Android.com</a></nobr>
</span>
</div>
<div class="and-diff-id" style="margin-top:6px;margin-right:8px;">
<table class="diffspectable">
<tr>
<td colspan="2" class="diffspechead">API Diff Specification</td>
</tr>
<tr>
<td class="diffspec" style="padding-top:.25em">To Level:</td>
<td class="diffvaluenew" style="padding-top:.25em">5</td>
</tr>
<tr>
<td class="diffspec">From Level:</td>
<td class="diffvalueold">4</td>
</tr>
<tr>
<td class="diffspec">Generated</td>
<td class="diffvalue">2009.11.19 19:35</td>
</tr>
</table>
</div><!-- End and-diff-id -->
<div class="and-diff-id" style="margin-right:8px;">
<table class="diffspectable">
<tr>
<td class="diffspec" colspan="2"><a href="jdiff_statistics.html">Statistics</a>
</tr>
</table>
</div> <!-- End and-diff-id -->
</div> <!-- End headerRight -->
</div> <!-- End header -->
<div id="body-content" xstyle="padding:12px;padding-right:18px;">
<div id="doc-content" style="position:relative;">
<div id="mainBodyFluid">
<H2>
Class android.app.<A HREF="../../../../reference/android/app/Activity.html" target="_top"><font size="+2"><code>Activity</code></font></A>
</H2>
<a NAME="constructors"></a>
<a NAME="methods"></a>
<p>
<a NAME="Added"></a>
<TABLE summary="Added Methods" WIDTH="100%">
<TR>
<TH VALIGN="TOP" COLSPAN=2>Added Methods</FONT></TD>
</TH>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.onAttachedToWindow_added()"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/app/Activity.html#onAttachedToWindow()" target="_top"><code>onAttachedToWindow</code></A>()</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.onBackPressed_added()"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/app/Activity.html#onBackPressed()" target="_top"><code>onBackPressed</code></A>()</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.onDetachedFromWindow_added()"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/app/Activity.html#onDetachedFromWindow()" target="_top"><code>onDetachedFromWindow</code></A>()</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.onKeyLongPress_added(int, android.view.KeyEvent)"></A>
<nobr><code>boolean</code> <A HREF="../../../../reference/android/app/Activity.html#onKeyLongPress(int, android.view.KeyEvent)" target="_top"><code>onKeyLongPress</code></A>(<code>int,</nobr> KeyEvent<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.overridePendingTransition_added(int, int)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/app/Activity.html#overridePendingTransition(int, int)" target="_top"><code>overridePendingTransition</code></A>(<code>int,</nobr> int<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.startIntentSenderForResult_added(android.content.IntentSender, int, android.content.Intent, int, int, int)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)" target="_top"><code>startIntentSenderForResult</code></A>(<code>IntentSender,</nobr> int<nobr>,</nobr> Intent<nobr>,</nobr> int<nobr>,</nobr> int<nobr>,</nobr> int<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.startIntentSenderFromChild_added(android.app.Activity, android.content.IntentSender, int, android.content.Intent, int, int, int)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/app/Activity.html#startIntentSenderFromChild(android.app.Activity, android.content.IntentSender, int, android.content.Intent, int, int, int)" target="_top"><code>startIntentSenderFromChild</code></A>(<code>Activity,</nobr> IntentSender<nobr>,</nobr> int<nobr>,</nobr> Intent<nobr>,</nobr> int<nobr>,</nobr> int<nobr>,</nobr> int<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.app.Activity.triggerSearch_added(java.lang.String, android.os.Bundle)"></A>
<nobr><code>void</code> <A HREF="../../../../reference/android/app/Activity.html#triggerSearch(java.lang.String, android.os.Bundle)" target="_top"><code>triggerSearch</code></A>(<code>String,</nobr> Bundle<nobr><nobr></code>)</nobr>
</TD>
<TD> </TD>
</TR>
</TABLE>
<a NAME="fields"></a>
</div>
<div id="footer">
<div id="copyright">
Except as noted, this content is licensed under
<a href="http://creativecommons.org/licenses/by/2.5/"> Creative Commons Attribution 2.5</a>.
For details and restrictions, see the <a href="/license.html">Content License</a>.
</div>
<div id="footerlinks">
<p>
<a href="http://www.android.com/terms.html">Site Terms of Service</a> -
<a href="http://www.android.com/privacy.html">Privacy Policy</a> -
<a href="http://www.android.com/branding.html">Brand Guidelines</a>
</p>
</div>
</div> <!-- end footer -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
<script src="http://www.google-analytics.com/ga.js" type="text/javascript">
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-5831155-1");
pageTracker._setAllowAnchor(true);
pageTracker._initData();
pageTracker._trackPageview();
} catch(e) {}
</script>
</BODY>
</HTML>
| mateor/pdroid | android-2.3.4_r1/tags/1.32/frameworks/base/docs/html/sdk/api_diff/5/changes/android.app.Activity.html | HTML | gpl-3.0 | 8,007 |
\documentclass{article}
% Previously we had five input LaTeX files (booklet.tex bk-lt.tex bk-a4.tex
% refcard.tex gnusref.tex) and two logo files (gnuslogo-refcard.eps and
% gnuslogo-booklet.eps).
%
% From this LaTeX file (gnus-refcard.tex) plus a single logo (gnus-logo.eps),
% we can generate the refcard and the booklet version. This simplifies to
% distribute the refcard with Emacs. Appropriate Makefile rules were added in
% gnus/texi/Makefile.
% For Emacs, we may use the following commands (w/o) using Gnus' Makefile:
%
% latex gnus-refcard.tex &&
% dvips -t letter -f gnus-refcard.dvi > gnus-refcard.ps
%
% latex '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}' &&
% mv gnus-refcard.dvi gnus-booklet.dvi &&
% dvips -t letter -f gnus-booklet.dvi > gnus-booklet.ps
\usepackage{ifthen}
\ifthenelse{\isundefined{\booklettrue}}{
\typeout{Creating reference card...}
}{
\typeout{Creating reference booklet...}}
\usepackage{supertabular}
\newlength{\logowidth} \setlength{\logowidth} {6.861in}
\newlength{\logoheight} \setlength{\logoheight}{7.013in}
\usepackage{graphicx}
\usepackage{geometry}
\ifthenelse{\isundefined{\booklettrue}}{% ifcard %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Reference Card
\def\Guide{Card}\def\guide{card}
\def\logoscale{0.25}
% Page setup for the refcard:
% \setlength{\textwidth}{7.26in} \setlength{\textheight}{10in}
% \setlength{\topmargin}{-1.0in}
% % the same settings work for A4, although there is a bit of space at the
% % top and bottom of the page.
% \setlength{\oddsidemargin}{-0.5in} \setlength{\evensidemargin}{-0.5in}
\ifthenelse{\isundefined{\letterpapertrue}}{
\geometry{a4paper,hmargin=10mm,tmargin=10mm,bmargin=35mm}
}{
\geometry{hmargin=20mm,tmargin=10mm,bmargin=12mm}
}
}{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Reference Booklet
\def\Guide{Booklet}\def\guide{booklet}
\def\logoscale{0.5}% FIXME: too large for 2up printing? --rsteib
\ifthenelse{\isundefined{\letterpapertrue}}{
\geometry{a5paper,hmargin=10mm,tmargin=10mm,bmargin=4mm}
}{
\geometry{a5paper,hmargin=20mm,tmargin=10mm,bmargin=4mm}
}
\def\sec{\section}
\def\subsec{\subsection}
\def\subsubsec{\subsubsection}
\def\blankpage{\vspace*{\fill}\par
%\centerline{(This page intentionally left blank.)}
\par\vspace*{\fill}\pagebreak}
}%ifbooklet% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \input{gnusref} % % % % % % % % % % % % % % % % % % % % % % % % % %
%% include file for the Gnus refcard and booklet
\def\progver{5.11} % program version
% \def\refver{5.10-2} % refcard version (not used)
\def\date{April, 2006}
\def\author{Gnus Bugfixing Girls + Boys $<[email protected]$>$}
%%
\newlength{\keycolwidth}
\newenvironment{keys}[1]% #1 is the widest key
{\nopagebreak%\noindent%
\settowidth{\keycolwidth}{#1}%
\addtolength{\keycolwidth}{\tabcolsep}%
\addtolength{\keycolwidth}{-\columnwidth}%
\begin{supertabular}{@{}l@{\hspace{\tabcolsep}}p{-\keycolwidth}@{}}}%
{\end{supertabular}\\}
%% uncomment the first definition if you do not want pagebreaks in maps
%%\newcommand{\esamepage}{\samepage}
\newcommand{\esamepage}{}
\newcommand*{\B}[1]{{\bf#1})} % bold l)etter
\newcommand{\Title}{%
\begin{center}
{\bf\LARGE Gnus \progver\ Reference \Guide\\}
%{\normalsize \Guide\ version \refver}
\end{center}
}
% \newcommand*{\LogoOLD}[1]{\centerline{%
% \makebox[\logoscale\logowidth][l]{\vbox to \logoscale\logoheight
% {\vfill\epsfig{figure=gnuslogo-#1}}\vspace{-\baselineskip}}}}
\newcommand*{\Logo}[1]{\centerline{%
\includegraphics[width=\logoscale\logowidth]{gnus-logo}}}
%% Contributions by:
%% 1995 Vladimir Alexiev <[email protected]>
%% 2000 Felix Natter <[email protected]>
%% 2001, 2002, 2003, 2005 \author.
%% Original Gnus manual 1994 Lars Magne Ingebrigtsen
%% Some material from Emacs Help Bindings feature (C-h b).
%% Gnus logo by Luis Fernandes.
\newcommand{\Copyright}{%
\begin{center}
Copyright \copyright\ 1995, 2000, 2002--2017 Free Software Foundation, Inc.\\*
\end{center}
Released under the terms of the GNU General Public License version 3 or later.
For more Emacs documentation, and the \TeX{} source for this card,
see the Emacs distribution, or {\tt http://www.gnu.org/software/emacs}
Please send corrections, additions and suggestions to the
current maintainer's email address. \Guide{} last edited on \date.
}
\newcommand{\Notes}{%
\subsection*{Notes}
{\esamepage
Gnus is complex. Currently it has some 876 interactive (user-callable)
functions. Of these 618 are in the two major modes (Group and
Summary/Article). Many of these functions have more than one binding, some
have 3 or even 4 bindings. The total number of keybindings is 677. So in
order to save 40\% space, every function is listed only once on this
\guide, under the ``more logical'' binding. Alternative bindings are given
in parentheses in the beginning of the description.
Many Gnus commands are affected by the numeric prefix. Normally you enter a
prefix by holding the Meta key and typing a number, but in most Gnus modes
you don't need to use Meta since the digits are not self-inserting. The
prefixed behavior of commands is given in [brackets]. Often the prefix is
used to specify:
\quad [distance] How many objects to move the point over.
\quad [scope] How many objects to operate on (including current one).
\quad [p/p] The ``Process/Prefix Convention'': If a prefix is given then it
determines how many objects to operate on. Else if there are some objects
marked with the process mark \#, these are operated on. Else only the
current object is affected.
\quad [level] A group subscribedness level. Only groups with a lower or
equal level will be affected by the operation. If no prefix is given,
`gnus-group-default-list-level' is used. If
`gnus-group-use-permanent-levels', then a prefix to the `g' and `l'
commands will also set the default level.
\quad [score] An article score. If no prefix is given,
`gnus-summary-default-score' is used. \\*[\baselineskip]
% some keys
Gnus startup-commands:\\*
\begin{keys}{M-x gnus-unplugged}
M-x gnus & start Gnus. \\
M-x gnus-no-server & start Gnus without connecting to server
(i.e. to read mail). \\
\end{keys}
Additionally, there are two commands \texttt{gnus-plugged} and
\texttt{gnus-unplugged}, which are only used if you want to download
news and/or read previously downloaded news offline (see C-c C-i g Gnus
Unplugged RET). Note: \texttt{gnus-no-server} ignores the stuff in
\texttt{gnus-agent-directory}, and thus does not allow you to use Gnus
Unplugged.\\
%
\begin{keys}{C-c C-i}
C-c C-i & Go to the Gnus online {\bf info}.\\
C-c C-b & Send a Gnus {\bf bug} report.\\
\end{keys}
}}
\newcommand{\GroupLevels}{%
The table below assumes that you use the default Gnus levels.
Fill your user-specific levels in the blank cells.\\[1\baselineskip]
\begin{tabular}{|c|l|l|}
\hline
Level & Groups & Status \\
\hline
1 & draft/mail groups & \\
2 & mail groups & \\
3 & & subscribed \\
4 & & \\
5 & default list level & \\
\hline
6 & & unsubscribed \\
7 & & \\
\hline
8 & & zombies \\
\hline
9 & & killed \\
\hline
\end{tabular}}
\newcommand{\MarkCharacters}{%
{\esamepage If a command directly sets a mark, it is shown in parentheses.\\*
\newlength{\markcolwidth}
\settowidth{\markcolwidth}{` '}% widest character
\addtolength{\markcolwidth}{4\tabcolsep}
\addtolength{\markcolwidth}{-\columnwidth}
\newlength{\markdblcolwidth}
\setlength{\markdblcolwidth}{\columnwidth}
\addtolength{\markdblcolwidth}{-2\tabcolsep}
\begin{tabular}{|c|p{-\markcolwidth}|}
\hline
\multicolumn{2}{|p{\markdblcolwidth}|}{{\bf ``Read'' Marks.}
All these marks appear in the first column of the summary line, and so
are mutually exclusive.}\\
\hline
` ' & (M-u, M SPC, M c) Not read.\\
! & (!, M !, M t) Ticked (interesting).\\
? & (?, M ?) Dormant (only followups are interesting).\\
E & (E, M e, M x) {\bf Expirable}. Only has effect in mail groups.\\
G & (C, B DEL) Canceled article (or deleted in mailgroups).\\
\$ & (M-d, M s x, S x). Marked as spam.\\
\hline\hline
\multicolumn{2}{|p{\markdblcolwidth}|}
{The marks below mean that the article
is read (killed, uninteresting), and have more or less the same effect.
Some commands however explicitly differentiate between them (e.g.\ M
M-C-r, adaptive scoring).}\\
\hline
r & (d, M d, M r) Deleted (marked as {\bf read}).\\
C & (M C; M C-c; M H; c, Z c; Z n; Z C) Killed by {\bf catch-up}.\\
F & SOUPed article. See the manual.\\
O & {\bf Old} (read in a previous session).\\
K & (k, M k; C-k, M K) {\bf Killed}.\\
M & Article marked as read by duplicate suppression.\\
Q & Article is part of a sparse thread (see ``Threading''
in manual).\\
R & {\bf Read} (viewed in actuality).\\
X & Killed by a kill file.\\
Y & Killed due to low score.\\
\hline\multicolumn{2}{c}{\vspace{1ex}}\\\hline
\multicolumn{2}{|p{\markdblcolwidth}|}
{{\bf Marks not affecting visibility}}\\
\hline
\# & (\#, M \#, M P p) Processable (affected by next operation).
[2]\\
A & {\bf Answered} (followed-up or replied). [2]\\
F & Forwarded. [2]\\
$\ast$ & Cached. [2]\\
S & Saved. [2]\\
N & Recently arrived. [2]\\
. & Unseen. [2]\\
+ & Over default score. [3]\\
$-$ & Under default score. [3]\\
$=$ & Has children (thread underneath it). Add `\%e' to
`gnus-summary-line-format'. [3]\\
\hline
\end{tabular}
}}
\newcommand{\GroupModeGeneral}{%
\begin{keys}{C-c M-C-x}
RET & (=) Enter this group. [Prefix: how many (read) articles to fetch.
Positive: newest articles, negative: oldest ones; non-numerical:
view all articles, not just unread]\\
M-RET & Enter group quickly.\\
M-SPC & Same as RET but does not expunge and hide dormants.\\
M-C-RET & Enter group without any processing, changes will not be permanent.\\
SPC & Select this group and display the first (unread) article. [Same
prefix as above.]\\
? & Give a very short help message.\\
$<$ & Go to the beginning of the Group buffer.\\
$>$ & Go to the end of the Group buffer.\\
, & Jump to the lowest-level group with unread articles.\\
. & Jump to the first group with unread articles.\\
\^{} & Enter the Server buffer mode.\\
a & Post an {\bf article} to a group
[Prefix: use group under point to find posting-style].\\
b & Find {\bf bogus} groups and delete them.\\
c & Mark all unticked articles in group as read ({\bf catch-up}).
[p/p]\\
g & Check the server for new articles ({\bf get}). [level]\\
M-g & Check the server for new articles in this group ({\bf get}). [p/p]\\
j & {\bf Jump} to a group.\\
m & {\bf Mail} a message to someone
[Prefix: use group under point to find posting-style].\\
n & Go to the {\bf next} group with unread articles. [distance]\\
M-n & Go to the {\bf next} group on the same or lower level.
[distance]\\
p & (DEL) Go to the {\bf previous} group with unread articles.
[distance]\\
M-p & Go to the {\bf previous} group on the same or lower level. [distance]\\
q & {\bf Quit} Gnus.\\
r & Re-read the init file ({\bf reset}).\\
s & {\bf Save} `.newsrc.eld' file (and `.newsrc' if
`gnus-save-newsrc-file').\\
z & Suspend (kill all buffers of) Gnus.\\
B & {\bf Browse} a foreign server.\\
C & Mark all articles in this group as read ({\bf Catch-up}). [p/p]\\
F & {\bf Find} new groups and process them.\\
N & Go to the {\bf next} group. [distance]\\
P & Go to the {\bf previous} group. [distance]\\
Q & {\bf Quit} Gnus without saving any startup (.newsrc) files.\\
R & {\bf Restart} Gnus.\\
Z & Clear the dribble buffer.\\
M-c & Clear data from group (marks and list of read articles). \\
C-c C-s & {\bf Sort} the groups by name, number of unread articles, or level
(depending on `gnus-group-sort-function').\\
C-c C-x & Run all expirable articles in group through the {\bf expiry}
process.\\
C-c M-C-x & Run all articles in all groups through the {\bf expiry} process.\\
C-c M-g & Activate all {\bf groups}.\\
C-c C-i & Gnus online-manual ({\bf info}).\\
C-x C-t & {\bf Transpose} two groups.\\
H f & Fetch this group's {\bf FAQ} (using ange-ftp).\\
H c & Display this group's {\bf charter}. [Prefix: query for group]\\
H C & Display this group's {\bf control message} (using
ange-ftp). [Prefix: query for group]\\
H v & (V) Display the Gnus {\bf version} number.\\
H d & (C-c C-d) Show the {\bf description} of this group
[Prefix: re-read from server].\\
M-d & {\bf Describe} all groups. [Prefix: re-read from server]\\
D g & Regenerate a Sieve script from group parameters.\\
D u & Regenerate Sieve script and {\bf upload} to server.\\
\end{keys}
}
\newcommand{\ListGroups}{%
{\esamepage
\begin{keys}{A M}
A d & (C-c C-M-a) List all groups whose names or {\bf descriptions} match a regexp.\\
A k & (C-c C-l) List all {\bf killed} groups.
[Prefix: look at active-file from server]\\
A l & List all groups on a specific level.
[Prefix: also list groups with no unread articles]\\
A a & (C-c C-a) List all groups whose names match a regexp
({\bf apropos}).\\
A A & List the server's active-file.\\
A M & List groups that {\bf match} a regexp.\\
A m & List groups that {\bf match} a regexp and have unread articles.
[level]\\
A s & (l) List all {\bf subscribed} groups with unread articles.
[level; 5 and lower is the default]\\
A u & (L) List all groups (including read and {\bf unsubscribed}).
[level; 7 and lower is the default]\\
A z & List all {\bf zombie} groups.\\
A c & List all groups with cached articles. [level]\\
A ? & List all groups with dormant articles. [level]\\
\end{keys}
}
\newcommand{\CreateEditGroups}{%
{\esamepage
The select methods are indicated in parentheses.\\*
\begin{keys}{G DEL}
G a & Make the Gnus list {\bf archive} group. (nndir over ange-ftp)\\
G c & {\bf Customize} this group's parameters.\\
G d & Make a {\bf directory} group (every file must be a posting and files
must have numeric names). (nndir)\\
G D & Enter a {\bf directory} as a (temporary) group.
(nneething without recording articles read)\\
G e & (M-e) {\bf Edit} this group's select method.\\
G E & {\bf Edit} this group's info (select method, articles read, etc).\\
G f & Make a group based on a {\bf file}. (nndoc)\\
G h & Make the Gnus {\bf help} (documentation) group. (nndoc)\\
G k & Make a {\bf kiboze} group. (nnkiboze)\\
G m & {\bf Make} a new group.\\
G p & Edit this group's {\bf parameters}.\\
G r & Rename this group (does not work with read-only groups!).\\
G u & Create one of the groups mentioned in gnus-{\bf useful}-groups.\\
G v & Add this group to a {\bf virtual} group. [p/p]\\
G V & Make a new empty {\bf virtual} group. (nnvirtual)\\
G w & Create ephemeral group based on web-search. [Prefix: make solid group
instead]\\
G R & Make an {\bf RSS} group.\\
G DEL & {\bf Delete} group [Prefix: delete all articles as well].\\
G x & Expunge all deleted articles in an nnimap mailbox.\\
G l & Edit ACL (Access Control {\bf List}) for an nnimap mailbox.\\
\end{keys}
You can also create mail-groups and read your mail with Gnus (very useful
if you are subscribed to mailing lists), using one of the methods
nnmbox, nnbabyl, nnml, nnmh, or nnfolder. Read about it in the online info
(C-c C-i g Reading Mail RET).
}}
% TODO:
\newcommand{\SoupCommands}{%
\begin{keys}{G s w}
G s b & gnus-group-brew-soup: not documented.\\
G s p & gnus-soup-pack-packet: not documented.\\
G s r & nnsoup-pack-replies: not documented.\\
G s s & gnus-soup-send-replies: not documented.\\
G s w & gnus-soup-save-areas: not documented.\\
\end{keys}}
\newcommand{\MarkGroups}{%
\begin{keys}{M m}
M m & (\#) Set the process {\bf mark} on this group. [scope]\\
M r & Mark all groups matching regular expression.\\
M u & (M-\#) Remove process mark from this group ({\bf unmark}).
[scope]\\
M U & Remove the process mark from all groups (\textbf{unmark all}).\\
M w & Mark all groups in the current region. [prefix: unmark]\\
M b & Mark all groups in the {\bf buffer}. [prefix: unmark]\\
\end{keys}}
\newcommand{\GroupTopicsGeneral}{%
{\esamepage
Topics are ``categories'' for groups. Press t in the group-buffer to
toggle gnus-topic-mode (C-c C-i g Group Topics RET).\\*
\begin{keys}{C-c C-x}
T n & Prompt for topic {\bf name} and create it.\\
T m & {\bf Move} the current group to some other topic [p/p].\\
T j & {\bf Jump} to a topic.\\
T c & {\bf Copy} the current group to some other topic [p/p].\\
T D & Remove (not delete) the current group [p/p].\\
T M & {\bf Move} all groups matching a regexp to a topic.\\
T C & {\bf Copy} all groups matching a regexp to a topic.\\
T H & Toggle {\bf hiding} of empty topics.\\
T r & {\bf Rename} a topic.\\
T DEL & Delete an empty topic.\\
T \# & Mark all groups in the current topic with the process-mark.\\
T M-\# & Remove the process-mark from all groups in the current topic.\\
T TAB & (TAB) Indent current topic [Prefix: unindent].\\
M-TAB & Unindent the current topic.\\
RET & (SPC) Either unfold topic or enter group [level].\\
T s & {\bf Show} the current topic. [Prefix: show permanently]\\
T h & {\bf Hide} the current topic. [Prefix: hide permanently]\\
C-c C-x & Expire all articles in current group or topic.\\
C-k & {\bf Kill} a group or topic.\\
C-y & {\bf Yank} a group or topic.\\
A T & List active-file using {\bf topics}.\\
G p & Edit topic-{\bf parameters}.\\
T M-n & Go to {\bf next} topic. [distance]\\
T M-p & Go to {\bf previous} topic. [distance]\\
\end{keys}
}
}
\newcommand{\TopicSorting}{%
{\esamepage
\begin{keys}{T S m}
T S a & Sort {\bf alphabetically}.\\
T S u & Sort by number of {\bf unread} articles.\\
T S l & Sort by group {\bf level}.\\
T S v & Sort by group score ({\bf value}).\\
T S r & Sort by group {\bf rank}.\\
T S m & Sort by {\bf method}.\\
T S e & Sort by {\bf server} name.\\
T S s & Sort according to `gnus-group-sort-function'.\\
\end{keys}
With a prefix these commands will sort in reverse order.
}
}
\newcommand{\SubscribeKillYankGroups}{%
{\esamepage
\begin{keys}{S C-k}
S k & (C-k) {\bf Kill} this group.\\
S l & Set the {\bf level} of this group. [p/p]\\
S s & (U) Prompt for a group and toggle its {\bf subscription}.\\
S t & (u) {\bf Toggle} subscription to this group. [p/p]\\
S w & (C-w) Kill all groups in the region.\\
S y & (C-y) {\bf Yank} the last killed group.\\
S z & Kill all {\bf zombie} groups.\\
S C-k & Kill all groups on a certain level.\\
\end{keys}
}
}
\newcommand{\SummaryModeGeneral}{%
{\esamepage
\begin{keys}{M-RET}
SPC & (A SPC, A n) Select an article, scroll it one page, move to the
next one.\\
DEL & (A DEL, A p, b) Scroll this article one page back. [distance]\\
RET & (A RET) Scroll this article one line forward. [distance]\\
M-RET & (A M-RET) Scroll this article one line backward. [distance]\\
= & Expand the Summary window (fullsize).
[Prefix: shrink to display article window]\\
%
\& & Execute a command on all articles whose header matches a regexp.
[Prefix: move backwards]\\
M-\& & Execute a command on all articles having the process mark.\\
%
M-n & (G M-n) Go to {\bf next} summary line of unread article.
[distance]\\
M-p & (G M-p) Go to {\bf previous} summary line of an unread article.
[distance]\\
M-s & {\bf Search} through all subsequent articles for a regexp.\\
M-r & Search through all previous articles for a regexp.\\
%
A P & {\bf Postscript}-print current buffer.\\
%
M-k & Edit this group's {\bf kill} file.\\
M-K & Edit the general {\bf kill} file.\\
%
C-t & Toggle {\bf truncation} of summary lines.\\
Y g & Regenerate the summary-buffer.\\
Y c & Insert all cached articles into the summary-buffer.\\
%
M-C-e & {\bf Edit} the group-parameters.\\
M-C-a & Customize the group-parameters.\\
%
% article handling
%
A $<$ & ($<$, A b) Scroll to the beginning of this article.\\
A $>$ & ($>$, A e) Scroll to the end of this article.\\
A s & (s) Perform an i{\bf search} in the article buffer.\\
%
A D & (C-d) Un{\bf digestify} this article into a separate group.
[Prefix: force digest]\\
M-C-d & Like C-d, but open several documents in nndoc-groups, wrapped
in an nnvirtual group [p/p]\\
%
A g & (g) (Re)fetch this article ({\bf get}). [Prefix: get raw version]\\
A r & (\^{}, A \^{}) Fetch the parent(s) of this article.
[Prefix: if positive fetch \textit{n} ancestors;
negative: fetch only the \textit{n}th ancestor]\\
A t & {\bf Translate} this article.\\
A R & Fetch all articles mentioned in the {\bf References}-header.\\
A T & Fetch full \textbf{thread} in which the current article appears.\\
M-\^{} & Fetch the article with a given Message-ID.\\
S y & {\bf Yank} the current article into an existing message-buffer.
[p/p]\\
A M & Setup group parameters for {\bf mailing} lists from
headers. [Prefix: replace old settings]\\
\end{keys}
}
}
\newcommand{\MIMESummary}{%
{\esamepage
For the commands operating on one MIME part (a subset of gnus-article-*), a
prefix selects which part to operate on. If the point is placed over a
MIME button in the article buffer, use the corresponding bindings for the
article buffer instead.
\begin{keys}{W M w}
K v & (b, W M b) {\bf View} the MIME-part.\\
K o & {\bf Save} the MIME part.\\
K c & {\bf Copy} the MIME part.\\
K e & View the MIME part {\bf externally}.\\
K i & View the MIME part {\bf internally}.\\
K $\mid$ & Pipe the MIME part to an external command.\\
K b & Make all the MIME parts have buttons in front of them.\\
K m & Try to repair {\bf multipart-headers}.\\
K C & View the MIME part using a different {\bf charset}.\\
X m & Save all parts matching a MIME type to a directory. [p/p]\\
M-t & Toggle the buttonized display of the article buffer.\\
W M w & Decode RFC2047-encoded words in the article headers.\\
W M c & Decode encoded article bodies. [Prefix: prompt for charset]\\
W M v & View all MIME parts in the current article.\\
\end{keys}
}
}
\newcommand{\SortSummary}{%
{\esamepage
\begin{keys}{C-c C-s C-a}
C-c C-s C-a & Sort the summary-buffer by {\bf author}.\\
C-c C-s C-t & Sort the summary-buffer by {\bf recipient}.\\
C-c C-s C-d & Sort the summary-buffer by {\bf date}.\\
C-c C-s C-i & Sort the summary-buffer by article score.\\
C-c C-s C-l & Sort the summary-buffer by amount of {\bf lines}.\\
C-c C-s C-c & Sort the summary-buffer by length.\\
C-c C-s C-n & Sort the summary-buffer by article {\bf number}.\\
C-c C-s C-s & Sort the summary-buffer by {\bf subject}.\\
C-c C-s C-r & Sort the summary-buffer {\bf randomly}.\\
C-c C-s C-o & Sort the summary-buffer using the default method.\\
\end{keys}
With a prefix these functions sort in reverse order.
}
}
\newcommand{\MailGroups}{% formerly \Bsubmap
{\esamepage
These commands (except `B c') are only valid in a mail group.\\*
\begin{keys}{B M-C-e}
B DEL & (B backspace, B delete) {\bf Delete} the mail article from disk (!).
[p/p]\\
B B & Crosspost this article to another group.\\
B c & {\bf Copy} this article from any group to a mail group. [p/p]\\
B e & {\bf Expire} all expirable articles in this group. [p/p]\\
B i & {\bf Import} a random file into this group.\\
B I & Create an empty article in this group.\\
B m & {\bf Move} the article from one mail group to another. [p/p]\\
B p & Query whether the article was {\bf posted} as well.\\
B q & {\bf Query} where the article will end up after fancy splitting\\
B r & {\bf Respool} this mail article. [p/p]\\
B t & {\bf Trace} the fancy splitting patterns applied to this article.\\
B w & (e) Edit this article.\\
B M-C-e & {\bf Expunge} (delete from disk) all expirable articles in this group
(!). [p/p]\\
K E & {\bf Encrypt} article body. [p/p]\\
\end{keys}
}
}
\newcommand{\DraftGroup}{% formerly \Dsubmap
{\esamepage
The ``drafts''-group contains messages that have been saved but not sent
and rejected articles. \\*
\begin{keys}{B DEL}
D e & \textbf{edit} message.\\
D s & \textbf{Send} message. [p/p]\\
D S & \textbf{Send} all messages.\\
D t & \textbf{Toggle} sending (mark as unsendable).\\
B DEL & \textbf{Delete} message (like in mailgroup).\\
\end{keys}
}
}
\newcommand{\SelectArticles}{% formerly \Gsubmap
{\esamepage
These commands select the target article. They do not use the prefix.\\*
\begin{keys}{G C-n}
h & Enter article-buffer.\\
G b & (,) Go to the {\bf best} article (the one with highest score).\\
G f & (.) Go to the {\bf first} unread article.\\
G n & (n) Go to the {\bf next} unread article.\\
G p & (p) Go to the {\bf previous} unread article.\\
%
G N & (N) Go to {\bf the} next article.\\
G P & (P) Go to the {\bf previous} article.\\
%
G C-n & (M-C-n) Go to the {\bf next} article with the same subject.\\
G C-p & (M-C-p) Go to the {\bf previous} article with the same subject.\\
%
G l & (l) Go to the previously read article ({\bf last-read-article}).\\
G o & Pop an article off the summary history and go to it.\\
%
G g & Search an article via subject.\\
G j & (j) Search an article via Message-Id or subject.\\
\end{keys}
}
}
\newcommand{\ArticleModeGeneral}{%
{\esamepage
The normal navigation keys work in Article mode. Some additional keys are:\\
\begin{keys}{C-c RET}
C-c \^{} & Get the article with the Message-ID near point.\\
C-c RET & Send reply to address near point.\\
h & Go to the \textbf{header}-line of the article in the
summary-buffer.\\
s & Go to \textbf{summary}-buffer.\\
RET & (middle mouse button) Activate the button at point to follow
an URL or Message-ID.\\
TAB & Move the point to the next button.\\
M-TAB & Move point to previous button.\\
\end{keys}
}
}
\newcommand{\WashArticle}{% formerly \Wsubmap
{\esamepage
\begin{keys}{W W H}
W 6 & Translate a base64 article.\\
W a & Strip certain {\bf headers} from body.\\
W b & Make Message-IDs and URLs in the article mouse-clickable
{\bf buttons}.\\
W c & Translate CRLF-pairs to LF and then remaining CR's to LF's.\\
W d & Treat {\bf dumbquotes}.\\
W e & Treat {\bf emphasized} text.\\
W h & Treat {\bf HTML}.\\
W l & (w) Remove page breaks ({\bf\^{}L}) from the article.\\
W m & {\bf Morse} decode article.\\
W o & Treat {\bf overstrike} or underline (\^{}H\_) in the article.\\
W p & Verify X-{\bf PGP}-Sig header.\\
W q & Treat {\bf quoted}-printable in the article.\\
W r & (C-c C-r) Do a Caesar {\bf rotate} (rot13) on the article.\\
W s & Verify (and decrypt) a {\bf signed} message.\\
W t & (t) {\bf Toggle} display of all headers.\\
W u & {\bf Unsplit} broken URLs.\\
W v & (v) Toggle permanent {\bf verbose} displaying of all headers.\\
W w & Do word {\bf wrap} in the article.\\
W B & Add clickable {\bf buttons} to the article headers.\\
W C & {\bf Capitalize} first word in each sentence.\\
W Q & Fill long lines.\\
W Z & Translate a HZ-encoded article.\\
%
W G u & {\bf Unfold} folded header lines.\\
W G f & {\bf Fold} all header lines.\\
W G n & Unfold {\bf Newsgroups:} and Follow-Up-To:.\\
%
W Y c & Repair broken {\bf citations}.\\
W Y a & Repair broken {\bf attribution} lines.\\
W Y u & {\bf Unwrap} broken citation lines.\\
W Y f & Do a {\bf full} deuglification (W Y c, W Y a, W Y u).\\
\end{keys}
}
}
\newcommand{\BlankAndWhitespace}{%
{\esamepage
\begin{keys}{W E w}
W E l & Strip blank {\bf lines} from the beginning of the article.\\
W E m & Replace blank lines with empty lines and remove {\bf multiple}
blank lines.\\
W E t & Remove {\bf trailing} blank lines.\\
W E a & Strip blank lines at start and end
(W E l, W E m and W E t).\\
W E A & Strip {\bf all} blank lines.\\
W E s & Strip leading blank lines from the article body.\\
W E e & Strip trailing blank lines from the article body.\\
W E w & Remove leading {\bf whitespace} from all headers.\\
\end{keys}
}
}
\newcommand{\Picons}{%
{\esamepage
\begin{keys}{W D D}
W D s & (W g) Display {\bf smilies}.\\
W D x & (W f) Look for and display any X-{\bf Face} headers.\\
W D d & Display any Face headers.\\
W D n & Toggle picons in {\bf Newsgroups} and Followup-To.\\
W D m & Toggle picons in {\bf mail} headers (To and Cc).\\
W D f & Toggle picons in {\bf From}.\\
W D D & Remove all images from the article buffer.\\
\end{keys}
}
}
\newcommand{\TimeAndDate}{%
{\esamepage
\begin{keys}{W T u}
W T u & (W T z) Display the article timestamp in GMT ({\bf UT, ZULU}).\\
W T i & Display the article timestamp in {\bf ISO} 8601.\\
W T l & Display the article timestamp in the {\bf local} timezone.\\
W T s & Display according to `gnus-article-time-format'.\\
W T e & Display the time {\bf elapsed} since it was sent.\\
W T o & Display the {\bf original} timestamp.\\
W T p & Display the date in format that's {\bf
pronounceable} in English.\\
\end{keys}
}
}
\newcommand{\HideHighlightArticle}{%
{\esamepage
\begin{keys}{W W C-c}
W W a & Hide {\bf all} unwanted parts. Calls W W h, W W s, W W C-c.\\
W W h & Hide article {\bf headers}.\\
W W b & Hide {\bf boring} headers.\\
W W s & Hide {\bf signature}.\\
W W l & Hide {\bf list} identifiers in subject-header.\\
W W P & Hide {\bf PEM} (privacy enhanced messages).\\
W W B & Hide banner specified by group parameter.\\
W W c & Hide {\bf citation}.\\
W W C-c & Hide {\bf citation} using a more intelligent algorithm.\\
W W C & Hide cited text in articles that aren't roots.\\
W H a & Highlight {\bf all} parts. Calls W b, W H c, W H h, W H s.\\
W H c & Highlight article {\bf citations}.\\
W H h & Highlight article {\bf headers}.\\
W H s & Highlight article {\bf signature}.\\
\end{keys}
For all hiding-commands: A positive prefix always hides, and a negative
prefix will show what was previously hidden.
}}
\newcommand{\MIMEArticleMode}{%
{\esamepage
\begin{keys}{RET}
RET & (BUTTON-2) Toggle display of the MIME object.\\
v & Prompt for a method and then view object using this method.\\
o & Prompt for a filename and save the MIME object.\\
C-o & Prompt for a filename to save the MIME object to and remove it.\\
d & {\bf Delete} the MIME object.\\
c & {\bf Copy} the MIME object to a new buffer and display this buffer.\\
i & Display the MIME object in this buffer.\\
C & Copy the MIME object to a new buffer and display this buffer using {\bf Charset} \\
E & View internally. \\
e & View {\bf externally}. \\
t & View the MIME object as a different {\bf type}.\\
p & {\bf Print} the MIME object.\\
$\mid$ & Pipe the MIME object to a process.\\
. & Take action on the MIME object.\\
\end{keys}
}
}
%% end of article mode for reading ..........................................
\newcommand{\MarkArticlesGeneral}{% formerly \Msubmap
{\esamepage
\begin{keys}{M M-C-r}
d & (M d, M r) Mark this article as read and move to the next one.
[scope]\\
D & Mark this article as read and move to previous one. [scope]\\
! & (u, M !, M t) Tick this article (mark it as interesting) and move
to the next one. [scope]\\
U & Tick this article and move to the previous one. [scope]\\
M ? & (?) Mark this article as dormant (only followups are
interesting). [scope]\\
M D & Show all {\bf dormant} articles (normally they are hidden unless they
have any followups).\\
M M-D & Hide all {\bf dormant} articles.\\
C-w & Mark all articles between point and mark as read.\\
M-u & (M SPC, M c) Clear all marks from this article and move to the next
one. [scope]\\
M-U & Clear all marks from this article and move to the previous one.
[scope]\\
%
M e & (E, M x) Mark this article as {\bf expirable}. [scope]\\
%
M k & (k) {\bf Kill} all articles with same subject, select
next unread one.\\
M K & (C-k) {\bf Kill} all articles with the same subject as this one.\\
%
M C & {\bf Catch-up} the articles that are not ticked and not dormant.\\
M C-c & {\bf Catch-up} all articles in this group.\\
M H & {\bf Catch-up} (mark read) this group to point (to-{\bf here}).\\
%
M b & Set a {\bf bookmark} in this article.\\
M B & Remove the {\bf bookmark} from this article.\\
%
M M-r & (x) Expunge all {\bf read} articles from this group.\\
M M-C-r & Expunge all articles having a given mark.\\
M S & (C-c M-C-s) {\bf Show} all expunged articles.\\
M M C-h & Displays some more keys doing ticking slightly differently.\\
\end{keys}
The variable `gnus-summary-goto-unread' controls what happens after a mark
has been set (C-x C-i g Setting Marks RET)
}}
\newcommand{\MarkByScore}{%
\begin{keys}{M V m}
M V c & {\bf Clear} all marks from all high-scored articles. [score]\\
M V k & {\bf Kill} all low-scored articles. [score]\\
M V m & Mark all high-scored articles with a given {\bf mark}. [score]\\
M V u & Mark all high-scored articles as interesting (tick them). [score]\\
\end{keys}
}
}
\newcommand{\ProcessMark}{%
{\esamepage
These commands set and remove the process mark (\#). You only need to use
it if the set of articles you want to operate on is non-contiguous. Else
use a numeric prefix.\\*
\begin{keys}{M P R}
M P p & (\#, M \#) Mark this article.\\
M P u & (M-\#, M M-\#) \textbf{unmark} this article.\\
M P b & Mark all articles in {\bf buffer}.\\
M P r & Mark all articles in the {\bf region}.\\
M P g & Unmark all articles in the region.\\
M P R & Mark all articles matching a {\bf regexp}.\\
M P G & Unmark all articles matching a regexp.\\
M P t & Mark all articles in this (sub){\bf thread}.\\
M P T & Unmark all articles in this (sub){\bf thread}.\\
M P s & Mark all articles in the current {\bf series}.\\
M P S & Mark all {\bf series} that already contain a marked article.\\
M P a & Mark {\bf all} articles (in series order).\\
M P U & \textbf{unmark} all articles.\\
M P i & {\bf Invert} the list of process-marked articles.\\
M P k & Push process-mark set onto stack and unmark
all articles.\\
M P y & Pop process-mark set from stack and restore it.\\
M P w & Push process-mark set on the stack.\\
M P v & Mark all articles with score over default score. [Prefix: score]\\
\end{keys}
}
}
\newcommand{\Limiting}{%
{\esamepage
\begin{keys}{/M}
// & (/s) Limit the summary-buffer to articles matching {\bf subject}.\\
/a & Limit the summary-buffer to articles matching {\bf author}.\\
/R & Limit the summary-buffer to articles matching {\bf recipient}.\\
/x & Limit depending on ``extra'' headers.\\
/u & (x) Limit to {\bf unread} articles.
[Prefix: also exclude ticked and dormant articles]\\
/. & Limit to unseen articles.\\
/m & Limit to articles marked with specified {\bf mark}.\\
/t & Ask for a number and exclude articles younger than that many days.
[Prefix: exclude older articles]\\
/n & Limit to current article. [p/p]\\
/w & Pop previous limit off stack and restore it.
[Prefix: pop all limits]\\
/v & Limit to score. [score]\\
/E & (M S) Include all expunged articles in the limit.\\
/D & Include all dormant articles in the limit.\\
/* & Limit to cached articles.\\
Y C & Include all cached articles in the limit.\\
/d & Exclude all dormant articles from the limit.\\
/M & Exclude all marked articles.\\
/T & Include all articles from the current thread in the limit.\\
/c & Exclude all dormant articles that have no children from the limit.\\
/C & Mark all excluded unread articles as read.
[Prefix: also mark ticked and dormant articles]\\
/o & Insert all {\bf old} articles. [Prefix: how many]\\
/N & Insert all {\bf new} articles.\\
/p & Limit to articles {\bf predicated} in the `display' group parameter.\\
/r & Limit to {\bf replied} articles. [Prefix: unreplied]\\
\end{keys}
}
}
\newcommand{\OutputArticles}{% formerly \Osubmap
{\esamepage
\begin{keys}{O m}
O o & (o, C-o) Save this article using the default article saver. [p/p]\\
O b & Save this article's {\bf body} in plain file format [p/p]\\
O f & Save this article in plain {\bf file} format. [p/p]\\
O F & like O f, but overwrite file's contents. [p/p]\\
O h & Save this article in {\bf mh} folder format. [p/p]\\
O m & Save this article in {\bf mail} format. [p/p]\\
O r & Save this article in {\bf rmail} format. [p/p]\\
O v & Save this article in {\bf vm} format. [p/p]\\
O p & ($\mid$) {\bf Pipe} this article to a shell command. [p/p]\\
O P & \textbf{Print} this article using Muttprint. [p/p]\\
\end{keys}
}
}
\newcommand{\PostReplyetc}{% formerly \Ssubmap
{\esamepage
These commands put you in a separate news or mail buffer. See the section
about composing messages for more information.\\*
%After
%editing the article, send it by pressing C-c C-c. If you are in a
%foreign group and want to post the article using the foreign server, give
%a prefix to C-c C-c.\\*
\begin{keys}{S O m}
S p & (a) {\bf Post} an article to this group.\\
S f & (f) Post a {\bf followup} to this article.\\
S F & (F) Post a {\bf followup} and include the original. [p/p]\\
S o p & Forward this article as a {\bf post} to a newsgroup.\\
S M-c & Complain about excessive crossposting to
article's author. [p/p]\\
%
S m & (m) Send a {\bf mail} to some other person.\\
S r & (r) Mail a {\bf reply} to the author of this article.\\
S R & (R) Mail a {\bf reply} and include the original. [p/p]\\
S B r & Like S r but ignore the Reply-To: header.\\
S B R & Like S R but ignore the Reply-To: header.\\
S w & Mail a {\bf wide} reply to this article.\\
S W & Mail a {\bf wide} reply to this article and include
the original.\\
S v & Mail a {\bf very} wide reply to this article.\\
S V & Mail a {\bf very} wide reply to this article and include the original.\\
S o m & (C-c C-f) Forward this article by {\bf mail} to a person.\\
S D b & Resend {\bf bounced} mail.\\
S D r & {\bf Resend} mail to a different person.\\
S D e & {\bf Edit} and resend.\\
%
S n & Post a followup via {\bf news} even if you got the message
through mail.\\
S N & Post a followup via {\bf news} and include the original mail.
[p/p]\\
%
S c & (C) {\bf Cancel} this article (only works if it is
your own). [p/p]\\
S s & {\bf Supersede} this article with a new one (only for own
articles).\\
%
S O m & Digest these series and forward by {\bf mail}. [p/p]\\
S O p & Digest these series and forward as a {\bf post} to a newsgroup.
[p/p]\\
%
S u & {\bf Uuencode} a file and post it as a series.\\
\end{keys}
If you want to cancel or supersede an article you just posted (before it
has appeared on the server), go to the *post-news* buffer, change
`Message-ID' to `Cancel' or `Supersedes' and send again with C-c C-c.
}}
\newcommand{\Threading}{% formerly \Tsubmap
{\esamepage
\begin{keys}{T M-\#}
T \# & Mark this thread with the process mark.\\
T M-\# & Remove process-marks from this thread.\\
%
T t & Re-{\bf thread} the current article's thread.\\
T \^{} & Make the current article child of the marked (or previous) one.\\
% movement
T n & (M-C-f, M-down) Go to the {\bf next} thread. [distance]\\
T p & (M-C-b, M-up) Go to the {\bf previous} thread. [distance]\\
T d & {\bf Descend} this thread. [distance]\\
T u & Ascend this thread ({\bf up}-thread). [distance]\\
T o & Go to the top of this thread.\\
%
T s & {\bf Show} the thread hidden under this article.\\
T h & {\bf Hide} this (sub)thread.\\
%
T i & {\bf Increase} the score of this thread.\\
T l & (M-C-l) {\bf Lower} the score of this thread.\\
%
T k & (M-C-k) {\bf Kill} the current (sub)thread. [Negative prefix:
tick it, positive prefix: unmark it.]\\
%
T H & {\bf Hide} all threads.\\
T S & {\bf Show} all hidden threads.\\
T T & (M-C-t) {\bf Toggle} threading.\\
\end{keys}
}
}
\newcommand{\Scoring}{% formerly \Vsubmap
{\esamepage
Read about Adaptive Scoring in the online info.\\*
\begin{keys}{\bf A p m l}
V a & {\bf Add} a new score entry, specifying all elements.\\
V c & Specify a new score file as {\bf current}.\\
V e & {\bf Edit} the current score alist.\\
V f & Edit a score {\bf file} and make it the current one.\\
V m & {\bf Mark} all articles below a given score as read.\\
V s & Set the {\bf score} of this article.\\
V t & Display all score rules applied to this article ({\bf track}).\\
W w & List {\bf words} used in scoring.\\
V x & {\bf Expunge} all low-scored articles. [score]\\
V C & {\bf Customize} current score file with a user-friendly
interface.\\
V F & {\bf Flush} the cache of score files.\\
V R & {\bf Re-score} the summary buffer.\\
V S & Display the {\bf score} of this article.\\
\bf A p m l& Make a scoring entry based on this article.\\
\end{keys}
The four letters stand for:\\*
\quad \B{A}ction: I)ncrease, L)ower;\\*
\quad \B{p}art: a)uthor (from), s)ubject, x)refs (cross-post), d)ate, l)ines,
message-i)d, t)references (parent), f)ollowup, b)ody, h)ead (all headers);\\*
\quad \B{m}atch type:\\*
\qquad string: s)ubstring, e)xact, r)egexp, f)uzzy,\\*
\qquad date: b)efore, a)t, n)this,\\*
\qquad number: $<$, =, $>$;\\*
\quad \B{l}ifetime: t)emporary, p)ermanent, i)mmediate.
If you type the second letter in uppercase, the remaining two are assumed
to be s)ubstring and t)emporary.
If you type the third letter in uppercase, the last one is assumed to be
t)emporary.
\quad Extra keys for manual editing of a score file:\\*
\begin{keys}{C-c C-c}
C-c C-c & Finish editing the score file.\\
C-c C-d & Insert the current {\bf date} as number of days.\\
\end{keys}
}
}
\newcommand{\ExtractSeries}{% formerly \Xsubmap
{\esamepage
Gnus recognizes if the current article is part of a series (multipart
posting whose parts are identified by numbers in their subjects, e.g.{}
1/10\dots10/10) and processes the series accordingly. You can mark and
process more than one series at a time. If the posting contains any
archives, they are expanded and gathered in a new group.\\*
\begin{keys}{X p}
X b & Un-{\bf binhex} these series. [p/p]\\
X o & Simply {\bf output} these series (no decoding). [p/p]\\
X p & Unpack these {\bf postscript} series. [p/p]\\
X s & Un-{\bf shar} these series. [p/p]\\
X u & {\bf Uudecode} these series. [p/p]\\
\end{keys}
Each one of these commands has four variants:\\*
\begin{keys}{X v \bf Z}
X \bf z & Decode these series. [p/p]\\
X \bf Z & Decode and save these series. [p/p]\\
X v \bf z & Decode and view these series. [p/p]\\
X v \bf Z & Decode, save and view these series. [p/p]\\
\end{keys}
where {\bf z} or {\bf Z} identifies the decoding method (b, o, p, s, u).
An alternative binding for the most-often used of these commands is\\*
\begin{keys}{C-c C-v C-v}
C-c C-v C-v & (X v u) Uudecode and view these series. [p/p]\\
\end{keys}
}}
\newcommand{\ExitSummary}{% formerly \Zsubmap
{\esamepage
\begin{keys}{Z G}
Z Z & (q, Z Q) Exit this group.\\
Z E & (Q) {\bf Exit} without updating the group information.\\
%
Z c & (c) Mark all unticked articles as read ({\bf catch-up}) and exit.\\
Z C & Mark all articles as read ({\bf catch-up}) and exit.\\
%
Z n & Mark all articles as read and go to the {\bf next} group.\\
Z N & Exit and go to {\bf the} next group.\\
Z P & Exit and go to the {\bf previous} group.\\
%
Z G & (M-g) Check for new articles in this group ({\bf get}).\\
Z R & (C-x C-s) Exit this group, and then enter it again ({\bf reenter}).
[Prefix: select all articles, read and unread.]\\
Z s & Update and save the dribble buffer. [Prefix: save .newsrc* as well]\\
\end{keys}
}
}
\newcommand{\MsgCompositionGeneral}{%
Press C-c ? in the composition-buffer to get this information.\\*
{\esamepage
\begin{keys}{C-c C-m}
% sending
C-c C-c & Send message and exit. [Prefix: send via foreign server]\\
C-c C-s & Send message. [Prefix: send via foreign server]\\
C-c C-d & Don't send message (save as \textbf{draft}).\\
C-c C-k & \textbf{Kill} message-buffer.\\
C-c C-m & {\bf Mail} reply to the address near point.
[Prefix: include the original]\\
% modify headers/body
C-c C-o & Sort headers.\\
C-c C-e & \textbf{Elide} region.\\
C-c C-v & Kill everything outside region.\\
C-c C-r & Do a \textbf{Rot-13} on the body.\\
C-c C-w & Insert signature (from `message-signature-file').\\
C-c C-z & Kill everything up to signature.\\
C-c C-y & \textbf{Yank} original message.\\
C-c C-q & Fill the yanked message.\\
C-c M-C-y & \textbf{Yank} a buffer and quote it.\\
M-RET & Insert four newlines and format quoted text. [Prefix:
justify as well]\\
C-c M-r & \textbf{Rename} message buffer. [Prefix: ask for new name]\\
\end{keys}
}
}
\newcommand{\MsgCompositionMovementArticle}{%
The following functions create the header-field if necessary.\\*
{\esamepage
\begin{keys}{C-c C-f C-u}
C-c TAB & Move to \textbf{signature}.\\
C-c C-b & Move to \textbf{body}.\\
C-c C-f C-t & (C-c C-t) Move to \textbf{To:}.\\
C-c C-f C-c & Move to \textbf{Cc:}.\\
C-c C-f C-b & Move to \textbf{Bcc:}.\\
C-c C-f C-w & Move to \textbf{Fcc:}.\\
C-c C-f C-s & Move to \textbf{Subject:}.\\
C-c C-f C-r & Move to \textbf{Reply-To:}.\\
C-c C-f C-f & Move to \textbf{Followup-To:}.\\
C-c C-f C-n & (C-c C-n) Move to \textbf{Newsgroups:}.\\
C-c C-f C-u & Move to \textbf{Summary:}.\\
C-c C-f C-k & Move to \textbf{Keywords:}.\\
C-c C-f C-d & Move to \textbf{Distribution:}.\\
C-c C-f C-m & Move to \textbf{Mail-Followup-To:}.\\
C-c C-f C-o & Move to \textbf{From:}.\\
C-c C-f C-a & Insert a reasonable \textbf{Mail-Followup-To:} for
an unsubscribed list. [Prefix: include addresses in \textbf{Cc:}]\\
C-c C-f TAB & (C-c C-u) Move to \textbf{Importance:}.\\
C-c M-n & Insert \textbf{Disposition-Notification-To:}
(request receipt).\\
\end{keys}
}
}
\newcommand{\MsgCompositionMML}{%
{\esamepage
\begin{keys}{C-c C-m P}
C-c C-m f & (C-c C-a) Attach \textbf{file}.\\
C-c C-m b & Attach contents of \textbf{buffer}.\\
C-c C-m e & Attach \textbf{external} file (ftp..).\\
C-c C-m P & Create MIME-\textbf{preview} (new
buffer). [Prefix: show raw MIME preview]\\
C-c C-m v & \textbf{Validate} article.\\
C-c C-m p & Insert \textbf{part}.\\
C-c C-m m & Insert \textbf{multi}-part.\\
C-c C-m q & \textbf{Quote} region.\\
C-c C-m c s & Encrypt message using \textbf{S/MIME}.\\
C-c C-m c o & Encrypt message using PGP.\\
C-c C-m c p & Encrypt message using \textbf{PGP/MIME}.\\
C-c C-m s s & Sign message using \textbf{S/MIME}.\\
C-c C-m s o & Sign message using PGP.\\
C-c C-m s p & Sign message using \textbf{PGP/MIME}.\\
C-c C-m C-n & Remove security related MML tags from message.\\
% TODO: narrow headers (C-c C-m n) ?
\end{keys}
}
}
%% TODO:
\newcommand{\ServerMode}{%
{\esamepage
To enter this mode, press \^{} while in Group mode.\\*
\begin{keys}{SPC}
SPC & (RET) Browse this server.\\
a & {\bf Add} a new server.\\
c & {\bf Copy} this server.\\
e & {\bf Edit} a server.\\
k & {\bf Kill} this server. [scope]\\
l & {\bf List} all servers.\\
q & Return to the group buffer ({\bf quit}).\\
s & Request that the server scan its sources for new articles.\\
g & Request that the server regenerate its data.\\
y & {\bf Yank} the previously killed server.\\
O & Try to {\bf open} a connection to this server.\\
C & {\bf Close} connection to this server.\\
D & Mark this server as unreachable ({\bf deny}).\\
M-o & {\bf Open} the connection to all servers.\\
M-c & {\bf Close} the connection to all servers.\\
R & Make all denied servers into closed servers.\\
L & Set server status to offline.\\
\end{keys}
}
}
\newcommand{\BrowseServer}{%
{\esamepage
To enter this mode, press `B' while in Group mode.\\*
\begin{keys}{RET}
RET & Enter the current group.\\
SPC & Enter the current group and display the first article.\\
? & Give a very short help message.\\
n & Go to the {\bf next} group. [distance]\\
p & Go to the {\bf previous} group. [distance]\\
q & (l) {\bf Quit} browse mode.\\
u & Subscribe to the current group. [scope]\\
\end{keys}
}
}
\newcommand{\GroupUnplugged}{%
{\esamepage
\begin{keys}{J S}
J j & Toggle plugged-state.\\
J s & Fetch articles from all groups for offline-reading.\\
J u & Fetch all eligible articles from this group.\\
J S & \textbf{Send} all sendable messages in the drafts group.\\
%
J c & Enter \textbf{category} buffer.\\
J a & \textbf{Add} this group to an Agent category [p/p].\\
J r & \textbf{Remove} this group from its Agent category [p/p].\\
J Y & Synchronize flags changed while unplugged with remote server.\\
\end{keys}
}
}
\newcommand{\SummaryUnplugged}{%
{\esamepage
\begin{keys}{J M-\#}
J \# & \textbf{Mark} the article for downloading.\\
J M-\# & \textbf{Unmark} the article for downloading.\\
@ & \textbf{Toggle} whether to download the article.\\
J c & Mark all undownloaded articles as read (\textbf{catch-up}).\\
J u & Download all downloadable articles from group.\\
\end{keys}
}
}
\newcommand{\ServerUnplugged}{%
{\esamepage
\begin{keys}{J a}
J a & \textbf{Add} the current server to the list of servers covered
by the agent.\\
J r & \textbf{Remove} the current server from the list of servers covered
by the agent.\\
\end{keys}
}
}
% end {gnusref} % % % % % % % % % % % % % % % % % % % % % % % % % %
% o some things might not be updated: scoring and server modes, maybe more
% o Gnus Unplugged category-buffer commands need to be written
\begin{document}
\ifthenelse{\isundefined{\booklettrue}}{ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\raggedbottom\raggedright
\twocolumn
% use \tiny to shrink it to 4 pages (needs a high-resolution printer though)
% \tiny
\scriptsize
\pagestyle{plain}
\Title
\par
\Logo{refcard}
}{
\setcounter{page}{0}
\thispagestyle{empty}
\vspace*{\fill}
\Title
\vspace{0.4in}
\Logo{booklet}
\vspace*{\fill}
\pagebreak
}%ifbooklet% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO: how does this work ?
%\tableofcontents
\Notes
%
\section*{Group-Mode}
\GroupModeGeneral
\subsection*{Group Subscribedness-Levels}
\GroupLevels
\subsection*{List Groups}
\ListGroups
\subsection*{Create/Edit Foreign Groups}
\CreateEditGroups
\ifthenelse{\isundefined{\booklettrue}}{}{\pagebreak}
\subsection*{Unsubscribe, Kill and Yank Groups}
\SubscribeKillYankGroups
\subsection*{Mark Groups}
\MarkGroups
\subsection*{Group-Unplugged}
\GroupUnplugged
% topics in group-mode
\subsection*{Group Topics}
\GroupTopicsGeneral
\subsubsection*{Topic Sorting}
\TopicSorting
% \ifthenelse{\isundefined{\booklettrue}}{}{\pagebreak}
% summary-mode
\section*{Summary Mode}
\SummaryModeGeneral
\subsection*{Select Articles}
\SelectArticles
%
\ifthenelse{\isundefined{\booklettrue}}{}{\pagebreak}
\subsection*{Threading}
\Threading
%
\subsection*{Limiting}
\Limiting
\subsection*{Sort the Summary-Buffer}
\SortSummary
\subsection*{Score (Value) Commands}
\Scoring
\ifthenelse{\isundefined{\booklettrue}}{% ifcard %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection*{Output Articles}
\OutputArticles
\subsection*{Extract Series (Uudecode etc)}
\ExtractSeries
}{}%ifcard% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection*{MIME operations from the Summary-Buffer}
\MIMESummary
\ifthenelse{\isundefined{\booklettrue}}{}{% ifbooklet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection*{Extract Series (Uudecode etc)}
\ExtractSeries
\subsection*{Output Articles}
\OutputArticles
}%ifbooklet% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\subsection*{Post, Followup, Reply, Forward, Cancel}
\PostReplyetc
\ifthenelse{\isundefined{\booklettrue}}{\newpage}{}% newpage ifcard
\subsection*{Message Composition}
\MsgCompositionGeneral
\subsubsection*{Jumping in message-buffer}
\MsgCompositionMovementArticle
\subsubsection*{Attachments/MML}
\MsgCompositionMML
% marking articles
\subsection*{Mark Articles}
\MarkArticlesGeneral
\subsubsection*{Mark Based on Score}
\MarkByScore
\subsubsection*{The Process Mark}
\ProcessMark
\subsubsection*{Mark Indication-Characters}
\MarkCharacters
%
%\ifthenelse{\isundefined{\booklettrue}}{\newpage}{}%
\newpage
\subsection*{Summary-Unplugged}
\SummaryUnplugged
\subsection*{Mail-Group Commands}
\MailGroups
\subsection*{Draft-Group Commands}
\DraftGroup
% exiting
\subsection*{Exit the Summary-Buffer}
\ExitSummary
%
%
\section*{Article Mode (reading)}
\ArticleModeGeneral
\subsection*{Wash the Article-Buffer}
\WashArticle
\subsubsection*{Blank Lines and Whitespace}
\BlankAndWhitespace
\subsubsection*{Picons, X-faces, Smileys}
\Picons
\subsubsection*{Time and Date}
\TimeAndDate
\ifthenelse{\isundefined{\booklettrue}}{}{\pagebreak}
\subsection*{Hide/Highlight Parts of the Article}
\HideHighlightArticle
\subsection*{MIME operations from the Article-Buffer (reading)}
\MIMEArticleMode
%
%
\ifthenelse{\isundefined{\booklettrue}}{\pagebreak}{}%
\section*{Server Mode}
\ServerMode
\subsection*{Unplugged-Server}
\ServerUnplugged
%
%
\section*{Browse Server Mode}
\BrowseServer
%\pagebreak
\vspace*{\fill}
\Copyright
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
| davidswelt/aquamacs-emacs | etc/refcards/gnus-refcard.tex | TeX | gpl-3.0 | 61,356 |
#page-admin-local-getkey-index .area {
fill: steelblue;
clip-path: url(#clip);
}
#page-admin-local-getkey-index .axis path, .axis line {
fill: none;
stroke: rgba(0, 0, 0, 0.2);
shape-rendering: crispEdges;
}
#page-admin-local-getkey-index .brush .extent {
stroke: #fff;
fill-opacity: .125;
shape-rendering: crispEdges;
}
#page-admin-local-getkey-index .grid .tick {
stroke: rgba(0, 0, 0, 0.2);
stroke-dasharray: 1, 1;
stroke-width: 1px;
z-index: -1;
}
#page-admin-local-getkey-index .dot {
fill: white;
stroke: steelblue;
/*opacity:0.01;*/
opacity:0;
stroke-width: 2px;
}
#page-admin-local-getkey-index .dot:hover {
opacity:1;
}
#page-admin-local-getkey-index div.tooltip {
position: absolute;
text-align: left;
padding: 12px;
font: 12px sans-serif;
background: #f7f7f7;
border-radius: 2px;
pointer-events: none;
border: 1px solid rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
#page-admin-local-getkey-index #usergraph{
margin-top:50px;
}
#page-admin-local-getkey-index .aGraph{
margin-left: 50px;
margin-top:20px;
}
#page-admin-local-getkey-index .text{
font: 10px sans-serif;
text-stroke: red;
}
#page-admin-local-getkey-index .msggraphheading{
font: 20px sans-serif;
}
#page-admin-local-getkey-index div#option .btnhighlight{
color: red;
} | vidyamantra/moodle-local_getkey | styles.css | CSS | gpl-3.0 | 1,401 |
#! /usr/bin/env python
"""
This script checks HighGUI's cvGetCaptureProperty functionality for correct return
of the frame width and height of a DivX-compressed .avi file.
"""
# name if this test and it's requirements
TESTNAME = "size_divx"
REQUIRED = []
# needed for sys.exit(int), .works file handling and check routine
import sys
import works
import size_test
# check requirements and delete old flag file, if it exists
if not works.check_files(REQUIRED,TESTNAME):
sys.exit(77)
# name of file we check here
FILENAME='divx.avi'
# run check routine
result=size_test.size_ok(FILENAME)
# create flag file for following tests
works.set_file(TESTNAME)
# return result of test routine
sys.exit(result)
| fursund/EmguCV-Unity | opencv/tests/swig_python/highgui/size_divx.py | Python | gpl-3.0 | 708 |
from .buildapi_tasks import *
from .pulse_tasks import *
from .cleanup_tasks import *
from .classification_mirroring_tasks import *
from .tasks import *
| wlach/treeherder | treeherder/etl/tasks/__init__.py | Python | mpl-2.0 | 153 |
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.RefMan.domain.base.impl;
import ims.domain.impl.DomainImpl;
public abstract class BaseERODHistoryImpl extends DomainImpl implements ims.RefMan.domain.ERODHistory, ims.domain.impl.Transactional
{
private static final long serialVersionUID = 1L;
@SuppressWarnings("unused")
public void validatelistERODHistory(ims.RefMan.vo.CatsReferralRefVo catsReferral)
{
}
}
| open-health-hub/openMAXIMS | openmaxims_workspace/RefMan/src/ims/RefMan/domain/base/impl/BaseERODHistoryImpl.java | Java | agpl-3.0 | 604 |
<?php
namespace Sabre\CalDAV;
use Sabre\DAV;
use Sabre\DAVACL;
/**
* The UserCalenders class contains all calendars associated to one user
*
* @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class UserCalendars implements DAV\IExtendedCollection, DAVACL\IACL {
/**
* CalDAV backend
*
* @var Sabre\CalDAV\Backend\BackendInterface
*/
protected $caldavBackend;
/**
* Principal information
*
* @var array
*/
protected $principalInfo;
/**
* Constructor
*
* @param Backend\BackendInterface $caldavBackend
* @param mixed $userUri
*/
public function __construct(Backend\BackendInterface $caldavBackend, $principalInfo) {
$this->caldavBackend = $caldavBackend;
$this->principalInfo = $principalInfo;
}
/**
* Returns the name of this object
*
* @return string
*/
public function getName() {
list(,$name) = DAV\URLUtil::splitPath($this->principalInfo['uri']);
return $name;
}
/**
* Updates the name of this object
*
* @param string $name
* @return void
*/
public function setName($name) {
throw new DAV\Exception\Forbidden();
}
/**
* Deletes this object
*
* @return void
*/
public function delete() {
throw new DAV\Exception\Forbidden();
}
/**
* Returns the last modification date
*
* @return int
*/
public function getLastModified() {
return null;
}
/**
* Creates a new file under this object.
*
* This is currently not allowed
*
* @param string $filename
* @param resource $data
* @return void
*/
public function createFile($filename, $data=null) {
throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported');
}
/**
* Creates a new directory under this object.
*
* This is currently not allowed.
*
* @param string $filename
* @return void
*/
public function createDirectory($filename) {
throw new DAV\Exception\MethodNotAllowed('Creating new collections in this collection is not supported');
}
/**
* Returns a single calendar, by name
*
* @param string $name
* @todo needs optimizing
* @return Calendar
*/
public function getChild($name) {
foreach($this->getChildren() as $child) {
if ($name==$child->getName())
return $child;
}
throw new DAV\Exception\NotFound('Calendar with name \'' . $name . '\' could not be found');
}
/**
* Checks if a calendar exists.
*
* @param string $name
* @todo needs optimizing
* @return bool
*/
public function childExists($name) {
foreach($this->getChildren() as $child) {
if ($name==$child->getName())
return true;
}
return false;
}
/**
* Returns a list of calendars
*
* @return array
*/
public function getChildren() {
$calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
$objs = array();
foreach($calendars as $calendar) {
if ($this->caldavBackend instanceof Backend\SharingSupport) {
if (isset($calendar['{http://calendarserver.org/ns/}shared-url'])) {
$objs[] = new SharedCalendar($this->caldavBackend, $calendar);
} else {
$objs[] = new ShareableCalendar($this->caldavBackend, $calendar);
}
} else {
$objs[] = new Calendar($this->caldavBackend, $calendar);
}
}
$objs[] = new Schedule\Outbox($this->principalInfo['uri']);
// We're adding a notifications node, if it's supported by the backend.
if ($this->caldavBackend instanceof Backend\NotificationSupport) {
$objs[] = new Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
}
return $objs;
}
/**
* Creates a new calendar
*
* @param string $name
* @param array $resourceType
* @param array $properties
* @return void
*/
public function createExtendedCollection($name, array $resourceType, array $properties) {
$isCalendar = false;
foreach($resourceType as $rt) {
switch ($rt) {
case '{DAV:}collection' :
case '{http://calendarserver.org/ns/}shared-owner' :
// ignore
break;
case '{urn:ietf:params:xml:ns:caldav}calendar' :
$isCalendar = true;
break;
default :
throw new DAV\Exception\InvalidResourceType('Unknown resourceType: ' . $rt);
}
}
if (!$isCalendar) {
throw new DAV\Exception\InvalidResourceType('You can only create calendars in this collection');
}
$this->caldavBackend->createCalendar($this->principalInfo['uri'], $name, $properties);
}
/**
* Returns the owner principal
*
* This must be a url to a principal, or null if there's no owner
*
* @return string|null
*/
public function getOwner() {
return $this->principalInfo['uri'];
}
/**
* Returns a group principal
*
* This must be a url to a principal, or null if there's no owner
*
* @return string|null
*/
public function getGroup() {
return null;
}
/**
* Returns a list of ACE's for this node.
*
* Each ACE has the following properties:
* * 'privilege', a string such as {DAV:}read or {DAV:}write. These are
* currently the only supported privileges
* * 'principal', a url to the principal who owns the node
* * 'protected' (optional), indicating that this ACE is not allowed to
* be updated.
*
* @return array
*/
public function getACL() {
return array(
array(
'privilege' => '{DAV:}read',
'principal' => $this->principalInfo['uri'],
'protected' => true,
),
array(
'privilege' => '{DAV:}write',
'principal' => $this->principalInfo['uri'],
'protected' => true,
),
array(
'privilege' => '{DAV:}read',
'principal' => $this->principalInfo['uri'] . '/calendar-proxy-write',
'protected' => true,
),
array(
'privilege' => '{DAV:}write',
'principal' => $this->principalInfo['uri'] . '/calendar-proxy-write',
'protected' => true,
),
array(
'privilege' => '{DAV:}read',
'principal' => $this->principalInfo['uri'] . '/calendar-proxy-read',
'protected' => true,
),
);
}
/**
* Updates the ACL
*
* This method will receive a list of new ACE's.
*
* @param array $acl
* @return void
*/
public function setACL(array $acl) {
throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported');
}
/**
* Returns the list of supported privileges for this node.
*
* The returned data structure is a list of nested privileges.
* See Sabre\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple
* standard structure.
*
* If null is returned from this method, the default privilege set is used,
* which is fine for most common usecases.
*
* @return array|null
*/
public function getSupportedPrivilegeSet() {
return null;
}
/**
* This method is called when a user replied to a request to share.
*
* This method should return the url of the newly created calendar if the
* share was accepted.
*
* @param string href The sharee who is replying (often a mailto: address)
* @param int status One of the SharingPlugin::STATUS_* constants
* @param string $calendarUri The url to the calendar thats being shared
* @param string $inReplyTo The unique id this message is a response to
* @param string $summary A description of the reply
* @return null|string
*/
public function shareReply($href, $status, $calendarUri, $inReplyTo, $summary = null) {
if (!$this->caldavBackend instanceof Backend\SharingSupport) {
throw new DAV\Exception\NotImplemented('Sharing support is not implemented by this backend.');
}
return $this->caldavBackend->shareReply($href, $status, $calendarUri, $inReplyTo, $summary);
}
}
| tbrown0139/webmail-lite | libraries/Sabre/CalDAV/UserCalendars.php | PHP | agpl-3.0 | 9,395 |
###############################################################################
#
# EGSnrc egs++ makefile to build cd geometry
# Copyright (C) 2015 National Research Council Canada
#
# This file is part of EGSnrc.
#
# EGSnrc 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 of the License, or (at your
# option) any later version.
#
# EGSnrc 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 EGSnrc. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
#
# Author: Iwan Kawrakow, 2005
#
# Contributors:
#
###############################################################################
include $(EGS_CONFIG)
include $(SPEC_DIR)egspp.spec
include $(SPEC_DIR)egspp_$(my_machine).conf
DEFS = $(DEF1) -DBUILD_CDGEOMETRY_DLL
library = egs_cdgeometry
lib_files = egs_cd_geometry
include $(SPEC_DIR)egspp_libs.spec
$(make_depend)
| nrc-cnrc/EGSnrc | HEN_HOUSE/egs++/geometry/egs_cd_geometry/Makefile | Makefile | agpl-3.0 | 1,334 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
Copyright 1999-2003 Carnegie Mellon University.
Portions Copyright 2002-2003 Sun Microsystems, Inc.
Portions Copyright 2002-2003 Mitsubishi Electric Research Laboratories.
All Rights Reserved. Use is subject to license terms.
See the file "license.terms" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL
WARRANTIES.
-->
</head>
<body bgcolor="white">
Provides a set of general purpose utility classes for Sphinx. This is
a grab bag of classes that generally useful but not specific to any
one sphinx subsystem.
<p>
</body>
</html>
| deepstupid/sphinx5 | sphinx4-core/src/main/javadoc/edu/cmu/sphinx/util/package.html | HTML | agpl-3.0 | 706 |
require 'simplecov'
require 'simplecov-rcov'
SimpleCov.use_merging
SimpleCov.merge_timeout(10000)
SimpleCov.command_name('canvas-quiz-statistics-gem')
SimpleCov.start('test_frameworks') do
SimpleCov.coverage_dir(File.join(File.dirname(__FILE__), '..', 'coverage'))
end
require 'canvas_quiz_statistics'
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.color = true
config.order = 'random'
File.join(File.dirname(__FILE__), 'canvas_quiz_statistics').tap do |cwd|
# spec support in support/
Dir.glob(File.join([
cwd, 'support', '**', '*.rb'
])).each { |file| require file }
# specs for shared metrics in analyzers/shared_metrics
Dir.glob(File.join([
cwd, 'analyzers', 'shared_metrics', '**', '*.rb'
])).each { |file| require file }
end
end
| usmschuck/canvas | gems/canvas_quiz_statistics/spec/spec_helper.rb | Ruby | agpl-3.0 | 914 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
from frappe.model.naming import make_autoname
from frappe import throw, _
import frappe.permissions
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from erpnext.utilities.transaction_base import delete_events
class EmployeeUserDisabledError(frappe.ValidationError): pass
class Employee(Document):
def onload(self):
self.get("__onload").salary_structure_exists = frappe.db.get_value("Salary Structure",
{"employee": self.name, "is_active": "Yes", "docstatus": ["!=", 2]})
def autoname(self):
naming_method = frappe.db.get_value("HR Settings", None, "emp_created_by")
if not naming_method:
throw(_("Please setup Employee Naming System in Human Resource > HR Settings"))
else:
if naming_method=='Naming Series':
self.name = make_autoname(self.naming_series + '.####')
elif naming_method=='Employee Number':
self.name = self.employee_number
self.employee = self.name
def validate(self):
from erpnext.controllers.status_updater import validate_status
validate_status(self.status, ["Active", "Left"])
self.employee = self.name
self.validate_date()
self.validate_email()
self.validate_status()
self.validate_employee_leave_approver()
self.validate_reports_to()
if self.user_id:
self.validate_for_enabled_user_id()
self.validate_duplicate_user_id()
else:
existing_user_id = frappe.db.get_value("Employee", self.name, "user_id")
if existing_user_id:
frappe.permissions.remove_user_permission("Employee", self.name, existing_user_id)
def on_update(self):
if self.user_id:
self.update_user()
self.update_user_permissions()
def update_user_permissions(self):
frappe.permissions.add_user_permission("Employee", self.name, self.user_id)
frappe.permissions.set_user_permission_if_allowed("Company", self.company, self.user_id)
def update_user(self):
# add employee role if missing
user = frappe.get_doc("User", self.user_id)
user.flags.ignore_permissions = True
if "Employee" not in user.get("user_roles"):
user.add_roles("Employee")
# copy details like Fullname, DOB and Image to User
if self.employee_name and not (user.first_name and user.last_name):
employee_name = self.employee_name.split(" ")
if len(employee_name) >= 3:
user.last_name = " ".join(employee_name[2:])
user.middle_name = employee_name[1]
elif len(employee_name) == 2:
user.last_name = employee_name[1]
user.first_name = employee_name[0]
if self.date_of_birth:
user.birth_date = self.date_of_birth
if self.gender:
user.gender = self.gender
if self.image:
if not user.user_image:
user.user_image = self.image
try:
frappe.get_doc({
"doctype": "File",
"file_name": self.image,
"attached_to_doctype": "User",
"attached_to_name": self.user_id
}).insert()
except frappe.DuplicateEntryError:
# already exists
pass
user.save()
def validate_date(self):
if self.date_of_birth and getdate(self.date_of_birth) > getdate(today()):
throw(_("Date of Birth cannot be greater than today."))
if self.date_of_birth and self.date_of_joining and getdate(self.date_of_birth) >= getdate(self.date_of_joining):
throw(_("Date of Joining must be greater than Date of Birth"))
elif self.date_of_retirement and self.date_of_joining and (getdate(self.date_of_retirement) <= getdate(self.date_of_joining)):
throw(_("Date Of Retirement must be greater than Date of Joining"))
elif self.relieving_date and self.date_of_joining and (getdate(self.relieving_date) <= getdate(self.date_of_joining)):
throw(_("Relieving Date must be greater than Date of Joining"))
elif self.contract_end_date and self.date_of_joining and (getdate(self.contract_end_date)<=getdate(self.date_of_joining)):
throw(_("Contract End Date must be greater than Date of Joining"))
def validate_email(self):
if self.company_email:
validate_email_add(self.company_email, True)
if self.personal_email:
validate_email_add(self.personal_email, True)
def validate_status(self):
if self.status == 'Left' and not self.relieving_date:
throw(_("Please enter relieving date."))
def validate_for_enabled_user_id(self):
if not self.status == 'Active':
return
enabled = frappe.db.sql("""select name from `tabUser` where
name=%s and enabled=1""", self.user_id)
if not enabled:
throw(_("User {0} is disabled").format(self.user_id), EmployeeUserDisabledError)
def validate_duplicate_user_id(self):
employee = frappe.db.sql_list("""select name from `tabEmployee` where
user_id=%s and status='Active' and name!=%s""", (self.user_id, self.name))
if employee:
throw(_("User {0} is already assigned to Employee {1}").format(self.user_id, employee[0]), frappe.DuplicateEntryError)
def validate_employee_leave_approver(self):
for l in self.get("leave_approvers")[:]:
if "Leave Approver" not in frappe.get_roles(l.leave_approver):
frappe.get_doc("User", l.leave_approver).add_roles("Leave Approver")
def validate_reports_to(self):
if self.reports_to == self.name:
throw(_("Employee cannot report to himself."))
def on_trash(self):
delete_events(self.doctype, self.name)
@frappe.whitelist()
def get_retirement_date(date_of_birth=None):
import datetime
ret = {}
if date_of_birth:
try:
dt = getdate(date_of_birth) + datetime.timedelta(21915)
ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')}
except ValueError:
# invalid date
ret = {}
return ret
@frappe.whitelist()
def make_salary_structure(source_name, target=None):
target = get_mapped_doc("Employee", source_name, {
"Employee": {
"doctype": "Salary Structure",
"field_map": {
"name": "employee"
}
}
})
target.make_earn_ded_table()
return target
def validate_employee_role(doc, method):
# called via User hook
if "Employee" in [d.role for d in doc.get("user_roles")]:
if not frappe.db.get_value("Employee", {"user_id": doc.name}):
frappe.msgprint(_("Please set User ID field in an Employee record to set Employee Role"))
doc.get("user_roles").remove(doc.get("user_roles", {"role": "Employee"})[0])
def update_user_permissions(doc, method):
# called via User hook
if "Employee" in [d.role for d in doc.get("user_roles")]:
employee = frappe.get_doc("Employee", {"user_id": doc.name})
employee.update_user_permissions()
def send_birthday_reminders():
"""Send Employee birthday reminders if no 'Stop Birthday Reminders' is not set."""
if int(frappe.db.get_single_value("HR Settings", "stop_birthday_reminders") or 0):
return
from frappe.utils.user import get_enabled_system_users
users = None
birthdays = get_employees_who_are_born_today()
if birthdays:
if not users:
users = [u.email_id or u.name for u in get_enabled_system_users()]
for e in birthdays:
frappe.sendmail(recipients=filter(lambda u: u not in (e.company_email, e.personal_email, e.user_id), users),
subject=_("Birthday Reminder for {0}").format(e.employee_name),
message=_("""Today is {0}'s birthday!""").format(e.employee_name),
reply_to=e.company_email or e.personal_email or e.user_id,
bulk=True)
def get_employees_who_are_born_today():
"""Get Employee properties whose birthday is today."""
return frappe.db.sql("""select name, personal_email, company_email, user_id, employee_name
from tabEmployee where day(date_of_birth) = day(%(date)s)
and month(date_of_birth) = month(%(date)s)
and status = 'Active'""", {"date": today()}, as_dict=True)
| indictranstech/biggift-erpnext | erpnext/hr/doctype/employee/employee.py | Python | agpl-3.0 | 7,738 |
/**
* \file
*
* \brief Autogenerated API include file for the Atmel Software Framework (ASF)
*
* Copyright (c) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* 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. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
#ifndef ASF_H
#define ASF_H
/*
* This file includes all API header files for the selected drivers from ASF.
* Note: There might be duplicate includes required by more than one driver.
*
* The file is automatically generated and will be re-written when
* running the ASF driver selector tool. Any changes will be discarded.
*/
// From module: Common SAM0 compiler driver
#include <compiler.h>
#include <status_codes.h>
// From module: EVSYS - Event System Common
#include <events.h>
// From module: EVSYS - Event System with interupt hooks support
#include <events_hooks.h>
// From module: Generic board support
#include <board.h>
// From module: Interrupt management - SAM implementation
#include <interrupt.h>
// From module: PORT - GPIO Pin Control
#include <port.h>
// From module: Part identification macros
#include <parts.h>
// From module: SYSTEM - Clock Management for SAMD21/R21/DAx
#include <clock.h>
#include <gclk.h>
// From module: SYSTEM - Core System Driver
#include <system.h>
// From module: SYSTEM - I/O Pin Multiplexer
#include <pinmux.h>
// From module: SYSTEM - Interrupt Driver
#include <system_interrupt.h>
// From module: SYSTEM - Power Management for SAM D20/D21/R21/D09/D10/D11/DA0/DA1
#include <power.h>
// From module: SYSTEM - Reset Management for SAM D20/D21/R21/D09/D10/D11/DA0/DA1
#include <reset.h>
#endif // ASF_H
| evarty/Microcontroller | ARM/SAMD20XPlainedPRO/ASFFiles/drivers/events/quick_start/samr21_xplained_pro/iar/asf.h | C | agpl-3.0 | 3,204 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program 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 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 Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.18 build 40623.1500)
// Copyright (C) 1995-2004 IMS MAXIMS plc. All rights reserved.
package ims.nursing.forms.clinicalnotes;
import ims.clinical.vo.lookups.ClinicalNoteClassification;
import ims.clinical.vo.lookups.ClinicalNoteClassificationCollection;
import ims.configuration.gen.ConfigFlag;
import ims.core.vo.AuthoringInformationVo;
import ims.core.vo.ClinicalNoteStatusVo;
import ims.core.vo.MemberOfStaffShortVo;
import ims.core.vo.lookups.ClinicalNoteType;
import ims.core.vo.lookups.HcpDisType;
import ims.domain.exceptions.StaleObjectException;
import ims.domain.lookups.LookupService;
import ims.framework.enumerations.DialogResult;
import ims.framework.enumerations.FormMode;
import ims.framework.exceptions.PresentationLogicException;
import ims.framework.utils.DateTime;
import ims.nursing.forms.clinicalnotes.GenForm.gridCarePlanRow;
import ims.nursing.vo.CarePlan;
import ims.nursing.vo.CarePlanTitle;
import ims.nursing.vo.CarePlanTitleCollection;
import ims.nursing.vo.NursingClinicalNotesVo;
import ims.vo.LookupInstVo;
import ims.vo.LookupMappingVo;
import ims.vo.LookupMappingVoCollection;
public class Logic extends BaseLogic
{
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
// List Careplans for the root clinical contact
form.getLocalContext().setCarePlans(domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext()));
loadCarePlans();
form.btnUpdateActions().setVisible(ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().toString().equals("CCO"));
form.btnUpdateActions().setEnabled(areCarePlansSelected());
form.labelFlag().setVisible( ! ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().toString().equals("CCO"));//wdev-13781
form.chkHospitalReport().setVisible( ! ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().toString().equals("CCO"));//wdev-13781
if (form.getGlobalContext().COE.getClinicalNotesVo() != null)
{
NursingClinicalNotesVo notes = domain.getClinicalNotes(form.getGlobalContext().COE.getClinicalNotesVo());
if (notes != null)
{
if (notes.getIsCorrectedIsNotNull())
form.checkBoxCorrection().setValue(notes.getIsCorrected());
form.chkHospitalReport().setValue(notes.getInHospitalReport().booleanValue());
if (notes.getAuthoringInfoIsNotNull())
{
if (notes.getAuthoringInfo().getAuthoringDateTimeIsNotNull())
{
form.dateNote().setValue(notes.getAuthoringInfo().getAuthoringDateTime().getDate());
form.timeNote().setValue(notes.getAuthoringInfo().getAuthoringDateTime().getTime());
}
if (notes.getAuthoringInfo().getAuthoringHcpIsNotNull())
{
form.textBoxHCP().setValue(notes.getAuthoringInfo().getAuthoringHcp().toString());
form.getLocalContext().setCurrentHcp(notes.getAuthoringInfo().getAuthoringHcp());
}
}
form.textBoxClinicalNotes().setValue(notes.getClinicalNote());
ClinicalNoteStatusVo voClinicalNoteStatus = notes.getCurrentStatus();
if(voClinicalNoteStatus!=null && voClinicalNoteStatus.getCorrectionReason() != null && voClinicalNoteStatus.getCorrectionConfirmed()!= null)
{
form.textBoxCorrectionReason().setValue(voClinicalNoteStatus.getCorrectionReason());
form.checkBoxCorrection().setValue(voClinicalNoteStatus.getCorrectionConfirmed());
}
form.getLocalContext().setClinicalNote(notes);
populateCarePlans();
setButtonsViewMode();
}
else
setButtonsViewMode(); //WDEV-15066
}
else{
//WDEV-11531
newClinicalNote();
setButtonsNewMode();
}
}
protected void onBNewClick() throws ims.framework.exceptions.PresentationLogicException
{
newClinicalNote();
loadCarePlans();
setButtonsNewMode();
}
private void newClinicalNote() {
form.setMode(FormMode.EDIT);
form.getLocalContext().setClinicalNote(null);
form.checkBoxCorrection().setValue(false);
form.chkHospitalReport().setValue(false);
form.dateNote().setValue(new ims.framework.utils.Date());
form.textBoxClinicalNotes().setValue(null);
form.textBoxCorrectionReason().setValue(null);
MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo) domain.getMosUser();
if (memStaffShortVo != null && memStaffShortVo.getHcp() != null)
{
form.getLocalContext().setCurrentHcp(domain.getHcpLite(memStaffShortVo.getHcp().getID_Hcp()));
form.textBoxHCP().setValue((memStaffShortVo).toString());
}
else
form.getLocalContext().setCurrentHcp(null);
form.timeNote().setValue(new ims.framework.utils.Time());
}
private void setButtonsViewMode()
{
form.setMode(FormMode.VIEW);
form.checkBoxCorrection().setEnabled(false);
form.labelCorrectionConfirmed().setEnabled(false);
form.chkHospitalReport().setEnabled(false);
form.labelCorrectionReason().setEnabled(false);
form.textBoxClinicalNotes().setEnabled(false);
form.textBoxCorrectionReason().setEnabled(false);
if (form.checkBoxCorrection().getValue() == true)
{
form.bCorrection().setEnabled(false);
form.labelCorrectionReason().setVisible(true);
form.textBoxCorrectionReason().setVisible(true);
form.checkBoxCorrection().setVisible(true);
form.labelCorrectionConfirmed().setVisible(true);
}
else
{
form.bCorrection().setEnabled(form.getLocalContext().getClinicalNoteIsNotNull()); //WDEV-15066
form.labelCorrectionReason().setVisible(false);
form.textBoxCorrectionReason().setVisible(false);
form.checkBoxCorrection().setVisible(false);
form.labelCorrectionConfirmed().setVisible(false);
}
if (domain.getHcpLiteUser() == null)//WDEV-15037
{
form.bNew().setEnabled(false);
form.bCorrection().setEnabled(false);
}
else
{
form.bNew().setEnabled(true);
}
form.bSave().setVisible(false);//WDEV-14976
form.bSave().setEnabled(false);
form.bCancel().setEnabled(true);
}
private void setButtonsNewMode()
{
form.checkBoxCorrection().setVisible(false);
form.labelCorrectionConfirmed().setVisible(false);
form.chkHospitalReport().setEnabled(true);
form.labelCorrectionReason().setVisible(false);
form.textBoxClinicalNotes().setEnabled(true);
form.textBoxCorrectionReason().setVisible(false);
form.bCorrection().setVisible(false);
form.bNew().setVisible(false);
form.bSave().setVisible(true);//WDEV-14976
form.bSave().setEnabled(true);
form.bCancel().setEnabled(true);
}
private void setButtonsCorrectMode()
{
form.setMode(FormMode.EDIT);
form.labelCorrectionReason().setVisible(true);
form.textBoxCorrectionReason().setVisible(true);
form.checkBoxCorrection().setVisible(true);
form.labelCorrectionConfirmed().setVisible(true);
form.checkBoxCorrection().setEnabled(true);
form.labelCorrectionConfirmed().setEnabled(true);
form.chkHospitalReport().setEnabled(false);
form.labelCorrectionReason().setVisible(true);
form.textBoxClinicalNotes().setEnabled(false);
form.textBoxCorrectionReason().setEnabled(true);
form.bCorrection().setVisible(false);
form.bNew().setVisible(false);
form.bSave().setVisible(true);//WDEV-14976
form.bSave().setEnabled(true);
form.bCancel().setEnabled(true);
form.dateNote().setValue(new ims.framework.utils.Date());
MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo) domain.getMosUser();
if (memStaffShortVo != null && memStaffShortVo.getHcp() != null)
{
form.getLocalContext().setCurrentHcp(domain.getHcpLite(memStaffShortVo.getHcp().getID_Hcp()));
form.textBoxHCP().setValue((memStaffShortVo).toString());
}
else
form.getLocalContext().setCurrentHcp(null);
form.timeNote().setValue(new ims.framework.utils.Time());
}
private void loadCarePlans()
{
CarePlanTitleCollection coll = form.getLocalContext().getCarePlans();
if (coll != null)
{
form.gridCarePlan().getRows().clear();
GenForm.gridCarePlanRow row;
for (int i = 0; i < coll.size(); i++)
{
CarePlanTitle title = coll.get(i);
row = form.gridCarePlan().getRows().newRow();
row.setcolCarePlan(title.getTitle());
if(isClinicalNotesCarePlanDetailsAlias() && form.getGlobalContext().COE.getCarePlanIsNotNull())
{
if(title.equals(form.getGlobalContext().COE.getCarePlan()))
{
row.setcolSelect(true);
}
}
row.setValue(title);
}
}
}
private void populateCarePlans()
{
// Populate the careplan selected column with data from database
if (form.getLocalContext().getClinicalNote().getCarePlans() != null)
{
CarePlanTitleCollection dataColl = form.getLocalContext().getClinicalNote().getCarePlans();
if (dataColl != null)
{
GenForm.gridCarePlanRow row;
for (int i = 0; i < dataColl.size(); i++)
{
CarePlanTitle title = dataColl.get(i);
row = form.gridCarePlan().getRowByValue(title);
if (row != null)
row.setcolSelect(true);
}
}
}
}
protected void onBCorrectionClick() throws ims.framework.exceptions.PresentationLogicException
{
setButtonsCorrectMode();
}
protected void onBCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
form.setMode(FormMode.VIEW);
// If the form opened from PainReview or SkinReview - go back in these
// screens
if (form.getGlobalContext().COE.ClinicalNotes.getCallingForm() != null)
engine.open(form.getGlobalContext().COE.ClinicalNotes.getCallingForm());
if(isClinicalNotesCarePlanDetailsAlias())
engine.open(form.getForms().Nursing.ClinicalNotesViewCarePlanDetails);
else
engine.open(form.getForms().Nursing.ClinicalNotesView);
}
protected void onBSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
if (form.textBoxCorrectionReason().getValue() != null && !form.textBoxCorrectionReason().getValue().equals("") && form.checkBoxCorrection().getValue() == false)
{
engine.showMessage("Please Confirm Correction");
return;
}
NursingClinicalNotesVo notes = form.getLocalContext().getClinicalNote();
if (notes == null)
{
notes = new NursingClinicalNotesVo();
AuthoringInformationVo voAuthoring = new AuthoringInformationVo();
voAuthoring.setAuthoringDateTime(new DateTime(form.dateNote().getValue(), form.timeNote().getValue()));
voAuthoring.setAuthoringHcp(form.getLocalContext().getCurrentHcp());
notes.setAuthoringInfo(voAuthoring);
}
// else if (form.checkBoxCorrection().getValue() == true)
// {
// notes.setDateTimeCorrection(new DateTime(form.dateNote().getValue(), form.timeNote().getValue()));
// notes.setHCPCorrection(form.getLocalContext().getCurrentHcp());
// }
notes.setIsCorrected(form.checkBoxCorrection().getValue());
notes.setInHospitalReport(new Boolean(form.chkHospitalReport().getValue()));
notes.setClinicalNote(form.textBoxClinicalNotes().getValue());
ClinicalNoteStatusVo voClinicalNoteStatus = new ClinicalNoteStatusVo();
if (form.checkBoxCorrection().getValue() == false)
{
voClinicalNoteStatus.setCorrectionConfirmed(Boolean.FALSE);//TRUE);
voClinicalNoteStatus.setStatus(ims.core.vo.lookups.ClinicalNotesStatus.ACTIVE);//WDEV-14960
}
else
{
voClinicalNoteStatus.setCorrectionConfirmed(Boolean.TRUE); //FALSE);
voClinicalNoteStatus.setStatus(ims.core.vo.lookups.ClinicalNotesStatus.CORRECTED);//
voClinicalNoteStatus.setCorrectedBy(form.getLocalContext().getCurrentHcp() != null ? form.getLocalContext().getCurrentHcp().getMos() : null);//WDEV-14960
}
voClinicalNoteStatus.setCorrectionReason(form.textBoxCorrectionReason().getValue());
// voClinicalNoteStatus.setCorrectedBy(notes.getAuthoringInfo().getAuthoringHcp() != null ? notes.getAuthoringInfo().getAuthoringHcp().getMos() : null);
voClinicalNoteStatus.setDateTime(new DateTime());
notes.setCurrentStatus(voClinicalNoteStatus);
if (form.getGlobalContext().Core.getPatientShortIsNotNull())
notes.setWard(form.getGlobalContext().Core.getPatientShort().getWard());
if (notes.getClinicalContact() == null)
notes.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
if (notes.getCareContext() == null)
notes.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
// HcpDisType voInstance = new HcpDisType();
// voInstance.id = HcpDisType.NURSING.id;
//WDEV-12236
// WDEV-15055 notes.setDiscipline(HcpDisType.NURSING);
notes.setNoteClassification(getMappedClassificationLookup());
// Save the Careplans too
CarePlanTitleCollection cpColl = null;
if(isClinicalNotesCarePlanDetailsAlias() && form.getGlobalContext().COE.getCarePlanIsNotNull())
{
CarePlan voCarePlan = form.getGlobalContext().COE.getCarePlan();
cpColl = notes.getCarePlans();
if(cpColl == null)
cpColl = new CarePlanTitleCollection();
cpColl.add(voCarePlan);
}
else
{
GenForm.gridCarePlanRow row;
cpColl = new CarePlanTitleCollection();
for (int i = 0; i < form.gridCarePlan().getRows().size(); i++)
{
row = form.gridCarePlan().getRows().get(i);
if (row.getcolSelect())
{
cpColl.add(row.getValue());
}
}
}
notes.setCarePlans(cpColl);
if (form.getLocalContext().getCurrentHcpIsNotNull() && form.getLocalContext().getCurrentHcp().getHcpTypeIsNotNull()) //WDEV-15055
{
notes.setDiscipline(form.getLocalContext().getCurrentHcp().getHcpType());
}
else
// Clinical notes default to nursing type
notes.setDiscipline(HcpDisType.NURSING);
if ( ! notes.getNoteTypeIsNotNull())
notes.setNoteType(ClinicalNoteType.CLINICALNOTE);
if (notes.getClinicalContact() == null)
notes.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
if (notes.getCareContext() == null)
notes.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
notes.setIsDerivedNote(Boolean.FALSE);
notes.setRecordingDateTime(new DateTime(form.dateNote().getValue(), form.timeNote().getValue()));
//ClinicalNoteStatusVo clinicalNoteStatusVo = new ClinicalNoteStatusVo();
//notes.setCurrentStatus(clinicalNoteStatusVo);
String[] errors = notes.validate();
if (errors != null)
{
engine.showErrors(errors);
return;
}
try
{
domain.saveClinicalNotes(notes);
}
catch (StaleObjectException e)
{
engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
onFormOpen();
return;
}
form.setMode(FormMode.VIEW);
// If the form opened from PainReview or SkinReview - go back in these
// screens
if (form.getGlobalContext().COE.ClinicalNotes.getCallingForm() != null)
engine.open(form.getGlobalContext().COE.ClinicalNotes.getCallingForm());
if(isClinicalNotesCarePlanDetailsAlias())
engine.open(form.getForms().Nursing.ClinicalNotesViewCarePlanDetails);
else
engine.open(form.getForms().Nursing.ClinicalNotesView);
}
//WDEV-12236
public ClinicalNoteClassification getMappedClassificationLookup()
{
ClinicalNoteClassificationCollection coll = ims.clinical.vo.lookups.LookupHelper.getClinicalNoteClassification(domain.getLookupService());
for (int i = 0; i < coll.size(); i++)
{
LookupInstVo instMap = domain.getMappings(coll.get(i));
LookupMappingVoCollection mapColl = instMap.getMappings();
for (int j = 0; j < mapColl.size(); j++)
{
LookupMappingVo valueObject = mapColl.get(j);
if(valueObject.getExtCode()!=null && valueObject.getExtCode().equals("CAREPLANNOTE"))
return coll.get(i);
}
}
return null;
}
private boolean isClinicalNotesCarePlanDetailsAlias()
{
return engine.getFormName().equals(form.getForms().Nursing.ClinicalNotesCarePlanDetails);
}
// BW Not used - here as a sample on how to mark an object as recorded in
// error
/*
* protected void onBtnRIEClick() throws PresentationLogicException { try {
* domain.markAsRecordedInError(form.getLocalContext().getClinicalNote().getID_ClinicalNotes(),
* "ClinicalNotes"); } catch (StaleObjectException e) {
* engine.showMessage("Notes record has been updated by another user. Screen
* will be refreshed."); onFormOpen(); return; } }
*/
@Override
protected void onBtnUpdateActionsClick() throws PresentationLogicException
{
if (areCarePlansSelected())
engine.open(form.getForms().Nursing.ClinicalNotesUpdateActionsDialog,new Object[]{listCarePlans()});
}
private CarePlanTitleCollection listCarePlans()
{
CarePlanTitleCollection voColl = new CarePlanTitleCollection();
for (int i = 0 ; i < form.gridCarePlan().getRows().size() ; i++)
{
if (form.gridCarePlan().getRows().get(i).getcolSelect())
voColl.add(form.gridCarePlan().getRows().get(i).getValue());
}
return voColl;
}
private boolean areCarePlansSelected()
{
boolean bSelected = false;
for (int i = 0 ; i < form.gridCarePlan().getRows().size() ; i++)
{
if (form.gridCarePlan().getRows().get(i).getcolSelect())
bSelected = true;
}
return bSelected;
}
@Override
protected void onGridCarePlanSelectionChanged() throws PresentationLogicException
{
}
@Override
protected void onGridCarePlanGridCheckBoxClicked(int column, gridCarePlanRow row, boolean isChecked) throws PresentationLogicException
{
if (ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().toString().equals("CCO"))
{
form.btnUpdateActions().setVisible(true);
form.btnUpdateActions().setEnabled(areCarePlansSelected());
}
}
@Override //WDEV-15066
protected void onRIEDialogClosed(DialogResult result) throws PresentationLogicException
{
clearScreen();
form.getLocalContext().setClinicalNote(null);
}
private void clearScreen()
{
form.dateNote().setValue(null);
form.timeNote().setValue(null);
form.textBoxHCP().setValue(null);
form.textBoxClinicalNotes().setValue(null);
form.chkHospitalReport().setValue(false);
form.textBoxCorrectionReason().setValue(null);
form.checkBoxCorrection().setValue(false);
}
}
| open-health-hub/openMAXIMS | openmaxims_workspace/Nursing/src/ims/nursing/forms/clinicalnotes/Logic.java | Java | agpl-3.0 | 19,339 |
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe ContentZipper do
# Note that EportfoliosController#export,
# SubmissionsController#submission_zip, and FoldersController#download are
# all ALMOST exactly the same code, copied and pasted with slight changes.
#
# This really needs to get refactored at some point.
def grab_zip
expect { yield }.to change(Delayed::Job, :count).by(1)
expect(response).to be_success
attachment_id = json_parse['attachment']['id']
expect(attachment_id).to be_present
a = Attachment.find attachment_id
expect(a).to be_to_be_zipped
# a second query should just return status
expect { yield }.to change(Delayed::Job, :count).by(0)
expect(response).to be_success
expect(json_parse['attachment']['id']).to eq a.id
end
context "submission zips" do
before(:once) do
course_with_teacher(:active_all => true)
submission_model(:course => @course)
end
before(:each) do
user_session(@teacher)
end
it "should schedule a job on the first request, and then respond with progress updates" do
grab_zip { get "/courses/#{@course.id}/assignments/#{@assignment.id}/submissions.json?zip=1&compile=1" }
end
it "should recreate the submission zip if the anonymous grading setting changes" do
get "/courses/#{@course.id}/assignments/#{@assignment.id}/submissions.json?zip=1&compile=1"
att0 = json_parse['attachment']['id']
@course.enable_feature! :anonymous_grading
get "/courses/#{@course.id}/assignments/#{@assignment.id}/submissions.json?zip=1&compile=1"
att1 = json_parse['attachment']['id']
expect(att0).not_to eq(att1)
end
it "should recreate the submission zip if the previous one is too old" do
att0 = nil
Timecop.travel(1.day.ago) do
get "/courses/#{@course.id}/assignments/#{@assignment.id}/submissions.json?zip=1&compile=1"
att0 = json_parse['attachment']['id']
end
get "/courses/#{@course.id}/assignments/#{@assignment.id}/submissions.json?zip=1&compile=1"
att1 = json_parse['attachment']['id']
expect(att0).not_to eq(att1)
end
it "should recreate the submission zip if a submission has been made since its creation" do
att0 = nil
Timecop.travel(1.minute.ago) do
get "/courses/#{@course.id}/assignments/#{@assignment.id}/submissions.json?zip=1&compile=1"
att0 = json_parse['attachment']['id']
end
submission_model(:course => @course)
get "/courses/#{@course.id}/assignments/#{@assignment.id}/submissions.json?zip=1&compile=1"
att1 = json_parse['attachment']['id']
expect(att0).not_to eq(att1)
end
end
context "eportfolio zips" do
it "should schedule a job on the first request, and then respond with progress updates" do
eportfolio_model
user_session(@user)
grab_zip { get "/eportfolios/#{@eportfolio.id}/export.json?compile=1" }
end
end
end
| matematikk-mooc/canvas-lms | spec/integration/content_zipper_spec.rb | Ruby | agpl-3.0 | 3,009 |
<?php
/*********************************************************************************
* Zurmo is a customer relationship management program developed by
* Zurmo, Inc. Copyright (C) 2015 Zurmo Inc.
*
* Zurmo is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* Zurmo 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
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
* Suite 370 Chicago, IL 60606. or at email address [email protected].
*
* The interactive user interfaces in original and modified versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the Zurmo
* logo and Zurmo copyright notice. If the display of the logo is not reasonably
* feasible for technical reasons, the Appropriate Legal Notices must display the words
* "Copyright Zurmo Inc. 2015. All rights reserved".
********************************************************************************/
class ViewIsMissingRequiredAttributesView extends View
{
protected $failureMessageContent;
/**
* @param string $failureMessageContent
*/
public function __construct($failureMessageContent)
{
assert('is_string($failureMessageContent)');
$this->failureMessageContent = $failureMessageContent;
}
protected function renderContent()
{
return '<h2>' . $this->failureMessageContent . '</h2>';
}
}
?>
| raymondlamwu/zurmotest | app/protected/modules/zurmo/views/ViewIsMissingRequiredAttributesView.php | PHP | agpl-3.0 | 2,649 |
package gziphandler
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/http/httptest"
"net/url"
"strconv"
"testing"
"github.com/stretchr/testify/assert"
)
func TestParseEncodings(t *testing.T) {
examples := map[string]codings{
// Examples from RFC 2616
"compress, gzip": {"compress": 1.0, "gzip": 1.0},
"": {},
"*": {"*": 1.0},
"compress;q=0.5, gzip;q=1.0": {"compress": 0.5, "gzip": 1.0},
"gzip;q=1.0, identity; q=0.5, *;q=0": {"gzip": 1.0, "identity": 0.5, "*": 0.0},
// More random stuff
"AAA;q=1": {"aaa": 1.0},
"BBB ; q = 2": {"bbb": 1.0},
}
for eg, exp := range examples {
act, _ := parseEncodings(eg)
assert.Equal(t, exp, act)
}
}
func TestGzipHandler(t *testing.T) {
testBody := "aaabbbccc"
// This just exists to provide something for GzipHandler to wrap.
handler := newTestHandler(testBody)
// requests without accept-encoding are passed along as-is
req1, _ := http.NewRequest("GET", "/whatever", nil)
resp1 := httptest.NewRecorder()
handler.ServeHTTP(resp1, req1)
res1 := resp1.Result()
assert.Equal(t, 200, res1.StatusCode)
assert.Equal(t, "", res1.Header.Get("Content-Encoding"))
assert.Equal(t, "Accept-Encoding", res1.Header.Get("Vary"))
assert.Equal(t, testBody, resp1.Body.String())
// but requests with accept-encoding:gzip are compressed if possible
req2, _ := http.NewRequest("GET", "/whatever", nil)
req2.Header.Set("Accept-Encoding", "gzip")
resp2 := httptest.NewRecorder()
handler.ServeHTTP(resp2, req2)
res2 := resp2.Result()
assert.Equal(t, 200, res2.StatusCode)
assert.Equal(t, "gzip", res2.Header.Get("Content-Encoding"))
assert.Equal(t, "Accept-Encoding", res2.Header.Get("Vary"))
assert.Equal(t, gzipStrLevel(testBody, gzip.DefaultCompression), resp2.Body.Bytes())
// content-type header is correctly set based on uncompressed body
req3, _ := http.NewRequest("GET", "/whatever", nil)
req3.Header.Set("Accept-Encoding", "gzip")
res3 := httptest.NewRecorder()
handler.ServeHTTP(res3, req3)
assert.Equal(t, http.DetectContentType([]byte(testBody)), res3.Header().Get("Content-Type"))
}
func TestNewGzipLevelHandler(t *testing.T) {
testBody := "aaabbbccc"
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
io.WriteString(w, testBody)
})
for lvl := gzip.BestSpeed; lvl <= gzip.BestCompression; lvl++ {
wrapper, err := NewGzipLevelHandler(lvl)
if !assert.Nil(t, err, "NewGzipLevleHandler returned error for level:", lvl) {
continue
}
req, _ := http.NewRequest("GET", "/whatever", nil)
req.Header.Set("Accept-Encoding", "gzip")
resp := httptest.NewRecorder()
wrapper(handler).ServeHTTP(resp, req)
res := resp.Result()
assert.Equal(t, 200, res.StatusCode)
assert.Equal(t, "gzip", res.Header.Get("Content-Encoding"))
assert.Equal(t, "Accept-Encoding", res.Header.Get("Vary"))
assert.Equal(t, gzipStrLevel(testBody, lvl), resp.Body.Bytes())
}
}
func TestNewGzipLevelHandlerReturnsErrorForInvalidLevels(t *testing.T) {
var err error
_, err = NewGzipLevelHandler(-42)
assert.NotNil(t, err)
_, err = NewGzipLevelHandler(42)
assert.NotNil(t, err)
}
func TestMustNewGzipLevelHandlerWillPanic(t *testing.T) {
defer func() {
if r := recover(); r == nil {
t.Error("panic was not called")
}
}()
_ = MustNewGzipLevelHandler(-42)
}
func TestGzipHandlerNoBody(t *testing.T) {
tests := []struct {
statusCode int
contentEncoding string
bodyLen int
}{
// Body must be empty.
{http.StatusNoContent, "", 0},
{http.StatusNotModified, "", 0},
// Body is going to get gzip'd no matter what.
{http.StatusOK, "gzip", 23},
}
for num, test := range tests {
handler := GzipHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(test.statusCode)
}))
rec := httptest.NewRecorder()
// TODO: in Go1.7 httptest.NewRequest was introduced this should be used
// once 1.6 is not longer supported.
req := &http.Request{
Method: "GET",
URL: &url.URL{Path: "/"},
Proto: "HTTP/1.1",
ProtoMinor: 1,
RemoteAddr: "192.0.2.1:1234",
Header: make(http.Header),
}
req.Header.Set("Accept-Encoding", "gzip")
handler.ServeHTTP(rec, req)
body, err := ioutil.ReadAll(rec.Body)
if err != nil {
t.Fatalf("Unexpected error reading response body: %v", err)
}
header := rec.Header()
assert.Equal(t, test.contentEncoding, header.Get("Content-Encoding"), fmt.Sprintf("for test iteration %d", num))
assert.Equal(t, "Accept-Encoding", header.Get("Vary"), fmt.Sprintf("for test iteration %d", num))
assert.Equal(t, test.bodyLen, len(body), fmt.Sprintf("for test iteration %d", num))
}
}
func TestGzipHandlerContentLength(t *testing.T) {
b := []byte("testtesttesttesttesttesttesttesttesttesttesttesttest")
handler := GzipHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Length", strconv.Itoa(len(b)))
w.Write(b)
}))
// httptest.NewRecorder doesn't give you access to the Content-Length
// header so instead, we create a server on a random port and make
// a request to that instead
ln, err := net.Listen("tcp", "127.0.0.1:")
if err != nil {
t.Fatalf("failed creating listen socket: %v", err)
}
defer ln.Close()
srv := &http.Server{
Handler: handler,
}
go srv.Serve(ln)
req := &http.Request{
Method: "GET",
URL: &url.URL{Path: "/", Scheme: "http", Host: ln.Addr().String()},
Header: make(http.Header),
Close: true,
}
req.Header.Set("Accept-Encoding", "gzip")
res, err := http.DefaultClient.Do(req)
if err != nil {
t.Fatalf("Unexpected error making http request: %v", err)
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
t.Fatalf("Unexpected error reading response body: %v", err)
}
l, err := strconv.Atoi(res.Header.Get("Content-Length"))
if err != nil {
t.Fatalf("Unexpected error parsing Content-Length: %v", err)
}
assert.Len(t, body, l)
assert.Equal(t, "gzip", res.Header.Get("Content-Encoding"))
assert.NotEqual(t, b, body)
}
// --------------------------------------------------------------------
func BenchmarkGzipHandler_S2k(b *testing.B) { benchmark(b, false, 2048) }
func BenchmarkGzipHandler_S20k(b *testing.B) { benchmark(b, false, 20480) }
func BenchmarkGzipHandler_S100k(b *testing.B) { benchmark(b, false, 102400) }
func BenchmarkGzipHandler_P2k(b *testing.B) { benchmark(b, true, 2048) }
func BenchmarkGzipHandler_P20k(b *testing.B) { benchmark(b, true, 20480) }
func BenchmarkGzipHandler_P100k(b *testing.B) { benchmark(b, true, 102400) }
// --------------------------------------------------------------------
func gzipStrLevel(s string, lvl int) []byte {
var b bytes.Buffer
w, _ := gzip.NewWriterLevel(&b, lvl)
io.WriteString(w, s)
w.Close()
return b.Bytes()
}
func benchmark(b *testing.B, parallel bool, size int) {
bin, err := ioutil.ReadFile("testdata/benchmark.json")
if err != nil {
b.Fatal(err)
}
req, _ := http.NewRequest("GET", "/whatever", nil)
req.Header.Set("Accept-Encoding", "gzip")
handler := newTestHandler(string(bin[:size]))
if parallel {
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
runBenchmark(b, req, handler)
}
})
} else {
b.ResetTimer()
for i := 0; i < b.N; i++ {
runBenchmark(b, req, handler)
}
}
}
func runBenchmark(b *testing.B, req *http.Request, handler http.Handler) {
res := httptest.NewRecorder()
handler.ServeHTTP(res, req)
if code := res.Code; code != 200 {
b.Fatalf("Expected 200 but got %d", code)
} else if blen := res.Body.Len(); blen < 500 {
b.Fatalf("Expected complete response body, but got %d bytes", blen)
}
}
func newTestHandler(body string) http.Handler {
return GzipHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, body)
}))
}
| asaadmahmoodspin/platform | vendor/github.com/NYTimes/gziphandler/gzip_test.go | GO | agpl-3.0 | 7,929 |
-- DB update 2020_11_02_00 -> 2020_11_02_01
DROP PROCEDURE IF EXISTS `updateDb`;
DELIMITER //
CREATE PROCEDURE updateDb ()
proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE';
SELECT COUNT(*) INTO @COLEXISTS
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2020_11_02_00';
IF @COLEXISTS = 0 THEN LEAVE proc; END IF;
START TRANSACTION;
ALTER TABLE version_db_world CHANGE COLUMN 2020_11_02_00 2020_11_02_01 bit;
SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1602787862865620600'; IF OK <> 'FALSE' THEN LEAVE proc; END IF;
--
-- START UPDATING QUERIES
--
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1602787862865620600');
UPDATE `quest_template_addon` SET `SpecialFlags`=0 WHERE `id`=708;
--
-- END UPDATING QUERIES
--
COMMIT;
END //
DELIMITER ;
CALL updateDb();
DROP PROCEDURE IF EXISTS `updateDb`;
| ShinDarth/azerothcore-wotlk | data/sql/archive/db_world/3.x/2020_11_02_01.sql | SQL | agpl-3.0 | 895 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program 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 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 Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.billing.forms.adddiscountdialog;
public final class FormInfo extends ims.framework.FormInfo
{
private static final long serialVersionUID = 1L;
public FormInfo(Integer formId)
{
super(formId);
}
public String getNamespaceName()
{
return "Billing";
}
public String getFormName()
{
return "AddDiscountDialog";
}
public int getWidth()
{
return 208;
}
public int getHeight()
{
return 168;
}
public String[] getContextVariables()
{
return new String[] { };
}
public String getLocalVariablesPrefix()
{
return "_lv_Billing.AddDiscountDialog.__internal_x_context__" + String.valueOf(getFormId());
}
public ims.framework.FormInfo[] getComponentsFormInfo()
{
ims.framework.FormInfo[] componentsInfo = new ims.framework.FormInfo[0];
return componentsInfo;
}
public String getImagePath()
{
return "";
}
}
| open-health-hub/openMAXIMS | openmaxims_workspace/Billing/src/ims/billing/forms/adddiscountdialog/FormInfo.java | Java | agpl-3.0 | 2,526 |
/*
* opencog/embodiment/Learning/behavior/PredicateHandleSet.cc
*
* Copyright (C) 2002-2009 Novamente LLC
* All Rights Reserved
* Author(s): Andre Senna
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* at http://opencog.org/wiki/Licenses
*
* 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 Affero General Public License
* along with this program; if not, write to:
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <opencog/atomspace/Node.h>
#include "PredicateHandleSet.h"
using namespace behavior;
PredicateHandleSet::~PredicateHandleSet()
{
}
PredicateHandleSet::PredicateHandleSet()
{
}
void PredicateHandleSet::insert(const Handle &handle)
{
handles.insert(handle);
}
void PredicateHandleSet::clear()
{
handles.clear();
}
const std::set<Handle> &PredicateHandleSet::getSet() const
{
return handles;
}
bool PredicateHandleSet::equals(const PredicateHandleSet &other) const
{
if (other.getSize() != this->getSize()) {
return false;
}
std::set<Handle>::iterator it1, it2;
for (it1 = handles.begin(), it2 = other.handles.begin(); it1 != handles.end(); ++it1, ++it2) {
if (*it1 != *it2) {
return false;
}
}
return true;
}
std::string PredicateHandleSet::toString(AtomSpace &atomspace) const
{
std::string answer = "{";
std::set<Handle>::iterator it = handles.begin();
while (it != handles.end()) {
//if Atom then print the name
//but if link then print the string representation
//printing the atom name instead of its string representation
//is kept for compatibility reason
std::string str;
if (atomspace.isNode(*it)) {
const std::string an = atomspace.getName(*it);
str = an;
} else {
str = atomspace.atomAsString((*it));
}
answer.append(str);
++it;
if (it != handles.end()) {
answer.append(",");
}
}
answer.append("}");
return answer;
}
bool PredicateHandleSet::operator==(const PredicateHandleSet& other) const
{
//printf("operator %s == %s\n", toString().c_str(), other.toString().c_str());
bool answer = equals(other);
/*
if (answer) {
printf("true\n");
} else {
printf("false\n");
}
*/
return answer;
}
PredicateHandleSet &PredicateHandleSet::operator=(const PredicateHandleSet & other)
{
//printf("operator %s = %s\n", toString().c_str(), other.toString().c_str());
handles.clear();
for (std::set<Handle>::iterator it = other.handles.begin(); it != other.handles.end(); ++it) {
handles.insert(*it);
}
//printf("exiting operator %s = %s\n", toString().c_str(), other.toString().c_str());
return *this;
}
bool PredicateHandleSet::operator<(const PredicateHandleSet& other) const
{
//printf("operator %s < %s\n", toString().c_str(), other.toString().c_str());
if (getSize() == 0) {
if (other.getSize() == 0) {
return false;
} else {
return true;
}
} else {
if (other.getSize() == 0) {
return false;
}
}
std::set<Handle>::iterator it1, it2;
for (it1 = handles.begin(), it2 = other.handles.begin(); ((it1 != handles.end()) && (it2 != other.handles.end())); ) {
if ((*it1) < (*it2)) {
//printf("true 1\n");
return true;
} else {
if ((*it1) > (*it2)) {
//printf("false 1\n");
return false;
} else {
++it1;
++it2;
if (it1 == handles.end()) {
if (it2 == other.handles.end()) {
//printf("false 2\n");
return false;
} else {
//printf("true 2\n");
return true;
}
} else {
if (it2 == other.handles.end()) {
//printf("false 3\n");
return false;
}
}
}
}
}
//printf("false 4\n");
return false;
}
int PredicateHandleSet::getSize() const
{
return handles.size();
}
bool PredicateHandleSet::empty() const
{
return handles.empty();
}
| anitzkin/opencog | opencog/embodiment/Learning/behavior/PredicateHandleSet.cc | C++ | agpl-3.0 | 4,819 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program 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 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 Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
/*
* This code was generated
* Copyright (C) 1995-2004 IMS MAXIMS plc. All rights reserved.
* IMS Development Environment (version 1.80 build 5007.25751)
* WARNING: DO NOT MODIFY the content of this file
* Generated: 16/04/2014, 12:34
*
*/
package ims.nursing.assessment.domain.objects;
/**
*
* @author Sinead McDermott
* Generated.
*/
public class BowelRegime extends ims.domain.DomainObject implements ims.domain.SystemInformationRetainer, java.io.Serializable {
public static final int CLASSID = 1015100019;
private static final long serialVersionUID = 1015100019L;
public static final String CLASSVERSION = "${ClassVersion}";
@Override
public boolean shouldCapQuery()
{
return true;
}
/** Bowel Regime */
private ims.domain.lookups.LookupInstance bowelRegime;
/** Status - Yes / No / Unknown */
private ims.domain.lookups.LookupInstance status;
/** Details */
private String details;
/** SystemInformation */
private ims.domain.SystemInformation systemInformation = new ims.domain.SystemInformation();
public BowelRegime (Integer id, int ver)
{
super(id, ver);
}
public BowelRegime ()
{
super();
}
public BowelRegime (Integer id, int ver, Boolean includeRecord)
{
super(id, ver, includeRecord);
}
public Class getRealDomainClass()
{
return ims.nursing.assessment.domain.objects.BowelRegime.class;
}
public ims.domain.lookups.LookupInstance getBowelRegime() {
return bowelRegime;
}
public void setBowelRegime(ims.domain.lookups.LookupInstance bowelRegime) {
this.bowelRegime = bowelRegime;
}
public ims.domain.lookups.LookupInstance getStatus() {
return status;
}
public void setStatus(ims.domain.lookups.LookupInstance status) {
this.status = status;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public ims.domain.SystemInformation getSystemInformation() {
if (systemInformation == null) systemInformation = new ims.domain.SystemInformation();
return systemInformation;
}
/**
* isConfigurationObject
* Taken from the Usage property of the business object, this method will return
* a boolean indicating whether this is a configuration object or not
* Configuration = true, Instantiation = false
*/
public static boolean isConfigurationObject()
{
if ( "Instantiation".equals("Configuration") )
return true;
else
return false;
}
public int getClassId() {
return CLASSID;
}
public String getClassVersion()
{
return CLASSVERSION;
}
public String toAuditString()
{
StringBuffer auditStr = new StringBuffer();
auditStr.append("\r\n*bowelRegime* :");
if (bowelRegime != null)
auditStr.append(bowelRegime.getText());
auditStr.append("; ");
auditStr.append("\r\n*status* :");
if (status != null)
auditStr.append(status.getText());
auditStr.append("; ");
auditStr.append("\r\n*details* :");
auditStr.append(details);
auditStr.append("; ");
return auditStr.toString();
}
public String toXMLString()
{
return toXMLString(new java.util.HashMap());
}
public String toXMLString(java.util.HashMap domMap)
{
StringBuffer sb = new StringBuffer();
sb.append("<class type=\"" + this.getClass().getName() + "\" ");
sb.append(" id=\"" + this.getId() + "\"");
sb.append(" source=\"" + ims.configuration.EnvironmentConfig.getImportExportSourceName() + "\" ");
sb.append(" classVersion=\"" + this.getClassVersion() + "\" ");
sb.append(" component=\"" + this.getIsComponentClass() + "\" >");
if (domMap.get(this) == null)
{
domMap.put(this, this);
sb.append(this.fieldsToXMLString(domMap));
}
sb.append("</class>");
String keyClassName = "BowelRegime";
String externalSource = ims.configuration.EnvironmentConfig.getImportExportSourceName();
ims.configuration.ImportedObject impObj = (ims.configuration.ImportedObject)domMap.get(keyClassName + "_" + externalSource + "_" + this.getId());
if (impObj == null)
{
impObj = new ims.configuration.ImportedObject();
impObj.setExternalId(this.getId());
impObj.setExternalSource(externalSource);
impObj.setDomainObject(this);
impObj.setLocalId(this.getId());
impObj.setClassName(keyClassName);
domMap.put(keyClassName + "_" + externalSource + "_" + this.getId(), impObj);
}
return sb.toString();
}
public String fieldsToXMLString(java.util.HashMap domMap)
{
StringBuffer sb = new StringBuffer();
if (this.getBowelRegime() != null)
{
sb.append("<bowelRegime>");
sb.append(this.getBowelRegime().toXMLString());
sb.append("</bowelRegime>");
}
if (this.getStatus() != null)
{
sb.append("<status>");
sb.append(this.getStatus().toXMLString());
sb.append("</status>");
}
if (this.getDetails() != null)
{
sb.append("<details>");
sb.append(ims.framework.utils.StringUtils.encodeXML(this.getDetails().toString()));
sb.append("</details>");
}
return sb.toString();
}
public static java.util.List fromListXMLString(org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.List list, java.util.HashMap domMap) throws Exception
{
if (list == null)
list = new java.util.ArrayList();
fillListFromXMLString(list, el, factory, domMap);
return list;
}
public static java.util.Set fromSetXMLString(org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.Set set, java.util.HashMap domMap) throws Exception
{
if (set == null)
set = new java.util.HashSet();
fillSetFromXMLString(set, el, factory, domMap);
return set;
}
private static void fillSetFromXMLString(java.util.Set set, org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
if (el == null)
return;
java.util.List cl = el.elements("class");
int size = cl.size();
java.util.Set newSet = new java.util.HashSet();
for(int i=0; i<size; i++)
{
org.dom4j.Element itemEl = (org.dom4j.Element)cl.get(i);
BowelRegime domainObject = getBowelRegimefromXML(itemEl, factory, domMap);
if (domainObject == null)
{
continue;
}
//Trying to avoid the hibernate collection being marked as dirty via its public interface methods. (like add)
if (!set.contains(domainObject))
set.add(domainObject);
newSet.add(domainObject);
}
java.util.Set removedSet = new java.util.HashSet();
java.util.Iterator iter = set.iterator();
//Find out which objects need to be removed
while (iter.hasNext())
{
ims.domain.DomainObject o = (ims.domain.DomainObject)iter.next();
if ((o == null || o.getIsRIE() == null || !o.getIsRIE().booleanValue()) && !newSet.contains(o))
{
removedSet.add(o);
}
}
iter = removedSet.iterator();
//Remove the unwanted objects
while (iter.hasNext())
{
set.remove(iter.next());
}
}
private static void fillListFromXMLString(java.util.List list, org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
if (el == null)
return;
java.util.List cl = el.elements("class");
int size = cl.size();
for(int i=0; i<size; i++)
{
org.dom4j.Element itemEl = (org.dom4j.Element)cl.get(i);
BowelRegime domainObject = getBowelRegimefromXML(itemEl, factory, domMap);
if (domainObject == null)
{
continue;
}
int domIdx = list.indexOf(domainObject);
if (domIdx == -1)
{
list.add(i, domainObject);
}
else if (i != domIdx && i < list.size())
{
Object tmp = list.get(i);
list.set(i, list.get(domIdx));
list.set(domIdx, tmp);
}
}
//Remove all ones in domList where index > voCollection.size() as these should
//now represent the ones removed from the VO collection. No longer referenced.
int i1=list.size();
while (i1 > size)
{
list.remove(i1-1);
i1=list.size();
}
}
public static BowelRegime getBowelRegimefromXML(String xml, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
org.dom4j.Document doc = new org.dom4j.io.SAXReader().read(new org.xml.sax.InputSource(xml));
return getBowelRegimefromXML(doc.getRootElement(), factory, domMap);
}
public static BowelRegime getBowelRegimefromXML(org.dom4j.Element el, ims.domain.DomainFactory factory, java.util.HashMap domMap) throws Exception
{
if (el == null)
return null;
String className = el.attributeValue("type");
if (!BowelRegime.class.getName().equals(className))
{
Class clz = Class.forName(className);
if (!BowelRegime.class.isAssignableFrom(clz))
throw new Exception("Element of type = " + className + " cannot be imported using the BowelRegime class");
String shortClassName = className.substring(className.lastIndexOf(".")+1);
String methodName = "get" + shortClassName + "fromXML";
java.lang.reflect.Method m = clz.getMethod(methodName, new Class[]{org.dom4j.Element.class, ims.domain.DomainFactory.class, java.util.HashMap.class});
return (BowelRegime)m.invoke(null, new Object[]{el, factory, domMap});
}
String impVersion = el.attributeValue("classVersion");
if(!impVersion.equals(BowelRegime.CLASSVERSION))
{
throw new Exception("Incompatible class structure found. Cannot import instance.");
}
BowelRegime ret = null;
int extId = Integer.parseInt(el.attributeValue("id"));
String externalSource = el.attributeValue("source");
ret = (BowelRegime)factory.getImportedDomainObject(BowelRegime.class, externalSource, extId);
if (ret == null)
{
ret = new BowelRegime();
}
String keyClassName = "BowelRegime";
ims.configuration.ImportedObject impObj = (ims.configuration.ImportedObject)domMap.get(keyClassName + "_" + externalSource + "_" + extId);
if (impObj != null)
{
return (BowelRegime)impObj.getDomainObject();
}
else
{
impObj = new ims.configuration.ImportedObject();
impObj.setExternalId(extId);
impObj.setExternalSource(externalSource);
impObj.setDomainObject(ret);
domMap.put(keyClassName + "_" + externalSource + "_" + extId, impObj);
}
fillFieldsfromXML(el, factory, ret, domMap);
return ret;
}
public static void fillFieldsfromXML(org.dom4j.Element el, ims.domain.DomainFactory factory, BowelRegime obj, java.util.HashMap domMap) throws Exception
{
org.dom4j.Element fldEl;
fldEl = el.element("bowelRegime");
if(fldEl != null)
{
fldEl = fldEl.element("lki");
obj.setBowelRegime(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
}
fldEl = el.element("status");
if(fldEl != null)
{
fldEl = fldEl.element("lki");
obj.setStatus(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
}
fldEl = el.element("details");
if(fldEl != null)
{
obj.setDetails(new String(fldEl.getTextTrim()));
}
}
public static String[] getCollectionFields()
{
return new String[]{
};
}
public static class FieldNames
{
public static final String ID = "id";
public static final String BowelRegime = "bowelRegime";
public static final String Status = "status";
public static final String Details = "details";
}
}
| open-health-hub/openMAXIMS | openmaxims_workspace/DomainObjects/src/ims/nursing/assessment/domain/objects/BowelRegime.java | Java | agpl-3.0 | 12,603 |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program 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 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 Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
/*
* This code was generated
* Copyright (C) 1995-2004 IMS MAXIMS plc. All rights reserved.
* IMS Development Environment (version 1.80 build 5007.25751)
* WARNING: DO NOT MODIFY the content of this file
* Generated on 16/04/2014, 12:31
*
*/
package ims.generalmedical.vo.domain;
import ims.vo.domain.DomainObjectMap;
import java.util.HashMap;
import org.hibernate.proxy.HibernateProxy;
/**
* @author Charlotte Murphy
*/
public class MskSpineExamFindingShortVoAssembler
{
/**
* Copy one ValueObject to another
* @param valueObjectDest to be updated
* @param valueObjectSrc to copy values from
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVo copy(ims.generalmedical.vo.MskSpineExamFindingShortVo valueObjectDest, ims.generalmedical.vo.MskSpineExamFindingShortVo valueObjectSrc)
{
if (null == valueObjectSrc)
{
return valueObjectSrc;
}
valueObjectDest.setID_MskSpineExam(valueObjectSrc.getID_MskSpineExam());
valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
// ClinicalContact
valueObjectDest.setClinicalContact(valueObjectSrc.getClinicalContact());
// CareContext
valueObjectDest.setCareContext(valueObjectSrc.getCareContext());
// AuthoringCP
valueObjectDest.setAuthoringCP(valueObjectSrc.getAuthoringCP());
// AuthoringDateTime
valueObjectDest.setAuthoringDateTime(valueObjectSrc.getAuthoringDateTime());
return valueObjectDest;
}
/**
* Create the ValueObject collection to hold the set of DomainObjects.
* This is a convenience method only.
* It is intended to be used when one called to an Assembler is made.
* If more than one call to an Assembler is made then #createMskSpineExamFindingShortVoCollectionFromMskSpineExam(DomainObjectMap, Set) should be used.
* @param domainObjectSet - Set of ims.medical.domain.objects.MskSpineExam objects.
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVoCollection createMskSpineExamFindingShortVoCollectionFromMskSpineExam(java.util.Set domainObjectSet)
{
return createMskSpineExamFindingShortVoCollectionFromMskSpineExam(new DomainObjectMap(), domainObjectSet);
}
/**
* Create the ValueObject collection to hold the set of DomainObjects.
* @param map - maps DomainObjects to created ValueObjects
* @param domainObjectSet - Set of ims.medical.domain.objects.MskSpineExam objects.
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVoCollection createMskSpineExamFindingShortVoCollectionFromMskSpineExam(DomainObjectMap map, java.util.Set domainObjectSet)
{
ims.generalmedical.vo.MskSpineExamFindingShortVoCollection voList = new ims.generalmedical.vo.MskSpineExamFindingShortVoCollection();
if ( null == domainObjectSet )
{
return voList;
}
int rieCount=0;
int activeCount=0;
java.util.Iterator iterator = domainObjectSet.iterator();
while( iterator.hasNext() )
{
ims.medical.domain.objects.MskSpineExam domainObject = (ims.medical.domain.objects.MskSpineExam) iterator.next();
ims.generalmedical.vo.MskSpineExamFindingShortVo vo = create(map, domainObject);
if (vo != null)
voList.add(vo);
if (domainObject != null)
{
if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
rieCount++;
else
activeCount++;
}
}
voList.setRieCount(rieCount);
voList.setActiveCount(activeCount);
return voList;
}
/**
* Create the ValueObject collection to hold the list of DomainObjects.
* @param domainObjectList - List of ims.medical.domain.objects.MskSpineExam objects.
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVoCollection createMskSpineExamFindingShortVoCollectionFromMskSpineExam(java.util.List domainObjectList)
{
return createMskSpineExamFindingShortVoCollectionFromMskSpineExam(new DomainObjectMap(), domainObjectList);
}
/**
* Create the ValueObject collection to hold the list of DomainObjects.
* @param map - maps DomainObjects to created ValueObjects
* @param domainObjectList - List of ims.medical.domain.objects.MskSpineExam objects.
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVoCollection createMskSpineExamFindingShortVoCollectionFromMskSpineExam(DomainObjectMap map, java.util.List domainObjectList)
{
ims.generalmedical.vo.MskSpineExamFindingShortVoCollection voList = new ims.generalmedical.vo.MskSpineExamFindingShortVoCollection();
if ( null == domainObjectList )
{
return voList;
}
int rieCount=0;
int activeCount=0;
for (int i = 0; i < domainObjectList.size(); i++)
{
ims.medical.domain.objects.MskSpineExam domainObject = (ims.medical.domain.objects.MskSpineExam) domainObjectList.get(i);
ims.generalmedical.vo.MskSpineExamFindingShortVo vo = create(map, domainObject);
if (vo != null)
voList.add(vo);
if (domainObject != null)
{
if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
rieCount++;
else
activeCount++;
}
}
voList.setRieCount(rieCount);
voList.setActiveCount(activeCount);
return voList;
}
/**
* Create the ims.medical.domain.objects.MskSpineExam set from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/
public static java.util.Set extractMskSpineExamSet(ims.domain.ILightweightDomainFactory domainFactory, ims.generalmedical.vo.MskSpineExamFindingShortVoCollection voCollection)
{
return extractMskSpineExamSet(domainFactory, voCollection, null, new HashMap());
}
public static java.util.Set extractMskSpineExamSet(ims.domain.ILightweightDomainFactory domainFactory, ims.generalmedical.vo.MskSpineExamFindingShortVoCollection voCollection, java.util.Set domainObjectSet, HashMap domMap)
{
int size = (null == voCollection) ? 0 : voCollection.size();
if (domainObjectSet == null)
{
domainObjectSet = new java.util.HashSet();
}
java.util.Set newSet = new java.util.HashSet();
for(int i=0; i<size; i++)
{
ims.generalmedical.vo.MskSpineExamFindingShortVo vo = voCollection.get(i);
ims.medical.domain.objects.MskSpineExam domainObject = MskSpineExamFindingShortVoAssembler.extractMskSpineExam(domainFactory, vo, domMap);
//TODO: This can only occur in the situation of a stale object exception. For now leave it to the Interceptor to handle it.
if (domainObject == null)
{
continue;
}
//Trying to avoid the hibernate collection being marked as dirty via its public interface methods. (like add)
if (!domainObjectSet.contains(domainObject)) domainObjectSet.add(domainObject);
newSet.add(domainObject);
}
java.util.Set removedSet = new java.util.HashSet();
java.util.Iterator iter = domainObjectSet.iterator();
//Find out which objects need to be removed
while (iter.hasNext())
{
ims.domain.DomainObject o = (ims.domain.DomainObject)iter.next();
if ((o == null || o.getIsRIE() == null || !o.getIsRIE().booleanValue()) && !newSet.contains(o))
{
removedSet.add(o);
}
}
iter = removedSet.iterator();
//Remove the unwanted objects
while (iter.hasNext())
{
domainObjectSet.remove(iter.next());
}
return domainObjectSet;
}
/**
* Create the ims.medical.domain.objects.MskSpineExam list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/
public static java.util.List extractMskSpineExamList(ims.domain.ILightweightDomainFactory domainFactory, ims.generalmedical.vo.MskSpineExamFindingShortVoCollection voCollection)
{
return extractMskSpineExamList(domainFactory, voCollection, null, new HashMap());
}
public static java.util.List extractMskSpineExamList(ims.domain.ILightweightDomainFactory domainFactory, ims.generalmedical.vo.MskSpineExamFindingShortVoCollection voCollection, java.util.List domainObjectList, HashMap domMap)
{
int size = (null == voCollection) ? 0 : voCollection.size();
if (domainObjectList == null)
{
domainObjectList = new java.util.ArrayList();
}
for(int i=0; i<size; i++)
{
ims.generalmedical.vo.MskSpineExamFindingShortVo vo = voCollection.get(i);
ims.medical.domain.objects.MskSpineExam domainObject = MskSpineExamFindingShortVoAssembler.extractMskSpineExam(domainFactory, vo, domMap);
//TODO: This can only occur in the situation of a stale object exception. For now leave it to the Interceptor to handle it.
if (domainObject == null)
{
continue;
}
int domIdx = domainObjectList.indexOf(domainObject);
if (domIdx == -1)
{
domainObjectList.add(i, domainObject);
}
else if (i != domIdx && i < domainObjectList.size())
{
Object tmp = domainObjectList.get(i);
domainObjectList.set(i, domainObjectList.get(domIdx));
domainObjectList.set(domIdx, tmp);
}
}
//Remove all ones in domList where index > voCollection.size() as these should
//now represent the ones removed from the VO collection. No longer referenced.
int i1=domainObjectList.size();
while (i1 > size)
{
domainObjectList.remove(i1-1);
i1=domainObjectList.size();
}
return domainObjectList;
}
/**
* Create the ValueObject from the ims.medical.domain.objects.MskSpineExam object.
* @param domainObject ims.medical.domain.objects.MskSpineExam
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVo create(ims.medical.domain.objects.MskSpineExam domainObject)
{
if (null == domainObject)
{
return null;
}
DomainObjectMap map = new DomainObjectMap();
return create(map, domainObject);
}
/**
* Create the ValueObject from the ims.medical.domain.objects.MskSpineExam object.
* @param map DomainObjectMap of DomainObjects to already created ValueObjects.
* @param domainObject
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVo create(DomainObjectMap map, ims.medical.domain.objects.MskSpineExam domainObject)
{
if (null == domainObject)
{
return null;
}
// check if the domainObject already has a valueObject created for it
ims.generalmedical.vo.MskSpineExamFindingShortVo valueObject = (ims.generalmedical.vo.MskSpineExamFindingShortVo) map.getValueObject(domainObject, ims.generalmedical.vo.MskSpineExamFindingShortVo.class);
if ( null == valueObject )
{
valueObject = new ims.generalmedical.vo.MskSpineExamFindingShortVo(domainObject.getId(), domainObject.getVersion());
map.addValueObject(domainObject, valueObject);
valueObject = insert(map, valueObject, domainObject);
}
return valueObject;
}
/**
* Update the ValueObject with the Domain Object.
* @param valueObject to be updated
* @param domainObject ims.medical.domain.objects.MskSpineExam
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVo insert(ims.generalmedical.vo.MskSpineExamFindingShortVo valueObject, ims.medical.domain.objects.MskSpineExam domainObject)
{
if (null == domainObject)
{
return valueObject;
}
DomainObjectMap map = new DomainObjectMap();
return insert(map, valueObject, domainObject);
}
/**
* Update the ValueObject with the Domain Object.
* @param map DomainObjectMap of DomainObjects to already created ValueObjects.
* @param valueObject to be updated
* @param domainObject ims.medical.domain.objects.MskSpineExam
*/
public static ims.generalmedical.vo.MskSpineExamFindingShortVo insert(DomainObjectMap map, ims.generalmedical.vo.MskSpineExamFindingShortVo valueObject, ims.medical.domain.objects.MskSpineExam domainObject)
{
if (null == domainObject)
{
return valueObject;
}
if (null == map)
{
map = new DomainObjectMap();
}
valueObject.setID_MskSpineExam(domainObject.getId());
valueObject.setIsRIE(domainObject.getIsRIE());
// If this is a recordedInError record, and the domainObject
// value isIncludeRecord has not been set, then we return null and
// not the value object
if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord())
return null;
// If this is not a recordedInError record, and the domainObject
// value isIncludeRecord has been set, then we return null and
// not the value object
if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord())
return null;
// ClinicalContact
valueObject.setClinicalContact(ims.core.vo.domain.ClinicalContactShortVoAssembler.create(map, domainObject.getClinicalContact()) );
// CareContext
valueObject.setCareContext(ims.core.vo.domain.CareContextShortVoAssembler.create(map, domainObject.getCareContext()) );
// AuthoringCP
valueObject.setAuthoringCP(ims.core.vo.domain.HcpLiteVoAssembler.create(map, domainObject.getAuthoringCP()) );
// AuthoringDateTime
java.util.Date AuthoringDateTime = domainObject.getAuthoringDateTime();
if ( null != AuthoringDateTime )
{
valueObject.setAuthoringDateTime(new ims.framework.utils.DateTime(AuthoringDateTime) );
}
return valueObject;
}
/**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/
public static ims.medical.domain.objects.MskSpineExam extractMskSpineExam(ims.domain.ILightweightDomainFactory domainFactory, ims.generalmedical.vo.MskSpineExamFindingShortVo valueObject)
{
return extractMskSpineExam(domainFactory, valueObject, new HashMap());
}
public static ims.medical.domain.objects.MskSpineExam extractMskSpineExam(ims.domain.ILightweightDomainFactory domainFactory, ims.generalmedical.vo.MskSpineExamFindingShortVo valueObject, HashMap domMap)
{
if (null == valueObject)
{
return null;
}
Integer id = valueObject.getID_MskSpineExam();
ims.medical.domain.objects.MskSpineExam domainObject = null;
if ( null == id)
{
if (domMap.get(valueObject) != null)
{
return (ims.medical.domain.objects.MskSpineExam)domMap.get(valueObject);
}
// ims.generalmedical.vo.MskSpineExamFindingShortVo ID_MskSpineExam field is unknown
domainObject = new ims.medical.domain.objects.MskSpineExam();
domMap.put(valueObject, domainObject);
}
else
{
String key = (valueObject.getClass().getName() + "__" + valueObject.getID_MskSpineExam());
if (domMap.get(key) != null)
{
return (ims.medical.domain.objects.MskSpineExam)domMap.get(key);
}
domainObject = (ims.medical.domain.objects.MskSpineExam) domainFactory.getDomainObject(ims.medical.domain.objects.MskSpineExam.class, id );
//TODO: Not sure how this should be handled. Effectively it must be a staleobject exception, but maybe should be handled as that further up.
if (domainObject == null)
return null;
domMap.put(key, domainObject);
}
domainObject.setVersion(valueObject.getVersion_MskSpineExam());
// SaveAsRefVO - treated as a refVo in extract methods
ims.core.admin.domain.objects.ClinicalContact value1 = null;
if ( null != valueObject.getClinicalContact() )
{
if (valueObject.getClinicalContact().getBoId() == null)
{
if (domMap.get(valueObject.getClinicalContact()) != null)
{
value1 = (ims.core.admin.domain.objects.ClinicalContact)domMap.get(valueObject.getClinicalContact());
}
}
else
{
value1 = (ims.core.admin.domain.objects.ClinicalContact)domainFactory.getDomainObject(ims.core.admin.domain.objects.ClinicalContact.class, valueObject.getClinicalContact().getBoId());
}
}
domainObject.setClinicalContact(value1);
// SaveAsRefVO - treated as a refVo in extract methods
ims.core.admin.domain.objects.CareContext value2 = null;
if ( null != valueObject.getCareContext() )
{
if (valueObject.getCareContext().getBoId() == null)
{
if (domMap.get(valueObject.getCareContext()) != null)
{
value2 = (ims.core.admin.domain.objects.CareContext)domMap.get(valueObject.getCareContext());
}
}
else
{
value2 = (ims.core.admin.domain.objects.CareContext)domainFactory.getDomainObject(ims.core.admin.domain.objects.CareContext.class, valueObject.getCareContext().getBoId());
}
}
domainObject.setCareContext(value2);
domainObject.setAuthoringCP(ims.core.vo.domain.HcpLiteVoAssembler.extractHcp(domainFactory, valueObject.getAuthoringCP(), domMap));
ims.framework.utils.DateTime dateTime4 = valueObject.getAuthoringDateTime();
java.util.Date value4 = null;
if ( dateTime4 != null )
{
value4 = dateTime4.getJavaDate();
}
domainObject.setAuthoringDateTime(value4);
return domainObject;
}
}
| open-health-hub/openMAXIMS | openmaxims_workspace/ValueObjects/src/ims/generalmedical/vo/domain/MskSpineExamFindingShortVoAssembler.java | Java | agpl-3.0 | 18,258 |
<?php
/*********************************************************************************
* Zurmo is a customer relationship management program developed by
* Zurmo, Inc. Copyright (C) 2015 Zurmo Inc.
*
* Zurmo is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* Zurmo 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
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
* Suite 370 Chicago, IL 60606. or at email address [email protected].
*
* The interactive user interfaces in original and modified versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the Zurmo
* logo and Zurmo copyright notice. If the display of the logo is not reasonably
* feasible for technical reasons, the Appropriate Legal Notices must display the words
* "Copyright Zurmo Inc. 2015. All rights reserved".
********************************************************************************/
/**
* Form used for selecting a contact model in any state. (leads and contacts)
*/
class AnyContactSelectForm extends ContactSelectForm
{
public function attributeLabels()
{
return array(
'contactId' => Zurmo::t('LeadsModule', 'ContactsModuleSingularLabel or LeadsModuleSingularLabel ID',
LabelUtil::getTranslationParamsForAllModules()),
'contactName' => Zurmo::t('LeadsModule', 'ContactsModuleSingularLabel or LeadsModuleSingularLabel Name',
LabelUtil::getTranslationParamsForAllModules()),
);
}
}
?> | raymondlamwu/zurmotest | app/protected/modules/leads/forms/AnyContactSelectForm.php | PHP | agpl-3.0 | 2,836 |
# R Style Guide for JASP programming
In the past we've had many different styles for the `R` analyses, as people from different backgrounds have been creating analyses for JASP. This has created different structures and different styles which makes it fundamentally hard to read our code. With the new backend of `jaspResults`, we have an opportunity to fix this issue. This document outlines a style guide for our R files. A `linter` will be implemented on Travis CI to preclude style deviations from happening in the future: any code that does not follow this style guide will be rejected because of errors in the CI checks. In other words: _strictly adhere to the style guide._
This style was influenced by the [Google style guide](https://google.github.io/styleguide/Rguide.xml) and how our repository behaves on GitHub.
## Style Guide
- No tabs allowed, use 2 spaces. Otherwise the file will be malformed on GitHub.
- Code may not be wider than 120 characters. This makes it possible to view 2 files side-by-side on a reasonable screen and it makes sure there is no sideways scrolling on GitHub. It does still allow wider than regular code (regular limit is 80 characters). Adjust your editor to show you the margin!
- Use `<-` not `=` for assignment.
- See [spacing](https://google.github.io/styleguide/Rguide.xml#spacing). Additionally, wherever it improves legibility the code may be aligned by using extra spaces (_But stay within 120 characters_)
```r
hello <- someFunc(x = "something", y = "ok", z = 1)
ok <- someFunc(x = "socool", y = "nope", z = 2)
nice <- someFunc(x = "nice", y = "yippie", z = 3)
```
Functions with many arguments may be made more legible by making them vertical and aligning the equals signs:
```r
coolFunction(
arg1 = "hello",
arg2 = "world",
numbers = 1:10,
ok = letters[1:10],
morestuff = TRUE,
lessstuff = FALSE
)
```
- An opening curly brace should never go on its own line; a closing curly brace should always go on its own line. See [curly braces](https://google.github.io/styleguide/Rguide.xml#curlybraces). Omit curly braces where possible, such as with single-statement if-blocks:
```r
if (condition)
doSomething(with = argument)
```
- See [else](https://google.github.io/styleguide/Rguide.xml#else). If it fits, single-line if-else statements are also allowed:
```r
if (condition) doSomething() else doSomethingElse()
```
- Make function returns explicit in if statements.
```r
myFunc <- function(sth) {
if (sth > 10) {
return("bigger")
} else if (sth > 5) {
return("big")
} else {
return("small")
}
}
```
otherwise, return may be used but is not required.
```r
myFunc <- function(sth) {
sth2 <- sth^2
sth2
}
```
- `camelCasing` or `lowercase` for variable names.
- Main analysis functions have the format `SomeCoolAnalysis()`, as well as all other functions called by the user interface.
- R internal functions have the format `.[name]ReadData()` where `[name]` is a unique short identifier of the analysis.
- Follow the (`analysis-skeleton.R`)[https://github.com/jasp-stats/jasp-desktop/blob/development/Docs/development/analysis-skeleton.R] file for structuring analyses.
- Each file starts with the following copyright notice (edit the date if necessary):
```r
#
# Copyright (C) 2018 University of Amsterdam
#
# 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/>.
#
```
- Put comments where necessary.
- Denote to-dos with `# TODO(username) my thing todo in this code section`.
| boutinb/jasp-desktop | Docs/development/r-style-guide.md | Markdown | agpl-3.0 | 4,137 |
๏ปฟusing System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using NHibernate.Cfg;
using NHibernate.Hql.Ast;
using NHibernate.Linq.Functions;
using NHibernate.Linq.Visitors;
using NHibernate.Util;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.GH1879
{
[TestFixture]
public class CoalesceChildThenAccessExtensionMethod : GH1879BaseFixture<Issue>
{
protected override void OnSetUp()
{
using (var session = OpenSession())
using (var transaction = session.BeginTransaction())
{
var clientA = new Client { Name = "Albert" };
var clientB = new Client { Name = "Bob" };
var corpA = new CorporateClient { Name = "Alpha", CorporateId = "1234" };
var corpB = new CorporateClient { Name = "Beta", CorporateId = "5647" };
var clientZ = new Client { Name = null }; // A null value should propagate if the entity is non-null
session.Save(clientA);
session.Save(clientB);
session.Save(corpA);
session.Save(corpB);
session.Save(clientZ);
var projectA = new Project { Name = "A", BillingClient = null, Client = clientA };
var projectB = new Project { Name = "B", BillingClient = corpB, Client = clientA };
var projectC = new Project { Name = "C", BillingClient = null, Client = clientB };
var projectD = new Project { Name = "D", BillingClient = corpA, Client = clientB };
var projectE = new Project { Name = "E", BillingClient = clientZ, Client = clientA };
var projectZ = new Project { Name = "Z", BillingClient = null, Client = null };
session.Save(projectA);
session.Save(projectB);
session.Save(projectC);
session.Save(projectD);
session.Save(projectE);
session.Save(projectZ);
session.Save(new Issue { Name = "01", Project = null, Client = null });
session.Save(new Issue { Name = "02", Project = null, Client = clientA });
session.Save(new Issue { Name = "03", Project = null, Client = clientB });
session.Save(new Issue { Name = "04", Project = projectC, Client = clientA });
session.Save(new Issue { Name = "05", Project = projectA, Client = clientB });
session.Save(new Issue { Name = "06", Project = projectB, Client = clientA });
session.Save(new Issue { Name = "07", Project = projectD, Client = clientB });
session.Save(new Issue { Name = "08", Project = projectZ, Client = corpA });
session.Save(new Issue { Name = "09", Project = projectZ, Client = corpB });
session.Save(new Issue { Name = "10", Project = projectE, Client = clientA });
session.Flush();
transaction.Commit();
}
}
protected override void Configure(Configuration configuration)
{
configuration.LinqToHqlGeneratorsRegistry<TestLinqToHqlGeneratorsRegistry>();
}
private class TestLinqToHqlGeneratorsRegistry : DefaultLinqToHqlGeneratorsRegistry
{
public TestLinqToHqlGeneratorsRegistry()
{
this.Merge(new TestHqlGeneratorForMethod());
}
}
private class TestHqlGeneratorForMethod : IHqlGeneratorForMethod
{
/// <inheritdoc />
public IEnumerable<MethodInfo> SupportedMethods => new []
{
ReflectHelper.GetMethodDefinition<Client>(x => x.NameByExtension()),
};
/// <inheritdoc />
public HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
{
return treeBuilder.Dot(visitor.Visit(arguments[0]).AsExpression(), treeBuilder.Ident("Name").AsExpression());
}
}
[Test]
public void WhereClause()
{
AreEqual(
// Actual
q => q.Where(i => (i.Project.BillingClient ?? i.Project.Client ?? i.Client).NameByExtension().StartsWith("A")),
// Expected
q => q.Where(i => (i.Project.BillingClient != null ? i.Project.BillingClient.NameByExtension() : i.Project.Client != null ? i.Project.Client.NameByExtension() : i.Client.NameByExtension()).StartsWith("A"))
);
}
[Test]
public void SelectClause()
{
AreEqual(
// Actual
q => q.OrderBy(i =>i.Name)
.Select(i => (i.Project.BillingClient ?? i.Project.Client ?? i.Client).NameByExtension()),
// Expected
q => q.OrderBy(i =>i.Name)
.Select(i => i.Project.BillingClient != null ? i.Project.BillingClient.NameByExtension() : i.Project.Client != null ? i.Project.Client.NameByExtension() : i.Client.NameByExtension())
);
}
[Test]
public void SelectClauseToAnon()
{
AreEqual(
// Actual
q => q.OrderBy(i =>i.Name)
.Select(i => new { Key =i.Name, Client = (i.Project.BillingClient ?? i.Project.Client ?? i.Client).NameByExtension() }),
// Expected
q => q.OrderBy(i =>i.Name)
.Select(i => new { Key =i.Name, Client = i.Project.BillingClient != null ? i.Project.BillingClient.NameByExtension() : i.Project.Client != null ? i.Project.Client.NameByExtension() : i.Client.NameByExtension() })
);
}
[Test]
public void OrderByClause()
{
AreEqual(
// Actual
q => q.OrderBy(i => (i.Project.BillingClient ?? i.Project.Client ?? i.Client).NameByExtension() ?? "ZZZ")
.ThenBy(i =>i.Name)
.Select(i =>i.Name),
// Expected
q => q.OrderBy(i => (i.Project.BillingClient != null ? i.Project.BillingClient.NameByExtension() : i.Project.Client != null ? i.Project.Client.NameByExtension() : i.Client.NameByExtension()) ?? "ZZZ")
.ThenBy(i =>i.Name)
.Select(i =>i.Name)
);
}
[Test]
public void GroupByClause()
{
AreEqual(
// Actual
q => q.GroupBy(i => (i.Project.BillingClient ?? i.Project.Client ?? i.Client).NameByExtension())
.OrderBy(x => x.Key ?? "ZZZ")
.Select(grp => new { grp.Key, Count = grp.Count() }),
// Expected
q => q.GroupBy(i => i.Project.BillingClient != null ? i.Project.BillingClient.NameByExtension() : i.Project.Client != null ? i.Project.Client.NameByExtension() : i.Client.NameByExtension())
.OrderBy(x => x.Key ?? "ZZZ")
.Select(grp => new { grp.Key, Count = grp.Count() })
);
}
}
}
| RogerKratz/nhibernate-core | src/NHibernate.Test/NHSpecificTest/GH1879/CoalesceChildThenAccessExtensionMethod.cs | C# | lgpl-2.1 | 6,108 |
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "circularclipboard.h"
using namespace TextEditor::Internal;
static const int kMaxSize = 10;
CircularClipboard::CircularClipboard()
: m_current(-1)
{}
CircularClipboard::~CircularClipboard()
{
}
CircularClipboard *CircularClipboard::instance()
{
static CircularClipboard clipboard;
return &clipboard;
}
void CircularClipboard::collect(const QMimeData *mimeData)
{
collect(QSharedPointer<const QMimeData>(mimeData));
}
void CircularClipboard::collect(const QSharedPointer<const QMimeData> &mimeData)
{
//Avoid duplicates
const QString text = mimeData->text();
for (QList< QSharedPointer<const QMimeData> >::iterator i = m_items.begin(); i != m_items.end(); ++i) {
if (mimeData == *i || text == (*i)->text()) {
m_items.erase(i);
break;
}
}
if (m_items.size() >= kMaxSize)
m_items.removeLast();
m_items.prepend(mimeData);
}
QSharedPointer<const QMimeData> CircularClipboard::next() const
{
if (m_items.isEmpty())
return QSharedPointer<const QMimeData>();
if (m_current == m_items.length() - 1)
m_current = 0;
else
++m_current;
return m_items.at(m_current);
}
void CircularClipboard::toLastCollect()
{
m_current = -1;
}
int CircularClipboard::size() const
{
return m_items.size();
}
| mornelon/QtCreator_compliments | src/plugins/texteditor/circularclipboard.cpp | C++ | lgpl-2.1 | 2,789 |
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="id" sourcelanguage="en">
<context>
<name>CmdRaytracingExportProject</name>
<message>
<location filename="../../Command.cpp" line="522"/>
<source>File</source>
<translation>Mengajukan</translation>
</message>
<message>
<location filename="../../Command.cpp" line="523"/>
<source>&Export project...</source>
<translation>&Export project...</translation>
</message>
<message>
<location filename="../../Command.cpp" line="524"/>
<source>Export a Raytracing project to a file</source>
<translation>Mengekspor sebuah proyek Raytracing ke file</translation>
</message>
</context>
<context>
<name>CmdRaytracingNewLuxProject</name>
<message>
<location filename="../../Command.cpp" line="756"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="757"/>
<source>New Luxrender project</source>
<translation>Proyek Luxrender baru</translation>
</message>
<message>
<location filename="../../Command.cpp" line="758"/>
<source>Insert new Luxrender project into the document</source>
<translation>Masukkan proyek Luxrender baru ke dalam dokumen</translation>
</message>
<message>
<location filename="../../Command.cpp" line="810"/>
<source>No template</source>
<translation>Tidak ada template</translation>
</message>
<message>
<location filename="../../Command.cpp" line="811"/>
<source>No template available</source>
<translation>Tidak ada template yang tersedia</translation>
</message>
</context>
<context>
<name>CmdRaytracingNewPartSegment</name>
<message>
<location filename="../../Command.cpp" line="438"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="439"/>
<source>Insert part</source>
<translation>Sisipkan bagian</translation>
</message>
<message>
<location filename="../../Command.cpp" line="440"/>
<source>Insert a new part object into a Raytracing project</source>
<translation>Menyisipkan objek bagian baru ke dalam sebuah proyek Raytracing</translation>
</message>
</context>
<context>
<name>CmdRaytracingNewPovrayProject</name>
<message>
<location filename="../../Command.cpp" line="321"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="322"/>
<source>New POV-Ray project</source>
<translation>New POV-Ray proyek</translation>
</message>
<message>
<location filename="../../Command.cpp" line="323"/>
<source>Insert new POV-Ray project into the document</source>
<translation>Masukkan baru POV-Ray proyek ke dalam dokumen</translation>
</message>
<message>
<location filename="../../Command.cpp" line="375"/>
<source>No template</source>
<translation>Tidak ada template</translation>
</message>
<message>
<location filename="../../Command.cpp" line="376"/>
<source>No template available</source>
<translation>Tidak ada template yang tersedia</translation>
</message>
</context>
<context>
<name>CmdRaytracingRender</name>
<message>
<location filename="../../Command.cpp" line="589"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="590"/>
<source>&Render</source>
<translation>&Memberikan</translation>
</message>
<message>
<location filename="../../Command.cpp" line="591"/>
<source>Renders the current raytracing project with an external renderer</source>
<translation>Merender proyek raytracing saat ini dengan perender eksternal</translation>
</message>
</context>
<context>
<name>CmdRaytracingResetCamera</name>
<message>
<location filename="../../Command.cpp" line="869"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="870"/>
<source>&Reset Camera</source>
<translation>& Reset Kamera</translation>
</message>
<message>
<location filename="../../Command.cpp" line="871"/>
<source>Sets the camera of the selected Raytracing project to match the current view</source>
<translation>Mengatur kamera dari proyek Raytracing yang dipilih agar sesuai dengan tampilan saat ini</translation>
</message>
</context>
<context>
<name>CmdRaytracingWriteCamera</name>
<message>
<location filename="../../Command.cpp" line="82"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="83"/>
<source>Export camera to POV-Ray...</source>
<translation>Ekspor kamera ke POV-Ray...</translation>
</message>
<message>
<location filename="../../Command.cpp" line="84"/>
<source>Export the camera position of the active 3D view in POV-Ray format to a file</source>
<translation>Ekspor posisi kamera dari tampilan 3D aktif dalam format POV-Ray ke file</translation>
</message>
</context>
<context>
<name>CmdRaytracingWritePart</name>
<message>
<location filename="../../Command.cpp" line="175"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="176"/>
<source>Export part to POV-Ray...</source>
<translation>Ekspor bagian ke POV-Ray...</translation>
</message>
<message>
<location filename="../../Command.cpp" line="177"/>
<source>Write the selected Part (object) as a POV-Ray file</source>
<translation>Menulis yang dipilih Part ( objek) sebagai POV-Ray berkas</translation>
</message>
</context>
<context>
<name>CmdRaytracingWriteView</name>
<message>
<location filename="../../Command.cpp" line="98"/>
<location filename="../../Command.cpp" line="237"/>
<location filename="../../Command.cpp" line="337"/>
<location filename="../../Command.cpp" line="772"/>
<source>No perspective camera</source>
<translation>Tidak ada kamera perspektif</translation>
</message>
<message>
<location filename="../../Command.cpp" line="99"/>
<location filename="../../Command.cpp" line="238"/>
<location filename="../../Command.cpp" line="338"/>
<source>The current view camera is not perspective and thus resulting in a POV-Ray image that may look different than what was expected.
Do you want to continue?</source>
<translation type="unfinished">The current view camera is not perspective and thus resulting in a POV-Ray image that may look different than what was expected.
Do you want to continue?</translation>
</message>
<message>
<location filename="../../Command.cpp" line="221"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../Command.cpp" line="222"/>
<source>Export view to POV-Ray...</source>
<translation>Tampilan ekspor ke POV-Ray...</translation>
</message>
<message>
<location filename="../../Command.cpp" line="223"/>
<source>Write the active 3D view with camera and all its content to a POV-Ray file</source>
<translation>Menulis 3D aktif pandangan dengan kamera dan semua isinya ke POV-Ray berkas</translation>
</message>
<message>
<location filename="../../Command.cpp" line="352"/>
<location filename="../../Command.cpp" line="787"/>
<source>No template</source>
<translation>Tidak ada template</translation>
</message>
<message>
<location filename="../../Command.cpp" line="353"/>
<location filename="../../Command.cpp" line="788"/>
<source>Cannot create a project because there is no template installed.</source>
<translation>Tidak dapat membuat projek karena tidak ada template terinstal.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="773"/>
<source>The current view camera is not perspective and thus resulting in a luxrender image that may look different than what was expected.
Do you want to continue?</source>
<translation type="unfinished">The current view camera is not perspective and thus resulting in a luxrender image that may look different than what was expected.
Do you want to continue?</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../../Command.cpp" line="135"/>
<location filename="../../Command.cpp" line="186"/>
<location filename="../../Command.cpp" line="248"/>
<location filename="../../Command.cpp" line="546"/>
<source>POV-Ray</source>
<translation>POV-Ray</translation>
</message>
<message>
<location filename="../../Command.cpp" line="136"/>
<location filename="../../Command.cpp" line="187"/>
<location filename="../../Command.cpp" line="249"/>
<location filename="../../Command.cpp" line="551"/>
<location filename="../../Command.cpp" line="665"/>
<source>All Files</source>
<translation>Semua data</translation>
</message>
<message>
<location filename="../../Command.cpp" line="137"/>
<location filename="../../Command.cpp" line="188"/>
<location filename="../../Command.cpp" line="251"/>
<location filename="../../Command.cpp" line="553"/>
<source>Export page</source>
<translation>Halaman ekspor</translation>
</message>
<message>
<location filename="../../Command.cpp" line="450"/>
<location filename="../../Command.cpp" line="537"/>
<location filename="../../Command.cpp" line="605"/>
<location filename="../../Command.cpp" line="883"/>
<source>Wrong selection</source>
<translation>Pilihan salah</translation>
</message>
<message>
<location filename="../../Command.cpp" line="451"/>
<source>Select a Part object.</source>
<translation>Pilih objek Bagian.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="461"/>
<location filename="../../Command.cpp" line="473"/>
<source>No Raytracing project to insert</source>
<translation>Tidak ada proyek Raytracing untuk dimasukkan</translation>
</message>
<message>
<location filename="../../Command.cpp" line="462"/>
<source>Create a Raytracing project to insert a view.</source>
<translation>Buat proyek Raytracing untuk menyisipkan tampilan.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="474"/>
<source>Select a Raytracing project to insert the view.</source>
<translation>Pilih proyek Raytracing untuk menyisipkan tampilan.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="538"/>
<location filename="../../Command.cpp" line="606"/>
<location filename="../../Command.cpp" line="884"/>
<source>Select one Raytracing project object.</source>
<translation>Pilih satu objek proyek Raytracing.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="542"/>
<source>Luxrender</source>
<translation>Luxrender</translation>
</message>
<message>
<location filename="../../Command.cpp" line="621"/>
<location filename="../../Command.cpp" line="627"/>
<source>POV-Ray not found</source>
<translation>POV-Ray tidak ditemukan</translation>
</message>
<message>
<location filename="../../Command.cpp" line="622"/>
<source>Please set the path to the POV-Ray executable in the preferences.</source>
<translation>Silakan mengatur yang jalan ke POV-Ray dieksekusi dalam preferensi.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="628"/>
<source>Please correct the path to the POV-Ray executable in the preferences.</source>
<translation>Harap perbaiki jalur ke POV-Ray yang dapat dieksekusi dalam preferensi.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="635"/>
<location filename="../../Command.cpp" line="641"/>
<source>Luxrender not found</source>
<translation>Luxrender tidak ditemukan</translation>
</message>
<message>
<location filename="../../Command.cpp" line="636"/>
<source>Please set the path to the luxrender or luxconsole executable in the preferences.</source>
<translation>Silakan mengatur yang jalan ke LuxRender atau luxconsole dieksekusi dalam preferensi.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="642"/>
<source>Please correct the path to the luxrender or luxconsole executable in the preferences.</source>
<translation>Perbaiki jalur ke luxrender atau luxconsole yang dapat dieksekusi dalam preferensi.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="654"/>
<source>POV-Ray file missing</source>
<translation>Berkas POV-Ray hilang</translation>
</message>
<message>
<location filename="../../Command.cpp" line="655"/>
<source>The POV-Ray project file doesn't exist.</source>
<translation>POV-Ray proyek berkas tidak ada.</translation>
</message>
<message>
<location filename="../../Command.cpp" line="661"/>
<location filename="../../Command.cpp" line="663"/>
<location filename="../../Command.cpp" line="666"/>
<source>Rendered image</source>
<translation>Gambar yang diberikan</translation>
</message>
<message>
<location filename="../../Command.cpp" line="723"/>
<source>Lux project file missing</source>
<translation>Berkas proyek Lux hilang</translation>
</message>
<message>
<location filename="../../Command.cpp" line="724"/>
<source>The Lux project file doesn't exist.</source>
<translation>Berkas proyek Lux tidak ada.</translation>
</message>
</context>
<context>
<name>RaytracingGui::DlgSettingsRay</name>
<message>
<location filename="../../DlgSettingsRay.ui" line="14"/>
<source>Raytracing</source>
<translation>Raytracing</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="26"/>
<source>Mesh export settings</source>
<translation>Pengaturan ekspor Mesh</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="52"/>
<source>Max mesh deviation:</source>
<translation>Max mesh deviasi :</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="80"/>
<source>Do not calculate vertex normals</source>
<translation>Jangan menghitung vertex normals</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="93"/>
<source>Write u,v coordinates</source>
<translation>Tulis koordinat u, v</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="109"/>
<source>Render</source>
<translation>Memberikan</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="127"/>
<source>POV-Ray executable:</source>
<translation>Eksekusi POV-Ray:</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="134"/>
<source>POV-Ray output parameters:</source>
<translation>Parameter keluaran POV-Ray :</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="143"/>
<source>The POV-Ray parameters to be passed to the render.</source>
<translation>The POV-Ray parameter yang akan diteruskan ke render .</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="146"/>
<source>+P +A</source>
<translation>+P +A</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="159"/>
<source>+W: </source>
<translation>+W: </translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="166"/>
<source>The width of the rendered image</source>
<translation>lebar dari gambar yang diberikan</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="185"/>
<source> +H : </source>
<translation> +H : </translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="192"/>
<source>The height of the rendered image</source>
<translation>Tinggi gambar yang diberikan</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="213"/>
<source>Luxrender executable:</source>
<translation>Luxrender dapat dieksekusi:</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="220"/>
<source>The path to the luxrender (or luxconsole) executable</source>
<translation>path ke LuxRender (atau luxconsole) executable</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="238"/>
<source>Directories</source>
<translation>Direktori</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="258"/>
<source>Part file name:</source>
<translation> Nama file bagian :</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="265"/>
<source>Camera file name:</source>
<translation>Nama file kamera :</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="275"/>
<location filename="../../DlgSettingsRay.ui" line="298"/>
<location filename="../../DlgSettingsRay.ui" line="314"/>
<source>Used by utility tools</source>
<translation>Digunakan oleh alat utilitas</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="291"/>
<source>Default Project dir:</source>
<translation>Default dir proyek:</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="301"/>
<source>TempCamera.inc</source>
<translation>TempCamera.inc</translation>
</message>
<message>
<location filename="../../DlgSettingsRay.ui" line="317"/>
<source>TempPart.inc</source>
<translation>TempPart.inc</translation>
</message>
</context>
<context>
<name>RaytracingGui::DlgSettingsRayImp</name>
<message>
<location filename="../../DlgSettingsRayImp.cpp" line="47"/>
<source>The path to the POV-Ray executable, if you want to render from %1</source>
<translation type="unfinished">The path to the POV-Ray executable, if you want to render from %1</translation>
</message>
</context>
<context>
<name>RaytracingGui::ViewProviderLux</name>
<message>
<location filename="../../ViewProvider.cpp" line="68"/>
<source>Edit LuxRender project</source>
<translation>Edit proyek LuxRender</translation>
</message>
<message>
<location filename="../../ViewProvider.cpp" line="99"/>
<source>LuxRender template</source>
<translation>Template LuxRender</translation>
</message>
<message>
<location filename="../../ViewProvider.cpp" line="99"/>
<source>Select a LuxRender template</source>
<translation>Pilih template LuxRender</translation>
</message>
</context>
<context>
<name>RaytracingGui::ViewProviderPovray</name>
<message>
<location filename="../../ViewProvider.cpp" line="147"/>
<source>Edit Povray project</source>
<translation>Edit proyek Povray</translation>
</message>
<message>
<location filename="../../ViewProvider.cpp" line="178"/>
<source>Povray template</source>
<translation>Template povray</translation>
</message>
<message>
<location filename="../../ViewProvider.cpp" line="178"/>
<source>Select a Povray template</source>
<translation>Pilih template Povray</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location filename="../../Workbench.cpp" line="37"/>
<source>&Raytracing</source>
<translation>& Raytracing</translation>
</message>
</context>
</TS>
| Fat-Zer/FreeCAD_sf_master | src/Mod/Raytracing/Gui/Resources/translations/Raytracing_id.ts | TypeScript | lgpl-2.1 | 21,161 |
#include <QTimer>
#include <QDebug>
#include "compressionhandler.h"
#include "xmpp/zlib/zlibcompressor.h"
#include "xmpp/zlib/zlibdecompressor.h"
CompressionHandler::CompressionHandler()
: errorCode_(0)
{
outgoing_buffer_.open(QIODevice::ReadWrite);
compressor_ = new ZLibCompressor(&outgoing_buffer_);
incoming_buffer_.open(QIODevice::ReadWrite);
decompressor_ = new ZLibDecompressor(&incoming_buffer_);
}
CompressionHandler::~CompressionHandler()
{
delete compressor_;
delete decompressor_;
}
void CompressionHandler::writeIncoming(const QByteArray& a)
{
//qDebug("CompressionHandler::writeIncoming");
//qDebug() << QString("Incoming %1 bytes").arg(a.size());
errorCode_ = decompressor_->write(a);
if (!errorCode_)
QTimer::singleShot(0, this, SIGNAL(readyRead()));
else
QTimer::singleShot(0, this, SIGNAL(error()));
}
void CompressionHandler::write(const QByteArray& a)
{
//qDebug() << QString("CompressionHandler::write(%1)").arg(a.size());
errorCode_ = compressor_->write(a);
if (!errorCode_)
QTimer::singleShot(0, this, SIGNAL(readyReadOutgoing()));
else
QTimer::singleShot(0, this, SIGNAL(error()));
}
QByteArray CompressionHandler::read()
{
//qDebug("CompressionHandler::read");
QByteArray b = incoming_buffer_.buffer();
incoming_buffer_.buffer().clear();
incoming_buffer_.reset();
return b;
}
QByteArray CompressionHandler::readOutgoing(int* i)
{
//qDebug("CompressionHandler::readOutgoing");
//qDebug() << QString("Outgoing %1 bytes").arg(outgoing_buffer_.size());
QByteArray b = outgoing_buffer_.buffer();
outgoing_buffer_.buffer().clear();
outgoing_buffer_.reset();
*i = b.size();
return b;
}
int CompressionHandler::errorCode()
{
return errorCode_;
}
| harishnavnit/iris | src/xmpp/xmpp-core/compressionhandler.cpp | C++ | lgpl-2.1 | 1,709 |
/*
* Copyright (C) 2015-2019 Freie Universitรคt Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup net_ieee802154 IEEE802.15.4
* @ingroup net
* @brief IEEE802.15.4 header definitions and utility functions
* @{
*
* @file
* @brief IEEE 802.15.4 header definitions
*
* @author Hauke Petersen <[email protected]>
*/
#ifndef NET_IEEE802154_H
#define NET_IEEE802154_H
#include <stdint.h>
#include <stdlib.h>
#include "byteorder.h"
#include "net/eui64.h"
#include "kernel_defines.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Default start frame delimiter
*/
#define IEEE802154_SFD (0xa7)
/**
* @brief IEEE 802.15.4 address lengths
* @{
*/
#define IEEE802154_SHORT_ADDRESS_LEN (2U) /**< short (16-bit) address */
#define IEEE802154_LONG_ADDRESS_LEN (8U) /**< long address (EUI-64) */
/**
* @}
*/
/**
* @brief IEEE802.15.4 FCF field definitions
* @{
*/
#define IEEE802154_MAX_HDR_LEN (23U)
#define IEEE802154_MIN_FRAME_LEN (IEEE802154_FCF_LEN + sizeof(uint8_t))
#define IEEE802154_FCF_LEN (2U)
#define IEEE802154_FCS_LEN (2U)
#define IEEE802154_FCF_TYPE_MASK (0x07)
#define IEEE802154_FCF_TYPE_BEACON (0x00)
#define IEEE802154_FCF_TYPE_DATA (0x01)
#define IEEE802154_FCF_TYPE_ACK (0x02)
#define IEEE802154_FCF_TYPE_MACCMD (0x03)
#define IEEE802154_FCF_SECURITY_EN (0x08) /**< enable security */
#define IEEE802154_FCF_FRAME_PEND (0x10) /**< follow-up frame is pending */
#define IEEE802154_FCF_ACK_REQ (0x20) /**< acknowledgement requested from receiver */
#define IEEE802154_FCF_PAN_COMP (0x40) /**< compress source PAN ID */
#define IEEE802154_FCF_DST_ADDR_MASK (0x0c)
#define IEEE802154_FCF_DST_ADDR_VOID (0x00) /**< no destination address */
#define IEEE802154_FCF_DST_ADDR_RESV (0x04) /**< reserved address mode */
#define IEEE802154_FCF_DST_ADDR_SHORT (0x08) /**< destination address length is 2 */
#define IEEE802154_FCF_DST_ADDR_LONG (0x0c) /**< destination address length is 8 */
#define IEEE802154_FCF_VERS_MASK (0x30)
#define IEEE802154_FCF_VERS_V0 (0x00)
#define IEEE802154_FCF_VERS_V1 (0x10)
#define IEEE802154_FCF_SRC_ADDR_MASK (0xc0)
#define IEEE802154_FCF_SRC_ADDR_VOID (0x00) /**< no source address */
#define IEEE802154_FCF_SRC_ADDR_RESV (0x40) /**< reserved address mode */
#define IEEE802154_FCF_SRC_ADDR_SHORT (0x80) /**< source address length is 2 */
#define IEEE802154_FCF_SRC_ADDR_LONG (0xc0) /**< source address length is 8 */
/** @} */
/**
* @brief Channel ranges
* @{
*/
#define IEEE802154_CHANNEL_MIN_SUBGHZ (0U) /**< Minimum channel for sub-GHz band */
#define IEEE802154_CHANNEL_MAX_SUBGHZ (10U) /**< Maximum channel for sub-GHz band */
#define IEEE802154_CHANNEL_MIN (11U) /**< Minimum channel for 2.4 GHz band */
#define IEEE802154_CHANNEL_MAX (26U) /**< Maximum channel for 2.4 GHz band */
/** @} */
#define IEEE802154_FRAME_LEN_MAX (127U) /**< maximum 802.15.4 frame length */
#define IEEE802154G_FRAME_LEN_MAX (2047U) /**< maximum 802.15.4g-2012 frame length */
#define IEEE802154_ACK_FRAME_LEN (5U) /**< ACK frame length */
/**
* @brief Number of symbols to wait during Long Inter Frame Spacing
*/
#define IEEE802154_LIFS_SYMS (40U)
/**
* @brief Number of symbols to wait during Short Inter Frame Spacing
*/
#define IEEE802154_SIFS_SYMS (12U)
/**
* @brief Maximum frame size to consider a frame as short.
*/
#define IEEE802154_SIFS_MAX_FRAME_SIZE (18U)
/**
* @brief value of measured power when RSSI is zero.
*
* This value is defined in the IEEE 802.15.4 standard
*/
#define IEEE802154_RADIO_RSSI_OFFSET (-174)
#define IEEE802154_PHY_MR_FSK_PHR_LEN (2) /**< MR-FSK PHY header length */
#define IEEE802154_PHY_MR_FSK_2FSK_SFD_LEN (2) /**< MR-FSK SFD length on Filtered 2-FSK */
/**
* For the MR-FSK PHY, the SFD value when PHR + PSDU are coded/uncoded and with
* phyMRFSKSFD = 0 or 1 respectively
*
* 802.15.4g, Table 131 (p. 51)
*
* @{
*/
#define IEEE802154_PHY_MR_FSK_2FSK_CODED_SFD_0 (0x6F4E)
#define IEEE802154_PHY_MR_FSK_2FSK_CODED_SFD_1 (0x632D)
#define IEEE802154_PHY_MR_FSK_2FSK_UNCODED_SFD_0 (0x90E4)
#define IEEE802154_PHY_MR_FSK_2FSK_UNCODED_SFD_1 (0x7A0E)
/** @} */
/**
* For the SUN PHYs, the value is 1 ms expressed in symbol periods, rounded
* up to the next integer number of symbol periods using the ceiling() function.
*
* 802.15.4g, Table 70 (p. 43)
*/
#define IEEE802154G_ATURNAROUNDTIME_US (1 * US_PER_MS)
/**
* IEEE Std 802.15.4-2020
* Table 11-1โPHY constants: The value is 12 for all other PHYs.
*/
#define IEEE802154_ATURNAROUNDTIME_IN_SYMBOLS (12)
/**
* IEEE Std 802.15.4-2020
* Table 11-1โPHY constants: For all other PHYsยน, the duration of
* 8 symbol periods.
*
* [1] all but MR-O-QPSK
*/
#define IEEE802154_CCA_DURATION_IN_SYMBOLS (8)
/**
* @brief 802.15.4 PHY modes
*/
typedef enum {
IEEE802154_PHY_DISABLED, /**< PHY disabled, no mode selected */
IEEE802154_PHY_BPSK, /**< Binary Phase Shift Keying */
IEEE802154_PHY_ASK, /**< Amplitude-Shift Keying */
IEEE802154_PHY_OQPSK, /**< Offset Quadrature Phase-Shift Keying */
IEEE802154_PHY_MR_OQPSK, /**< Multi-Rate Offset Quadrature Phase-Shift Keying */
IEEE802154_PHY_MR_OFDM, /**< Multi-Rate Orthogonal Frequency-Division Multiplexing */
IEEE802154_PHY_MR_FSK /**< Multi-Rate Frequency Shift Keying */
} ieee802154_phy_mode_t;
/**
* @brief 802.15.4 forward error correction schemes
*/
enum {
IEEE802154_FEC_NONE, /**< no forward error correction */
IEEE802154_FEC_NRNSC, /**< non-recursive and non-systematic code */
IEEE802154_FEC_RSC /**< recursive and systematic code */
};
/**
* @brief Special address definitions
* @{
*/
/**
* @brief Static initializer for broadcast address
*/
#define IEEE802154_ADDR_BCAST { 0xff, 0xff }
/**
* @brief Length in byte of @ref IEEE802154_ADDR_BCAST
*/
#define IEEE802154_ADDR_BCAST_LEN (IEEE802154_SHORT_ADDRESS_LEN)
/**
* @brief Broadcast address
*/
extern const uint8_t ieee802154_addr_bcast[IEEE802154_ADDR_BCAST_LEN];
/** @} */
/**
* @defgroup net_ieee802154_conf IEEE802.15.4 compile configurations
* @ingroup config
* @{
*/
/**
* @brief IEEE802.15.4 default PHY mode
* @{
*/
#if IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_BPSK)
#define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_BPSK
#elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_ASK)
#define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_ASK
#elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_OQPSK)
#define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_OQPSK
#elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_MR_OQPSK)
#define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_MR_OQPSK
#elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_MR_OFDM)
#define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_MR_OFDM
#elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_MR_FSK)
#define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_MR_FSK
#endif
#ifndef CONFIG_IEEE802154_DEFAULT_PHY_MODE
#define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_OQPSK
#endif
/** @} */
/**
* @brief IEEE802.15.4 default sub-GHZ channel
*/
#ifndef CONFIG_IEEE802154_DEFAULT_SUBGHZ_CHANNEL
#define CONFIG_IEEE802154_DEFAULT_SUBGHZ_CHANNEL (5U)
#endif
/**
* @brief IEEE802.15.4 default channel
*/
#ifndef CONFIG_IEEE802154_DEFAULT_CHANNEL
#define CONFIG_IEEE802154_DEFAULT_CHANNEL (26U)
#endif
/**
* @brief IEEE802.15.4 default sub-GHZ page
*/
#ifndef CONFIG_IEEE802154_DEFAULT_SUBGHZ_PAGE
#define CONFIG_IEEE802154_DEFAULT_SUBGHZ_PAGE (2U)
#endif
/**
* @brief IEEE802.15.4 default PANID
*/
#ifndef CONFIG_IEEE802154_DEFAULT_PANID
#define CONFIG_IEEE802154_DEFAULT_PANID (0x0023U)
#endif
/**
* @brief IEEE802.15.4 Broadcast PANID
*/
#ifndef IEEE802154_PANID_BCAST
#define IEEE802154_PANID_BCAST { 0xff, 0xff }
#endif
/**
* @brief IEEE802.15.4 default TX power (in dBm)
*/
#ifndef CONFIG_IEEE802154_DEFAULT_TXPOWER
#define CONFIG_IEEE802154_DEFAULT_TXPOWER (0)
#endif
/** @} */
/**
* @brief IEEE802.15.4 default value for minimum backoff exponent
*/
#ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_MIN_BE
#define CONFIG_IEEE802154_DEFAULT_CSMA_CA_MIN_BE (3U)
#endif
/**
* @brief IEEE802.15.4 default value for maximum number of CSMA-CA retries.
*/
#ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_RETRIES
#define CONFIG_IEEE802154_DEFAULT_CSMA_CA_RETRIES (4U)
#endif
/**
* @brief IEEE802.15.4 default value for maximum backoff exponent
*/
#ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_MAX_BE
#define CONFIG_IEEE802154_DEFAULT_CSMA_CA_MAX_BE (5U)
#endif
/**
* @brief IEEE802.15.4 default value for CCA threshold (in dBm)
*/
#ifndef CONFIG_IEEE802154_CCA_THRESH_DEFAULT
#define CONFIG_IEEE802154_CCA_THRESH_DEFAULT (-70)
#endif
/**
* @brief Disable Auto ACK support
*/
#ifdef DOXYGEN
#define CONFIG_IEEE802154_AUTO_ACK_DISABLE 0
#endif
/**
* @brief Initializes an IEEE 802.15.4 MAC frame header in @p buf.
*
* @pre Resulting header must fit in memory allocated at @p buf.
*
* @see IEEE Std 802.15.4-2011, 5.2.1 General MAC frame format.
*
* If @p dst is NULL the IEEE802154_FCF_ACK_REQ will be unset to prevent
* flooding the network.
*
* @param[out] buf Target memory for frame header.
* @param[in] src Source address for frame in network byteorder.
* May be NULL if @ref IEEE802154_FCF_SRC_ADDR_VOID is set
* in @p flags.
* @param[in] src_len Length of @p src. Legal values are:
* * 0 (will set @ref IEEE802154_FCF_SRC_ADDR_VOID in MHR)
* * 2 (will set @ref IEEE802154_FCF_SRC_ADDR_SHORT in MHR)
* * 8 (will set @ref IEEE802154_FCF_SRC_ADDR_LONG in MHR)
* @param[in] dst Destination address for frame in network byteorder.
* May be NULL if @ref IEEE802154_FCF_SRC_ADDR_VOID is set
* in @p flags.
* @param[in] dst_len Length of @p dst. Legal values are:
* * 0 (will set @ref IEEE802154_FCF_DST_ADDR_VOID in MHR)
* * 2 (will set @ref IEEE802154_FCF_DST_ADDR_SHORT in MHR)
* * 8 (will set @ref IEEE802154_FCF_DST_ADDR_LONG in MHR)
* @param[in] src_pan Source PAN ID in little-endian. May be 0 if
* @ref IEEE802154_FCF_PAN_COMP is set in @p flags.
* Otherwise, it will be ignored, when
* @ref IEEE802154_FCF_PAN_COMP is set.
* @param[in] dst_pan Destination PAN ID in little-endian.
* @param[in] flags Flags for the frame. These are interchangeable with the
* first byte of the IEEE 802.15.4 FCF. This means that
* it encompasses the type values,
* @ref IEEE802154_FCF_SECURITY_EN,
* @ref IEEE802154_FCF_FRAME_PEND, and
* @ref IEEE802154_FCF_ACK_REQ.
* @param[in] seq Sequence number for frame.
*
* The version field in the FCF will be set implicitly to version 1.
*
* @return Size of frame header on success.
* @return 0, on error (flags set to unexpected state).
*/
size_t ieee802154_set_frame_hdr(uint8_t *buf, const uint8_t *src, size_t src_len,
const uint8_t *dst, size_t dst_len,
le_uint16_t src_pan, le_uint16_t dst_pan,
uint8_t flags, uint8_t seq);
/**
* @brief Get length of MAC header.
*
* @todo include security header implications
*
* @param[in] mhr MAC header.
*
* @return Length of MAC header on success.
* @return 0, on error (source mode or destination mode set to reserved).
*/
size_t ieee802154_get_frame_hdr_len(const uint8_t *mhr);
/**
* @brief Gets source address from MAC header.
*
* @pre (@p src != NULL) && (@p src_pan != NULL)
*
* @param[in] mhr MAC header.
* @param[out] src Source address in network byte order in MAC header.
* @param[out] src_pan Source PAN little-endian byte order in MAC header.
*
* @return Length of source address.
* @return -EINVAL, if @p mhr contains unexpected flags.
*/
int ieee802154_get_src(const uint8_t *mhr, uint8_t *src, le_uint16_t *src_pan);
/**
* @brief Gets destination address from MAC header.
*
* @pre (@p dst != NULL) && (@p dst_pan != NULL)
*
* @param[in] mhr MAC header.
* @param[out] dst Destination address in network byte order in MAC header.
* @param[out] dst_pan Destination PAN in little-endian byte order in MAC header.
*
* @return Length of destination address.
* @return -EINVAL, if @p mhr contains unexpected flags.
*/
int ieee802154_get_dst(const uint8_t *mhr, uint8_t *dst, le_uint16_t *dst_pan);
/**
* @brief Check whether a frame pass the IEEE 802.15.4 frame filter.
*
* A frame passes the frame filter only if:
* - The PAN ID matches the PAN ID of the frame filter or the broadcast PAN ID
* - Either the Short or Extended Address matches the frame filter OR the
* Short Address is the broadcast address.
*
* @param[in] mhr MAC header (PSDU)
* @param[in] pan PAN ID of the frame filter.
* @param[in] short_addr Short Address of the frame filter.
* @param[in] ext_addr Extended Address of the frame filter.
*
* @return 0 if frame passes the frame filter.
* @return 1 if frame doesn't pass the frame filter.
*/
int ieee802154_dst_filter(const uint8_t *mhr, uint16_t pan,
network_uint16_t short_addr, const eui64_t *ext_addr);
/**
* @brief Gets sequence number from MAC header.
*
* @pre length of allocated space at @p mhr > 3
*
* @param[in] mhr MAC header.
*
* @return The sequence number in @p mhr.
*/
static inline uint8_t ieee802154_get_seq(const uint8_t *mhr)
{
return mhr[2];
}
/**
* @brief Generates an IPv6 interface identifier from an IEEE 802.15.4 address.
*
* @pre (@p eui64 != NULL) && (@p addr != NULL)
* @see <a href="https://tools.ietf.org/html/rfc4944#section-6">
* RFC 4944, section 6
* </a>
* @see <a href="https://tools.ietf.org/html/rfc6282#section-3.2.2">
* RFC 6282, section 3.2.2
* </a>
*
* @param[out] eui64 The resulting EUI-64.
* @param[in] addr An IEEE 802.15.4 address.
* @param[in] addr_len The length of @p addr. Must be 2 (short address),
* 4 (PAN ID + short address), or 8 (long address).
*
* @return Copy of @p eui64 on success.
* @return NULL, if @p addr_len was of illegal length.
*/
static inline eui64_t *ieee802154_get_iid(eui64_t *eui64, const uint8_t *addr,
size_t addr_len)
{
int i = 0;
eui64->uint8[0] = eui64->uint8[1] = 0;
switch (addr_len) {
case 8:
eui64->uint8[0] = addr[i++] ^ 0x02;
eui64->uint8[1] = addr[i++];
eui64->uint8[2] = addr[i++];
eui64->uint8[3] = addr[i++];
eui64->uint8[4] = addr[i++];
eui64->uint8[5] = addr[i++];
eui64->uint8[6] = addr[i++];
eui64->uint8[7] = addr[i++];
break;
case 4:
eui64->uint8[0] = addr[i++] ^ 0x02;
eui64->uint8[1] = addr[i++];
/* Falls through. */
case 2:
eui64->uint8[2] = 0;
eui64->uint8[3] = 0xff;
eui64->uint8[4] = 0xfe;
eui64->uint8[5] = 0;
eui64->uint8[6] = addr[i++];
eui64->uint8[7] = addr[i++];
break;
default:
return NULL;
}
return eui64;
}
/**
* @brief Convert from RSSI scale to dBm.
*
* The RSSI calculation is based on the IEEE 802.15.4 2020 specification and
* it's represented as one octet of integer.
*
* RSSI equal to zero maps to -174 dBm and has the same scale as dBm (1 RSSI
* step == 1 dBm). Therefore an RSSI value of 254 maps to +80 dBm.
*
* @note RSSI == 255 is defined as reserved by the standard and ignored by this
* function.
*
* @param[in] rssi RF power in RSSI scale
*
* @return RF power in dBm scale
*/
static inline int16_t ieee802154_rssi_to_dbm(uint8_t rssi)
{
return rssi + IEEE802154_RADIO_RSSI_OFFSET;
}
/**
* @brief Convert from dBm scale to RSSI.
*
* The RSSI calculation is based on the IEEE 802.15.4 2020 specification and
* it's represented as one octet of integer.
*
* RSSI equal to zero maps to -174 dBm and has the same scale as dBm (1 RSSI
* step == 1 dBm). Therefore an RSSI value of 254 maps to +80 dBm.
*
* @param[in] dbm RF power in dBm scale.
*
* @return RF power in RSSI scale.
*/
static inline uint8_t ieee802154_dbm_to_rssi(int16_t dbm)
{
const int min = IEEE802154_RADIO_RSSI_OFFSET;
const int max = min + (UINT8_MAX - 1);
int val = dbm <= min ? min : (dbm >= max ? max : dbm);
return val - IEEE802154_RADIO_RSSI_OFFSET;
}
#ifdef __cplusplus
}
#endif
#endif /* NET_IEEE802154_H */
/** @} */
| ReneHerthel/RIOT | sys/include/net/ieee802154.h | C | lgpl-2.1 | 17,660 |
/* This file was generated by SableCC (http://www.sablecc.org/). */
package soot.jimple.parser.node;
public abstract class PExpression extends Node
{
// Empty body
}
| plast-lab/soot | src/main/generated/sablecc/soot/jimple/parser/node/PExpression.java | Java | lgpl-2.1 | 172 |
package org.intermine.sql.precompute;
/*
* Copyright (C) 2002-2017 FlyMine
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. See the LICENSE file for more
* information or http://www.gnu.org/copyleft/lesser.html.
*
*/
import java.sql.Connection;
import java.sql.SQLException;
import org.intermine.sql.query.ExplainResult;
import org.intermine.sql.query.Query;
/**
* Gets the database to explain each Query added and keeps hold of the best one, logging all
* actions for the benefit of the IqlShell user.
*
* @author Matthew Wakeling
*/
public class BestQueryExplainerVerbose extends BestQueryExplainer
{
private int unexplained = 0;
/**
* Constructs an empty BestQueryExplainerVerbose.
*
* @param con the Connection to use
* @param timeLimit the time limit
*/
public BestQueryExplainerVerbose(Connection con, long timeLimit) {
super(con, timeLimit);
}
/**
* {@inheritDoc}
*/
@Override
protected ExplainResult getExplainResult(Query q) throws SQLException {
if (unexplained != 0) {
System.out .println("Did not explain " + unexplained + " queries");
unexplained = 0;
}
long startTime = System.currentTimeMillis();
ExplainResult retval = ExplainResult.getInstance(q, con);
//System.out .println("Optimiser: Explained query with " + q.getFrom().size()
// + " FROM entries took " + (System.currentTimeMillis() - startTime) + " ms, "
// + retval.toString());
System.out .println("Optimiser: Explained query " + q + ", took "
+ (System.currentTimeMillis() - startTime) + " ms, " + retval.toString());
return retval;
}
/**
* {@inheritDoc}
*/
@Override
protected ExplainResult getExplainResult(String q) throws SQLException {
if (unexplained != 0) {
System.out .println("Did not explain " + unexplained + " queries");
unexplained = 0;
}
long startTime = System.currentTimeMillis();
ExplainResult retval = ExplainResult.getInstance(q, con);
System.out .println("Optimiser: Explained query " + q + ", took "
+ (System.currentTimeMillis() - startTime) + " ms, " + retval.toString());
return retval;
}
/**
* {@inheritDoc}
*/
@Override
protected void didNotExplain(@SuppressWarnings("unused") Candidate c) {
//if (c.getQuery() == null) {
// System.out .println("Optimiser: Not explaining query " + c.getQueryString());
//} else {
// System.out .println("Optimiser: Not explaining query with " + c.getQuery().getFrom()
// .size() + " FROM entries");
//}
unexplained++;
}
/**
* {@inheritDoc}
*/
@Override
public void throwBestQueryException(String message) throws BestQueryException {
System.out .println(message);
super.throwBestQueryException(message);
}
}
| elsiklab/intermine | intermine/objectstore/main/src/org/intermine/sql/precompute/BestQueryExplainerVerbose.java | Java | lgpl-2.1 | 3,131 |
// CFile.java -- general procs for writing .c files, excluding method code
package ru.dz.jpc.tanslator;
import ru.dz.jpc.classfile.*;
import java.io.*;
import java.util.*;
@Deprecated
class CFile {
static private Hashtable<String, String> declared; // set of class structs declared
static private StringBuffer strpool; // string character pool
static private int strnums[]; // indices of used strings
static private int strlens[]; // lengths of those string
static private int strcount; // number of used strings
static private int nsupers; // number of superclasses incl self
static private int ninters; // number of interfaces implemented
static private int nothers; // number of "other" classes referenced
// write(d, c) -- write header info for class c on stream d.
static void write(PrintWriter d, ClassData c)
{
declared = new Hashtable<String, String>(); // clear list of classes
// include general definitions, present class, ancestors, their interfaces
d.println();
d.println("#include \"toba.h\"");
for (ClassData t = c; t != null; t = t.superclass) {
include(d, t.name);
for (int i = 0; i < t.interfaces.length; i++)
include(d, t.interfaces[i].name);
}
// always include these two classes (needed by generated code):
include(d, "java.lang.String");
include(d, "java.lang.Class");
// include declarations for other referenced classes
for (int i = 1; i < c.constants.length; i++) {
Constant k = c.constants[i];
if (k != null && k.tag == Constant.CLASS) {
ClassRef cr = (ClassRef)k.value;
String s = Names.baseclass(cr.name);
if (s != null)
include(d, s);
}
}
declared = new Hashtable<String, String>(); // reset list of classes
supers(d, c); // generate superclass list
inters(d, c); // generate interfaces list
others(d, c); // generate others list
d.println();
d.println("extern const Char ch_" + c.cname + "[];"); // declare string pool
d.println("extern const void *st_" + c.cname + "[];"); // declare string ptrs
for (int i = 0; i < c.methods.length; i++) {
Field m = c.methods[i];
/* This is really static, but we have to declare it extern
* to get by the Irix C compiler which won't allow forward
* decls of arrays of unknown size. We can't create a Method
* structure now, because the variable use flags will be
* wrong unless we've done some of the later setup. */
d.println("extern Class xt_" + m.cname + "[];");// declare exceptn lists
}
hashgen(d, c); // generate hash table
clname(d, c); // generate class name string
cltables(d, c); // generate variable static tables
clstruct(d, c); // generate class structure
gfloats(d, c.constants); // generate floating constants
// initialize bookkeeping for string pool
strnums = new int[c.constants.length]; // init constant index array
strlens = new int[c.constants.length]; // init string lengths array
strpool = new StringBuffer(c.name); // init pool with class name
strlens[0] = c.name.length(); // record it as first entry
strcount = 1; // and count it
// generate method code
for (int i = 0; i < c.methods.length; i++) {
Method m = new Method(c, c.methods[i]);
MethGen.minfo(d, m); // always gen exception list
if ((m.fl.access & ClassData.ACC_ABSTRACT) == 0) {
// generate body code if not native
if ((m.fl.access & ClassData.ACC_NATIVE) == 0) {
try {
MethGen.mgen(d, m);
} catch (Error e) {
Trans.abort("method " + m.fl.name + ": " + e.getMessage());
}
}
// if synchronized, generate wrapper function
if ((m.fl.access & ClassData.ACC_SYNCHRONIZED) != 0)
MethGen.syncwrap(d, m);
}
}
// dump string pool
strdump(d, c);
}
// include(d, name) -- generate #include for a class, if not already generated
static private void include(PrintWriter d, String name)
{
name = Names.classfile(name);
if (!declared.containsKey(name)) {
d.println("#include \"" + name + ".h\"");
declared.put(name, "");
}
}
// supers(d, c) -- write list of superclasses.
static private void supers(PrintWriter d, ClassData c)
{
nsupers = 0;
d.println();
d.println("static const Class supers[] = {");
for (; c != null; c = c.superclass) {
d.println(" &cl_" + c.cname + ".C,");
declared.put(c.cname, "");
nsupers++;
}
d.println("};");
}
// inters(d, c) -- write list of interfaces implemented.
static private void inters(PrintWriter d, ClassData c)
{
ninters = 0;
d.println();
d.println("static const Class inters[] = {");
for (; c != null; c = c.superclass) {
for (int j = 0; j < c.interfaces.length; j++) {
String s = Names.hashclass(c.interfaces[j].name);
d.println(" &cl_" + s + ".C,");
declared.put(s, "");
ninters++;
}
}
if (ninters == 0)
d.println(" 0");
d.println("};");
}
// others(d, c) -- write list of other classes referenced.
static private void others(PrintWriter d, ClassData c)
{
nothers = 0;
d.println();
d.println("static const Class others[] = {");
for (int i = 1; i < c.constants.length; i++) {
Constant k = c.constants[i];
if (k != null && k.tag == Constant.CLASS) {
ClassRef cr = (ClassRef)k.value;
String s = Names.baseclass(cr.name);
if (s != null) {
s = Names.hashclass(s);
if (! declared.containsKey(s)) {
d.println(" &cl_" + s + ".C,");
nothers++;
}
}
}
}
if (nothers == 0)
d.println(" 0");
d.println("};");
}
// hashgen(d, c) -- generate hash table for finding interface methods
static private int hcols;
static private final int HColMax = 75;
static private void hashgen(PrintWriter d, ClassData c)
{
IHash h = new IHash(c);
d.println();
d.println("#define HASHMASK 0x" + Integer.toHexString(h.mask));
for (int i = 0; i < h.hlist.length; i++) {
Field m = h.hlist[i];
if (m != null) {
d.println("/* " + Integer.toHexString(i) + ". " +
Integer.toHexString(m.hashcode) + " (" +
Integer.toHexString(m.hashcode & h.mask) +
") " + m.name + " */");
}
}
d.print("static const struct ihash htable[" + h.hlist.length + "] = {");
hcols = HColMax;
for (int i = 0; i < h.hlist.length; i++) {
Field m = h.hlist[i];
if (m == null)
hashprint(d, " 0, 0,");
else
hashprint(d, " " + m.hashcode + ", &cl_" + c.cname + ".M." +
m.cname + ",");
}
d.println("\n};");
}
static private void hashprint(PrintWriter d, String s)
{
if (hcols + s.length() > HColMax) {
d.print("\n ");
hcols = 3;
}
d.print(s);
hcols += s.length();
}
/** Emit the name and signature unicode char arrays for a given set of
* fields, tagging each definition with something that indicates whether
* it's static/instance method/field. */
static private void
emitNamesSigs (PrintWriter d, // Where to write data
String tag, // Identifying tag
Field [] farr) // Array of fields
{
for (int i = 0; i < farr.length; i++) {
d.println ("static const Char nm" + tag + "_" + i + "[] = {");
Repr.emitCharData (d, farr [i].name);
d.println ("};");
d.println ("static const Char sg" + tag + "_" + i + "[] = {");
Repr.emitCharData (d, farr [i].signature);
d.println ("};");
}
return;
}
// clname(d, c) -- generate class name constant.
//
// Some class names are needed during initialization, but the string
// constant generated here is later replaced by an interned version.
static private void clname(PrintWriter d, ClassData c)
{
d.println();
d.println("static const CARRAY(" + c.name.length() +
") nmchars = {&acl_char, 0, " + c.name.length() + ", 0,");
Repr.emitCharData (d, c.name);
d.println("};");
d.println("static struct in_java_lang_String classname =");
d.println(" { &cl_java_lang_String, 0, (Object)&nmchars, 0, " +
c.name.length() + " };");
}
// cltables(d, c) -- generate variable static tables.
static private void cltables(PrintWriter d, ClassData c)
{
/* We have to match these structures from toba.h:
struct vt_generic {
int offset; If nonzero, is offset of field from instance start
void *addr; If nonnull, is address of class variable
const Char * name_chars; Name of the field
int name_len; Length of field name
const Char * sig_chars; Signature of the field
int sig_len; Length of field signature
int localp; Nonzero iff field is declared in this class (not superclass)
int access; Access flags for field
int classfilePos; Index of variable in original classfile
};
struct mt_generic {
TobaMethodInvokeType itype; Type/source of method
Void (*f) (); Function entry point
const Char * name_chars; Name of the method
int name_len; Length of method name
const Char * sig_chars; Signature of the method
int sig_len; Length of method signature
int localp; Nonzero iff method is declared in this class (not superclass)
int access; Access flags for method
int classfilePos; Index of method in original classfile
Class *xlist; Exception list, if local method
};
*/
/* Have to generate Java-format strings for instance and static fields,
* and instance and static methods, names and signatures both. */
emitNamesSigs (d, "cv", c.cvtable);
emitNamesSigs (d, "iv", c.ivtable);
emitNamesSigs (d, "sm", c.smtable);
emitNamesSigs (d, "im", c.imtable);
// Class variable table
d.println();
d.println("static struct vt_generic cv_table[] = {");
for (int i = 0; i < c.cvtable.length; i++) {
Field f = c.cvtable[i];
d.println(" {0," +
"&cl_" + c.cname + ".V." + f.cname +
",(const Char *)&nmcv_" + i + "," + f.name.length () +
",(const Char *)&sgcv_" + i + "," + f.signature.length () +
(f.isInArray (c.fields) ? ",1" : ",0") +
",0x" + Integer.toHexString (f.access) +
"," + f.classfilePos + "}, ");
}
if (c.cvtable.length == 0) {
d.println(" {0}");
}
d.println("};");
// Instance variable table
d.println();
// Define the offsetof macro
d.println("#ifndef offsetof");
d.println("#define offsetof(s,m) ((int)&(((s *)0))->m)");
d.println("#endif");
d.println("static struct vt_generic iv_table[] = {");
for (int i = 0; i < c.ivtable.length; i++) {
Field f = c.ivtable[i];
d.println(" { offsetof(struct in_" +c.cname+", " +f.cname+"), 0" +
",(const Char *)&nmiv_" + i + "," + f.name.length () +
",(const Char *)&sgiv_" + i + "," + f.signature.length () +
(f.isInArray (c.fields) ? ",1" : ",0") +
",0x" + Integer.toHexString (f.access) +
"," + f.classfilePos + "}, ");
}
if (c.ivtable.length == 0)
d.println(" {0}");
d.println("};");
d.println("#undef offsetof");
// Static method table
d.println();
d.println("static struct mt_generic sm_table[] = {");
for (int i = 0; i < c.smtable.length; i++) {
Field f = c.smtable[i];
int localp = f.isInArray (c.methods) ? 1 : 0;
d.println(" {TMIT_native_code, (Void(*)())" + f.cname +
",\n\t(const Char *)&nmsm_" + i + "," + f.name.length () +
",(const Char *)&sgsm_" + i + "," + f.signature.length () +
",\n\t" + localp + ",0x" + Integer.toHexString (f.access) +
"," + f.classfilePos +
"," + (localp == 1 ? ("xt_" + f.cname) : "0") + "},");
}
if (c.smtable.length == 0)
d.println(" {TMIT_undefined}");
d.println("};");
}
/** Search the class fields, and if any have initializers, create a function
* that will assign them before we start real execution; this will be
* needed for reflection. */
static private boolean
emitStaticFinalInit (PrintWriter d, // Where to write data
ClassData c) // Information on class
{
boolean haveSFI; // Have we started an SFI function?
haveSFI = false;
for (int i = 0; i < c.cvtable.length; i++) {
Field f = c.cvtable [i];
byte adata [];
int cind;
// See if the field has a constant value (initializer)
adata = Attribute.find (f.attributes, "ConstantValue");
if (null == adata) {
continue;
}
/* OK, it does. What's the value of the initializer? If the
* exception is thrown below, we probably had an invalid class
* file. */
cind = -1;
try {
cind = (new DataInputStream (new ByteArrayInputStream (adata))).readShort ();
} catch (IOException e) {
}
if (0 > cind) {
continue;
}
/* OK, we're going to need an SFI. If we haven't started one, do
* so now. */
if (! haveSFI) {
haveSFI = true;
d.println ();
d.println ("static void\ninitStaticFields (void) {");
d.println (" extern struct in_java_lang_String *intern_string(struct in_java_lang_String *str);");
}
/* Name of the field we're going to assign. */
String fname = "cl_" + c.cname + ".V." + f.cname;
/* Do the initialization within a separate block so we can define
* local variables to assign in the init. */
d.println (" {");
Constant ival = c.constants [cind];
switch (ival.tag) {
case Constant.LONG: // Just assign value
String s;
long v = ((Long)ival.value).longValue();
if (v > (long)Integer.MIN_VALUE && v < (long)Integer.MAX_VALUE)
{
s = ival.value.toString();
} else {
// now we must use "ANSI C" to construct a possibly
// "long long" val
int lh = (int)(v >>> 32);
int rh = (int)v;
s = "((((Long)0x" + Integer.toHexString(lh) +
"u) << 32) | ((Long)0x" + Integer.toHexString(rh) +
"u))";
}
d.println (" " + fname + " = " + s + ";");
break;
case Constant.FLOAT: { // Union integral representation with float
float fv;
fv = ((Float)ival.value).floatValue ();
d.println (" union fconst _fv = {0x" +
Integer.toHexString (Float.floatToIntBits (fv)) +
"};");
d.println (" " + fname + " = _fv.v;");
break;
}
case Constant.DOUBLE: { // Union integral repr with doublen
double dv;
dv = ((Double)ival.value).doubleValue ();
d.println (" union dconst _dv = {0x" +
Long.toHexString (Double.doubleToLongBits (dv)) +
"L};");
d.println (" " + fname + " = _dv.v;");
break;
}
case Constant.INTEGER: // Just the value
d.println (" " + fname + " = " +
((Integer)ival.value).toString() +
";");
break;
case Constant.STRING: {
/* Create a character array containing the data, then set
* up a java.lang.String object pointing to it. Remember to
* intern the string. */
String sv = (String) ival.value;
d.println (" static const CARRAY(" + sv.length () +
") _svchars = {&acl_char, 0, " + sv.length () + ", 0,");
Repr.emitCharData (d, sv);
d.println (" };");
d.println (" static struct in_java_lang_String _svjls =");
d.println (" { &cl_java_lang_String, 0, (Object) &_svchars, 0, " + sv.length () + "};");
d.println (" " + fname + " = intern_string (&_svjls);");
}
break;
default:
throw new InternalError ("Invalid constant type for static final initializer");
}
d.println (" }");
}
if (haveSFI) {
/* Close off the function if we have one. */
d.println ("}");
}
return haveSFI;
}
// clstruct(d, c) -- write class struct.
//
// Must be kept in sync with class struct definition in toba.h.
/* The class structure format number; keep this in sync with toba.h */
static private final int TOBA_CLASSSTRUCT_VERSION = 43;
static private void clstruct(PrintWriter d, ClassData c)
{
/* Emit the initializer function for static finals (if there is one);
* remember whether it's there so we can save its address for future
* invocation. */
boolean haveSFI = emitStaticFinalInit (d, c);
// First, generate a static canonical class reference for the class.
// We don't have a real toba.classfile.ClassRef structure, so do something
// that looks much the same. */
d.println();
d.println("#ifndef h_toba_classfile_ClassRef");
d.println("extern struct cl_generic cl_toba_classfile_ClassRef;");
d.println("#endif /* h_toba_classfile_ClassRef */");
d.println("static struct { /* pseudo in_toba_classfile_ClassRef */");
d.println(" struct cl_generic *class;");
d.println(" struct monitor *monitor;");
d.println(" Object name;");
d.println(" Object refClass;");
d.println(" Object loadedRefdClasses;");
d.println("} inr_" + c.cname + " = {");
d.println(" (struct cl_generic *)&cl_toba_classfile_ClassRef.C, 0, &classname, &cl_" +
c.cname + ".C.classclass, 0};");
d.println();
d.println("struct cl_" + c.cname + " cl_" + c.cname + " = { {");
if ((c.access & ClassData.ACC_INTERFACE) != 0)
d.println(" 1, 1,"); // needinit, flags (IS_RESOLVED == 1)
else
d.println(" 1, 0,");
d.println(" &classname,"); // class name String
d.println(" &cl_java_lang_Class.C, 0,"); // class Class instance
d.println(" sizeof(struct in_" + c.cname + "),");
d.println(" " + c.imtable.length + ",");
d.println(" " + c.smtable.length + ",");
d.println(" " + c.ivtable.length + ",");
d.println(" " + c.cvtable.length + ",");
d.println(" " + nsupers + ", supers,");
d.println(" " + ninters + ", " + c.interfaces.length +
", inters, HASHMASK, htable,");
d.println(" " + nothers + ", others,");
d.println(" 0, 0,"); // arrayclass, elemclass
d.println(" ch_" + c.cname + ","); // string pool
d.println(" st_" + c.cname + ","); // string list
methodref(d, c, "<clinit>", false); // class initializer
constructor(d, c); // constructor
methodref(d, c, "finalize", true); // finalizer
d.println(" " + (haveSFI ? "initStaticFields" : "0") + ",");
d.println(" 0,"); // classloader - 0 since
// system class loader
d.println(" " + CFile.TOBA_CLASSSTRUCT_VERSION + ","); // class structure version
d.println(" 0x" + Integer.toHexString (c.access) + ","); // class access flags
d.println(" 0,"); // class data (none to start)
d.println(" (struct in_toba_classfile_ClassRef *)&inr_" + c.cname + ","); // canonical class reference structure
d.println(" iv_table, cv_table,"); // variable tables
d.println(" sm_table},"); // static method table
methodsigs(d, c); // instance methods and sigs
d.println("};");
}
// methodref(d, c, name, climb) -- find "()V" method and write its name
static private void methodref
(PrintWriter d, ClassData c, String name, boolean climb)
{
Field m = c.getmethod(name, climb);
if (m != null)
d.println(" " + m.cname + ",");
else
d.println(" 0,"); // not found
}
// constructor(c, d) -- generate constructor or exception tosser reference
static private void constructor(PrintWriter d, ClassData c)
{
if ((c.access & (ClassData.ACC_ABSTRACT | ClassData.ACC_INTERFACE)) != 0) {
d.println(" throwInstantiationException,");
return;
}
Field m = c.getmethod("<init>", false);
if (m == null)
d.println(" throwNoSuchMethodError,");
else
d.println(" " + m.cname + ",");
}
// methodsigs(d, c) -- generate signatures and references for method table.
static private void methodsigs(PrintWriter d, ClassData c)
{
d.println (" { /* methodsigs */");
for (int i = 0; i < c.imtable.length; i++) {
Field m = c.imtable[i];
if ((m.access & ClassData.ACC_ABSTRACT) != 0)
d.print("\t{TMIT_abstract, 0");
else {
//String s = String.valueOf(m.hashcode);
d.print("\t{TMIT_native_code, " + m.cname);
}
int localp = m.isInArray (c.methods) ? 1 : 0;
d.println(",(const Char *)&nmim_" + i + "," + m.name.length () +
",\n\t(const Char *)&sgim_" + i + "," + m.signature.length() +
"," + localp + ",0x" + Integer.toHexString(m.access) +
"," + m.classfilePos + "," +
(localp == 1 ? ("xt_" + m.cname) : "0") + "},");
};
d.println(" } /* end of methodsigs */");
}
// gfloats(d, table) -- generated needed floating constants for class.
static void gfloats(PrintWriter d, Constant table[])
{
d.println();
for (int i = 1; i < table.length; i++) {
Constant c = table[i];
if (c == null || (c.tag != Constant.FLOAT && c.tag != Constant.DOUBLE))
continue;
double v = ((Number)c.value).doubleValue();
if (Repr.simplefloat(v))
continue; // will generate in-line value
if (c.tag == Constant.FLOAT)
d.println("static union fconst fc" + i + " = { 0x" +
Integer.toHexString(Float.floatToIntBits((float)v)) + " };");
else {
long b = Double.doubleToLongBits(v);
String lh = Integer.toHexString((int)(b >> 32));
String rh = Integer.toHexString((int)(b));
d.println("static union dconst dc" + i + " = { (ULong)0x" + lh +
"<<32 | (ULong)(UInt)0x" + rh + " };");
}
}
}
// strref(k) -- generate reference index for constant k, which is a string.
static int strref(Constant k)
{
int n;
n = strnums[k.index]; // get index into string pool
if (n != 0) // if already allocated
return n; // return index
// append to string pool and create a new slot
n = strcount++; // count entry
strpool.append((String)k.value); // append characters to pool
strlens[n] = ((String)k.value).length(); // remember length
strnums[k.index] = n; // remember index
return n; // and return it
}
// strdump(d, c) -- dump string pool on stream d for class c.
static void strdump(PrintWriter d, ClassData c)
{
String chname = "ch_" + c.cname;
// generate string pool (a C array of Chars)
d.println();
d.println();
d.println();
d.print("const Char " + chname + "[] = { /* string pool */");
Repr.emitCharData (d, strpool.toString ());
d.println("};");
// generate array of pointers to ends of strings
int base = 0; /* starting point of current string */
d.println();
d.println("const void *st_" + c.cname + "[] = {");
for (int i = 0; i < strcount; i++) {
/* generate pointer */
d.print(" " + chname + "+" + (base + strlens[i]) +
",\t/* " + i + ". ");
/* in comment, print first 40 chars of each constant */
for (int j = 0; j < Repr.GCHARS_PER_CMMT && j < strlens[i]; j++) {
char ch = strpool.charAt(base + j);
if (ch >= ' ' && ch <= '~' && ch != '/' && ch != '?')
d.print(ch);
else
d.print("%"); /* use % as stand-in for troublesome chars */
}
d.println(" */");
base += strlens[i]; /* incr base for next string */
}
d.println(" 0};"); /* terminate table with sentinel */
}
} // class CFile
| tectronics/phantomuserland | etc/attic/jpc/tanslator/CFile.java | Java | lgpl-3.0 | 24,127 |
/*******************************************************************************
* File Name: cyfitter_cfg.h
*
* PSoC Creator 4.2
*
* Description:
* This file provides basic startup and mux configuration settings
* This file is automatically generated by PSoC Creator.
*
********************************************************************************
* Copyright (c) 2007-2018 Cypress Semiconductor. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
********************************************************************************/
#ifndef CYFITTER_CFG_H
#define CYFITTER_CFG_H
#include "cytypes.h"
extern void cyfitter_cfg(void);
/* Analog Set/Unset methods */
#endif /* CYFITTER_CFG_H */
/*[]*/
| hackair-project/hackAIR-PSoC | SEN0177 - Laser Dust Sensor/PSoC Firmware/PSoC Creator Project/SerialLaserSensor_SEN0177.cydsn/codegentemp/cyfitter_cfg.h | C | lgpl-3.0 | 897 |
package main
import (
"fmt"
"github.com/Joker/jade"
"io/ioutil"
)
func main() {
dat, err := ioutil.ReadFile("template.jade")
if err != nil {
fmt.Printf("ReadFile error: %v", err)
return
}
tmpl, err := jade.Parse("name_of_tpl", string(dat))
if err != nil {
fmt.Printf("Parse error: %v", err)
return
}
fmt.Printf("\nOutput:\n\n%s", tmpl)
}
| tiagofernandez/boobot | vendor/src/github.com/Joker/jade/example/jade.go | GO | unlicense | 360 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_11) on Mon Jul 12 21:36:26 CEST 2010 -->
<TITLE>
Uses of Class org.apache.fop.fo.properties.FontShorthandProperty (Apache FOP 1.0 API)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Uses of Class org.apache.fop.fo.properties.FontShorthandProperty (Apache FOP 1.0 API)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/fop/fo/properties/FontShorthandProperty.html" title="class in org.apache.fop.fo.properties"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
fop 1.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="FontShorthandProperty.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.fop.fo.properties.FontShorthandProperty</B></H2>
</CENTER>
No usage of org.apache.fop.fo.properties.FontShorthandProperty
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/fop/fo/properties/FontShorthandProperty.html" title="class in org.apache.fop.fo.properties"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
fop 1.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="FontShorthandProperty.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
| lewismc/yax | lib/fop-1.0/javadocs/org/apache/fop/fo/properties/class-use/FontShorthandProperty.html | HTML | apache-2.0 | 5,933 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import mxnet as mx
from mxnet import np, npx
from mxnet.test_utils import same, use_np, assert_almost_equal
import random
import pytest
@use_np
@pytest.mark.parametrize('shape',
[(3, 2), (9,17), (2, 7, 1, 8)] + [(i,) for i in range(1,65)])
def test_contrib_intgemm_maxabsolute(shape):
if "intgemm_maxabsolute" not in dir(mx.nd.contrib):
return
# mx.nd API
m = mx.nd.random_uniform(low=-100.0, high=100.0, shape=shape)
fast = mx.nd.contrib.intgemm_maxabsolute(m)
slow = mx.nd.max(mx.nd.abs(m))
assert same(fast, slow)
# np API
m = np.random.uniform(low=-100.0, high=100.0, size=shape)
fast = npx.intgemm_maxabsolute(m).reshape(())
slow = np.max(np.abs(m))
assert same(fast, slow)
@use_np
@pytest.mark.parametrize('shape', [(i,) for i in range(1, 67)] + [(2,3), (130, 12)])
@pytest.mark.parametrize('max_quant', [2.0])
def test_contrib_intgemm_prepare_data(shape, max_quant):
if "intgemm_prepare_data" not in dir(mx.nd.contrib):
return
m = mx.nd.random_uniform(low=-3.0, high=3.0, shape=shape)
scaled = m * 127.0 / max_quant
# Rounding 0.5 can go up or down. Move values away from 0.5.
too_close = mx.nd.abs(mx.nd.round(scaled) - scaled) > 0.45
# Add 0.2 in scaled space so (0.45, 0.55) maps to (0.65, 0.75) which will round consistently.
m += max_quant / 127.0 * 0.2 * too_close
# Reference: scale and round
ref = mx.nd.round(m * 127.0 / max_quant)
# Clip to [-127, 127]. Because otherwise e.g. -129 casts to +127.
ref = mx.nd.broadcast_maximum(ref, mx.nd.array([-127.0]))
ref = mx.nd.broadcast_minimum(ref, mx.nd.array([127.0]))
# Reference: cast to int8
ref = mx.nd.cast(ref, dtype='int8')
# Reference: ban -128
ref = mx.nd.broadcast_maximum(ref, mx.nd.array([-127], dtype = 'int8'))
test = mx.nd.contrib.intgemm_prepare_data(m, mx.nd.array([max_quant]))
assert same(test, ref)
test = npx.intgemm_prepare_data(m.as_np_ndarray(), np.array([max_quant]))
assert same(test, ref.as_np_ndarray())
@use_np
@pytest.mark.parametrize('shape', [(8, 64), (16, 64), (8, 128), (16, 128), (2, 4, 64)])
@pytest.mark.parametrize('max_quant', [0.2, 3.0])
@pytest.mark.parametrize('api', [(mx.nd.contrib, mx.nd), (npx, np)])
def test_contrib_intgemm_weight_consistent(shape, max_quant, api):
# The weight format is actually CPU-dependent so we don't directly test the
# output, but indirectly test that it works.
if "intgemm_prepare_weight" not in dir(mx.nd.contrib):
return
contrib, top = api
max_array = top.array([max_quant])
if top == mx.nd:
m = top.random_uniform(low=-3.0, high=3.0, shape=shape)
else:
m = np.random.uniform(size=shape)
direct = contrib.intgemm_prepare_weight(m, max_array)
quant = contrib.intgemm_prepare_data(m, max_array)
indirect = contrib.intgemm_prepare_weight(quant, already_quantized=True)
# Should get the same data from direct call and already_quantized version.
assert same(direct, indirect)
@use_np
@pytest.mark.parametrize('indices', [
[0,1,2,3,4,5,6,7],
[1,2,1,2,1,2,1,2],
[7,6,5,4,3,2,1,0],
[3,1,4,1,5,9,2,6],
# Since random_uniform doesn't support int8, use python
[random.randint(0,15) for i in range(8)],
[random.randint(0,15) for i in range(16)],
[random.randint(0,15) for i in range(24)]
])
@pytest.mark.parametrize('api', [(mx.nd.contrib, mx.nd), (npx, np)])
def test_contrib_intgemm_take_weight(indices, api):
if "intgemm_take_weight" not in dir(mx.nd.contrib):
return
contrib, top = api
m = top.array([random.randint(-127,127) for i in range(16 * 64)], dtype='int8')
m = m.reshape((16, 64))
indices = top.array(indices, dtype='int32')
# Prepare weight then take.
test = contrib.intgemm_prepare_weight(m, already_quantized=True)
test = contrib.intgemm_take_weight(test, indices)
# Take then prepare.
ref = m.take(indices, axis=0)
ref = contrib.intgemm_prepare_weight(ref, already_quantized=True)
assert same(test, ref)
@use_np
@pytest.mark.parametrize('data_rows', range(1, 5))
@pytest.mark.parametrize('inner', range(64, 256, 64))
@pytest.mark.parametrize('weight_cols', range(8, 24, 8))
@pytest.mark.parametrize('api', [
(mx.nd.contrib, mx.nd, mx.nd.FullyConnected, mx.nd.cast),
(npx, np, npx.fully_connected, npx.cast)])
def test_contrib_intgemm_multiply(data_rows, inner, weight_cols, api):
if "intgemm_fully_connected" not in dir(mx.nd.contrib):
return
contrib, top, fully_connected, cast = api
#The multiplication routine has approximations so everything is tested
#deterministically to ensure bounds are met.
random.seed(1)
# Don't use full range (-127, 127) to avoid saturation.
data = [random.randint(-64, 64) for i in range(data_rows * inner)]
data = top.array(data, dtype='int8').reshape((data_rows, inner))
weight = [random.randint(-64, 64) for i in range(inner * weight_cols)]
weight = top.array(weight, dtype='int8').reshape((weight_cols, inner))
weight_prepared = contrib.intgemm_prepare_weight(weight, already_quantized=True)
# int32 output, no bias
test = contrib.intgemm_fully_connected(data,
weight_prepared,
no_bias=True,
flatten=False,
out_type='int32',
num_hidden=weight_cols)
ref = fully_connected(cast(data, dtype='float32'),
cast(weight, dtype='float32'),
no_bias=True,
flatten=False,
num_hidden=weight_cols)
assert_almost_equal(cast(test, dtype='float32'), ref, rtol=0.01, atol=0.01)
# float32 output, no bias
scale = 3.0
test = contrib.intgemm_fully_connected(data,
weight_prepared,
top.array([scale]),
no_bias=True,
flatten=False,
out_type='float32',
num_hidden=weight_cols)
assert_almost_equal(test, ref * scale, rtol=0.01, atol=0.01)
# int32 output, bias
bias = top.array([random.randint(-60000, 60000) for i in range(weight_cols)], dtype = 'int32')
test = contrib.intgemm_fully_connected(data,
weight_prepared,
bias,
no_bias=False,
flatten=False,
out_type='int32',
num_hidden=weight_cols)
ref = fully_connected(cast(data, dtype='float32'),
cast(weight, dtype='float32'),
cast(bias, dtype='float32'),
no_bias=False,
flatten=False,
num_hidden=weight_cols)
assert_almost_equal(cast(test, dtype='float32'), ref, rtol=0.01, atol=0.01)
# float32 output, bias
# Scaling is applied before bias (and bias is not scaled). So to make the
# reference comparison easy, just scale the bias beforehand.
test = contrib.intgemm_fully_connected(data,
weight_prepared,
top.array([scale]),
cast(bias, dtype='float32') * scale,
no_bias=False,
flatten=False,
out_type='float32',
num_hidden=weight_cols)
assert_almost_equal(test, ref * scale, rtol=0.01, atol=0.01)
# float32 input should work the same as manually prepared int8 input.
data_float = top.array([random.uniform(-3.14, 3.14) for i in range(data_rows * inner)])
data_float = data_float.reshape(data_rows, inner)
direct = contrib.intgemm_fully_connected(data_float,
weight_prepared,
top.array([scale]),
cast(bias, dtype='float32'),
no_bias=False,
flatten=False,
out_type='float32',
num_hidden=weight_cols)
maxabs = contrib.intgemm_maxabsolute(data_float)
data_prepared = contrib.intgemm_prepare_data(data_float, maxabs)
cooked = contrib.intgemm_fully_connected(data_prepared,
weight_prepared,
top.array(scale * maxabs / 127.0),
cast(bias, dtype='float32'),
no_bias=False,
flatten=False,
out_type='float32',
num_hidden=weight_cols)
assert_almost_equal(direct, cooked, rtol=0.01, atol=0.01)
| yajiedesign/mxnet | tests/python/unittest/test_contrib_intgemm.py | Python | apache-2.0 | 10,316 |
/*
* Copyright 2012 Amadeus s.a.s.
* 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.
*/
var Aria = require("../Aria");
var ariaUtilsOverlayLoadingOverlay = require("./overlay/LoadingOverlay");
var ariaUtilsType = require("./Type");
var ariaUtilsEvent = require("./Event");
var ariaUtilsAriaWindow = require("./AriaWindow");
var ariaTemplatesLayout = require("../templates/Layout");
/**
* This class contains utilities to show and hide a loading indicator above a DOM Element
* @singleton
*/
module.exports = Aria.classDefinition({
$classpath : "aria.utils.DomOverlay",
$singleton : true,
$statics : {
UNIQUE_ID_GENERATOR : 12
},
$constructor : function () {
/**
* List of overlays objects
* @type Object
*
* <pre>
* {
* uniqueId : aria.utils.overlay.LoadingOverlay
* }
* </pre>
*/
this.overlays = null;
/**
* Number of overlay objects in overlays.
* @type Number
*/
this._nbOverlays = 0;
/**
* Keep the overlay above the body in a special place since there's no need to destroy it on refresh
* @type aria.utils.overlay.LoadingOverlay
*/
this.bodyOverlay = null;
ariaUtilsAriaWindow.$on({
"unloadWindow" : this._reset,
scope : this
});
},
$destructor : function () {
this._reset();
ariaUtilsAriaWindow.$unregisterListeners(this);
},
$prototype : {
/**
* If it is not done already, notifies AriaWindow that we are starting to use Aria.$window, and registers the
* scroll event listener.
*/
_init : function () {
if (this.overlays == null) {
this.overlays = {};
ariaUtilsAriaWindow.attachWindow();
// Listen for scroll event to update the position of the overlay
ariaUtilsEvent.addListener(Aria.$window, "scroll", {
fn : this.__refresh,
scope : this
}, true);
ariaTemplatesLayout.$on({
"viewportResized" : this.__refresh,
scope : this
});
}
},
/**
* If it is not done already, unregisters the scroll event listener and notifies AriaWindow that we are no
* longer using Aria.$window.
*/
_reset : function () {
if (this.overlays != null) {
ariaUtilsEvent.removeListener(Aria.$window, "scroll", {
fn : this.__refresh
});
ariaTemplatesLayout.$removeListeners({
"viewportResized" : this.__refresh,
scope : this
});
ariaUtilsAriaWindow.detachWindow();
this.overlays = null;
this._nbOverlays = 0;
}
},
/**
* Create a DomOverlay above a DOM Element. This function should only be used for elements outside a template or a section.
*
* @param {HTMLElement} element See aria.utils.overlay.LoadingOverlay
* @param {Object|String} options See aria.utils.overlay.LoadingOverlay
*/
create : function (element, options) {
// Check if there is already an overlay on this element
var overlay = this.__getOverlay(element);
if (overlay) {
overlay.overlay.refresh();
return overlay.id;
}
// Generate an id for that
var id = ++this.UNIQUE_ID_GENERATOR;
// Create the overlay
overlay = new ariaUtilsOverlayLoadingOverlay(element, id, options);
this._init(); // check it is initialized
// Store the overlay internally
if (element !== Aria.$window.document.body) {
this.overlays[id] = overlay;
this._nbOverlays++;
// Store the id on the element expando
element.__overlay = id;
} else {
this.bodyOverlay = overlay;
}
return id;
},
/**
* Detach an overlay from a DOM Element
* @param {HTMLElement} element The element with an overlay to detach
*/
detachFrom : function (element) {
var overlayInfo = this.__getOverlay(element);
if (!overlayInfo) {
return;
}
// Dispose the overlay
overlayInfo.overlay.$dispose();
var id = overlayInfo.id;
// Remove any pointer
if (element === Aria.$window.document.body) {
this.bodyOverlay = null;
} else {
delete this.overlays[id];
this._nbOverlays--;
}
overlayInfo = null;
if (this._nbOverlays === 0 && this.bodyOverlay == null) {
this._reset();
}
return id;
},
/**
* Get the information about an overlay
* @private
* @param {HTMLElement} element
* @return {Object}
*
* <pre>
* {overlay: Overlay object, id : unique verlay id}
* </pre>
*/
__getOverlay : function (element) {
if (element === Aria.$window.document.body) {
return !this.bodyOverlay ? null : {
overlay : this.bodyOverlay
};
} else {
// Get the overlay object
var id = element.__overlay;
if (!id || this.overlays == null) {
return;
}
var overlay = this.overlays[id];
if (!overlay) {
element.__overlay = null;
return;
}
return {
overlay : overlay,
id : id
};
}
},
/**
* Refresh the position of the overlays
* @private
*/
__refresh : function () {
// Refresh any open overlay
this.$assert(184, this.overlays != null);
var overlays = this.overlays;
for (var key in overlays) {
if (overlays.hasOwnProperty(key)) {
var overlay = overlays[key];
overlay.refreshPosition();
}
}
if (this.bodyOverlay) {
this.bodyOverlay.refreshPosition();
}
},
/**
* Dispose a list of overlays specified by their unique identifier
* @param {Array} ids Array of overlay id
*/
disposeOverlays : function (ids) {
if (!ariaUtilsType.isArray(ids) || this.overlays == null) {
return;
}
for (var i = 0, len = ids.length; i < len; i += 1) {
var overlay = this.overlays[ids[i]];
if (overlay) {
overlay.$dispose();
delete this.overlays[ids[i]];
this._nbOverlays--;
}
}
if (this._nbOverlays === 0 && this.bodyOverlay == null) {
this._reset();
}
}
}
});
| vcarle/ariatemplates | src/aria/utils/DomOverlay.js | JavaScript | apache-2.0 | 7,995 |
๏ปฟusing System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Diamto-Google-plus-sample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Diamto-Google-plus-sample")]
[assembly: AssemblyCopyright("Copyright ยฉ 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("db4f3d86-85ed-421e-b423-223bbcdfa91a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| Ashokkumaresan/Google-Dotnet-Samples | Google-plus/Diamto-Google-plus-sample/Diamto-Google-plus-sample/Properties/AssemblyInfo.cs | C# | apache-2.0 | 1,426 |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="Stylesheet" href="../css/analysis.css" />
<script type="text/javascript">
function init() {
if (window.location.hash) {
var parentDiv, nodes, i, helpId;
helpId = window.location.hash.substring(1);
parentDiv = document.getElementById("topics");
nodes = parentDiv.children;
for(i=0; i < nodes.length; i++) {
if(nodes[i].id !== helpId) {
nodes[i].style.display ="none";
}
}
}
}
</script>
</head>
<body onload="init()">
<div id="topics">
<div id="toolDescription" class="largesize">
<h2>๊ธฐ์กด ์์น ์ฐพ๊ธฐ</h2><p/>
<h2><img src="../images/GUID-C5409FC7-EC93-45C5-8B00-3D6EA80A0A77-web.png" alt="๊ธฐ์กด ์์น ์ฐพ๊ธฐ"></h2>
<hr/>
<p>์ด ๋๊ตฌ๋ ์ฒ๋ฆฌ ๋ฒ์์์ ์ง์ ํ ์ผ๋ จ์ ์กฐ๊ฑด์ ์ถฉ์กฑํ๋ ๊ธฐ์กด ํผ์ฒ๋ฅผ ์ ํํฉ๋๋ค. ์ด๋ฌํ ์กฐ๊ฑด์ ์์ฑ ์ฟผ๋ฆฌ(์: ๋น์ด ์๋ ํ์ง) ๋ฐ ๊ณต๊ฐ ์ฟผ๋ฆฌ(์: ๊ฐ์์ 1.6Km ์ด๋ด)๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ ์ ์์ต๋๋ค.
</p>
<p> <b>ํ์ฌ ๋งต ๋ฒ์ ์ฌ์ฉ</b>์ ์ ํํ ๊ฒฝ์ฐ ํ์ฌ ๋งต ๋ฒ์ ๋ด์ ํ์๋ ๋ถ์ ๋ ์ด์ด์ ํผ์ฒ๋ง ๋ถ์๋๊ณ , ์ด ์ต์
์ ์ ํ ์ทจ์ํ๋ฉด ํ์ฌ ๋งต ๋ฒ์๊ฐ ์๋ ๊ฒฝ์ฐ์๋ ๋ชจ๋ ํผ์ฒ๊ฐ ๋ถ์๋ฉ๋๋ค.
</p>
</div>
<!--Parameter divs for each param-->
<div id="Expression">
<div><h2>๋ค์ ์๊ณผ ์ผ์นํ๋ ํผ์ฒ ์ฐพ๊ธฐ</h2></div>
<hr/>
<div>
<p> <b>์ ์ถ๊ฐ</b> ๋ฒํผ์ ํด๋ฆญํ์ฌ ์์ ์ ์ํฉ๋๋ค. ์ฌ๋ฌ ์์ ์ถ๊ฐํ ์ ์์ต๋๋ค. ์์ ์
๋ ฅํ๊ณ <b>๋ถ์ ์คํ</b> ๋ฒํผ์ ํด๋ฆญํ๋ฉด ๋ถ์ ๋ ์ด์ด์ ์๋ ํผ์ฒ๊ฐ ๊ฐ ์์ ํตํด ํํฐ๋ง๋ฉ๋๋ค. ๋ชจ๋ ์์ ์ถฉ์กฑํ๋ ํผ์ฒ๋ง ๊ฒฐ๊ณผ ๋ ์ด์ด์ ์์ฑ๋ฉ๋๋ค.
</p>
<p>์์ฑํ ์ ์๋ ๋ ๊ฐ์ง ๊ธฐ๋ณธ ์ ํ์ ์, ์ฆ ์์ฑ ์๊ณผ ๊ณต๊ฐ ์์ด ์์ต๋๋ค. ์์ฑ ์์ <code>where name is 'San Francisco'</code>์ ๊ฐ์ ํ๋ ๊ฐ์ ๋ํ ์ฟผ๋ฆฌ์
๋๋ค. ๊ณต๊ฐ ์์๋ 4๊ฐ์ง ์ ํ์ด ์์ต๋๋ค.
<ul>
<li> <b>๊ฑฐ๋ฆฌ ๋ด์ ์์</b>: ํผ์ฒ๊ฐ ๋ค๋ฅธ ๋ ์ด์ด์ ํผ์ฒ์์ ์ผ์ ๊ฑฐ๋ฆฌ ์ด๋ด์ ์์ด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด Los Angeles ๊ฐ์์ 500๋ฏธํฐ ์ด๋ด์ ์๋ ํ์ง๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.
</li>
<li> <b>์์ ํ ํฌํจ</b>: ํผ์ฒ๊ฐ ๋ค๋ฅธ ๋ ์ด์ด์ ํผ์ฒ๋ฅผ ๋ชจ๋ ํฌํจํด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด ์ฐ์
์ฉ ํ์ง๋ฅผ ์์ ํ ํฌํจํ ํ์ฒ์ ์ฐพ์ต๋๋ค. ํ์ง์ ์ผ๋ถ๊ฐ ํ์ฒ ์ธ๋ถ์ ์์ ์ ์์ต๋๋ค.
</li>
<li> <b>์์ ํ ์ํจ</b>: ํผ์ฒ๊ฐ ๋ค๋ฅธ ๋ ์ด์ด์ ํผ์ฒ๋ก ์์ ํ ๋๋ฌ์ธ์ฌ ์์ด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด ๋์ ๊ฒฝ๊ณ ๋ด์ ์์ ํ ์ํด ์๋ ํ๊ตฐ์ ์ฐพ์ต๋๋ค. ํ๊ตฐ์ ์ผ๋ถ๊ฐ ๋์ ๊ฒฝ๊ณ ์ธ๋ถ์ ์์ ์ ์์ต๋๋ค.
</li>
<li> <b>๊ต์ฐจํจ</b>: ํผ์ฒ๊ฐ ๋ค๋ฅธ ๋ ์ด์ด์ ํผ์ฒ ์ผ๋ถ๋ฅผ ํฌํจํฉ๋๋ค. ์๋ฅผ ๋ค์ด ๊ฐ์ ๊ต์ฐจํ๋ ํ์ง๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. ํ์ง๋ฅผ ๊ดํตํ๊ฑฐ๋ ํ์ง์ ๊ฒฝ๊ณ์ ์ ํ ๊ฐ์ ์ผ๋ถ๋ ํ์ง๋ฅผ ๊ต์ฐจํ๋ ๊ฒ์
๋๋ค.
</li>
</ul>
</p>
<p>๊ฐ ๊ณต๊ฐ ์์๋ ํด๋นํ๋ ๋ถ์ ์์ด ์์ต๋๋ค( <b>๋ค์ ๊ฑฐ๋ฆฌ ๋ด์ ์์</b>, <b>์์ ํ ํฌํจํ์ง ์์</b>, <b>์์ ํ ํฌํจ๋์ง ์์</b> ๋ฐ <b>๊ต์ฐจํ์ง ์์</b>).
</p>
</div>
</div>
<div id="OuputName">
<div><h2>๊ฒฐ๊ณผ ๋ ์ด์ด ์ด๋ฆ</h2></div>
<hr/>
<div>
<p> <b>๋ด ์ปจํ
์ธ </b>์ ์์ฑ๋๊ณ ๋งต์ ์ถ๊ฐ๋๋ ๋ ์ด์ด์ ์ด๋ฆ์
๋๋ค. ๊ธฐ๋ณธ ์ด๋ฆ์ ๋ถ์ ์ ํ ๋ฐ ๋ถ์ ๋ ์ด์ด ์ด๋ฆ์ ๊ธฐ๋ฐ์ ๋ก๋๋ค. ๋ ์ด์ด๊ฐ ์ด๋ฏธ ์๋ ๊ฒฝ์ฐ ๋ฎ์ด์ธ์ง ํ์ธํ๋ ๋ฉ์์ง๊ฐ ๋ํ๋ฉ๋๋ค.
</p>
<p> <b>๊ฒฐ๊ณผ ์ ์ฅ:</b> ๋๋กญ๋ค์ด ์์๋ฅผ ์ฌ์ฉํ์ฌ <b>๋ด ์ปจํ
์ธ </b>์์ ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ ํด๋์ ์ด๋ฆ์ ์ง์ ํ ์ ์์ต๋๋ค.
</p>
</div>
</div>
</div>
</html>
| aconyteds/Esri-Ozone-Map-Widget | vendor/js/esri/arcgis_js_api/library/3.12/3.12compact/esri/dijit/analysis/help/ko/FindExistingLocations.html | HTML | apache-2.0 | 4,485 |
// scalac: -Xfatal-warnings
package foo {
package object foo {
case class X(z: Int) { }
}
}
| scala/scala | test/files/pos/package-ob-case/B_2.scala | Scala | apache-2.0 | 100 |
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.test.bench;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import org.h2.store.fs.FileUtils;
import org.h2.test.TestBase;
import org.h2.util.IOUtils;
import org.h2.util.JdbcUtils;
/**
* Used to compare scalability between the old engine and the new MVStore
* engine. Mostly it runs BenchB with various numbers of threads.
*/
public class TestScalability implements Database.DatabaseTest {
/**
* Whether data should be collected.
*/
boolean collect;
/**
* The flag used to enable or disable trace messages.
*/
boolean trace;
/**
* This method is called when executing this sample application.
*
* @param args the command line parameters
*/
public static void main(String... args) throws Exception {
new TestScalability().test();
}
private static Connection getResultConnection() throws SQLException {
org.h2.Driver.load();
return DriverManager.getConnection("jdbc:h2:./data/results");
}
private static void openResults() throws SQLException {
Connection conn = null;
Statement stat = null;
try {
conn = getResultConnection();
stat = conn.createStatement();
stat.execute(
"CREATE TABLE IF NOT EXISTS RESULTS(TESTID INT, " +
"TEST VARCHAR, UNIT VARCHAR, DBID INT, " +
"DB VARCHAR, RESULT VARCHAR)");
} finally {
JdbcUtils.closeSilently(stat);
JdbcUtils.closeSilently(conn);
}
}
private void test() throws Exception {
final boolean exit = false;
FileUtils.deleteRecursive("data", true);
final String out = "benchmark.html";
final int size = 400;
ArrayList<Database> dbs = new ArrayList<Database>();
int id = 1;
final String h2Url = "jdbc:h2:./data/test;" +
"LOCK_TIMEOUT=10000;LOCK_MODE=3";
dbs.add(createDbEntry(id++, "H2", 1, h2Url));
dbs.add(createDbEntry(id++, "H2", 10, h2Url));
dbs.add(createDbEntry(id++, "H2", 20, h2Url));
dbs.add(createDbEntry(id++, "H2", 30, h2Url));
dbs.add(createDbEntry(id++, "H2", 40, h2Url));
dbs.add(createDbEntry(id++, "H2", 50, h2Url));
dbs.add(createDbEntry(id++, "H2", 100, h2Url));
final String mvUrl = "jdbc:h2:./data/mvTest;" +
"LOCK_TIMEOUT=10000;MV_STORE=TRUE";
dbs.add(createDbEntry(id++, "MV", 1, mvUrl));
dbs.add(createDbEntry(id++, "MV", 10, mvUrl));
dbs.add(createDbEntry(id++, "MV", 20, mvUrl));
dbs.add(createDbEntry(id++, "MV", 30, mvUrl));
dbs.add(createDbEntry(id++, "MV", 40, mvUrl));
dbs.add(createDbEntry(id++, "MV", 50, mvUrl));
dbs.add(createDbEntry(id++, "MV", 100, mvUrl));
final BenchB test = new BenchB();
testAll(dbs, test, size);
collect = false;
ArrayList<Object[]> results = dbs.get(0).getResults();
Connection conn = null;
PreparedStatement prep = null;
Statement stat = null;
PrintWriter writer = null;
try {
openResults();
conn = getResultConnection();
stat = conn.createStatement();
prep = conn.prepareStatement(
"INSERT INTO RESULTS(TESTID, " +
"TEST, UNIT, DBID, DB, RESULT) VALUES(?, ?, ?, ?, ?, ?)");
for (int i = 0; i < results.size(); i++) {
Object[] res = results.get(i);
prep.setInt(1, i);
prep.setString(2, res[0].toString());
prep.setString(3, res[1].toString());
for (Database db : dbs) {
prep.setInt(4, db.getId());
prep.setString(5, db.getName());
Object[] v = db.getResults().get(i);
prep.setString(6, v[2].toString());
prep.execute();
}
}
writer = new PrintWriter(new FileWriter(out));
ResultSet rs = stat.executeQuery(
"CALL '<table><tr><th>Test Case</th>" +
"<th>Unit</th>' " +
"|| SELECT GROUP_CONCAT('<th>' || DB || '</th>' " +
"ORDER BY DBID SEPARATOR '') FROM " +
"(SELECT DISTINCT DBID, DB FROM RESULTS)" +
"|| '</tr>' || CHAR(10) " +
"|| SELECT GROUP_CONCAT('<tr><td>' || " +
"TEST || '</td><td>' || UNIT || '</td>' || ( " +
"SELECT GROUP_CONCAT('<td>' || RESULT || '</td>' " +
"ORDER BY DBID SEPARATOR '') FROM RESULTS R2 WHERE " +
"R2.TESTID = R1.TESTID) || '</tr>' " +
"ORDER BY TESTID SEPARATOR CHAR(10)) FROM " +
"(SELECT DISTINCT TESTID, TEST, UNIT FROM RESULTS) R1" +
"|| '</table>'");
rs.next();
String result = rs.getString(1);
writer.println(result);
} finally {
JdbcUtils.closeSilently(prep);
JdbcUtils.closeSilently(stat);
JdbcUtils.closeSilently(conn);
IOUtils.closeSilently(writer);
}
if (exit) {
System.exit(0);
}
}
private Database createDbEntry(int id, String namePrefix,
int threadCount, String url) {
Database db = Database.parse(this, id, namePrefix + "(" + threadCount +
"threads), org.h2.Driver, " + url + ", sa, sa", threadCount);
return db;
}
private void testAll(ArrayList<Database> dbs, BenchB test, int size)
throws Exception {
for (int i = 0; i < dbs.size(); i++) {
if (i > 0) {
Thread.sleep(1000);
}
// calls garbage collection
TestBase.getMemoryUsed();
Database db = dbs.get(i);
System.out.println("Testing the performance of " + db.getName());
db.startServer();
Connection conn = db.openNewConnection();
DatabaseMetaData meta = conn.getMetaData();
System.out.println(" " + meta.getDatabaseProductName() + " " +
meta.getDatabaseProductVersion());
runDatabase(db, test, 1);
runDatabase(db, test, 1);
collect = true;
runDatabase(db, test, size);
conn.close();
db.log("Executed statements", "#", db.getExecutedStatements());
db.log("Total time", "ms", db.getTotalTime());
int statPerSec = (int) (db.getExecutedStatements() *
1000L / db.getTotalTime());
db.log("Statements per second", "#", statPerSec);
System.out.println("Statements per second: " + statPerSec);
collect = false;
db.stopServer();
}
}
private static void runDatabase(Database db, BenchB bench, int size)
throws Exception {
bench.init(db, size);
bench.setThreadCount(db.getThreadsCount());
bench.runTest();
}
/**
* Print a message to system out if trace is enabled.
*
* @param s the message
*/
@Override
public void trace(String s) {
if (trace) {
System.out.println(s);
}
}
@Override
public boolean isCollect() {
return collect;
}
}
| vdr007/ThriftyPaxos | src/applications/h2/src/test/org/h2/test/bench/TestScalability.java | Java | apache-2.0 | 7,901 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.