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
|
---|---|---|---|---|---|
cmd_arch/arm/vfp/entry.o := /home/milind/toolchain/arm-eabi-4.6/bin/arm-eabi-gcc -Wp,-MD,arch/arm/vfp/.entry.o.d -nostdinc -isystem /home/milind/toolchain/arm-eabi-4.6/bin/../lib/gcc/arm-eabi/4.6.x-google/include -I/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include -Iarch/arm/include/generated -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-capri/include -Iarch/arm/plat-kona/include -D__ASSEMBLY__ -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv7-a -include asm/unified.h -mfpu=vfp3 -mfloat-abi=softfp -gdwarf-2 -c -o arch/arm/vfp/entry.o arch/arm/vfp/entry.S
source_arch/arm/vfp/entry.o := arch/arm/vfp/entry.S
deps_arch/arm/vfp/entry.o := \
$(wildcard include/config/preempt.h) \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/unified.h \
$(wildcard include/config/arm/asm/unified.h) \
$(wildcard include/config/thumb2/kernel.h) \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/thread_info.h \
$(wildcard include/config/arm/thumbee.h) \
include/linux/compiler.h \
$(wildcard include/config/sparse/rcu/pointer.h) \
$(wildcard include/config/trace/branch/profiling.h) \
$(wildcard include/config/profile/all/branches.h) \
$(wildcard include/config/enable/must/check.h) \
$(wildcard include/config/enable/warn/deprecated.h) \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/fpstate.h \
$(wildcard include/config/vfpv3.h) \
$(wildcard include/config/smp.h) \
$(wildcard include/config/iwmmxt.h) \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/vfpmacros.h \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/hwcap.h \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/vfp.h \
arch/arm/vfp/../kernel/entry-header.S \
$(wildcard include/config/frame/pointer.h) \
$(wildcard include/config/alignment/trap.h) \
$(wildcard include/config/cpu/v6.h) \
$(wildcard include/config/cpu/32v6k.h) \
$(wildcard include/config/have/hw/breakpoint.h) \
include/linux/init.h \
$(wildcard include/config/modules.h) \
$(wildcard include/config/hotplug.h) \
include/linux/linkage.h \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/linkage.h \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/assembler.h \
$(wildcard include/config/cpu/feroceon.h) \
$(wildcard include/config/trace/irqflags.h) \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/ptrace.h \
$(wildcard include/config/cpu/endian/be8.h) \
$(wildcard include/config/arm/thumb.h) \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/domain.h \
$(wildcard include/config/io/36.h) \
$(wildcard include/config/cpu/use/domains.h) \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/asm-offsets.h \
include/generated/asm-offsets.h \
/home/milind/work/kernel/android_kernel_samsung_i9082/arch/arm/include/asm/errno.h \
include/asm-generic/errno.h \
include/asm-generic/errno-base.h \
arch/arm/vfp/entry.o: $(deps_arch/arm/vfp/entry.o)
$(deps_arch/arm/vfp/entry.o):
|
sai9615/MY-kernel-for-grand-I9082
|
dragon/arch/arm/vfp/.entry.o.cmd
|
Batchfile
|
gpl-2.0
| 3,348 |
package org.xmlvm.ios;
import java.util.*;
import org.xmlvm.XMLVMSkeletonOnly;
@XMLVMSkeletonOnly
public class CFGregorianDate {
/*
* Variables
*/
public int year;
public byte month;
public byte day;
public byte hour;
public byte minute;
public double second;
/*
* Constructors
*/
/** Default constructor */
CFGregorianDate() {}
/*
* Instance methods
*/
/**
* Boolean CFGregorianDateIsValid(CFGregorianDate gdate, CFOptionFlags unitFlags);
*/
public byte isValid(long unitFlags){
throw new RuntimeException("Stub");
}
/**
* CFAbsoluteTime CFGregorianDateGetAbsoluteTime(CFGregorianDate gdate, CFTimeZoneRef tz);
*/
public double getAbsoluteTime(NSTimeZone tz){
throw new RuntimeException("Stub");
}
}
|
skyHALud/codenameone
|
Ports/iOSPort/xmlvm/src/ios/org/xmlvm/ios/CFGregorianDate.java
|
Java
|
gpl-2.0
| 755 |
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Bolton Software Ltd.
* Copyright (C) 2012 Nick Bolton
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package 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/>.
*/
#include "IpcClient.h"
#include <QTcpSocket>
#include <QHostAddress>
#include <iostream>
#include <QTimer>
#include "IpcReader.h"
#include "Ipc.h"
IpcClient::IpcClient() :
m_ReaderStarted(false),
m_Enabled(false)
{
m_Socket = new QTcpSocket(this);
connect(m_Socket, SIGNAL(connected()), this, SLOT(connected()));
connect(m_Socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
m_Reader = new IpcReader(m_Socket);
connect(m_Reader, SIGNAL(readLogLine(const QString&)), this, SLOT(handleReadLogLine(const QString&)));
}
IpcClient::~IpcClient()
{
}
void IpcClient::connected()
{
char typeBuf[1];
typeBuf[0] = kIpcClientGui;
sendHello();
infoMessage("connection established");
}
void IpcClient::connectToHost()
{
m_Enabled = true;
infoMessage("connecting to service...");
m_Socket->connectToHost(QHostAddress(QHostAddress::LocalHost), IPC_PORT);
if (!m_ReaderStarted) {
m_Reader->start();
m_ReaderStarted = true;
}
}
void IpcClient::disconnectFromHost()
{
infoMessage("service disconnect");
m_Reader->stop();
m_Socket->close();
}
void IpcClient::error(QAbstractSocket::SocketError error)
{
QString text;
switch (error) {
case 0: text = "connection refused"; break;
case 1: text = "remote host closed"; break;
default: text = QString("code=%1").arg(error); break;
}
errorMessage(QString("ipc connection error, %1").arg(text));
QTimer::singleShot(1000, this, SLOT(retryConnect()));
}
void IpcClient::retryConnect()
{
if (m_Enabled) {
connectToHost();
}
}
void IpcClient::sendHello()
{
QDataStream stream(m_Socket);
stream.writeRawData(kIpcMsgHello, 4);
char typeBuf[1];
typeBuf[0] = kIpcClientGui;
stream.writeRawData(typeBuf, 1);
}
void IpcClient::sendCommand(const QString& command, bool elevate)
{
QDataStream stream(m_Socket);
stream.writeRawData(kIpcMsgCommand, 4);
std::string stdStringCommand = command.toStdString();
const char* charCommand = stdStringCommand.c_str();
int length = strlen(charCommand);
char lenBuf[4];
intToBytes(length, lenBuf, 4);
stream.writeRawData(lenBuf, 4);
stream.writeRawData(charCommand, length);
char elevateBuf[1];
elevateBuf[0] = elevate ? 1 : 0;
stream.writeRawData(elevateBuf, 1);
}
void IpcClient::handleReadLogLine(const QString& text)
{
readLogLine(text);
}
// TODO: qt must have a built in way of converting int to bytes.
void IpcClient::intToBytes(int value, char *buffer, int size)
{
if (size == 1) {
buffer[0] = value & 0xff;
}
else if (size == 2) {
buffer[0] = (value >> 8) & 0xff;
buffer[1] = value & 0xff;
}
else if (size == 4) {
buffer[0] = (value >> 24) & 0xff;
buffer[1] = (value >> 16) & 0xff;
buffer[2] = (value >> 8) & 0xff;
buffer[3] = value & 0xff;
}
else {
// TODO: other sizes, if needed.
}
}
|
thecubic/synergy-foss
|
src/gui/src/IpcClient.cpp
|
C++
|
gpl-2.0
| 3,524 |
#if UNITY_4_3 || UNITY_4_3_0 || UNITY_4_3_1
#define UNITY_4_3
#elif UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2
#define UNITY_4
#elif UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5
#define UNITY_3
#endif
using UnityEngine;
using UnityEditor;
using System.Collections;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using ProBuilder2.EditorEnum;
namespace ProBuilder2.Actions
{
public class ExtrudeFace : Editor
{
const int EXTRUDE = 100;
[MenuItem("Tools/" + pb_Constant.PRODUCT_NAME + "/Geometry/Extrude %#e", false, EXTRUDE + 1)]
public static void ExtrudeNoTranslation()
{
PerformExtrusion(0f);
}
[MenuItem("Tools/" + pb_Constant.PRODUCT_NAME + "/Geometry/Extrude with Translation %e", false, EXTRUDE)]
public static void Extrude()
{
PerformExtrusion(.25f);
}
private static void PerformExtrusion(float dist)
{
SelectMode mode = pb_Editor.instance.GetSelectionMode();
pb_Object[] pbs = pbUtil.GetComponents<pb_Object>(Selection.transforms);
#if !UNITY_4_3
Undo.RegisterUndo(pbUtil.GetComponents<pb_Object>(Selection.transforms), "extrude selected.");
#else
Undo.RecordObjects(pbUtil.GetComponents<pb_Object>(Selection.transforms), "extrude selected.");
#endif
int extrudedFaceCount = 0;
foreach(pb_Object pb in pbs)
{
switch(mode)
{
case SelectMode.Face:
if(pb.selected_faces.Length < 1)
continue;
extrudedFaceCount += pb.selected_faces.Length;
pb.Extrude(pb.selected_faces, dist);
break;
case SelectMode.Edge:
if(pb.selected_edges.Length < 1)
continue;
pb_Edge[] newEdges = pb.Extrude(pb.selected_edges, dist, pb_Preferences_Internal.GetBool(pb_Constant.pbPerimeterEdgeExtrusionOnly));
if(newEdges != null)
{
extrudedFaceCount += pb.selected_edges.Length;
pb.selected_edges = newEdges;
pb.selected_triangles = pb.SharedTrianglesWithTriangles( pb.selected_edges.ToIntArray() );
}
break;
}
pb.GenerateUV2(true);
}
if(extrudedFaceCount > 0)
{
string val = "";
if(mode == SelectMode.Edge)
val = (extrudedFaceCount > 1 ? extrudedFaceCount + " Edges" : "Edge");
else
val = (extrudedFaceCount > 1 ? extrudedFaceCount + " Faces" : "Face");
pb_Editor_Utility.ShowNotification("Extrude " + val, "Extrudes the selected faces / edges.");
}
if(pb_Editor.instance)
pb_Editor.instance.UpdateSelection();
}
}
}
|
Jack423/TankGame
|
Assets/6by7/ProBuilder/Editor/Actions/ExtrudeFace.cs
|
C#
|
gpl-2.0
| 2,531 |
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2017 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.openkm.frontend.client.bean;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* @author jllort
*
*/
public class GWTUserConfig implements IsSerializable {
private String user = "";
private String homePath = "";
private String homeType = "";
private String homeNode = "";
/**
* GWTUserConfig
*/
public GWTUserConfig() {
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getHomePath() {
return homePath;
}
public void setHomePath(String homePath) {
this.homePath = homePath;
}
public String getHomeType() {
return homeType;
}
public void setHomeType(String homeType) {
this.homeType = homeType;
}
public String getHomeNode() {
return homeNode;
}
public void setHomeNode(String homeNode) {
this.homeNode = homeNode;
}
}
|
Beau-M/document-management-system
|
src/main/java/com/openkm/frontend/client/bean/GWTUserConfig.java
|
Java
|
gpl-2.0
| 1,807 |
#ifndef __STDDEF
#define __STDDEF
/* $Id: stddef.h,v 1.1 2002/08/28 23:59:20 drh Exp $ */
#ifndef NULL
#define NULL ((void*)0)
#endif
#define offsetof(ty,mem) ((size_t)((char*)&((ty*)0)->mem - (char*)0))
typedef long ptrdiff_t;
#if !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(_SIZE_T_DEFINED)
#define _SIZE_T
#define _SIZE_T_
#define _SIZE_T_DEFINED
typedef unsigned long size_t;
#endif
#if !defined(_WCHAR_T) && !defined(_WCHAR_T_) && !defined(_WCHAR_T_DEFINED)
#define _WCHAR_T
#define _WCHAR_T_
#define _WCHAR_T_DEFINED
#if (_WCHAR_T_SIZE + 0) == 1
typedef unsigned char wchar_t;
#elif (_WCHAR_T_SIZE + 0) == 2
typedef unsigned short wchar_t;
#elif (_WCHAR_T_SIZE + 0) == 4
typedef unsigned int wchar_t;
#else
typedef unsigned short wchar_t;
#endif
#endif
#endif /* __STDDEF */
|
dpilawa/bytec
|
lcc/include/sparc/solaris/stddef.h
|
C
|
gpl-2.0
| 797 |
/*************************************************************************/ /*!
@File
@Title System Description Header
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description This header provides system-specific declarations and macros
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
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.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) 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; AND (B) 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.
*/ /**************************************************************************/
#if !defined(__APOLLO_H__)
#define __APOLLO_H__
#define TC_SYSTEM_NAME "Rogue Test Chip"
/* Valid values for the TC_MEMORY_CONFIG configuration option */
#define TC_MEMORY_LOCAL (1)
#define TC_MEMORY_HOST (2)
#define TC_MEMORY_HYBRID (3)
#define TC_MEMORY_DIRECT_MAPPED (4)
#define RGX_TC_CORE_CLOCK_SPEED (90000000)
#define RGX_TC_MEM_CLOCK_SPEED (65000000)
#if defined(SUPPORT_DISPLAY_CLASS) || defined(SUPPORT_DRM_DC_MODULE)
/* Memory reserved for use by the PDP DC. */
#define RGX_TC_RESERVE_DC_MEM_SIZE (32 * 1024 * 1024)
#endif
#if defined(SUPPORT_ION)
/* Memory reserved for use by ion. */
#define RGX_TC_RESERVE_ION_MEM_SIZE (384 * 1024 * 1024)
#endif
/* Apollo reg on base register 0 */
#define SYS_APOLLO_REG_PCI_BASENUM (0)
#define SYS_APOLLO_REG_REGION_SIZE (0x00010000)
#define SYS_APOLLO_REG_SYS_OFFSET (0x0000)
#define SYS_APOLLO_REG_SYS_SIZE (0x0400)
#define SYS_APOLLO_REG_PLL_OFFSET (0x1000)
#define SYS_APOLLO_REG_PLL_SIZE (0x0400)
#define SYS_APOLLO_REG_HOST_OFFSET (0x4050)
#define SYS_APOLLO_REG_HOST_SIZE (0x0014)
#define SYS_APOLLO_REG_PDP_OFFSET (0xC000)
#define SYS_APOLLO_REG_PDP_SIZE (0x0400)
/* Offsets for flashing Apollo PROMs from base 0 */
#define APOLLO_FLASH_STAT_OFFSET (0x4058)
#define APOLLO_FLASH_DATA_WRITE_OFFSET (0x4050)
#define APOLLO_FLASH_RESET_OFFSET (0x4060)
#define APOLLO_FLASH_FIFO_STATUS_MASK (0xF)
#define APOLLO_FLASH_FIFO_STATUS_SHIFT (0)
#define APOLLO_FLASH_PROGRAM_STATUS_MASK (0xF)
#define APOLLO_FLASH_PROGAM_STATUS_SHIFT (16)
#define APOLLO_FLASH_PROG_COMPLETE_BIT (0x1)
#define APOLLO_FLASH_PROG_PROGRESS_BIT (0x2)
#define APOLLO_FLASH_PROG_FAILED_BIT (0x4)
#define APOLLO_FLASH_INV_FILETYPE_BIT (0x8)
#define APOLLO_FLASH_FIFO_SIZE (8)
/* RGX reg on base register 1 */
#define SYS_RGX_REG_PCI_BASENUM (1)
#define SYS_RGX_REG_REGION_SIZE (0x00004000)
/* Device memory (including HP mapping) on base register 2 */
#define SYS_DEV_MEM_PCI_BASENUM (2)
/* number of bytes that are broken */
#define SYS_DEV_MEM_BROKEN_BYTES (1024 * 1024)
#define SYS_DEV_MEM_REGION_SIZE (0x40000000 - SYS_DEV_MEM_BROKEN_BYTES)
#endif /* if !defined(__APOLLO_H__) */
|
jmztaylor/android_kernel_amazon_ariel
|
drivers/gpu/mt8135/rgx_1.3_2876724/services/system/rgx_tc/apollo.h
|
C
|
gpl-2.0
| 4,510 |
/* $Id: PDMDevHlp.cpp $ */
/** @file
* PDM - Pluggable Device and Driver Manager, Device Helpers.
*/
/*
* Copyright (C) 2006-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DEVICE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
#include <VBox/vmm/mm.h>
#include <VBox/vmm/hm.h>
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/iom.h>
#ifdef VBOX_WITH_REM
# include <VBox/vmm/rem.h>
#endif
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/vmapi.h>
#include <VBox/vmm/vm.h>
#include <VBox/vmm/uvm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/version.h>
#include <VBox/log.h>
#include <VBox/err.h>
#include <iprt/asm.h>
#include <iprt/assert.h>
#include <iprt/ctype.h>
#include <iprt/string.h>
#include <iprt/thread.h>
#include "dtrace/VBoxVMM.h"
#include "PDMInline.h"
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** @def PDM_DEVHLP_DEADLOCK_DETECTION
* Define this to enable the deadlock detection when accessing physical memory.
*/
#if /*defined(DEBUG_bird) ||*/ defined(DOXYGEN_RUNNING)
# define PDM_DEVHLP_DEADLOCK_DETECTION /**< @todo enable DevHlp deadlock detection! */
#endif
/**
* Wrapper around PDMR3LdrGetSymbolRCLazy.
*/
DECLINLINE(int) pdmR3DevGetSymbolRCLazy(PPDMDEVINS pDevIns, const char *pszSymbol, PRTRCPTR ppvValue)
{
PVM pVM = pDevIns->Internal.s.pVMR3;
if (HMIsEnabled(pVM))
{
*ppvValue = NIL_RTRCPTR;
return VINF_SUCCESS;
}
return PDMR3LdrGetSymbolRCLazy(pVM,
pDevIns->Internal.s.pDevR3->pReg->szRCMod,
pDevIns->Internal.s.pDevR3->pszRCSearchPath,
pszSymbol, ppvValue);
}
/**
* Wrapper around PDMR3LdrGetSymbolR0Lazy.
*/
DECLINLINE(int) pdmR3DevGetSymbolR0Lazy(PPDMDEVINS pDevIns, const char *pszSymbol, PRTR0PTR ppvValue)
{
return PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3,
pDevIns->Internal.s.pDevR3->pReg->szR0Mod,
pDevIns->Internal.s.pDevR3->pszR0SearchPath,
pszSymbol, ppvValue);
}
/** @name R3 DevHlp
* @{
*/
/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTHCPTR pvUser, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn,
PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_IOPortRegister: caller='%s'/%d: Port=%#x cPorts=%#x pvUser=%p pfnOut=%p pfnIn=%p pfnOutStr=%p pfnInStr=%p p32_tszDesc=%p:{%s}\n", pDevIns->pReg->szName, pDevIns->iInstance,
Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc, pszDesc));
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
#if 0 /** @todo needs a real string cache for this */
if (pDevIns->iInstance > 0)
{
char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s [%u]", pszDesc, pDevIns->iInstance);
if (pszDesc2)
pszDesc = pszDesc2;
}
#endif
int rc = IOMR3IOPortRegisterR3(pDevIns->Internal.s.pVMR3, pDevIns, Port, cPorts, pvUser,
pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc);
LogFlow(("pdmR3DevHlp_IOPortRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortRegisterRC} */
static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterRC(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTRCPTR pvUser,
const char *pszOut, const char *pszIn,
const char *pszOutStr, const char *pszInStr, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_IOPortRegisterRC: caller='%s'/%d: Port=%#x cPorts=%#x pvUser=%p pszOut=%p:{%s} pszIn=%p:{%s} pszOutStr=%p:{%s} pszInStr=%p:{%s} pszDesc=%p:{%s}\n", pDevIns->pReg->szName, pDevIns->iInstance,
Port, cPorts, pvUser, pszOut, pszOut, pszIn, pszIn, pszOutStr, pszOutStr, pszInStr, pszInStr, pszDesc, pszDesc));
/*
* Resolve the functions (one of the can be NULL).
*/
int rc = VINF_SUCCESS;
if ( pDevIns->pReg->szRCMod[0]
&& (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
&& !HMIsEnabled(pVM))
{
RTRCPTR RCPtrIn = NIL_RTRCPTR;
if (pszIn)
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszIn, &RCPtrIn);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pReg->szRCMod, pszIn));
}
RTRCPTR RCPtrOut = NIL_RTRCPTR;
if (pszOut && RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszOut, &RCPtrOut);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pReg->szRCMod, pszOut));
}
RTRCPTR RCPtrInStr = NIL_RTRCPTR;
if (pszInStr && RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszInStr, &RCPtrInStr);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pReg->szRCMod, pszInStr));
}
RTRCPTR RCPtrOutStr = NIL_RTRCPTR;
if (pszOutStr && RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszOutStr, &RCPtrOutStr);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pReg->szRCMod, pszOutStr));
}
if (RT_SUCCESS(rc))
{
#if 0 /** @todo needs a real string cache for this */
if (pDevIns->iInstance > 0)
{
char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s [%u]", pszDesc, pDevIns->iInstance);
if (pszDesc2)
pszDesc = pszDesc2;
}
#endif
rc = IOMR3IOPortRegisterRC(pVM, pDevIns, Port, cPorts, pvUser, RCPtrOut, RCPtrIn, RCPtrOutStr, RCPtrInStr, pszDesc);
}
}
else if (!HMIsEnabled(pVM))
{
AssertMsgFailed(("No RC module for this driver!\n"));
rc = VERR_INVALID_PARAMETER;
}
LogFlow(("pdmR3DevHlp_IOPortRegisterRC: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortRegisterR0} */
static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts, RTR0PTR pvUser,
const char *pszOut, const char *pszIn,
const char *pszOutStr, const char *pszInStr, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_IOPortRegisterR0: caller='%s'/%d: Port=%#x cPorts=%#x pvUser=%p pszOut=%p:{%s} pszIn=%p:{%s} pszOutStr=%p:{%s} pszInStr=%p:{%s} pszDesc=%p:{%s}\n", pDevIns->pReg->szName, pDevIns->iInstance,
Port, cPorts, pvUser, pszOut, pszOut, pszIn, pszIn, pszOutStr, pszOutStr, pszInStr, pszInStr, pszDesc, pszDesc));
/*
* Resolve the functions (one of the can be NULL).
*/
int rc = VINF_SUCCESS;
if ( pDevIns->pReg->szR0Mod[0]
&& (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0))
{
R0PTRTYPE(PFNIOMIOPORTIN) pfnR0PtrIn = 0;
if (pszIn)
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszIn, &pfnR0PtrIn);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pReg->szR0Mod, pszIn));
}
R0PTRTYPE(PFNIOMIOPORTOUT) pfnR0PtrOut = 0;
if (pszOut && RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszOut, &pfnR0PtrOut);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pReg->szR0Mod, pszOut));
}
R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnR0PtrInStr = 0;
if (pszInStr && RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszInStr, &pfnR0PtrInStr);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pReg->szR0Mod, pszInStr));
}
R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnR0PtrOutStr = 0;
if (pszOutStr && RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszOutStr, &pfnR0PtrOutStr);
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pReg->szR0Mod, pszOutStr));
}
if (RT_SUCCESS(rc))
{
#if 0 /** @todo needs a real string cache for this */
if (pDevIns->iInstance > 0)
{
char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s [%u]", pszDesc, pDevIns->iInstance);
if (pszDesc2)
pszDesc = pszDesc2;
}
#endif
rc = IOMR3IOPortRegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, Port, cPorts, pvUser, pfnR0PtrOut, pfnR0PtrIn, pfnR0PtrOutStr, pfnR0PtrInStr, pszDesc);
}
}
else
{
AssertMsgFailed(("No R0 module for this driver!\n"));
rc = VERR_INVALID_PARAMETER;
}
LogFlow(("pdmR3DevHlp_IOPortRegisterR0: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnIOPortDeregister} */
static DECLCALLBACK(int) pdmR3DevHlp_IOPortDeregister(PPDMDEVINS pDevIns, RTIOPORT Port, RTIOPORT cPorts)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_IOPortDeregister: caller='%s'/%d: Port=%#x cPorts=%#x\n", pDevIns->pReg->szName, pDevIns->iInstance,
Port, cPorts));
int rc = IOMR3IOPortDeregister(pDevIns->Internal.s.pVMR3, pDevIns, Port, cPorts);
LogFlow(("pdmR3DevHlp_IOPortDeregister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegister} */
static DECLCALLBACK(int) pdmR3DevHlp_MMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
uint32_t fFlags, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvUser=%p pfnWrite=%p pfnRead=%p pfnFill=%p fFlags=%#x pszDesc=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc, fFlags, pszDesc));
if (pDevIns->iInstance > 0)
{
char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s [%u]", pszDesc, pDevIns->iInstance);
if (pszDesc2)
pszDesc = pszDesc2;
}
int rc = IOMR3MmioRegisterR3(pVM, pDevIns, GCPhysStart, cbRange, pvUser,
pfnWrite, pfnRead, pfnFill, fFlags, pszDesc);
LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegisterRC} */
static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterRC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTRCPTR pvUser,
const char *pszWrite, const char *pszRead, const char *pszFill)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_MMIORegisterRC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill));
/*
* Resolve the functions.
* Not all function have to present, leave it to IOM to enforce this.
*/
int rc = VINF_SUCCESS;
if ( pDevIns->pReg->szRCMod[0]
&& (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
&& !HMIsEnabled(pVM))
{
RTRCPTR RCPtrWrite = NIL_RTRCPTR;
if (pszWrite)
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszWrite, &RCPtrWrite);
RTRCPTR RCPtrRead = NIL_RTRCPTR;
int rc2 = VINF_SUCCESS;
if (pszRead)
rc2 = pdmR3DevGetSymbolRCLazy(pDevIns, pszRead, &RCPtrRead);
RTRCPTR RCPtrFill = NIL_RTRCPTR;
int rc3 = VINF_SUCCESS;
if (pszFill)
rc3 = pdmR3DevGetSymbolRCLazy(pDevIns, pszFill, &RCPtrFill);
if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3))
rc = IOMR3MmioRegisterRC(pVM, pDevIns, GCPhysStart, cbRange, pvUser, RCPtrWrite, RCPtrRead, RCPtrFill);
else
{
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszWrite)\n", pDevIns->pReg->szRCMod, pszWrite));
AssertMsgRC(rc2, ("Failed to resolve %s.%s (pszRead)\n", pDevIns->pReg->szRCMod, pszRead));
AssertMsgRC(rc3, ("Failed to resolve %s.%s (pszFill)\n", pDevIns->pReg->szRCMod, pszFill));
if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
rc = rc2;
if (RT_FAILURE(rc3) && RT_SUCCESS(rc))
rc = rc3;
}
}
else if (!HMIsEnabled(pVM))
{
AssertMsgFailed(("No RC module for this driver!\n"));
rc = VERR_INVALID_PARAMETER;
}
LogFlow(("pdmR3DevHlp_MMIORegisterRC: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnMMIORegisterR0} */
static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
const char *pszWrite, const char *pszRead, const char *pszFill)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_MMIORegisterHC: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill));
/*
* Resolve the functions.
* Not all function have to present, leave it to IOM to enforce this.
*/
int rc = VINF_SUCCESS;
if ( pDevIns->pReg->szR0Mod[0]
&& (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0))
{
R0PTRTYPE(PFNIOMMMIOWRITE) pfnR0PtrWrite = 0;
if (pszWrite)
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszWrite, &pfnR0PtrWrite);
R0PTRTYPE(PFNIOMMMIOREAD) pfnR0PtrRead = 0;
int rc2 = VINF_SUCCESS;
if (pszRead)
rc2 = pdmR3DevGetSymbolR0Lazy(pDevIns, pszRead, &pfnR0PtrRead);
R0PTRTYPE(PFNIOMMMIOFILL) pfnR0PtrFill = 0;
int rc3 = VINF_SUCCESS;
if (pszFill)
rc3 = pdmR3DevGetSymbolR0Lazy(pDevIns, pszFill, &pfnR0PtrFill);
if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3))
rc = IOMR3MmioRegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, pfnR0PtrWrite, pfnR0PtrRead, pfnR0PtrFill);
else
{
AssertMsgRC(rc, ("Failed to resolve %s.%s (pszWrite)\n", pDevIns->pReg->szR0Mod, pszWrite));
AssertMsgRC(rc2, ("Failed to resolve %s.%s (pszRead)\n", pDevIns->pReg->szR0Mod, pszRead));
AssertMsgRC(rc3, ("Failed to resolve %s.%s (pszFill)\n", pDevIns->pReg->szR0Mod, pszFill));
if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
rc = rc2;
if (RT_FAILURE(rc3) && RT_SUCCESS(rc))
rc = rc3;
}
}
else
{
AssertMsgFailed(("No R0 module for this driver!\n"));
rc = VERR_INVALID_PARAMETER;
}
LogFlow(("pdmR3DevHlp_MMIORegisterR0: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnMMIODeregister} */
static DECLCALLBACK(int) pdmR3DevHlp_MMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_MMIODeregister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange));
int rc = IOMR3MmioDeregister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange);
LogFlow(("pdmR3DevHlp_MMIODeregister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnMMIO2Register
*/
static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Register(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_MMIO2Register: caller='%s'/%d: iRegion=%#x cb=%#RGp fFlags=%RX32 ppv=%p pszDescp=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, iRegion, cb, fFlags, ppv, pszDesc, pszDesc));
/** @todo PGMR3PhysMMIO2Register mangles the description, move it here and
* use a real string cache. */
int rc = PGMR3PhysMMIO2Register(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, cb, fFlags, ppv, pszDesc);
LogFlow(("pdmR3DevHlp_MMIO2Register: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnMMIO2Deregister
*/
static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Deregister(PPDMDEVINS pDevIns, uint32_t iRegion)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_MMIO2Deregister: caller='%s'/%d: iRegion=%#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, iRegion));
AssertReturn(iRegion <= UINT8_MAX || iRegion == UINT32_MAX, VERR_INVALID_PARAMETER);
int rc = PGMR3PhysMMIO2Deregister(pDevIns->Internal.s.pVMR3, pDevIns, iRegion);
LogFlow(("pdmR3DevHlp_MMIO2Deregister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnMMIO2Map
*/
static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Map(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_MMIO2Map: caller='%s'/%d: iRegion=%#x GCPhys=%#RGp\n",
pDevIns->pReg->szName, pDevIns->iInstance, iRegion, GCPhys));
int rc = PGMR3PhysMMIO2Map(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, GCPhys);
LogFlow(("pdmR3DevHlp_MMIO2Map: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnMMIO2Unmap
*/
static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Unmap(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_MMIO2Unmap: caller='%s'/%d: iRegion=%#x GCPhys=%#RGp\n",
pDevIns->pReg->szName, pDevIns->iInstance, iRegion, GCPhys));
int rc = PGMR3PhysMMIO2Unmap(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, GCPhys);
LogFlow(("pdmR3DevHlp_MMIO2Unmap: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnMMHyperMapMMIO2
*/
static DECLCALLBACK(int) pdmR3DevHlp_MMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
const char *pszDesc, PRTRCPTR pRCPtr)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_MMHyperMapMMIO2: caller='%s'/%d: iRegion=%#x off=%RGp cb=%RGp pszDesc=%p:{%s} pRCPtr=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, iRegion, off, cb, pszDesc, pszDesc, pRCPtr));
if (pDevIns->iInstance > 0)
{
char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s [%u]", pszDesc, pDevIns->iInstance);
if (pszDesc2)
pszDesc = pszDesc2;
}
int rc = MMR3HyperMapMMIO2(pVM, pDevIns, iRegion, off, cb, pszDesc, pRCPtr);
LogFlow(("pdmR3DevHlp_MMHyperMapMMIO2: caller='%s'/%d: returns %Rrc *pRCPtr=%RRv\n", pDevIns->pReg->szName, pDevIns->iInstance, rc, *pRCPtr));
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnMMIO2MapKernel
*/
static DECLCALLBACK(int) pdmR3DevHlp_MMIO2MapKernel(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
const char *pszDesc, PRTR0PTR pR0Ptr)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_MMIO2MapKernel: caller='%s'/%d: iRegion=%#x off=%RGp cb=%RGp pszDesc=%p:{%s} pR0Ptr=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, iRegion, off, cb, pszDesc, pszDesc, pR0Ptr));
if (pDevIns->iInstance > 0)
{
char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s [%u]", pszDesc, pDevIns->iInstance);
if (pszDesc2)
pszDesc = pszDesc2;
}
int rc = PGMR3PhysMMIO2MapKernel(pVM, pDevIns, iRegion, off, cb, pszDesc, pR0Ptr);
LogFlow(("pdmR3DevHlp_MMIO2MapKernel: caller='%s'/%d: returns %Rrc *pR0Ptr=%RHv\n", pDevIns->pReg->szName, pDevIns->iInstance, rc, *pR0Ptr));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnROMRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange,
const void *pvBinary, uint32_t cbBinary, uint32_t fFlags, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvBinary=%p cbBinary=%#x fFlags=%#RX32 pszDesc=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, cbBinary, fFlags, pszDesc, pszDesc));
/** @todo can we mangle pszDesc? */
int rc = PGMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, cbBinary, fFlags, pszDesc);
LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnROMProtectShadow} */
static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, PGMROMPROT enmProt)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x enmProt=%d\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhysStart, cbRange, enmProt));
int rc = PGMR3PhysRomProtect(pDevIns->Internal.s.pVMR3, GCPhysStart, cbRange, enmProt);
LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnSSMRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_SSMRegister(PPDMDEVINS pDevIns, uint32_t uVersion, size_t cbGuess, const char *pszBefore,
PFNSSMDEVLIVEPREP pfnLivePrep, PFNSSMDEVLIVEEXEC pfnLiveExec, PFNSSMDEVLIVEVOTE pfnLiveVote,
PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone,
PFNSSMDEVLOADPREP pfnLoadPrep, PFNSSMDEVLOADEXEC pfnLoadExec, PFNSSMDEVLOADDONE pfnLoadDone)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_SSMRegister: caller='%s'/%d: uVersion=#x cbGuess=%#x pszBefore=%p:{%s}\n"
" pfnLivePrep=%p pfnLiveExec=%p pfnLiveVote=%p pfnSavePrep=%p pfnSaveExec=%p pfnSaveDone=%p pszLoadPrep=%p pfnLoadExec=%p pfnLoadDone=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, uVersion, cbGuess, pszBefore, pszBefore,
pfnLivePrep, pfnLiveExec, pfnLiveVote,
pfnSavePrep, pfnSaveExec, pfnSaveDone,
pfnLoadPrep, pfnLoadExec, pfnLoadDone));
int rc = SSMR3RegisterDevice(pDevIns->Internal.s.pVMR3, pDevIns, pDevIns->pReg->szName, pDevIns->iInstance,
uVersion, cbGuess, pszBefore,
pfnLivePrep, pfnLiveExec, pfnLiveVote,
pfnSavePrep, pfnSaveExec, pfnSaveDone,
pfnLoadPrep, pfnLoadExec, pfnLoadDone);
LogFlow(("pdmR3DevHlp_SSMRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnTMTimerCreate} */
static DECLCALLBACK(int) pdmR3DevHlp_TMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_TMTimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pvUser=%p fFlags=%#x pszDesc=%p:{%s} ppTimer=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, enmClock, pfnCallback, pvUser, fFlags, pszDesc, pszDesc, ppTimer));
if (pDevIns->iInstance > 0) /** @todo use a string cache here later. */
{
char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s [%u]", pszDesc, pDevIns->iInstance);
if (pszDesc2)
pszDesc = pszDesc2;
}
int rc = TMR3TimerCreateDevice(pVM, pDevIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer);
LogFlow(("pdmR3DevHlp_TMTimerCreate: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnTMUtcNow} */
static DECLCALLBACK(PRTTIMESPEC) pdmR3DevHlp_TMUtcNow(PPDMDEVINS pDevIns, PRTTIMESPEC pTime)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_TMUtcNow: caller='%s'/%d: pTime=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pTime));
pTime = TMR3UtcNow(pDevIns->Internal.s.pVMR3, pTime);
LogFlow(("pdmR3DevHlp_TMUtcNow: caller='%s'/%d: returns %RU64\n", pDevIns->pReg->szName, pDevIns->iInstance, RTTimeSpecGetNano(pTime)));
return pTime;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnTMTimeVirtGet} */
static DECLCALLBACK(uint64_t) pdmR3DevHlp_TMTimeVirtGet(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_TMTimeVirtGet: caller='%s'\n",
pDevIns->pReg->szName, pDevIns->iInstance));
uint64_t u64Time = TMVirtualSyncGet(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_TMTimeVirtGet: caller='%s'/%d: returns %RU64\n", pDevIns->pReg->szName, pDevIns->iInstance, u64Time));
return u64Time;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnTMTimeVirtGetFreq} */
static DECLCALLBACK(uint64_t) pdmR3DevHlp_TMTimeVirtGetFreq(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_TMTimeVirtGetFreq: caller='%s'\n",
pDevIns->pReg->szName, pDevIns->iInstance));
uint64_t u64Freq = TMVirtualGetFreq(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_TMTimeVirtGetFreq: caller='%s'/%d: returns %RU64\n", pDevIns->pReg->szName, pDevIns->iInstance, u64Freq));
return u64Freq;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnTMTimeVirtGetNano} */
static DECLCALLBACK(uint64_t) pdmR3DevHlp_TMTimeVirtGetNano(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_TMTimeVirtGetNano: caller='%s'\n",
pDevIns->pReg->szName, pDevIns->iInstance));
uint64_t u64Time = TMVirtualGet(pDevIns->Internal.s.pVMR3);
uint64_t u64Nano = TMVirtualToNano(pDevIns->Internal.s.pVMR3, u64Time);
LogFlow(("pdmR3DevHlp_TMTimeVirtGetNano: caller='%s'/%d: returns %RU64\n", pDevIns->pReg->szName, pDevIns->iInstance, u64Nano));
return u64Nano;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetSupDrvSession} */
static DECLCALLBACK(PSUPDRVSESSION) pdmR3DevHlp_GetSupDrvSession(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_GetSupDrvSession: caller='%s'\n",
pDevIns->pReg->szName, pDevIns->iInstance));
PSUPDRVSESSION pSession = pDevIns->Internal.s.pVMR3->pSession;
LogFlow(("pdmR3DevHlp_GetSupDrvSession: caller='%s'/%d: returns %#p\n", pDevIns->pReg->szName, pDevIns->iInstance, pSession));
return pSession;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysRead} */
static DECLCALLBACK(int) pdmR3DevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
LogFlow(("pdmR3DevHlp_PhysRead: caller='%s'/%d: GCPhys=%RGp pvBuf=%p cbRead=%#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhys, pvBuf, cbRead));
#if defined(VBOX_STRICT) && defined(PDM_DEVHLP_DEADLOCK_DETECTION)
if (!VM_IS_EMT(pVM))
{
char szNames[128];
uint32_t cLocks = PDMR3CritSectCountOwned(pVM, szNames, sizeof(szNames));
AssertMsg(cLocks == 0, ("cLocks=%u %s\n", cLocks, szNames));
}
#endif
VBOXSTRICTRC rcStrict;
if (VM_IS_EMT(pVM))
rcStrict = PGMPhysRead(pVM, GCPhys, pvBuf, cbRead, PGMACCESSORIGIN_DEVICE);
else
rcStrict = PGMR3PhysReadExternal(pVM, GCPhys, pvBuf, cbRead, PGMACCESSORIGIN_DEVICE);
AssertMsg(rcStrict == VINF_SUCCESS, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict))); /** @todo track down the users for this bugger. */
Log(("pdmR3DevHlp_PhysRead: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VBOXSTRICTRC_VAL(rcStrict) ));
return VBOXSTRICTRC_VAL(rcStrict);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysWrite} */
static DECLCALLBACK(int) pdmR3DevHlp_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
LogFlow(("pdmR3DevHlp_PhysWrite: caller='%s'/%d: GCPhys=%RGp pvBuf=%p cbWrite=%#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhys, pvBuf, cbWrite));
#if defined(VBOX_STRICT) && defined(PDM_DEVHLP_DEADLOCK_DETECTION)
if (!VM_IS_EMT(pVM))
{
char szNames[128];
uint32_t cLocks = PDMR3CritSectCountOwned(pVM, szNames, sizeof(szNames));
AssertMsg(cLocks == 0, ("cLocks=%u %s\n", cLocks, szNames));
}
#endif
VBOXSTRICTRC rcStrict;
if (VM_IS_EMT(pVM))
rcStrict = PGMPhysWrite(pVM, GCPhys, pvBuf, cbWrite, PGMACCESSORIGIN_DEVICE);
else
rcStrict = PGMR3PhysWriteExternal(pVM, GCPhys, pvBuf, cbWrite, PGMACCESSORIGIN_DEVICE);
AssertMsg(rcStrict == VINF_SUCCESS, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict))); /** @todo track down the users for this bugger. */
Log(("pdmR3DevHlp_PhysWrite: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VBOXSTRICTRC_VAL(rcStrict) ));
return VBOXSTRICTRC_VAL(rcStrict);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysGCPhys2CCPtr} */
static DECLCALLBACK(int) pdmR3DevHlp_PhysGCPhys2CCPtr(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv, PPGMPAGEMAPLOCK pLock)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
LogFlow(("pdmR3DevHlp_PhysGCPhys2CCPtr: caller='%s'/%d: GCPhys=%RGp fFlags=%#x ppv=%p pLock=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhys, fFlags, ppv, pLock));
AssertReturn(!fFlags, VERR_INVALID_PARAMETER);
#if defined(VBOX_STRICT) && defined(PDM_DEVHLP_DEADLOCK_DETECTION)
if (!VM_IS_EMT(pVM))
{
char szNames[128];
uint32_t cLocks = PDMR3CritSectCountOwned(pVM, szNames, sizeof(szNames));
AssertMsg(cLocks == 0, ("cLocks=%u %s\n", cLocks, szNames));
}
#endif
int rc = PGMR3PhysGCPhys2CCPtrExternal(pVM, GCPhys, ppv, pLock);
Log(("pdmR3DevHlp_PhysGCPhys2CCPtr: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysGCPhys2CCPtrReadOnly} */
static DECLCALLBACK(int) pdmR3DevHlp_PhysGCPhys2CCPtrReadOnly(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t fFlags, const void **ppv, PPGMPAGEMAPLOCK pLock)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
LogFlow(("pdmR3DevHlp_PhysGCPhys2CCPtrReadOnly: caller='%s'/%d: GCPhys=%RGp fFlags=%#x ppv=%p pLock=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPhys, fFlags, ppv, pLock));
AssertReturn(!fFlags, VERR_INVALID_PARAMETER);
#if defined(VBOX_STRICT) && defined(PDM_DEVHLP_DEADLOCK_DETECTION)
if (!VM_IS_EMT(pVM))
{
char szNames[128];
uint32_t cLocks = PDMR3CritSectCountOwned(pVM, szNames, sizeof(szNames));
AssertMsg(cLocks == 0, ("cLocks=%u %s\n", cLocks, szNames));
}
#endif
int rc = PGMR3PhysGCPhys2CCPtrReadOnlyExternal(pVM, GCPhys, ppv, pLock);
Log(("pdmR3DevHlp_PhysGCPhys2CCPtrReadOnly: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysReleasePageMappingLock} */
static DECLCALLBACK(void) pdmR3DevHlp_PhysReleasePageMappingLock(PPDMDEVINS pDevIns, PPGMPAGEMAPLOCK pLock)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
LogFlow(("pdmR3DevHlp_PhysReleasePageMappingLock: caller='%s'/%d: pLock=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pLock));
PGMPhysReleasePageMappingLock(pVM, pLock);
Log(("pdmR3DevHlp_PhysReleasePageMappingLock: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysReadGCVirt} */
static DECLCALLBACK(int) pdmR3DevHlp_PhysReadGCVirt(PPDMDEVINS pDevIns, void *pvDst, RTGCPTR GCVirtSrc, size_t cb)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_PhysReadGCVirt: caller='%s'/%d: pvDst=%p GCVirt=%RGv cb=%#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, pvDst, GCVirtSrc, cb));
PVMCPU pVCpu = VMMGetCpu(pVM);
if (!pVCpu)
return VERR_ACCESS_DENIED;
#if defined(VBOX_STRICT) && defined(PDM_DEVHLP_DEADLOCK_DETECTION)
/** @todo SMP. */
#endif
int rc = PGMPhysSimpleReadGCPtr(pVCpu, pvDst, GCVirtSrc, cb);
LogFlow(("pdmR3DevHlp_PhysReadGCVirt: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysWriteGCVirt} */
static DECLCALLBACK(int) pdmR3DevHlp_PhysWriteGCVirt(PPDMDEVINS pDevIns, RTGCPTR GCVirtDst, const void *pvSrc, size_t cb)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_PhysWriteGCVirt: caller='%s'/%d: GCVirtDst=%RGv pvSrc=%p cb=%#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCVirtDst, pvSrc, cb));
PVMCPU pVCpu = VMMGetCpu(pVM);
if (!pVCpu)
return VERR_ACCESS_DENIED;
#if defined(VBOX_STRICT) && defined(PDM_DEVHLP_DEADLOCK_DETECTION)
/** @todo SMP. */
#endif
int rc = PGMPhysSimpleWriteGCPtr(pVCpu, GCVirtDst, pvSrc, cb);
LogFlow(("pdmR3DevHlp_PhysWriteGCVirt: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPhysGCPtr2GCPhys} */
static DECLCALLBACK(int) pdmR3DevHlp_PhysGCPtr2GCPhys(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_PhysGCPtr2GCPhys: caller='%s'/%d: GCPtr=%RGv pGCPhys=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, GCPtr, pGCPhys));
PVMCPU pVCpu = VMMGetCpu(pVM);
if (!pVCpu)
return VERR_ACCESS_DENIED;
#if defined(VBOX_STRICT) && defined(PDM_DEVHLP_DEADLOCK_DETECTION)
/** @todo SMP. */
#endif
int rc = PGMPhysGCPtr2GCPhys(pVCpu, GCPtr, pGCPhys);
LogFlow(("pdmR3DevHlp_PhysGCPtr2GCPhys: caller='%s'/%d: returns %Rrc *pGCPhys=%RGp\n", pDevIns->pReg->szName, pDevIns->iInstance, rc, *pGCPhys));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnMMHeapAlloc} */
static DECLCALLBACK(void *) pdmR3DevHlp_MMHeapAlloc(PPDMDEVINS pDevIns, size_t cb)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_MMHeapAlloc: caller='%s'/%d: cb=%#x\n", pDevIns->pReg->szName, pDevIns->iInstance, cb));
void *pv = MMR3HeapAlloc(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE_USER, cb);
LogFlow(("pdmR3DevHlp_MMHeapAlloc: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pv));
return pv;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnMMHeapAllocZ} */
static DECLCALLBACK(void *) pdmR3DevHlp_MMHeapAllocZ(PPDMDEVINS pDevIns, size_t cb)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_MMHeapAllocZ: caller='%s'/%d: cb=%#x\n", pDevIns->pReg->szName, pDevIns->iInstance, cb));
void *pv = MMR3HeapAllocZ(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE_USER, cb);
LogFlow(("pdmR3DevHlp_MMHeapAllocZ: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pv));
return pv;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnMMHeapFree} */
static DECLCALLBACK(void) pdmR3DevHlp_MMHeapFree(PPDMDEVINS pDevIns, void *pv)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_MMHeapFree: caller='%s'/%d: pv=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pv));
MMR3HeapFree(pv);
LogFlow(("pdmR3DevHlp_MMHeapAlloc: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMState} */
static DECLCALLBACK(VMSTATE) pdmR3DevHlp_VMState(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VMSTATE enmVMState = VMR3GetState(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDevIns->pReg->szName, pDevIns->iInstance,
enmVMState, VMR3GetStateName(enmVMState)));
return enmVMState;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMTeleportedAndNotFullyResumedYet} */
static DECLCALLBACK(bool) pdmR3DevHlp_VMTeleportedAndNotFullyResumedYet(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
bool fRc = VMR3TeleportedAndNotFullyResumedYet(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_VMState: caller='%s'/%d: returns %RTbool\n", pDevIns->pReg->szName, pDevIns->iInstance,
fRc));
return fRc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSetError} */
static DECLCALLBACK(int) pdmR3DevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
va_list args;
va_start(args, pszFormat);
int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMR3, rc, RT_SRC_POS_ARGS, pszFormat, args); Assert(rc2 == rc); NOREF(rc2);
va_end(args);
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSetErrorV} */
static DECLCALLBACK(int) pdmR3DevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMR3, rc, RT_SRC_POS_ARGS, pszFormat, va); Assert(rc2 == rc); NOREF(rc2);
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSetRuntimeError} */
static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
va_list args;
va_start(args, pszFormat);
int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFlags, pszErrorId, pszFormat, args);
va_end(args);
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSetRuntimeErrorV} */
static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFlags, pszErrorId, pszFormat, va);
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDBGFStopV} */
static DECLCALLBACK(int) pdmR3DevHlp_DBGFStopV(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction, const char *pszFormat, va_list args)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
#ifdef LOG_ENABLED
va_list va2;
va_copy(va2, args);
LogFlow(("pdmR3DevHlp_DBGFStopV: caller='%s'/%d: pszFile=%p:{%s} iLine=%d pszFunction=%p:{%s} pszFormat=%p:{%s} (%N)\n",
pDevIns->pReg->szName, pDevIns->iInstance, pszFile, pszFile, iLine, pszFunction, pszFunction, pszFormat, pszFormat, pszFormat, &va2));
va_end(va2);
#endif
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
int rc = DBGFR3EventSrcV(pVM, DBGFEVENT_DEV_STOP, pszFile, iLine, pszFunction, pszFormat, args);
if (rc == VERR_DBGF_NOT_ATTACHED)
rc = VINF_SUCCESS;
LogFlow(("pdmR3DevHlp_DBGFStopV: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDBGFInfoRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_DBGFInfoRegister(PPDMDEVINS pDevIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_DBGFInfoRegister: caller='%s'/%d: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pszName, pszName, pszDesc, pszDesc, pfnHandler));
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
int rc = DBGFR3InfoRegisterDevice(pVM, pszName, pszDesc, pfnHandler, pDevIns);
LogFlow(("pdmR3DevHlp_DBGFInfoRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDBGFRegRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_DBGFRegRegister(PPDMDEVINS pDevIns, PCDBGFREGDESC paRegisters)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_DBGFRegRegister: caller='%s'/%d: paRegisters=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, paRegisters));
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
int rc = DBGFR3RegRegisterDevice(pVM, paRegisters, pDevIns, pDevIns->pReg->szName, pDevIns->iInstance);
LogFlow(("pdmR3DevHlp_DBGFRegRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDBGFTraceBuf} */
static DECLCALLBACK(RTTRACEBUF) pdmR3DevHlp_DBGFTraceBuf(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
RTTRACEBUF hTraceBuf = pDevIns->Internal.s.pVMR3->hTraceBufR3;
LogFlow(("pdmR3DevHlp_DBGFTraceBuf: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, hTraceBuf));
return hTraceBuf;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnSTAMRegister} */
static DECLCALLBACK(void) pdmR3DevHlp_STAMRegister(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
STAM_REG(pVM, pvSample, enmType, pszName, enmUnit, pszDesc);
NOREF(pVM);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnSTAMRegisterF} */
static DECLCALLBACK(void) pdmR3DevHlp_STAMRegisterF(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
STAMUNIT enmUnit, const char *pszDesc, const char *pszName, ...)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
va_list args;
va_start(args, pszName);
int rc = STAMR3RegisterV(pVM, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, args);
va_end(args);
AssertRC(rc);
NOREF(pVM);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnSTAMRegisterV} */
static DECLCALLBACK(void) pdmR3DevHlp_STAMRegisterV(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
STAMUNIT enmUnit, const char *pszDesc, const char *pszName, va_list args)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
int rc = STAMR3RegisterV(pVM, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, args);
AssertRC(rc);
NOREF(pVM);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCIRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_PCIRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: pPciDev=%p:{.config={%#.256Rhxs}\n",
pDevIns->pReg->szName, pDevIns->iInstance, pPciDev, pPciDev->config));
/*
* Validate input.
*/
if (!pPciDev)
{
Assert(pPciDev);
LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: returns %Rrc (pPciDev)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!pPciDev->config[0] && !pPciDev->config[1])
{
Assert(pPciDev->config[0] || pPciDev->config[1]);
LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: returns %Rrc (vendor)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (pDevIns->Internal.s.pPciDeviceR3)
{
/** @todo the PCI device vs. PDM device designed is a bit flawed if we have to
* support a PDM device with multiple PCI devices. This might become a problem
* when upgrading the chipset for instance because of multiple functions in some
* devices...
*/
AssertMsgFailed(("Only one PCI device per device is currently implemented!\n"));
return VERR_PDM_ONE_PCI_FUNCTION_PER_DEVICE;
}
/*
* Choose the PCI bus for the device.
*
* This is simple. If the device was configured for a particular bus, the PCIBusNo
* configuration value will be set. If not the default bus is 0.
*/
int rc;
PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3;
if (!pBus)
{
uint8_t u8Bus;
rc = CFGMR3QueryU8Def(pDevIns->Internal.s.pCfgHandle, "PCIBusNo", &u8Bus, 0);
AssertLogRelMsgRCReturn(rc, ("Configuration error: PCIBusNo query failed with rc=%Rrc (%s/%d)\n",
rc, pDevIns->pReg->szName, pDevIns->iInstance), rc);
AssertLogRelMsgReturn(u8Bus < RT_ELEMENTS(pVM->pdm.s.aPciBuses),
("Configuration error: PCIBusNo=%d, max is %d. (%s/%d)\n", u8Bus,
RT_ELEMENTS(pVM->pdm.s.aPciBuses), pDevIns->pReg->szName, pDevIns->iInstance),
VERR_PDM_NO_PCI_BUS);
pBus = pDevIns->Internal.s.pPciBusR3 = &pVM->pdm.s.aPciBuses[u8Bus];
}
if (pBus->pDevInsR3)
{
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0)
pDevIns->Internal.s.pPciBusR0 = MMHyperR3ToR0(pVM, pDevIns->Internal.s.pPciBusR3);
else
pDevIns->Internal.s.pPciBusR0 = NIL_RTR0PTR;
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
pDevIns->Internal.s.pPciBusRC = MMHyperR3ToRC(pVM, pDevIns->Internal.s.pPciBusR3);
else
pDevIns->Internal.s.pPciBusRC = NIL_RTRCPTR;
/*
* Check the configuration for PCI device and function assignment.
*/
int iDev = -1;
uint8_t u8Device;
rc = CFGMR3QueryU8(pDevIns->Internal.s.pCfgHandle, "PCIDeviceNo", &u8Device);
if (RT_SUCCESS(rc))
{
AssertMsgReturn(u8Device <= 31,
("Configuration error: PCIDeviceNo=%d, max is 31. (%s/%d)\n",
u8Device, pDevIns->pReg->szName, pDevIns->iInstance),
VERR_PDM_BAD_PCI_CONFIG);
uint8_t u8Function;
rc = CFGMR3QueryU8(pDevIns->Internal.s.pCfgHandle, "PCIFunctionNo", &u8Function);
AssertMsgRCReturn(rc, ("Configuration error: PCIDeviceNo, but PCIFunctionNo query failed with rc=%Rrc (%s/%d)\n",
rc, pDevIns->pReg->szName, pDevIns->iInstance),
rc);
AssertMsgReturn(u8Function <= 7,
("Configuration error: PCIFunctionNo=%d, max is 7. (%s/%d)\n",
u8Function, pDevIns->pReg->szName, pDevIns->iInstance),
VERR_PDM_BAD_PCI_CONFIG);
iDev = (u8Device << 3) | u8Function;
}
else if (rc != VERR_CFGM_VALUE_NOT_FOUND)
{
AssertMsgFailed(("Configuration error: PCIDeviceNo query failed with rc=%Rrc (%s/%d)\n",
rc, pDevIns->pReg->szName, pDevIns->iInstance));
return rc;
}
/*
* Call the pci bus device to do the actual registration.
*/
pdmLock(pVM);
rc = pBus->pfnRegisterR3(pBus->pDevInsR3, pPciDev, pDevIns->pReg->szName, iDev);
pdmUnlock(pVM);
if (RT_SUCCESS(rc))
{
pPciDev->pDevIns = pDevIns;
pDevIns->Internal.s.pPciDeviceR3 = pPciDev;
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0)
pDevIns->Internal.s.pPciDeviceR0 = MMHyperR3ToR0(pVM, pPciDev);
else
pDevIns->Internal.s.pPciDeviceR0 = NIL_RTR0PTR;
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
pDevIns->Internal.s.pPciDeviceRC = MMHyperR3ToRC(pVM, pPciDev);
else
pDevIns->Internal.s.pPciDeviceRC = NIL_RTRCPTR;
Log(("PDM: Registered device '%s'/%d as PCI device %d on bus %d\n",
pDevIns->pReg->szName, pDevIns->iInstance, pPciDev->devfn, pDevIns->Internal.s.pPciBusR3->iBus));
}
}
else
{
AssertLogRelMsgFailed(("Configuration error: No PCI bus available. This could be related to init order too!\n"));
rc = VERR_PDM_NO_PCI_BUS;
}
LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCIIORegionRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_PCIIORegionRegister(PPDMDEVINS pDevIns, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_PCIIORegionRegister: caller='%s'/%d: iRegion=%d cbRegion=%#x enmType=%d pfnCallback=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, iRegion, cbRegion, enmType, pfnCallback));
/*
* Validate input.
*/
if (iRegion < 0 || iRegion >= PCI_NUM_REGIONS)
{
Assert(iRegion >= 0 && iRegion < PCI_NUM_REGIONS);
LogFlow(("pdmR3DevHlp_PCIIORegionRegister: caller='%s'/%d: returns %Rrc (iRegion)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
switch ((int)enmType)
{
case PCI_ADDRESS_SPACE_IO:
/*
* Sanity check: don't allow to register more than 32K of the PCI I/O space.
*/
AssertMsgReturn(cbRegion <= _32K,
("caller='%s'/%d: %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, cbRegion),
VERR_INVALID_PARAMETER);
break;
case PCI_ADDRESS_SPACE_MEM:
case PCI_ADDRESS_SPACE_MEM_PREFETCH:
case PCI_ADDRESS_SPACE_MEM | PCI_ADDRESS_SPACE_BAR64:
case PCI_ADDRESS_SPACE_MEM_PREFETCH | PCI_ADDRESS_SPACE_BAR64:
/*
* Sanity check: don't allow to register more than 512MB of the PCI MMIO space for
* now. If this limit is increased beyond 2GB, adapt the aligned check below as well!
*/
AssertMsgReturn(cbRegion <= 512 * _1M,
("caller='%s'/%d: %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, cbRegion),
VERR_INVALID_PARAMETER);
break;
default:
AssertMsgFailed(("enmType=%#x is unknown\n", enmType));
LogFlow(("pdmR3DevHlp_PCIIORegionRegister: caller='%s'/%d: returns %Rrc (enmType)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!pfnCallback)
{
Assert(pfnCallback);
LogFlow(("pdmR3DevHlp_PCIIORegionRegister: caller='%s'/%d: returns %Rrc (callback)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
AssertRelease(VMR3GetState(pVM) != VMSTATE_RUNNING);
/*
* Must have a PCI device registered!
*/
int rc;
PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3;
if (pPciDev)
{
/*
* We're currently restricted to page aligned MMIO regions.
*/
if ( ((enmType & ~(PCI_ADDRESS_SPACE_BAR64 | PCI_ADDRESS_SPACE_MEM_PREFETCH)) == PCI_ADDRESS_SPACE_MEM)
&& cbRegion != RT_ALIGN_32(cbRegion, PAGE_SIZE))
{
Log(("pdmR3DevHlp_PCIIORegionRegister: caller='%s'/%d: aligning cbRegion %#x -> %#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, cbRegion, RT_ALIGN_32(cbRegion, PAGE_SIZE)));
cbRegion = RT_ALIGN_32(cbRegion, PAGE_SIZE);
}
/*
* For registering PCI MMIO memory or PCI I/O memory, the size of the region must be a power of 2!
*/
int iLastSet = ASMBitLastSetU32(cbRegion);
Assert(iLastSet > 0);
uint32_t cbRegionAligned = RT_BIT_32(iLastSet - 1);
if (cbRegion > cbRegionAligned)
cbRegion = cbRegionAligned * 2; /* round up */
PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3;
Assert(pBus);
pdmLock(pVM);
rc = pBus->pfnIORegionRegisterR3(pBus->pDevInsR3, pPciDev, iRegion, cbRegion, enmType, pfnCallback);
pdmUnlock(pVM);
}
else
{
AssertMsgFailed(("No PCI device registered!\n"));
rc = VERR_PDM_NOT_PCI_DEVICE;
}
LogFlow(("pdmR3DevHlp_PCIIORegionRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCISetConfigCallbacks} */
static DECLCALLBACK(void) pdmR3DevHlp_PCISetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_PCISetConfigCallbacks: caller='%s'/%d: pPciDev=%p pfnRead=%p ppfnReadOld=%p pfnWrite=%p ppfnWriteOld=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld));
/*
* Validate input and resolve defaults.
*/
AssertPtr(pfnRead);
AssertPtr(pfnWrite);
AssertPtrNull(ppfnReadOld);
AssertPtrNull(ppfnWriteOld);
AssertPtrNull(pPciDev);
if (!pPciDev)
pPciDev = pDevIns->Internal.s.pPciDeviceR3;
AssertReleaseMsg(pPciDev, ("You must register your device first!\n"));
PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3;
AssertRelease(pBus);
AssertRelease(VMR3GetState(pVM) != VMSTATE_RUNNING);
/*
* Do the job.
*/
pdmLock(pVM);
pBus->pfnSetConfigCallbacksR3(pBus->pDevInsR3, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld);
pdmUnlock(pVM);
LogFlow(("pdmR3DevHlp_PCISetConfigCallbacks: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCIPhysRead} */
static DECLCALLBACK(int) pdmR3DevHlp_PCIPhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
#ifndef PDM_DO_NOT_RESPECT_PCI_BM_BIT
/*
* Just check the busmaster setting here and forward the request to the generic read helper.
*/
PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3;
AssertReleaseMsg(pPciDev, ("No PCI device registered!\n"));
if (!PCIDevIsBusmaster(pPciDev))
{
Log(("pdmR3DevHlp_PCIPhysRead: caller='%s'/%d: returns %Rrc - Not bus master! GCPhys=%RGp cbRead=%#zx\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_PDM_NOT_PCI_BUS_MASTER, GCPhys, cbRead));
return VERR_PDM_NOT_PCI_BUS_MASTER;
}
#endif
return pDevIns->pHlpR3->pfnPhysRead(pDevIns, GCPhys, pvBuf, cbRead);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCIPhysRead} */
static DECLCALLBACK(int) pdmR3DevHlp_PCIPhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
#ifndef PDM_DO_NOT_RESPECT_PCI_BM_BIT
/*
* Just check the busmaster setting here and forward the request to the generic read helper.
*/
PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3;
AssertReleaseMsg(pPciDev, ("No PCI device registered!\n"));
if (!PCIDevIsBusmaster(pPciDev))
{
Log(("pdmR3DevHlp_PCIPhysWrite: caller='%s'/%d: returns %Rrc - Not bus master! GCPhys=%RGp cbWrite=%#zx\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_PDM_NOT_PCI_BUS_MASTER, GCPhys, cbWrite));
return VERR_PDM_NOT_PCI_BUS_MASTER;
}
#endif
return pDevIns->pHlpR3->pfnPhysWrite(pDevIns, GCPhys, pvBuf, cbWrite);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCISetIrq} */
static DECLCALLBACK(void) pdmR3DevHlp_PCISetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_PCISetIrq: caller='%s'/%d: iIrq=%d iLevel=%d\n", pDevIns->pReg->szName, pDevIns->iInstance, iIrq, iLevel));
/*
* Validate input.
*/
Assert(iIrq == 0);
Assert((uint32_t)iLevel <= PDM_IRQ_LEVEL_FLIP_FLOP);
/*
* Must have a PCI device registered!
*/
PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3;
if (pPciDev)
{
PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; /** @todo the bus should be associated with the PCI device not the PDM device. */
Assert(pBus);
PVM pVM = pDevIns->Internal.s.pVMR3;
pdmLock(pVM);
uint32_t uTagSrc;
if (iLevel & PDM_IRQ_LEVEL_HIGH)
{
pDevIns->Internal.s.uLastIrqTag = uTagSrc = pdmCalcIrqTag(pVM, pDevIns->idTracing);
if (iLevel == PDM_IRQ_LEVEL_HIGH)
VBOXVMM_PDM_IRQ_HIGH(VMMGetCpu(pVM), RT_LOWORD(uTagSrc), RT_HIWORD(uTagSrc));
else
VBOXVMM_PDM_IRQ_HILO(VMMGetCpu(pVM), RT_LOWORD(uTagSrc), RT_HIWORD(uTagSrc));
}
else
uTagSrc = pDevIns->Internal.s.uLastIrqTag;
pBus->pfnSetIrqR3(pBus->pDevInsR3, pPciDev, iIrq, iLevel, uTagSrc);
if (iLevel == PDM_IRQ_LEVEL_LOW)
VBOXVMM_PDM_IRQ_LOW(VMMGetCpu(pVM), RT_LOWORD(uTagSrc), RT_HIWORD(uTagSrc));
pdmUnlock(pVM);
}
else
AssertReleaseMsgFailed(("No PCI device registered!\n"));
LogFlow(("pdmR3DevHlp_PCISetIrq: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCISetIrqNoWait} */
static DECLCALLBACK(void) pdmR3DevHlp_PCISetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel)
{
pdmR3DevHlp_PCISetIrq(pDevIns, iIrq, iLevel);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCIRegisterMsi} */
static DECLCALLBACK(int) pdmR3DevHlp_PCIRegisterMsi(PPDMDEVINS pDevIns, PPDMMSIREG pMsiReg)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_PCIRegisterMsi: caller='%s'/%d: %d MSI vectors %d MSI-X vectors\n", pDevIns->pReg->szName, pDevIns->iInstance, pMsiReg->cMsiVectors,pMsiReg->cMsixVectors ));
int rc = VINF_SUCCESS;
/*
* Must have a PCI device registered!
*/
PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3;
if (pPciDev)
{
PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; /** @todo the bus should be associated with the PCI device not the PDM device. */
Assert(pBus);
PVM pVM = pDevIns->Internal.s.pVMR3;
pdmLock(pVM);
if (pBus->pfnRegisterMsiR3)
rc = pBus->pfnRegisterMsiR3(pBus->pDevInsR3, pPciDev, pMsiReg);
else
rc = VERR_NOT_IMPLEMENTED;
pdmUnlock(pVM);
}
else
AssertReleaseMsgFailed(("No PCI device registered!\n"));
LogFlow(("pdmR3DevHlp_PCISetIrq: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnISASetIrq} */
static DECLCALLBACK(void) pdmR3DevHlp_ISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_ISASetIrq: caller='%s'/%d: iIrq=%d iLevel=%d\n", pDevIns->pReg->szName, pDevIns->iInstance, iIrq, iLevel));
/*
* Validate input.
*/
Assert(iIrq < 16);
Assert((uint32_t)iLevel <= PDM_IRQ_LEVEL_FLIP_FLOP);
PVM pVM = pDevIns->Internal.s.pVMR3;
/*
* Do the job.
*/
pdmLock(pVM);
uint32_t uTagSrc;
if (iLevel & PDM_IRQ_LEVEL_HIGH)
{
pDevIns->Internal.s.uLastIrqTag = uTagSrc = pdmCalcIrqTag(pVM, pDevIns->idTracing);
if (iLevel == PDM_IRQ_LEVEL_HIGH)
VBOXVMM_PDM_IRQ_HIGH(VMMGetCpu(pVM), RT_LOWORD(uTagSrc), RT_HIWORD(uTagSrc));
else
VBOXVMM_PDM_IRQ_HILO(VMMGetCpu(pVM), RT_LOWORD(uTagSrc), RT_HIWORD(uTagSrc));
}
else
uTagSrc = pDevIns->Internal.s.uLastIrqTag;
PDMIsaSetIrq(pVM, iIrq, iLevel, uTagSrc); /* (The API takes the lock recursively.) */
if (iLevel == PDM_IRQ_LEVEL_LOW)
VBOXVMM_PDM_IRQ_LOW(VMMGetCpu(pVM), RT_LOWORD(uTagSrc), RT_HIWORD(uTagSrc));
pdmUnlock(pVM);
LogFlow(("pdmR3DevHlp_ISASetIrq: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
}
/** @interface_method_impl{PDMDEVHLPR3,pfnISASetIrqNoWait} */
static DECLCALLBACK(void) pdmR3DevHlp_ISASetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel)
{
pdmR3DevHlp_ISASetIrq(pDevIns, iIrq, iLevel);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDriverAttach} */
static DECLCALLBACK(int) pdmR3DevHlp_DriverAttach(PPDMDEVINS pDevIns, uint32_t iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_DriverAttach: caller='%s'/%d: iLun=%d pBaseInterface=%p ppBaseInterface=%p pszDesc=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, iLun, pBaseInterface, ppBaseInterface, pszDesc, pszDesc));
/*
* Lookup the LUN, it might already be registered.
*/
PPDMLUN pLunPrev = NULL;
PPDMLUN pLun = pDevIns->Internal.s.pLunsR3;
for (; pLun; pLunPrev = pLun, pLun = pLun->pNext)
if (pLun->iLun == iLun)
break;
/*
* Create the LUN if if wasn't found, else check if driver is already attached to it.
*/
if (!pLun)
{
if ( !pBaseInterface
|| !pszDesc
|| !*pszDesc)
{
Assert(pBaseInterface);
Assert(pszDesc || *pszDesc);
return VERR_INVALID_PARAMETER;
}
pLun = (PPDMLUN)MMR3HeapAlloc(pVM, MM_TAG_PDM_LUN, sizeof(*pLun));
if (!pLun)
return VERR_NO_MEMORY;
pLun->iLun = iLun;
pLun->pNext = pLunPrev ? pLunPrev->pNext : NULL;
pLun->pTop = NULL;
pLun->pBottom = NULL;
pLun->pDevIns = pDevIns;
pLun->pUsbIns = NULL;
pLun->pszDesc = pszDesc;
pLun->pBase = pBaseInterface;
if (!pLunPrev)
pDevIns->Internal.s.pLunsR3 = pLun;
else
pLunPrev->pNext = pLun;
Log(("pdmR3DevHlp_DriverAttach: Registered LUN#%d '%s' with device '%s'/%d.\n",
iLun, pszDesc, pDevIns->pReg->szName, pDevIns->iInstance));
}
else if (pLun->pTop)
{
AssertMsgFailed(("Already attached! The device should keep track of such things!\n"));
LogFlow(("pdmR3DevHlp_DriverAttach: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_PDM_DRIVER_ALREADY_ATTACHED));
return VERR_PDM_DRIVER_ALREADY_ATTACHED;
}
Assert(pLun->pBase == pBaseInterface);
/*
* Get the attached driver configuration.
*/
int rc;
PCFGMNODE pNode = CFGMR3GetChildF(pDevIns->Internal.s.pCfgHandle, "LUN#%u", iLun);
if (pNode)
rc = pdmR3DrvInstantiate(pVM, pNode, pBaseInterface, NULL /*pDrvAbove*/, pLun, ppBaseInterface);
else
rc = VERR_PDM_NO_ATTACHED_DRIVER;
LogFlow(("pdmR3DevHlp_DriverAttach: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnQueueCreate} */
static DECLCALLBACK(int) pdmR3DevHlp_QueueCreate(PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_QueueCreate: caller='%s'/%d: cbItem=%#x cItems=%#x cMilliesInterval=%u pfnCallback=%p fGCEnabled=%RTbool pszName=%p:{%s} ppQueue=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, pszName, pszName, ppQueue));
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
if (pDevIns->iInstance > 0)
{
pszName = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s_%u", pszName, pDevIns->iInstance);
AssertLogRelReturn(pszName, VERR_NO_MEMORY);
}
int rc = PDMR3QueueCreateDevice(pVM, pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, pszName, ppQueue);
LogFlow(("pdmR3DevHlp_QueueCreate: caller='%s'/%d: returns %Rrc *ppQueue=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, rc, *ppQueue));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnCritSectInit} */
static DECLCALLBACK(int) pdmR3DevHlp_CritSectInit(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL,
const char *pszNameFmt, va_list va)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_CritSectInit: caller='%s'/%d: pCritSect=%p pszNameFmt=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, pCritSect, pszNameFmt, pszNameFmt));
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
int rc = pdmR3CritSectInitDevice(pVM, pDevIns, pCritSect, RT_SRC_POS_ARGS, pszNameFmt, va);
LogFlow(("pdmR3DevHlp_CritSectInit: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnCritSectGetNop} */
static DECLCALLBACK(PPDMCRITSECT) pdmR3DevHlp_CritSectGetNop(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
PPDMCRITSECT pCritSect = PDMR3CritSectGetNop(pVM);
LogFlow(("pdmR3DevHlp_CritSectGetNop: caller='%s'/%d: return %p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pCritSect));
return pCritSect;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnCritSectGetNopR0} */
static DECLCALLBACK(R0PTRTYPE(PPDMCRITSECT)) pdmR3DevHlp_CritSectGetNopR0(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
R0PTRTYPE(PPDMCRITSECT) pCritSect = PDMR3CritSectGetNopR0(pVM);
LogFlow(("pdmR3DevHlp_CritSectGetNopR0: caller='%s'/%d: return %RHv\n",
pDevIns->pReg->szName, pDevIns->iInstance, pCritSect));
return pCritSect;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnCritSectGetNopRC} */
static DECLCALLBACK(RCPTRTYPE(PPDMCRITSECT)) pdmR3DevHlp_CritSectGetNopRC(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
RCPTRTYPE(PPDMCRITSECT) pCritSect = PDMR3CritSectGetNopRC(pVM);
LogFlow(("pdmR3DevHlp_CritSectGetNopRC: caller='%s'/%d: return %RRv\n",
pDevIns->pReg->szName, pDevIns->iInstance, pCritSect));
return pCritSect;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnSetDeviceCritSect} */
static DECLCALLBACK(int) pdmR3DevHlp_SetDeviceCritSect(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect)
{
/*
* Validate input.
*
* Note! We only allow the automatically created default critical section
* to be replaced by this API.
*/
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertPtrReturn(pCritSect, VERR_INVALID_POINTER);
LogFlow(("pdmR3DevHlp_SetDeviceCritSect: caller='%s'/%d: pCritSect=%p (%s)\n",
pDevIns->pReg->szName, pDevIns->iInstance, pCritSect, pCritSect->s.pszName));
AssertReturn(PDMCritSectIsInitialized(pCritSect), VERR_INVALID_PARAMETER);
PVM pVM = pDevIns->Internal.s.pVMR3;
AssertReturn(pCritSect->s.pVMR3 == pVM, VERR_INVALID_PARAMETER);
VM_ASSERT_EMT(pVM);
VM_ASSERT_STATE_RETURN(pVM, VMSTATE_CREATING, VERR_WRONG_ORDER);
AssertReturn(pDevIns->pCritSectRoR3, VERR_PDM_DEV_IPE_1);
AssertReturn(pDevIns->pCritSectRoR3->s.fAutomaticDefaultCritsect, VERR_WRONG_ORDER);
AssertReturn(!pDevIns->pCritSectRoR3->s.fUsedByTimerOrSimilar, VERR_WRONG_ORDER);
AssertReturn(pDevIns->pCritSectRoR3 != pCritSect, VERR_INVALID_PARAMETER);
/*
* Replace the critical section and destroy the automatic default section.
*/
PPDMCRITSECT pOldCritSect = pDevIns->pCritSectRoR3;
pDevIns->pCritSectRoR3 = pCritSect;
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0)
pDevIns->pCritSectRoR0 = MMHyperCCToR0(pVM, pDevIns->pCritSectRoR3);
else
Assert(pDevIns->pCritSectRoR0 == NIL_RTRCPTR);
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
pDevIns->pCritSectRoRC = MMHyperCCToRC(pVM, pDevIns->pCritSectRoR3);
else
Assert(pDevIns->pCritSectRoRC == NIL_RTRCPTR);
PDMR3CritSectDelete(pOldCritSect);
if (pDevIns->pReg->fFlags & (PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0))
MMHyperFree(pVM, pOldCritSect);
else
MMR3HeapFree(pOldCritSect);
LogFlow(("pdmR3DevHlp_SetDeviceCritSect: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnThreadCreate} */
static DECLCALLBACK(int) pdmR3DevHlp_ThreadCreate(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread,
PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_ThreadCreate: caller='%s'/%d: ppThread=%p pvUser=%p pfnThread=%p pfnWakeup=%p cbStack=%#zx enmType=%d pszName=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName, pszName));
int rc = pdmR3ThreadCreateDevice(pDevIns->Internal.s.pVMR3, pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
LogFlow(("pdmR3DevHlp_ThreadCreate: caller='%s'/%d: returns %Rrc *ppThread=%RTthrd\n", pDevIns->pReg->szName, pDevIns->iInstance,
rc, *ppThread));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnSetAsyncNotification} */
static DECLCALLBACK(int) pdmR3DevHlp_SetAsyncNotification(PPDMDEVINS pDevIns, PFNPDMDEVASYNCNOTIFY pfnAsyncNotify)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT0(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_SetAsyncNotification: caller='%s'/%d: pfnAsyncNotify=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pfnAsyncNotify));
int rc = VINF_SUCCESS;
AssertStmt(pfnAsyncNotify, rc = VERR_INVALID_PARAMETER);
AssertStmt(!pDevIns->Internal.s.pfnAsyncNotify, rc = VERR_WRONG_ORDER);
AssertStmt(pDevIns->Internal.s.fIntFlags & (PDMDEVINSINT_FLAGS_SUSPENDED | PDMDEVINSINT_FLAGS_RESET), rc = VERR_WRONG_ORDER);
VMSTATE enmVMState = VMR3GetState(pDevIns->Internal.s.pVMR3);
AssertStmt( enmVMState == VMSTATE_SUSPENDING
|| enmVMState == VMSTATE_SUSPENDING_EXT_LS
|| enmVMState == VMSTATE_SUSPENDING_LS
|| enmVMState == VMSTATE_RESETTING
|| enmVMState == VMSTATE_RESETTING_LS
|| enmVMState == VMSTATE_POWERING_OFF
|| enmVMState == VMSTATE_POWERING_OFF_LS,
rc = VERR_INVALID_STATE);
if (RT_SUCCESS(rc))
pDevIns->Internal.s.pfnAsyncNotify = pfnAsyncNotify;
LogFlow(("pdmR3DevHlp_SetAsyncNotification: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnAsyncNotificationCompleted} */
static DECLCALLBACK(void) pdmR3DevHlp_AsyncNotificationCompleted(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VMSTATE enmVMState = VMR3GetState(pVM);
if ( enmVMState == VMSTATE_SUSPENDING
|| enmVMState == VMSTATE_SUSPENDING_EXT_LS
|| enmVMState == VMSTATE_SUSPENDING_LS
|| enmVMState == VMSTATE_RESETTING
|| enmVMState == VMSTATE_RESETTING_LS
|| enmVMState == VMSTATE_POWERING_OFF
|| enmVMState == VMSTATE_POWERING_OFF_LS)
{
LogFlow(("pdmR3DevHlp_AsyncNotificationCompleted: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
VMR3AsyncPdmNotificationWakeupU(pVM->pUVM);
}
else
LogFlow(("pdmR3DevHlp_AsyncNotificationCompleted: caller='%s'/%d: enmVMState=%d\n", pDevIns->pReg->szName, pDevIns->iInstance, enmVMState));
}
/** @interface_method_impl{PDMDEVHLPR3,pfnRTCRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_RTCRegister(PPDMDEVINS pDevIns, PCPDMRTCREG pRtcReg, PCPDMRTCHLP *ppRtcHlp)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_RTCRegister: caller='%s'/%d: pRtcReg=%p:{.u32Version=%#x, .pfnWrite=%p, .pfnRead=%p} ppRtcHlp=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pRtcReg, pRtcReg->u32Version, pRtcReg->pfnWrite,
pRtcReg->pfnWrite, ppRtcHlp));
/*
* Validate input.
*/
if (pRtcReg->u32Version != PDM_RTCREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pRtcReg->u32Version,
PDM_RTCREG_VERSION));
LogFlow(("pdmR3DevHlp_RTCRegister: caller='%s'/%d: returns %Rrc (version)\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( !pRtcReg->pfnWrite
|| !pRtcReg->pfnRead)
{
Assert(pRtcReg->pfnWrite);
Assert(pRtcReg->pfnRead);
LogFlow(("pdmR3DevHlp_RTCRegister: caller='%s'/%d: returns %Rrc (callbacks)\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppRtcHlp)
{
Assert(ppRtcHlp);
LogFlow(("pdmR3DevHlp_RTCRegister: caller='%s'/%d: returns %Rrc (ppRtcHlp)\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Only one DMA device.
*/
PVM pVM = pDevIns->Internal.s.pVMR3;
if (pVM->pdm.s.pRtc)
{
AssertMsgFailed(("Only one RTC device is supported!\n"));
LogFlow(("pdmR3DevHlp_RTCRegister: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Allocate and initialize pci bus structure.
*/
int rc = VINF_SUCCESS;
PPDMRTC pRtc = (PPDMRTC)MMR3HeapAlloc(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE, sizeof(*pRtc));
if (pRtc)
{
pRtc->pDevIns = pDevIns;
pRtc->Reg = *pRtcReg;
pVM->pdm.s.pRtc = pRtc;
/* set the helper pointer. */
*ppRtcHlp = &g_pdmR3DevRtcHlp;
Log(("PDM: Registered RTC device '%s'/%d pDevIns=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
}
else
rc = VERR_NO_MEMORY;
LogFlow(("pdmR3DevHlp_RTCRegister: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDMARegister} */
static DECLCALLBACK(int) pdmR3DevHlp_DMARegister(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_DMARegister: caller='%s'/%d: uChannel=%d pfnTransferHandler=%p pvUser=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, uChannel, pfnTransferHandler, pvUser));
int rc = VINF_SUCCESS;
if (pVM->pdm.s.pDmac)
pVM->pdm.s.pDmac->Reg.pfnRegister(pVM->pdm.s.pDmac->pDevIns, uChannel, pfnTransferHandler, pvUser);
else
{
AssertMsgFailed(("Configuration error: No DMAC controller available. This could be related to init order too!\n"));
rc = VERR_PDM_NO_DMAC_INSTANCE;
}
LogFlow(("pdmR3DevHlp_DMARegister: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDMAReadMemory} */
static DECLCALLBACK(int) pdmR3DevHlp_DMAReadMemory(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbRead)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_DMAReadMemory: caller='%s'/%d: uChannel=%d pvBuffer=%p off=%#x cbBlock=%#x pcbRead=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, uChannel, pvBuffer, off, cbBlock, pcbRead));
int rc = VINF_SUCCESS;
if (pVM->pdm.s.pDmac)
{
uint32_t cb = pVM->pdm.s.pDmac->Reg.pfnReadMemory(pVM->pdm.s.pDmac->pDevIns, uChannel, pvBuffer, off, cbBlock);
if (pcbRead)
*pcbRead = cb;
}
else
{
AssertMsgFailed(("Configuration error: No DMAC controller available. This could be related to init order too!\n"));
rc = VERR_PDM_NO_DMAC_INSTANCE;
}
LogFlow(("pdmR3DevHlp_DMAReadMemory: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDMAWriteMemory} */
static DECLCALLBACK(int) pdmR3DevHlp_DMAWriteMemory(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbWritten)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_DMAWriteMemory: caller='%s'/%d: uChannel=%d pvBuffer=%p off=%#x cbBlock=%#x pcbWritten=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, uChannel, pvBuffer, off, cbBlock, pcbWritten));
int rc = VINF_SUCCESS;
if (pVM->pdm.s.pDmac)
{
uint32_t cb = pVM->pdm.s.pDmac->Reg.pfnWriteMemory(pVM->pdm.s.pDmac->pDevIns, uChannel, pvBuffer, off, cbBlock);
if (pcbWritten)
*pcbWritten = cb;
}
else
{
AssertMsgFailed(("Configuration error: No DMAC controller available. This could be related to init order too!\n"));
rc = VERR_PDM_NO_DMAC_INSTANCE;
}
LogFlow(("pdmR3DevHlp_DMAWriteMemory: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDMASetDREQ} */
static DECLCALLBACK(int) pdmR3DevHlp_DMASetDREQ(PPDMDEVINS pDevIns, unsigned uChannel, unsigned uLevel)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_DMASetDREQ: caller='%s'/%d: uChannel=%d uLevel=%d\n",
pDevIns->pReg->szName, pDevIns->iInstance, uChannel, uLevel));
int rc = VINF_SUCCESS;
if (pVM->pdm.s.pDmac)
pVM->pdm.s.pDmac->Reg.pfnSetDREQ(pVM->pdm.s.pDmac->pDevIns, uChannel, uLevel);
else
{
AssertMsgFailed(("Configuration error: No DMAC controller available. This could be related to init order too!\n"));
rc = VERR_PDM_NO_DMAC_INSTANCE;
}
LogFlow(("pdmR3DevHlp_DMASetDREQ: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDMAGetChannelMode} */
static DECLCALLBACK(uint8_t) pdmR3DevHlp_DMAGetChannelMode(PPDMDEVINS pDevIns, unsigned uChannel)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_DMAGetChannelMode: caller='%s'/%d: uChannel=%d\n",
pDevIns->pReg->szName, pDevIns->iInstance, uChannel));
uint8_t u8Mode;
if (pVM->pdm.s.pDmac)
u8Mode = pVM->pdm.s.pDmac->Reg.pfnGetChannelMode(pVM->pdm.s.pDmac->pDevIns, uChannel);
else
{
AssertMsgFailed(("Configuration error: No DMAC controller available. This could be related to init order too!\n"));
u8Mode = 3 << 2 /* illegal mode type */;
}
LogFlow(("pdmR3DevHlp_DMAGetChannelMode: caller='%s'/%d: returns %#04x\n",
pDevIns->pReg->szName, pDevIns->iInstance, u8Mode));
return u8Mode;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDMASchedule} */
static DECLCALLBACK(void) pdmR3DevHlp_DMASchedule(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_DMASchedule: caller='%s'/%d: VM_FF_PDM_DMA %d -> 1\n",
pDevIns->pReg->szName, pDevIns->iInstance, VM_FF_IS_SET(pVM, VM_FF_PDM_DMA)));
AssertMsg(pVM->pdm.s.pDmac, ("Configuration error: No DMAC controller available. This could be related to init order too!\n"));
VM_FF_SET(pVM, VM_FF_PDM_DMA);
#ifdef VBOX_WITH_REM
REMR3NotifyDmaPending(pVM);
#endif
VMR3NotifyGlobalFFU(pVM->pUVM, VMNOTIFYFF_FLAGS_DONE_REM);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnCMOSWrite} */
static DECLCALLBACK(int) pdmR3DevHlp_CMOSWrite(PPDMDEVINS pDevIns, unsigned iReg, uint8_t u8Value)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_CMOSWrite: caller='%s'/%d: iReg=%#04x u8Value=%#04x\n",
pDevIns->pReg->szName, pDevIns->iInstance, iReg, u8Value));
int rc;
if (pVM->pdm.s.pRtc)
{
PPDMDEVINS pDevInsRtc = pVM->pdm.s.pRtc->pDevIns;
rc = PDMCritSectEnter(pDevInsRtc->pCritSectRoR3, VERR_IGNORED);
if (RT_SUCCESS(rc))
{
rc = pVM->pdm.s.pRtc->Reg.pfnWrite(pDevInsRtc, iReg, u8Value);
PDMCritSectLeave(pDevInsRtc->pCritSectRoR3);
}
}
else
rc = VERR_PDM_NO_RTC_INSTANCE;
LogFlow(("pdmR3DevHlp_CMOSWrite: caller='%s'/%d: return %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnCMOSRead} */
static DECLCALLBACK(int) pdmR3DevHlp_CMOSRead(PPDMDEVINS pDevIns, unsigned iReg, uint8_t *pu8Value)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_CMOSWrite: caller='%s'/%d: iReg=%#04x pu8Value=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, iReg, pu8Value));
int rc;
if (pVM->pdm.s.pRtc)
{
PPDMDEVINS pDevInsRtc = pVM->pdm.s.pRtc->pDevIns;
rc = PDMCritSectEnter(pDevInsRtc->pCritSectRoR3, VERR_IGNORED);
if (RT_SUCCESS(rc))
{
rc = pVM->pdm.s.pRtc->Reg.pfnRead(pDevInsRtc, iReg, pu8Value);
PDMCritSectLeave(pDevInsRtc->pCritSectRoR3);
}
}
else
rc = VERR_PDM_NO_RTC_INSTANCE;
LogFlow(("pdmR3DevHlp_CMOSWrite: caller='%s'/%d: return %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnAssertEMT} */
static DECLCALLBACK(bool) pdmR3DevHlp_AssertEMT(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
if (VM_IS_EMT(pDevIns->Internal.s.pVMR3))
return true;
char szMsg[100];
RTStrPrintf(szMsg, sizeof(szMsg), "AssertEMT '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance);
RTAssertMsg1Weak(szMsg, iLine, pszFile, pszFunction);
AssertBreakpoint();
return false;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnAssertOther} */
static DECLCALLBACK(bool) pdmR3DevHlp_AssertOther(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
if (!VM_IS_EMT(pDevIns->Internal.s.pVMR3))
return true;
char szMsg[100];
RTStrPrintf(szMsg, sizeof(szMsg), "AssertOther '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance);
RTAssertMsg1Weak(szMsg, iLine, pszFile, pszFunction);
AssertBreakpoint();
return false;
}
/** @interface_method_impl{PDMDEVHLP,pfnLdrGetRCInterfaceSymbols} */
static DECLCALLBACK(int) pdmR3DevHlp_LdrGetRCInterfaceSymbols(PPDMDEVINS pDevIns, void *pvInterface, size_t cbInterface,
const char *pszSymPrefix, const char *pszSymList)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_PDMLdrGetRCInterfaceSymbols: caller='%s'/%d: pvInterface=%p cbInterface=%zu pszSymPrefix=%p:{%s} pszSymList=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, pvInterface, cbInterface, pszSymPrefix, pszSymPrefix, pszSymList, pszSymList));
int rc;
if ( strncmp(pszSymPrefix, "dev", 3) == 0
&& RTStrIStr(pszSymPrefix + 3, pDevIns->pReg->szName) != NULL)
{
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3,
pvInterface, cbInterface,
pDevIns->pReg->szRCMod, pDevIns->Internal.s.pDevR3->pszRCSearchPath,
pszSymPrefix, pszSymList,
false /*fRing0OrRC*/);
else
{
AssertMsgFailed(("Not a raw-mode enabled driver\n"));
rc = VERR_PERMISSION_DENIED;
}
}
else
{
AssertMsgFailed(("Invalid prefix '%s' for '%s'; must start with 'dev' and contain the driver name!\n",
pszSymPrefix, pDevIns->pReg->szName));
rc = VERR_INVALID_NAME;
}
LogFlow(("pdmR3DevHlp_PDMLdrGetRCInterfaceSymbols: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName,
pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLP,pfnLdrGetR0InterfaceSymbols} */
static DECLCALLBACK(int) pdmR3DevHlp_LdrGetR0InterfaceSymbols(PPDMDEVINS pDevIns, void *pvInterface, size_t cbInterface,
const char *pszSymPrefix, const char *pszSymList)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_PDMLdrGetR0InterfaceSymbols: caller='%s'/%d: pvInterface=%p cbInterface=%zu pszSymPrefix=%p:{%s} pszSymList=%p:{%s}\n",
pDevIns->pReg->szName, pDevIns->iInstance, pvInterface, cbInterface, pszSymPrefix, pszSymPrefix, pszSymList, pszSymList));
int rc;
if ( strncmp(pszSymPrefix, "dev", 3) == 0
&& RTStrIStr(pszSymPrefix + 3, pDevIns->pReg->szName) != NULL)
{
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0)
rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3,
pvInterface, cbInterface,
pDevIns->pReg->szR0Mod, pDevIns->Internal.s.pDevR3->pszR0SearchPath,
pszSymPrefix, pszSymList,
true /*fRing0OrRC*/);
else
{
AssertMsgFailed(("Not a ring-0 enabled driver\n"));
rc = VERR_PERMISSION_DENIED;
}
}
else
{
AssertMsgFailed(("Invalid prefix '%s' for '%s'; must start with 'dev' and contain the driver name!\n",
pszSymPrefix, pDevIns->pReg->szName));
rc = VERR_INVALID_NAME;
}
LogFlow(("pdmR3DevHlp_PDMLdrGetR0InterfaceSymbols: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName,
pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLP,pfnCallR0} */
static DECLCALLBACK(int) pdmR3DevHlp_CallR0(PPDMDEVINS pDevIns, uint32_t uOperation, uint64_t u64Arg)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_CallR0: caller='%s'/%d: uOperation=%#x u64Arg=%#RX64\n",
pDevIns->pReg->szName, pDevIns->iInstance, uOperation, u64Arg));
/*
* Resolve the ring-0 entry point. There is not need to remember this like
* we do for drivers since this is mainly for construction time hacks and
* other things that aren't performance critical.
*/
int rc;
if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0)
{
char szSymbol[ sizeof("devR0") + sizeof(pDevIns->pReg->szName) + sizeof("ReqHandler")];
strcat(strcat(strcpy(szSymbol, "devR0"), pDevIns->pReg->szName), "ReqHandler");
szSymbol[sizeof("devR0") - 1] = RT_C_TO_UPPER(szSymbol[sizeof("devR0") - 1]);
PFNPDMDRVREQHANDLERR0 pfnReqHandlerR0;
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, szSymbol, &pfnReqHandlerR0);
if (RT_SUCCESS(rc))
{
/*
* Make the ring-0 call.
*/
PDMDEVICECALLREQHANDLERREQ Req;
Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
Req.Hdr.cbReq = sizeof(Req);
Req.pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
Req.pfnReqHandlerR0 = pfnReqHandlerR0;
Req.uOperation = uOperation;
Req.u32Alignment = 0;
Req.u64Arg = u64Arg;
rc = SUPR3CallVMMR0Ex(pVM->pVMR0, NIL_VMCPUID, VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER, 0, &Req.Hdr);
}
else
pfnReqHandlerR0 = NIL_RTR0PTR;
}
else
rc = VERR_ACCESS_DENIED;
LogFlow(("pdmR3DevHlp_CallR0: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName,
pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLP,pfnVMGetSuspendReason} */
static DECLCALLBACK(VMSUSPENDREASON) pdmR3DevHlp_VMGetSuspendReason(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
VMSUSPENDREASON enmReason = VMR3GetSuspendReason(pVM->pUVM);
LogFlow(("pdmR3DevHlp_VMGetSuspendReason: caller='%s'/%d: returns %d\n",
pDevIns->pReg->szName, pDevIns->iInstance, enmReason));
return enmReason;
}
/** @interface_method_impl{PDMDEVHLP,pfnVMGetResumeReason} */
static DECLCALLBACK(VMRESUMEREASON) pdmR3DevHlp_VMGetResumeReason(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
VMRESUMEREASON enmReason = VMR3GetResumeReason(pVM->pUVM);
LogFlow(("pdmR3DevHlp_VMGetResumeReason: caller='%s'/%d: returns %d\n",
pDevIns->pReg->szName, pDevIns->iInstance, enmReason));
return enmReason;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetUVM} */
static DECLCALLBACK(PUVM) pdmR3DevHlp_GetUVM(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_GetUVM: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns->Internal.s.pVMR3));
return pDevIns->Internal.s.pVMR3->pUVM;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetVM} */
static DECLCALLBACK(PVM) pdmR3DevHlp_GetVM(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
LogFlow(("pdmR3DevHlp_GetVM: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns->Internal.s.pVMR3));
return pDevIns->Internal.s.pVMR3;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetVMCPU} */
static DECLCALLBACK(PVMCPU) pdmR3DevHlp_GetVMCPU(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_GetVMCPU: caller='%s'/%d for CPU %u\n", pDevIns->pReg->szName, pDevIns->iInstance, VMMGetCpuId(pDevIns->Internal.s.pVMR3)));
return VMMGetCpu(pDevIns->Internal.s.pVMR3);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetCurrentCpuId} */
static DECLCALLBACK(VMCPUID) pdmR3DevHlp_GetCurrentCpuId(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VMCPUID idCpu = VMMGetCpuId(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_GetCurrentCpuId: caller='%s'/%d for CPU %u\n", pDevIns->pReg->szName, pDevIns->iInstance, idCpu));
return idCpu;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPCIBusRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_PCIBusRegister(PPDMDEVINS pDevIns, PPDMPCIBUSREG pPciBusReg, PCPDMPCIHLPR3 *ppPciHlpR3)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: pPciBusReg=%p:{.u32Version=%#x, .pfnRegisterR3=%p, .pfnIORegionRegisterR3=%p, "
".pfnSetIrqR3=%p, .pfnFakePCIBIOSR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppPciHlpR3=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pPciBusReg, pPciBusReg->u32Version, pPciBusReg->pfnRegisterR3,
pPciBusReg->pfnIORegionRegisterR3, pPciBusReg->pfnSetIrqR3, pPciBusReg->pfnFakePCIBIOSR3,
pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqRC, pPciBusReg->pszSetIrqR0, pPciBusReg->pszSetIrqR0, ppPciHlpR3));
/*
* Validate the structure.
*/
if (pPciBusReg->u32Version != PDM_PCIBUSREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pPciBusReg->u32Version, PDM_PCIBUSREG_VERSION));
LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: returns %Rrc (version)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( !pPciBusReg->pfnRegisterR3
|| !pPciBusReg->pfnIORegionRegisterR3
|| !pPciBusReg->pfnSetIrqR3
|| (!pPciBusReg->pfnFakePCIBIOSR3 && !pVM->pdm.s.aPciBuses[0].pDevInsR3)) /* Only the first bus needs to do the BIOS work. */
{
Assert(pPciBusReg->pfnRegisterR3);
Assert(pPciBusReg->pfnIORegionRegisterR3);
Assert(pPciBusReg->pfnSetIrqR3);
Assert(pPciBusReg->pfnFakePCIBIOSR3);
LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc (R3 callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pPciBusReg->pszSetIrqRC
&& !VALID_PTR(pPciBusReg->pszSetIrqRC))
{
Assert(VALID_PTR(pPciBusReg->pszSetIrqRC));
LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc (GC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pPciBusReg->pszSetIrqR0
&& !VALID_PTR(pPciBusReg->pszSetIrqR0))
{
Assert(VALID_PTR(pPciBusReg->pszSetIrqR0));
LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc (GC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppPciHlpR3)
{
Assert(ppPciHlpR3);
LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc (ppPciHlpR3)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Find free PCI bus entry.
*/
unsigned iBus = 0;
for (iBus = 0; iBus < RT_ELEMENTS(pVM->pdm.s.aPciBuses); iBus++)
if (!pVM->pdm.s.aPciBuses[iBus].pDevInsR3)
break;
if (iBus >= RT_ELEMENTS(pVM->pdm.s.aPciBuses))
{
AssertMsgFailed(("Too many PCI buses. Max=%u\n", RT_ELEMENTS(pVM->pdm.s.aPciBuses)));
LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc (pci bus)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
PPDMPCIBUS pPciBus = &pVM->pdm.s.aPciBuses[iBus];
/*
* Resolve and init the RC bits.
*/
if (pPciBusReg->pszSetIrqRC)
{
int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPciBusReg->pszSetIrqRC, &pPciBus->pfnSetIrqRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPciBusReg->pszSetIrqRC, rc));
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pPciBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
}
else
{
pPciBus->pfnSetIrqRC = 0;
pPciBus->pDevInsRC = 0;
}
/*
* Resolve and init the R0 bits.
*/
if (pPciBusReg->pszSetIrqR0)
{
int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPciBusReg->pszSetIrqR0, &pPciBus->pfnSetIrqR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPciBusReg->pszSetIrqR0, rc));
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pPciBus->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
}
else
{
pPciBus->pfnSetIrqR0 = 0;
pPciBus->pDevInsR0 = 0;
}
/*
* Init the R3 bits.
*/
pPciBus->iBus = iBus;
pPciBus->pDevInsR3 = pDevIns;
pPciBus->pfnRegisterR3 = pPciBusReg->pfnRegisterR3;
pPciBus->pfnRegisterMsiR3 = pPciBusReg->pfnRegisterMsiR3;
pPciBus->pfnIORegionRegisterR3 = pPciBusReg->pfnIORegionRegisterR3;
pPciBus->pfnSetConfigCallbacksR3 = pPciBusReg->pfnSetConfigCallbacksR3;
pPciBus->pfnSetIrqR3 = pPciBusReg->pfnSetIrqR3;
pPciBus->pfnFakePCIBIOSR3 = pPciBusReg->pfnFakePCIBIOSR3;
Log(("PDM: Registered PCI bus device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
/* set the helper pointer and return. */
*ppPciHlpR3 = &g_pdmR3DevPciHlp;
LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPICRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_PICRegister(PPDMDEVINS pDevIns, PPDMPICREG pPicReg, PCPDMPICHLPR3 *ppPicHlpR3)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: pPicReg=%p:{.u32Version=%#x, .pfnSetIrqR3=%p, .pfnGetInterruptR3=%p, .pszGetIrqRC=%p:{%s}, .pszGetInterruptRC=%p:{%s}, .pszGetIrqR0=%p:{%s}, .pszGetInterruptR0=%p:{%s} } ppPicHlpR3=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pPicReg, pPicReg->u32Version, pPicReg->pfnSetIrqR3, pPicReg->pfnGetInterruptR3,
pPicReg->pszSetIrqRC, pPicReg->pszSetIrqRC, pPicReg->pszGetInterruptRC, pPicReg->pszGetInterruptRC,
pPicReg->pszSetIrqR0, pPicReg->pszSetIrqR0, pPicReg->pszGetInterruptR0, pPicReg->pszGetInterruptR0,
ppPicHlpR3));
/*
* Validate input.
*/
if (pPicReg->u32Version != PDM_PICREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pPicReg->u32Version, PDM_PICREG_VERSION));
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc (version)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( !pPicReg->pfnSetIrqR3
|| !pPicReg->pfnGetInterruptR3)
{
Assert(pPicReg->pfnSetIrqR3);
Assert(pPicReg->pfnGetInterruptR3);
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc (R3 callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( ( pPicReg->pszSetIrqRC
|| pPicReg->pszGetInterruptRC)
&& ( !VALID_PTR(pPicReg->pszSetIrqRC)
|| !VALID_PTR(pPicReg->pszGetInterruptRC))
)
{
Assert(VALID_PTR(pPicReg->pszSetIrqRC));
Assert(VALID_PTR(pPicReg->pszGetInterruptRC));
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc (RC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pPicReg->pszSetIrqRC
&& !(pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC))
{
Assert(pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC);
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc (RC flag)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pPicReg->pszSetIrqR0
&& !(pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0))
{
Assert(pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0);
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc (R0 flag)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppPicHlpR3)
{
Assert(ppPicHlpR3);
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc (ppPicHlpR3)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Only one PIC device.
*/
PVM pVM = pDevIns->Internal.s.pVMR3;
if (pVM->pdm.s.Pic.pDevInsR3)
{
AssertMsgFailed(("Only one pic device is supported!\n"));
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* RC stuff.
*/
if (pPicReg->pszSetIrqRC)
{
int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPicReg->pszSetIrqRC, &pVM->pdm.s.Pic.pfnSetIrqRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPicReg->pszSetIrqRC, rc));
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPicReg->pszGetInterruptRC, &pVM->pdm.s.Pic.pfnGetInterruptRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPicReg->pszGetInterruptRC, rc));
}
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pVM->pdm.s.Pic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
}
else
{
pVM->pdm.s.Pic.pDevInsRC = 0;
pVM->pdm.s.Pic.pfnSetIrqRC = 0;
pVM->pdm.s.Pic.pfnGetInterruptRC = 0;
}
/*
* R0 stuff.
*/
if (pPicReg->pszSetIrqR0)
{
int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPicReg->pszSetIrqR0, &pVM->pdm.s.Pic.pfnSetIrqR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPicReg->pszSetIrqR0, rc));
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPicReg->pszGetInterruptR0, &pVM->pdm.s.Pic.pfnGetInterruptR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPicReg->pszGetInterruptR0, rc));
}
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pVM->pdm.s.Pic.pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
Assert(pVM->pdm.s.Pic.pDevInsR0);
}
else
{
pVM->pdm.s.Pic.pfnSetIrqR0 = 0;
pVM->pdm.s.Pic.pfnGetInterruptR0 = 0;
pVM->pdm.s.Pic.pDevInsR0 = 0;
}
/*
* R3 stuff.
*/
pVM->pdm.s.Pic.pDevInsR3 = pDevIns;
pVM->pdm.s.Pic.pfnSetIrqR3 = pPicReg->pfnSetIrqR3;
pVM->pdm.s.Pic.pfnGetInterruptR3 = pPicReg->pfnGetInterruptR3;
Log(("PDM: Registered PIC device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
/* set the helper pointer and return. */
*ppPicHlpR3 = &g_pdmR3DevPicHlp;
LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnAPICRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_APICRegister(PPDMDEVINS pDevIns, PPDMAPICREG pApicReg, PCPDMAPICHLPR3 *ppApicHlpR3)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: pApicReg=%p:{.u32Version=%#x, .pfnGetInterruptR3=%p, .pfnSetBaseR3=%p, .pfnGetBaseR3=%p, "
".pfnSetTPRR3=%p, .pfnGetTPRR3=%p, .pfnWriteMSR3=%p, .pfnReadMSR3=%p, .pfnBusDeliverR3=%p, .pfnLocalInterruptR3=%p .pfnGetTimerFreqR3=%p, pszGetInterruptRC=%p:{%s}, pszSetBaseRC=%p:{%s}, pszGetBaseRC=%p:{%s}, "
".pszSetTPRRC=%p:{%s}, .pszGetTPRRC=%p:{%s}, .pszWriteMSRRC=%p:{%s}, .pszReadMSRRC=%p:{%s}, .pszBusDeliverRC=%p:{%s}, .pszLocalInterruptRC=%p:{%s}, .pszGetTimerFreqRC=%p:{%s}} ppApicHlpR3=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pApicReg, pApicReg->u32Version, pApicReg->pfnGetInterruptR3, pApicReg->pfnSetBaseR3,
pApicReg->pfnGetBaseR3, pApicReg->pfnSetTPRR3, pApicReg->pfnGetTPRR3, pApicReg->pfnWriteMSRR3, pApicReg->pfnReadMSRR3, pApicReg->pfnBusDeliverR3, pApicReg->pfnLocalInterruptR3, pApicReg->pfnGetTimerFreqR3, pApicReg->pszGetInterruptRC,
pApicReg->pszGetInterruptRC, pApicReg->pszSetBaseRC, pApicReg->pszSetBaseRC, pApicReg->pszGetBaseRC, pApicReg->pszGetBaseRC,
pApicReg->pszSetTPRRC, pApicReg->pszSetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszWriteMSRRC, pApicReg->pszWriteMSRRC, pApicReg->pszReadMSRRC, pApicReg->pszReadMSRRC, pApicReg->pszBusDeliverRC,
pApicReg->pszBusDeliverRC, pApicReg->pszLocalInterruptRC, pApicReg->pszLocalInterruptRC, pApicReg->pszGetTimerFreqRC, pApicReg->pszGetTimerFreqRC, ppApicHlpR3));
/*
* Validate input.
*/
if (pApicReg->u32Version != PDM_APICREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pApicReg->u32Version, PDM_APICREG_VERSION));
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc (version)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( !pApicReg->pfnGetInterruptR3
|| !pApicReg->pfnHasPendingIrqR3
|| !pApicReg->pfnSetBaseR3
|| !pApicReg->pfnGetBaseR3
|| !pApicReg->pfnSetTPRR3
|| !pApicReg->pfnGetTPRR3
|| !pApicReg->pfnWriteMSRR3
|| !pApicReg->pfnReadMSRR3
|| !pApicReg->pfnBusDeliverR3
|| !pApicReg->pfnLocalInterruptR3
|| !pApicReg->pfnGetTimerFreqR3)
{
Assert(pApicReg->pfnGetInterruptR3);
Assert(pApicReg->pfnHasPendingIrqR3);
Assert(pApicReg->pfnSetBaseR3);
Assert(pApicReg->pfnGetBaseR3);
Assert(pApicReg->pfnSetTPRR3);
Assert(pApicReg->pfnGetTPRR3);
Assert(pApicReg->pfnWriteMSRR3);
Assert(pApicReg->pfnReadMSRR3);
Assert(pApicReg->pfnBusDeliverR3);
Assert(pApicReg->pfnLocalInterruptR3);
Assert(pApicReg->pfnGetTimerFreqR3);
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc (R3 callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( ( pApicReg->pszGetInterruptRC
|| pApicReg->pszHasPendingIrqRC
|| pApicReg->pszSetBaseRC
|| pApicReg->pszGetBaseRC
|| pApicReg->pszSetTPRRC
|| pApicReg->pszGetTPRRC
|| pApicReg->pszWriteMSRRC
|| pApicReg->pszReadMSRRC
|| pApicReg->pszBusDeliverRC
|| pApicReg->pszLocalInterruptRC
|| pApicReg->pszGetTimerFreqRC)
&& ( !VALID_PTR(pApicReg->pszGetInterruptRC)
|| !VALID_PTR(pApicReg->pszHasPendingIrqRC)
|| !VALID_PTR(pApicReg->pszSetBaseRC)
|| !VALID_PTR(pApicReg->pszGetBaseRC)
|| !VALID_PTR(pApicReg->pszSetTPRRC)
|| !VALID_PTR(pApicReg->pszGetTPRRC)
|| !VALID_PTR(pApicReg->pszWriteMSRRC)
|| !VALID_PTR(pApicReg->pszReadMSRRC)
|| !VALID_PTR(pApicReg->pszBusDeliverRC)
|| !VALID_PTR(pApicReg->pszLocalInterruptRC)
|| !VALID_PTR(pApicReg->pszGetTimerFreqRC))
)
{
Assert(VALID_PTR(pApicReg->pszGetInterruptRC));
Assert(VALID_PTR(pApicReg->pszHasPendingIrqRC));
Assert(VALID_PTR(pApicReg->pszSetBaseRC));
Assert(VALID_PTR(pApicReg->pszGetBaseRC));
Assert(VALID_PTR(pApicReg->pszSetTPRRC));
Assert(VALID_PTR(pApicReg->pszGetTPRRC));
Assert(VALID_PTR(pApicReg->pszReadMSRRC));
Assert(VALID_PTR(pApicReg->pszWriteMSRRC));
Assert(VALID_PTR(pApicReg->pszBusDeliverRC));
Assert(VALID_PTR(pApicReg->pszLocalInterruptRC));
Assert(VALID_PTR(pApicReg->pszGetTimerFreqRC));
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc (RC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( ( pApicReg->pszGetInterruptR0
|| pApicReg->pszHasPendingIrqR0
|| pApicReg->pszSetBaseR0
|| pApicReg->pszGetBaseR0
|| pApicReg->pszSetTPRR0
|| pApicReg->pszGetTPRR0
|| pApicReg->pszWriteMSRR0
|| pApicReg->pszReadMSRR0
|| pApicReg->pszBusDeliverR0
|| pApicReg->pszLocalInterruptR0
|| pApicReg->pszGetTimerFreqR0)
&& ( !VALID_PTR(pApicReg->pszGetInterruptR0)
|| !VALID_PTR(pApicReg->pszHasPendingIrqR0)
|| !VALID_PTR(pApicReg->pszSetBaseR0)
|| !VALID_PTR(pApicReg->pszGetBaseR0)
|| !VALID_PTR(pApicReg->pszSetTPRR0)
|| !VALID_PTR(pApicReg->pszGetTPRR0)
|| !VALID_PTR(pApicReg->pszReadMSRR0)
|| !VALID_PTR(pApicReg->pszWriteMSRR0)
|| !VALID_PTR(pApicReg->pszBusDeliverR0)
|| !VALID_PTR(pApicReg->pszLocalInterruptR0)
|| !VALID_PTR(pApicReg->pszGetTimerFreqR0))
)
{
Assert(VALID_PTR(pApicReg->pszGetInterruptR0));
Assert(VALID_PTR(pApicReg->pszHasPendingIrqR0));
Assert(VALID_PTR(pApicReg->pszSetBaseR0));
Assert(VALID_PTR(pApicReg->pszGetBaseR0));
Assert(VALID_PTR(pApicReg->pszSetTPRR0));
Assert(VALID_PTR(pApicReg->pszGetTPRR0));
Assert(VALID_PTR(pApicReg->pszReadMSRR0));
Assert(VALID_PTR(pApicReg->pszWriteMSRR0));
Assert(VALID_PTR(pApicReg->pszBusDeliverR0));
Assert(VALID_PTR(pApicReg->pszLocalInterruptR0));
Assert(VALID_PTR(pApicReg->pszGetTimerFreqR0));
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc (R0 callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppApicHlpR3)
{
Assert(ppApicHlpR3);
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc (ppApicHlpR3)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Only one APIC device. On SMP we have single logical device covering all LAPICs,
* as they need to communicate and share state easily.
*/
PVM pVM = pDevIns->Internal.s.pVMR3;
if (pVM->pdm.s.Apic.pDevInsR3)
{
AssertMsgFailed(("Only one apic device is supported!\n"));
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Resolve & initialize the RC bits.
*/
if (pApicReg->pszGetInterruptRC)
{
int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetInterruptRC, &pVM->pdm.s.Apic.pfnGetInterruptRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetInterruptRC, rc));
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszHasPendingIrqRC, &pVM->pdm.s.Apic.pfnHasPendingIrqRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszHasPendingIrqRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszSetBaseRC, &pVM->pdm.s.Apic.pfnSetBaseRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszSetBaseRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetBaseRC, &pVM->pdm.s.Apic.pfnGetBaseRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetBaseRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszSetTPRRC, &pVM->pdm.s.Apic.pfnSetTPRRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszSetTPRRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetTPRRC, &pVM->pdm.s.Apic.pfnGetTPRRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetTPRRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszWriteMSRRC, &pVM->pdm.s.Apic.pfnWriteMSRRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszWriteMSRRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszReadMSRRC, &pVM->pdm.s.Apic.pfnReadMSRRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszReadMSRRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszBusDeliverRC, &pVM->pdm.s.Apic.pfnBusDeliverRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszBusDeliverRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszLocalInterruptRC, &pVM->pdm.s.Apic.pfnLocalInterruptRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszLocalInterruptRC, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetTimerFreqRC, &pVM->pdm.s.Apic.pfnGetTimerFreqRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetTimerFreqRC, rc));
}
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pVM->pdm.s.Apic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
}
else
{
pVM->pdm.s.Apic.pDevInsRC = 0;
pVM->pdm.s.Apic.pfnGetInterruptRC = 0;
pVM->pdm.s.Apic.pfnHasPendingIrqRC = 0;
pVM->pdm.s.Apic.pfnSetBaseRC = 0;
pVM->pdm.s.Apic.pfnGetBaseRC = 0;
pVM->pdm.s.Apic.pfnSetTPRRC = 0;
pVM->pdm.s.Apic.pfnGetTPRRC = 0;
pVM->pdm.s.Apic.pfnWriteMSRRC = 0;
pVM->pdm.s.Apic.pfnReadMSRRC = 0;
pVM->pdm.s.Apic.pfnBusDeliverRC = 0;
pVM->pdm.s.Apic.pfnLocalInterruptRC = 0;
pVM->pdm.s.Apic.pfnGetTimerFreqRC = 0;
}
/*
* Resolve & initialize the R0 bits.
*/
if (pApicReg->pszGetInterruptR0)
{
int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetInterruptR0, &pVM->pdm.s.Apic.pfnGetInterruptR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetInterruptR0, rc));
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszHasPendingIrqR0, &pVM->pdm.s.Apic.pfnHasPendingIrqR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszHasPendingIrqR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszSetBaseR0, &pVM->pdm.s.Apic.pfnSetBaseR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszSetBaseR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetBaseR0, &pVM->pdm.s.Apic.pfnGetBaseR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetBaseR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszSetTPRR0, &pVM->pdm.s.Apic.pfnSetTPRR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszSetTPRR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetTPRR0, &pVM->pdm.s.Apic.pfnGetTPRR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetTPRR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszWriteMSRR0, &pVM->pdm.s.Apic.pfnWriteMSRR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszWriteMSRR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszReadMSRR0, &pVM->pdm.s.Apic.pfnReadMSRR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszReadMSRR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszBusDeliverR0, &pVM->pdm.s.Apic.pfnBusDeliverR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszBusDeliverR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszLocalInterruptR0, &pVM->pdm.s.Apic.pfnLocalInterruptR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszLocalInterruptR0, rc));
}
if (RT_SUCCESS(rc))
{
rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetTimerFreqR0, &pVM->pdm.s.Apic.pfnGetTimerFreqR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetTimerFreqR0, rc));
}
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pVM->pdm.s.Apic.pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
Assert(pVM->pdm.s.Apic.pDevInsR0);
}
else
{
pVM->pdm.s.Apic.pfnGetInterruptR0 = 0;
pVM->pdm.s.Apic.pfnHasPendingIrqR0 = 0;
pVM->pdm.s.Apic.pfnSetBaseR0 = 0;
pVM->pdm.s.Apic.pfnGetBaseR0 = 0;
pVM->pdm.s.Apic.pfnSetTPRR0 = 0;
pVM->pdm.s.Apic.pfnGetTPRR0 = 0;
pVM->pdm.s.Apic.pfnWriteMSRR0 = 0;
pVM->pdm.s.Apic.pfnReadMSRR0 = 0;
pVM->pdm.s.Apic.pfnBusDeliverR0 = 0;
pVM->pdm.s.Apic.pfnLocalInterruptR0 = 0;
pVM->pdm.s.Apic.pfnGetTimerFreqR0 = 0;
pVM->pdm.s.Apic.pDevInsR0 = 0;
}
/*
* Initialize the HC bits.
*/
pVM->pdm.s.Apic.pDevInsR3 = pDevIns;
pVM->pdm.s.Apic.pfnGetInterruptR3 = pApicReg->pfnGetInterruptR3;
pVM->pdm.s.Apic.pfnHasPendingIrqR3 = pApicReg->pfnHasPendingIrqR3;
pVM->pdm.s.Apic.pfnSetBaseR3 = pApicReg->pfnSetBaseR3;
pVM->pdm.s.Apic.pfnGetBaseR3 = pApicReg->pfnGetBaseR3;
pVM->pdm.s.Apic.pfnSetTPRR3 = pApicReg->pfnSetTPRR3;
pVM->pdm.s.Apic.pfnGetTPRR3 = pApicReg->pfnGetTPRR3;
pVM->pdm.s.Apic.pfnWriteMSRR3 = pApicReg->pfnWriteMSRR3;
pVM->pdm.s.Apic.pfnReadMSRR3 = pApicReg->pfnReadMSRR3;
pVM->pdm.s.Apic.pfnBusDeliverR3 = pApicReg->pfnBusDeliverR3;
pVM->pdm.s.Apic.pfnLocalInterruptR3 = pApicReg->pfnLocalInterruptR3;
pVM->pdm.s.Apic.pfnGetTimerFreqR3 = pApicReg->pfnGetTimerFreqR3;
Log(("PDM: Registered APIC device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
/* set the helper pointer and return. */
*ppApicHlpR3 = &g_pdmR3DevApicHlp;
LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnIOAPICRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_IOAPICRegister(PPDMDEVINS pDevIns, PPDMIOAPICREG pIoApicReg, PCPDMIOAPICHLPR3 *ppIoApicHlpR3)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: pIoApicReg=%p:{.u32Version=%#x, .pfnSetIrqR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppIoApicHlpR3=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pIoApicReg, pIoApicReg->u32Version, pIoApicReg->pfnSetIrqR3,
pIoApicReg->pszSetIrqRC, pIoApicReg->pszSetIrqRC, pIoApicReg->pszSetIrqR0, pIoApicReg->pszSetIrqR0, ppIoApicHlpR3));
/*
* Validate input.
*/
if (pIoApicReg->u32Version != PDM_IOAPICREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pIoApicReg->u32Version, PDM_IOAPICREG_VERSION));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (version)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!pIoApicReg->pfnSetIrqR3 || !pIoApicReg->pfnSendMsiR3)
{
Assert(pIoApicReg->pfnSetIrqR3);
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (R3 callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pIoApicReg->pszSetIrqRC
&& !VALID_PTR(pIoApicReg->pszSetIrqRC))
{
Assert(VALID_PTR(pIoApicReg->pszSetIrqRC));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (GC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pIoApicReg->pszSendMsiRC
&& !VALID_PTR(pIoApicReg->pszSendMsiRC))
{
Assert(VALID_PTR(pIoApicReg->pszSendMsiRC));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (GC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pIoApicReg->pszSetIrqR0
&& !VALID_PTR(pIoApicReg->pszSetIrqR0))
{
Assert(VALID_PTR(pIoApicReg->pszSetIrqR0));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (GC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pIoApicReg->pszSendMsiR0
&& !VALID_PTR(pIoApicReg->pszSendMsiR0))
{
Assert(VALID_PTR(pIoApicReg->pszSendMsiR0));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (GC callbacks)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppIoApicHlpR3)
{
Assert(ppIoApicHlpR3);
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (ppApicHlp)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* The I/O APIC requires the APIC to be present (hacks++).
* If the I/O APIC does GC stuff so must the APIC.
*/
PVM pVM = pDevIns->Internal.s.pVMR3;
if (!pVM->pdm.s.Apic.pDevInsR3)
{
AssertMsgFailed(("Configuration error / Init order error! No APIC!\n"));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (no APIC)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( pIoApicReg->pszSetIrqRC
&& !pVM->pdm.s.Apic.pDevInsRC)
{
AssertMsgFailed(("Configuration error! APIC doesn't do GC, I/O APIC does!\n"));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (no GC APIC)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Only one I/O APIC device.
*/
if (pVM->pdm.s.IoApic.pDevInsR3)
{
AssertMsgFailed(("Only one ioapic device is supported!\n"));
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc (only one)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Resolve & initialize the GC bits.
*/
if (pIoApicReg->pszSetIrqRC)
{
int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSetIrqRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pIoApicReg->pszSetIrqRC, rc));
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pVM->pdm.s.IoApic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
}
else
{
pVM->pdm.s.IoApic.pDevInsRC = 0;
pVM->pdm.s.IoApic.pfnSetIrqRC = 0;
}
if (pIoApicReg->pszSendMsiRC)
{
int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSendMsiRC);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pIoApicReg->pszSendMsiRC, rc));
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
}
else
{
pVM->pdm.s.IoApic.pfnSendMsiRC = 0;
}
/*
* Resolve & initialize the R0 bits.
*/
if (pIoApicReg->pszSetIrqR0)
{
int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSetIrqR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pIoApicReg->pszSetIrqR0, rc));
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
pVM->pdm.s.IoApic.pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
Assert(pVM->pdm.s.IoApic.pDevInsR0);
}
else
{
pVM->pdm.s.IoApic.pfnSetIrqR0 = 0;
pVM->pdm.s.IoApic.pDevInsR0 = 0;
}
if (pIoApicReg->pszSendMsiR0)
{
int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pIoApicReg->pszSendMsiR0, &pVM->pdm.s.IoApic.pfnSendMsiR0);
AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pIoApicReg->pszSendMsiR0, rc));
if (RT_FAILURE(rc))
{
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
}
else
{
pVM->pdm.s.IoApic.pfnSendMsiR0 = 0;
}
/*
* Initialize the R3 bits.
*/
pVM->pdm.s.IoApic.pDevInsR3 = pDevIns;
pVM->pdm.s.IoApic.pfnSetIrqR3 = pIoApicReg->pfnSetIrqR3;
pVM->pdm.s.IoApic.pfnSendMsiR3 = pIoApicReg->pfnSendMsiR3;
Log(("PDM: Registered I/O APIC device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
/* set the helper pointer and return. */
*ppIoApicHlpR3 = &g_pdmR3DevIoApicHlp;
LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnHPETRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_HPETRegister(PPDMDEVINS pDevIns, PPDMHPETREG pHpetReg, PCPDMHPETHLPR3 *ppHpetHlpR3)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_HPETRegister: caller='%s'/%d:\n"));
/*
* Validate input.
*/
if (pHpetReg->u32Version != PDM_HPETREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pHpetReg->u32Version, PDM_HPETREG_VERSION));
LogFlow(("pdmR3DevHlp_HPETRegister: caller='%s'/%d: returns %Rrc (version)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppHpetHlpR3)
{
Assert(ppHpetHlpR3);
LogFlow(("pdmR3DevHlp_HPETRegister: caller='%s'/%d: returns %Rrc (ppApicHlpR3)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/* set the helper pointer and return. */
*ppHpetHlpR3 = &g_pdmR3DevHpetHlp;
LogFlow(("pdmR3DevHlp_HPETRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnPciRawRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_PciRawRegister(PPDMDEVINS pDevIns, PPDMPCIRAWREG pPciRawReg, PCPDMPCIRAWHLPR3 *ppPciRawHlpR3)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_PciRawRegister: caller='%s'/%d:\n"));
/*
* Validate input.
*/
if (pPciRawReg->u32Version != PDM_PCIRAWREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pPciRawReg->u32Version, PDM_PCIRAWREG_VERSION));
LogFlow(("pdmR3DevHlp_PciRawRegister: caller='%s'/%d: returns %Rrc (version)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppPciRawHlpR3)
{
Assert(ppPciRawHlpR3);
LogFlow(("pdmR3DevHlp_PciRawRegister: caller='%s'/%d: returns %Rrc (ppApicHlpR3)\n", pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/* set the helper pointer and return. */
*ppPciRawHlpR3 = &g_pdmR3DevPciRawHlp;
LogFlow(("pdmR3DevHlp_PciRawRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS));
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnDMACRegister} */
static DECLCALLBACK(int) pdmR3DevHlp_DMACRegister(PPDMDEVINS pDevIns, PPDMDMACREG pDmacReg, PCPDMDMACHLP *ppDmacHlp)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_DMACRegister: caller='%s'/%d: pDmacReg=%p:{.u32Version=%#x, .pfnRun=%p, .pfnRegister=%p, .pfnReadMemory=%p, .pfnWriteMemory=%p, .pfnSetDREQ=%p, .pfnGetChannelMode=%p} ppDmacHlp=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pDmacReg, pDmacReg->u32Version, pDmacReg->pfnRun, pDmacReg->pfnRegister,
pDmacReg->pfnReadMemory, pDmacReg->pfnWriteMemory, pDmacReg->pfnSetDREQ, pDmacReg->pfnGetChannelMode, ppDmacHlp));
/*
* Validate input.
*/
if (pDmacReg->u32Version != PDM_DMACREG_VERSION)
{
AssertMsgFailed(("u32Version=%#x expected %#x\n", pDmacReg->u32Version,
PDM_DMACREG_VERSION));
LogFlow(("pdmR3DevHlp_DMACRegister: caller='%s'/%d: returns %Rrc (version)\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if ( !pDmacReg->pfnRun
|| !pDmacReg->pfnRegister
|| !pDmacReg->pfnReadMemory
|| !pDmacReg->pfnWriteMemory
|| !pDmacReg->pfnSetDREQ
|| !pDmacReg->pfnGetChannelMode)
{
Assert(pDmacReg->pfnRun);
Assert(pDmacReg->pfnRegister);
Assert(pDmacReg->pfnReadMemory);
Assert(pDmacReg->pfnWriteMemory);
Assert(pDmacReg->pfnSetDREQ);
Assert(pDmacReg->pfnGetChannelMode);
LogFlow(("pdmR3DevHlp_DMACRegister: caller='%s'/%d: returns %Rrc (callbacks)\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
if (!ppDmacHlp)
{
Assert(ppDmacHlp);
LogFlow(("pdmR3DevHlp_DMACRegister: caller='%s'/%d: returns %Rrc (ppDmacHlp)\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Only one DMA device.
*/
PVM pVM = pDevIns->Internal.s.pVMR3;
if (pVM->pdm.s.pDmac)
{
AssertMsgFailed(("Only one DMA device is supported!\n"));
LogFlow(("pdmR3DevHlp_DMACRegister: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
return VERR_INVALID_PARAMETER;
}
/*
* Allocate and initialize pci bus structure.
*/
int rc = VINF_SUCCESS;
PPDMDMAC pDmac = (PPDMDMAC)MMR3HeapAlloc(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE, sizeof(*pDmac));
if (pDmac)
{
pDmac->pDevIns = pDevIns;
pDmac->Reg = *pDmacReg;
pVM->pdm.s.pDmac = pDmac;
/* set the helper pointer. */
*ppDmacHlp = &g_pdmR3DevDmacHlp;
Log(("PDM: Registered DMAC device '%s'/%d pDevIns=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, pDevIns));
}
else
rc = VERR_NO_MEMORY;
LogFlow(("pdmR3DevHlp_DMACRegister: caller='%s'/%d: returns %Rrc\n",
pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnRegisterVMMDevHeap
*/
static DECLCALLBACK(int) pdmR3DevHlp_RegisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
int rc = PDMR3VmmDevHeapRegister(pDevIns->Internal.s.pVMR3, GCPhys, pvHeap, cbSize);
return rc;
}
/**
* @copydoc PDMDEVHLPR3::pfnUnregisterVMMDevHeap
*/
static DECLCALLBACK(int) pdmR3DevHlp_UnregisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
int rc = PDMR3VmmDevHeapUnregister(pDevIns->Internal.s.pVMR3, GCPhys);
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMReset} */
static DECLCALLBACK(int) pdmR3DevHlp_VMReset(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_VMReset: caller='%s'/%d: VM_FF_RESET %d -> 1\n",
pDevIns->pReg->szName, pDevIns->iInstance, VM_FF_IS_SET(pVM, VM_FF_RESET)));
/*
* We postpone this operation because we're likely to be inside a I/O instruction
* and the EIP will be updated when we return.
* We still return VINF_EM_RESET to break out of any execution loops and force FF evaluation.
*/
bool fHaltOnReset;
int rc = CFGMR3QueryBool(CFGMR3GetChild(CFGMR3GetRoot(pVM), "PDM"), "HaltOnReset", &fHaltOnReset);
if (RT_SUCCESS(rc) && fHaltOnReset)
{
Log(("pdmR3DevHlp_VMReset: Halt On Reset!\n"));
rc = VINF_EM_HALT;
}
else
{
VM_FF_SET(pVM, VM_FF_RESET);
rc = VINF_EM_RESET;
}
LogFlow(("pdmR3DevHlp_VMReset: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSuspend} */
static DECLCALLBACK(int) pdmR3DevHlp_VMSuspend(PPDMDEVINS pDevIns)
{
int rc;
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_VMSuspend: caller='%s'/%d:\n",
pDevIns->pReg->szName, pDevIns->iInstance));
/** @todo Always take the SMP path - fewer code paths. */
if (pVM->cCpus > 1)
{
/* We own the IOM lock here and could cause a deadlock by waiting for a VCPU that is blocking on the IOM lock. */
rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3Suspend, 2, pVM->pUVM, VMSUSPENDREASON_VM);
AssertRC(rc);
rc = VINF_EM_SUSPEND;
}
else
rc = VMR3Suspend(pVM->pUVM, VMSUSPENDREASON_VM);
LogFlow(("pdmR3DevHlp_VMSuspend: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/**
* Worker for pdmR3DevHlp_VMSuspendSaveAndPowerOff that is invoked via a queued
* EMT request to avoid deadlocks.
*
* @returns VBox status code fit for scheduling.
* @param pVM Pointer to the VM.
* @param pDevIns The device that triggered this action.
*/
static DECLCALLBACK(int) pdmR3DevHlp_VMSuspendSaveAndPowerOffWorker(PVM pVM, PPDMDEVINS pDevIns)
{
/*
* Suspend the VM first then do the saving.
*/
int rc = VMR3Suspend(pVM->pUVM, VMSUSPENDREASON_VM);
if (RT_SUCCESS(rc))
{
PUVM pUVM = pVM->pUVM;
rc = pUVM->pVmm2UserMethods->pfnSaveState(pVM->pUVM->pVmm2UserMethods, pUVM);
/*
* On success, power off the VM, on failure we'll leave it suspended.
*/
if (RT_SUCCESS(rc))
{
rc = VMR3PowerOff(pVM->pUVM);
if (RT_FAILURE(rc))
LogRel(("%s/SSP: VMR3PowerOff failed: %Rrc\n", pDevIns->pReg->szName, rc));
}
else
LogRel(("%s/SSP: pfnSaveState failed: %Rrc\n", pDevIns->pReg->szName, rc));
}
else
LogRel(("%s/SSP: Suspend failed: %Rrc\n", pDevIns->pReg->szName, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSuspendSaveAndPowerOff} */
static DECLCALLBACK(int) pdmR3DevHlp_VMSuspendSaveAndPowerOff(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_VMSuspendSaveAndPowerOff: caller='%s'/%d:\n",
pDevIns->pReg->szName, pDevIns->iInstance));
int rc;
if ( pVM->pUVM->pVmm2UserMethods
&& pVM->pUVM->pVmm2UserMethods->pfnSaveState)
{
rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)pdmR3DevHlp_VMSuspendSaveAndPowerOffWorker, 2, pVM, pDevIns);
if (RT_SUCCESS(rc))
{
LogRel(("%s: Suspending, Saving and Powering Off the VM\n", pDevIns->pReg->szName));
rc = VINF_EM_SUSPEND;
}
}
else
rc = VERR_NOT_SUPPORTED;
LogFlow(("pdmR3DevHlp_VMSuspendSaveAndPowerOff: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMPowerOff} */
static DECLCALLBACK(int) pdmR3DevHlp_VMPowerOff(PPDMDEVINS pDevIns)
{
int rc;
PDMDEV_ASSERT_DEVINS(pDevIns);
PVM pVM = pDevIns->Internal.s.pVMR3;
VM_ASSERT_EMT(pVM);
LogFlow(("pdmR3DevHlp_VMPowerOff: caller='%s'/%d:\n",
pDevIns->pReg->szName, pDevIns->iInstance));
/** @todo Always take the SMP path - fewer code paths. */
if (pVM->cCpus > 1)
{
/* We might be holding locks here and could cause a deadlock since
VMR3PowerOff rendezvous with the other CPUs. */
rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3PowerOff, 1, pVM->pUVM);
AssertRC(rc);
/* Set the VCPU state to stopped here as well to make sure no
inconsistency with the EM state occurs. */
VMCPU_SET_STATE(VMMGetCpu(pVM), VMCPUSTATE_STOPPED);
rc = VINF_EM_OFF;
}
else
rc = VMR3PowerOff(pVM->pUVM);
LogFlow(("pdmR3DevHlp_VMPowerOff: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnA20IsEnabled} */
static DECLCALLBACK(bool) pdmR3DevHlp_A20IsEnabled(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
bool fRc = PGMPhysIsA20Enabled(VMMGetCpu(pDevIns->Internal.s.pVMR3));
LogFlow(("pdmR3DevHlp_A20IsEnabled: caller='%s'/%d: returns %d\n", pDevIns->pReg->szName, pDevIns->iInstance, fRc));
return fRc;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnA20Set} */
static DECLCALLBACK(void) pdmR3DevHlp_A20Set(PPDMDEVINS pDevIns, bool fEnable)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_A20Set: caller='%s'/%d: fEnable=%d\n", pDevIns->pReg->szName, pDevIns->iInstance, fEnable));
PGMR3PhysSetA20(VMMGetCpu(pDevIns->Internal.s.pVMR3), fEnable);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetCpuId} */
static DECLCALLBACK(void) pdmR3DevHlp_GetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf,
uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
LogFlow(("pdmR3DevHlp_GetCpuId: caller='%s'/%d: iLeaf=%d pEax=%p pEbx=%p pEcx=%p pEdx=%p\n",
pDevIns->pReg->szName, pDevIns->iInstance, iLeaf, pEax, pEbx, pEcx, pEdx));
AssertPtr(pEax); AssertPtr(pEbx); AssertPtr(pEcx); AssertPtr(pEdx);
CPUMGetGuestCpuId(VMMGetCpu(pDevIns->Internal.s.pVMR3), iLeaf, 0 /*iSubLeaf*/, pEax, pEbx, pEcx, pEdx);
LogFlow(("pdmR3DevHlp_GetCpuId: caller='%s'/%d: returns void - *pEax=%#x *pEbx=%#x *pEcx=%#x *pEdx=%#x\n",
pDevIns->pReg->szName, pDevIns->iInstance, *pEax, *pEbx, *pEcx, *pEdx));
}
/**
* The device helper structure for trusted devices.
*/
const PDMDEVHLPR3 g_pdmR3DevHlpTrusted =
{
PDM_DEVHLPR3_VERSION,
pdmR3DevHlp_IOPortRegister,
pdmR3DevHlp_IOPortRegisterRC,
pdmR3DevHlp_IOPortRegisterR0,
pdmR3DevHlp_IOPortDeregister,
pdmR3DevHlp_MMIORegister,
pdmR3DevHlp_MMIORegisterRC,
pdmR3DevHlp_MMIORegisterR0,
pdmR3DevHlp_MMIODeregister,
pdmR3DevHlp_MMIO2Register,
pdmR3DevHlp_MMIO2Deregister,
pdmR3DevHlp_MMIO2Map,
pdmR3DevHlp_MMIO2Unmap,
pdmR3DevHlp_MMHyperMapMMIO2,
pdmR3DevHlp_MMIO2MapKernel,
pdmR3DevHlp_ROMRegister,
pdmR3DevHlp_ROMProtectShadow,
pdmR3DevHlp_SSMRegister,
pdmR3DevHlp_TMTimerCreate,
pdmR3DevHlp_TMUtcNow,
pdmR3DevHlp_PhysRead,
pdmR3DevHlp_PhysWrite,
pdmR3DevHlp_PhysGCPhys2CCPtr,
pdmR3DevHlp_PhysGCPhys2CCPtrReadOnly,
pdmR3DevHlp_PhysReleasePageMappingLock,
pdmR3DevHlp_PhysReadGCVirt,
pdmR3DevHlp_PhysWriteGCVirt,
pdmR3DevHlp_PhysGCPtr2GCPhys,
pdmR3DevHlp_MMHeapAlloc,
pdmR3DevHlp_MMHeapAllocZ,
pdmR3DevHlp_MMHeapFree,
pdmR3DevHlp_VMState,
pdmR3DevHlp_VMTeleportedAndNotFullyResumedYet,
pdmR3DevHlp_VMSetError,
pdmR3DevHlp_VMSetErrorV,
pdmR3DevHlp_VMSetRuntimeError,
pdmR3DevHlp_VMSetRuntimeErrorV,
pdmR3DevHlp_DBGFStopV,
pdmR3DevHlp_DBGFInfoRegister,
pdmR3DevHlp_DBGFRegRegister,
pdmR3DevHlp_DBGFTraceBuf,
pdmR3DevHlp_STAMRegister,
pdmR3DevHlp_STAMRegisterF,
pdmR3DevHlp_STAMRegisterV,
pdmR3DevHlp_PCIRegister,
pdmR3DevHlp_PCIRegisterMsi,
pdmR3DevHlp_PCIIORegionRegister,
pdmR3DevHlp_PCISetConfigCallbacks,
pdmR3DevHlp_PCIPhysRead,
pdmR3DevHlp_PCIPhysWrite,
pdmR3DevHlp_PCISetIrq,
pdmR3DevHlp_PCISetIrqNoWait,
pdmR3DevHlp_ISASetIrq,
pdmR3DevHlp_ISASetIrqNoWait,
pdmR3DevHlp_DriverAttach,
pdmR3DevHlp_QueueCreate,
pdmR3DevHlp_CritSectInit,
pdmR3DevHlp_CritSectGetNop,
pdmR3DevHlp_CritSectGetNopR0,
pdmR3DevHlp_CritSectGetNopRC,
pdmR3DevHlp_SetDeviceCritSect,
pdmR3DevHlp_ThreadCreate,
pdmR3DevHlp_SetAsyncNotification,
pdmR3DevHlp_AsyncNotificationCompleted,
pdmR3DevHlp_RTCRegister,
pdmR3DevHlp_PCIBusRegister,
pdmR3DevHlp_PICRegister,
pdmR3DevHlp_APICRegister,
pdmR3DevHlp_IOAPICRegister,
pdmR3DevHlp_HPETRegister,
pdmR3DevHlp_PciRawRegister,
pdmR3DevHlp_DMACRegister,
pdmR3DevHlp_DMARegister,
pdmR3DevHlp_DMAReadMemory,
pdmR3DevHlp_DMAWriteMemory,
pdmR3DevHlp_DMASetDREQ,
pdmR3DevHlp_DMAGetChannelMode,
pdmR3DevHlp_DMASchedule,
pdmR3DevHlp_CMOSWrite,
pdmR3DevHlp_CMOSRead,
pdmR3DevHlp_AssertEMT,
pdmR3DevHlp_AssertOther,
pdmR3DevHlp_LdrGetRCInterfaceSymbols,
pdmR3DevHlp_LdrGetR0InterfaceSymbols,
pdmR3DevHlp_CallR0,
pdmR3DevHlp_VMGetSuspendReason,
pdmR3DevHlp_VMGetResumeReason,
0,
0,
0,
0,
0,
0,
0,
pdmR3DevHlp_GetUVM,
pdmR3DevHlp_GetVM,
pdmR3DevHlp_GetVMCPU,
pdmR3DevHlp_GetCurrentCpuId,
pdmR3DevHlp_RegisterVMMDevHeap,
pdmR3DevHlp_UnregisterVMMDevHeap,
pdmR3DevHlp_VMReset,
pdmR3DevHlp_VMSuspend,
pdmR3DevHlp_VMSuspendSaveAndPowerOff,
pdmR3DevHlp_VMPowerOff,
pdmR3DevHlp_A20IsEnabled,
pdmR3DevHlp_A20Set,
pdmR3DevHlp_GetCpuId,
pdmR3DevHlp_TMTimeVirtGet,
pdmR3DevHlp_TMTimeVirtGetFreq,
pdmR3DevHlp_TMTimeVirtGetNano,
pdmR3DevHlp_GetSupDrvSession,
PDM_DEVHLPR3_VERSION /* the end */
};
/** @interface_method_impl{PDMDEVHLPR3,pfnGetUVM} */
static DECLCALLBACK(PUVM) pdmR3DevHlp_Untrusted_GetUVM(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return NULL;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetVM} */
static DECLCALLBACK(PVM) pdmR3DevHlp_Untrusted_GetVM(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return NULL;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetVMCPU} */
static DECLCALLBACK(PVMCPU) pdmR3DevHlp_Untrusted_GetVMCPU(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return NULL;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetCurrentCpuId} */
static DECLCALLBACK(VMCPUID) pdmR3DevHlp_Untrusted_GetCurrentCpuId(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return NIL_VMCPUID;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnRegisterVMMDevHeap} */
static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_RegisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
NOREF(GCPhys); NOREF(pvHeap); NOREF(cbSize);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return VERR_ACCESS_DENIED;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnUnregisterVMMDevHeap} */
static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_UnregisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
NOREF(GCPhys);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return VERR_ACCESS_DENIED;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMReset} */
static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_VMReset(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return VERR_ACCESS_DENIED;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSuspend} */
static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_VMSuspend(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return VERR_ACCESS_DENIED;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMSuspendSaveAndPowerOff} */
static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_VMSuspendSaveAndPowerOff(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return VERR_ACCESS_DENIED;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnVMPowerOff} */
static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_VMPowerOff(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return VERR_ACCESS_DENIED;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnA20IsEnabled} */
static DECLCALLBACK(bool) pdmR3DevHlp_Untrusted_A20IsEnabled(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return false;
}
/** @interface_method_impl{PDMDEVHLPR3,pfnA20Set} */
static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_A20Set(PPDMDEVINS pDevIns, bool fEnable)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
NOREF(fEnable);
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetCpuId} */
static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_GetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf,
uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
NOREF(iLeaf); NOREF(pEax); NOREF(pEbx); NOREF(pEcx); NOREF(pEdx);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
}
/** @interface_method_impl{PDMDEVHLPR3,pfnGetSupDrvSession} */
static DECLCALLBACK(PSUPDRVSESSION) pdmR3DevHlp_Untrusted_GetSupDrvSession(PPDMDEVINS pDevIns)
{
PDMDEV_ASSERT_DEVINS(pDevIns);
AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
return (PSUPDRVSESSION)0;
}
/**
* The device helper structure for non-trusted devices.
*/
const PDMDEVHLPR3 g_pdmR3DevHlpUnTrusted =
{
PDM_DEVHLPR3_VERSION,
pdmR3DevHlp_IOPortRegister,
pdmR3DevHlp_IOPortRegisterRC,
pdmR3DevHlp_IOPortRegisterR0,
pdmR3DevHlp_IOPortDeregister,
pdmR3DevHlp_MMIORegister,
pdmR3DevHlp_MMIORegisterRC,
pdmR3DevHlp_MMIORegisterR0,
pdmR3DevHlp_MMIODeregister,
pdmR3DevHlp_MMIO2Register,
pdmR3DevHlp_MMIO2Deregister,
pdmR3DevHlp_MMIO2Map,
pdmR3DevHlp_MMIO2Unmap,
pdmR3DevHlp_MMHyperMapMMIO2,
pdmR3DevHlp_MMIO2MapKernel,
pdmR3DevHlp_ROMRegister,
pdmR3DevHlp_ROMProtectShadow,
pdmR3DevHlp_SSMRegister,
pdmR3DevHlp_TMTimerCreate,
pdmR3DevHlp_TMUtcNow,
pdmR3DevHlp_PhysRead,
pdmR3DevHlp_PhysWrite,
pdmR3DevHlp_PhysGCPhys2CCPtr,
pdmR3DevHlp_PhysGCPhys2CCPtrReadOnly,
pdmR3DevHlp_PhysReleasePageMappingLock,
pdmR3DevHlp_PhysReadGCVirt,
pdmR3DevHlp_PhysWriteGCVirt,
pdmR3DevHlp_PhysGCPtr2GCPhys,
pdmR3DevHlp_MMHeapAlloc,
pdmR3DevHlp_MMHeapAllocZ,
pdmR3DevHlp_MMHeapFree,
pdmR3DevHlp_VMState,
pdmR3DevHlp_VMTeleportedAndNotFullyResumedYet,
pdmR3DevHlp_VMSetError,
pdmR3DevHlp_VMSetErrorV,
pdmR3DevHlp_VMSetRuntimeError,
pdmR3DevHlp_VMSetRuntimeErrorV,
pdmR3DevHlp_DBGFStopV,
pdmR3DevHlp_DBGFInfoRegister,
pdmR3DevHlp_DBGFRegRegister,
pdmR3DevHlp_DBGFTraceBuf,
pdmR3DevHlp_STAMRegister,
pdmR3DevHlp_STAMRegisterF,
pdmR3DevHlp_STAMRegisterV,
pdmR3DevHlp_PCIRegister,
pdmR3DevHlp_PCIRegisterMsi,
pdmR3DevHlp_PCIIORegionRegister,
pdmR3DevHlp_PCISetConfigCallbacks,
pdmR3DevHlp_PCIPhysRead,
pdmR3DevHlp_PCIPhysWrite,
pdmR3DevHlp_PCISetIrq,
pdmR3DevHlp_PCISetIrqNoWait,
pdmR3DevHlp_ISASetIrq,
pdmR3DevHlp_ISASetIrqNoWait,
pdmR3DevHlp_DriverAttach,
pdmR3DevHlp_QueueCreate,
pdmR3DevHlp_CritSectInit,
pdmR3DevHlp_CritSectGetNop,
pdmR3DevHlp_CritSectGetNopR0,
pdmR3DevHlp_CritSectGetNopRC,
pdmR3DevHlp_SetDeviceCritSect,
pdmR3DevHlp_ThreadCreate,
pdmR3DevHlp_SetAsyncNotification,
pdmR3DevHlp_AsyncNotificationCompleted,
pdmR3DevHlp_RTCRegister,
pdmR3DevHlp_PCIBusRegister,
pdmR3DevHlp_PICRegister,
pdmR3DevHlp_APICRegister,
pdmR3DevHlp_IOAPICRegister,
pdmR3DevHlp_HPETRegister,
pdmR3DevHlp_PciRawRegister,
pdmR3DevHlp_DMACRegister,
pdmR3DevHlp_DMARegister,
pdmR3DevHlp_DMAReadMemory,
pdmR3DevHlp_DMAWriteMemory,
pdmR3DevHlp_DMASetDREQ,
pdmR3DevHlp_DMAGetChannelMode,
pdmR3DevHlp_DMASchedule,
pdmR3DevHlp_CMOSWrite,
pdmR3DevHlp_CMOSRead,
pdmR3DevHlp_AssertEMT,
pdmR3DevHlp_AssertOther,
pdmR3DevHlp_LdrGetRCInterfaceSymbols,
pdmR3DevHlp_LdrGetR0InterfaceSymbols,
pdmR3DevHlp_CallR0,
pdmR3DevHlp_VMGetSuspendReason,
pdmR3DevHlp_VMGetResumeReason,
0,
0,
0,
0,
0,
0,
0,
pdmR3DevHlp_Untrusted_GetUVM,
pdmR3DevHlp_Untrusted_GetVM,
pdmR3DevHlp_Untrusted_GetVMCPU,
pdmR3DevHlp_Untrusted_GetCurrentCpuId,
pdmR3DevHlp_Untrusted_RegisterVMMDevHeap,
pdmR3DevHlp_Untrusted_UnregisterVMMDevHeap,
pdmR3DevHlp_Untrusted_VMReset,
pdmR3DevHlp_Untrusted_VMSuspend,
pdmR3DevHlp_Untrusted_VMSuspendSaveAndPowerOff,
pdmR3DevHlp_Untrusted_VMPowerOff,
pdmR3DevHlp_Untrusted_A20IsEnabled,
pdmR3DevHlp_Untrusted_A20Set,
pdmR3DevHlp_Untrusted_GetCpuId,
pdmR3DevHlp_TMTimeVirtGet,
pdmR3DevHlp_TMTimeVirtGetFreq,
pdmR3DevHlp_TMTimeVirtGetNano,
pdmR3DevHlp_Untrusted_GetSupDrvSession,
PDM_DEVHLPR3_VERSION /* the end */
};
/**
* Queue consumer callback for internal component.
*
* @returns Success indicator.
* If false the item will not be removed and the flushing will stop.
* @param pVM Pointer to the VM.
* @param pItem The item to consume. Upon return this item will be freed.
*/
DECLCALLBACK(bool) pdmR3DevHlpQueueConsumer(PVM pVM, PPDMQUEUEITEMCORE pItem)
{
PPDMDEVHLPTASK pTask = (PPDMDEVHLPTASK)pItem;
LogFlow(("pdmR3DevHlpQueueConsumer: enmOp=%d pDevIns=%p\n", pTask->enmOp, pTask->pDevInsR3));
switch (pTask->enmOp)
{
case PDMDEVHLPTASKOP_ISA_SET_IRQ:
PDMIsaSetIrq(pVM, pTask->u.SetIRQ.iIrq, pTask->u.SetIRQ.iLevel, pTask->u.SetIRQ.uTagSrc);
break;
case PDMDEVHLPTASKOP_PCI_SET_IRQ:
{
/* Same as pdmR3DevHlp_PCISetIrq, except we've got a tag already. */
PPDMDEVINS pDevIns = pTask->pDevInsR3;
PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3;
if (pPciDev)
{
PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; /** @todo the bus should be associated with the PCI device not the PDM device. */
Assert(pBus);
pdmLock(pVM);
pBus->pfnSetIrqR3(pBus->pDevInsR3, pPciDev, pTask->u.SetIRQ.iIrq,
pTask->u.SetIRQ.iLevel, pTask->u.SetIRQ.uTagSrc);
pdmUnlock(pVM);
}
else
AssertReleaseMsgFailed(("No PCI device registered!\n"));
break;
}
case PDMDEVHLPTASKOP_IOAPIC_SET_IRQ:
PDMIoApicSetIrq(pVM, pTask->u.SetIRQ.iIrq, pTask->u.SetIRQ.iLevel, pTask->u.SetIRQ.uTagSrc);
break;
default:
AssertReleaseMsgFailed(("Invalid operation %d\n", pTask->enmOp));
break;
}
return true;
}
/** @} */
|
sobomax/virtualbox_64bit_edd
|
src/VBox/VMM/VMMR3/PDMDevHlp.cpp
|
C++
|
gpl-2.0
| 158,554 |
package com.avrgaming.civcraft.endgame;
import java.util.ArrayList;
import com.avrgaming.civcraft.main.CivGlobal;
import com.avrgaming.civcraft.main.CivMessage;
import com.avrgaming.civcraft.object.Civilization;
import com.avrgaming.civcraft.object.Town;
import com.avrgaming.civcraft.sessiondb.SessionEntry;
import com.avrgaming.civcraft.structure.wonders.Wonder;
public class EndConditionScience extends EndGameCondition {
String techname;
@Override
public void onLoad() {
techname = this.getString("tech");
}
@Override
public boolean check(Civilization civ) {
if (!civ.hasTechnology(techname)) {
return false;
}
if (civ.isAdminCiv()) {
return false;
}
boolean hasGreatLibrary = false;
for (Town town : civ.getTowns()) {
if (town.getMotherCiv() != null) {
continue;
}
for (Wonder wonder :town.getWonders()) {
if (wonder.isActive()) {
if (wonder.getConfigId().equals("w_greatlibrary")) {
hasGreatLibrary = true;
break;
}
}
}
if (hasGreatLibrary) {
break;
}
}
if (!hasGreatLibrary) {
return false;
}
return true;
}
@Override
public boolean finalWinCheck(Civilization civ) {
Civilization rival = getMostAccumulatedBeakers();
if (rival != civ) {
CivMessage.global(civ.getName()+" doesn't have enough beakers for a scientific victory. The rival civilization of "+rival.getName()+" has more!");
return false;
}
return true;
}
public Civilization getMostAccumulatedBeakers() {
double most = 0;
Civilization mostCiv = null;
for (Civilization civ : CivGlobal.getCivs()) {
double beakers = getExtraBeakersInCiv(civ);
if (beakers > most) {
most = beakers;
mostCiv = civ;
}
}
return mostCiv;
}
@Override
public String getSessionKey() {
return "endgame:science";
}
@Override
protected void onWarDefeat(Civilization civ) {
/* remove any extra beakers we might have. */
CivGlobal.getSessionDB().delete_all(getBeakerSessionKey(civ));
civ.removeTech(techname);
CivMessage.sendCiv(civ, "We were defeated while trying to achieve a science victory! We've lost all of our accumulated beakers and our victory tech!");
civ.save();
this.onFailure(civ);
}
public static String getBeakerSessionKey(Civilization civ) {
return "endgame:sciencebeakers:"+civ.getId();
}
public double getExtraBeakersInCiv(Civilization civ) {
ArrayList<SessionEntry> entries = CivGlobal.getSessionDB().lookup(getBeakerSessionKey(civ));
if (entries.size() == 0) {
return 0;
}
return Double.valueOf(entries.get(0).value);
}
public void addExtraBeakersToCiv(Civilization civ, double beakers) {
ArrayList<SessionEntry> entries = CivGlobal.getSessionDB().lookup(getBeakerSessionKey(civ));
double current = 0;
if (entries.size() == 0) {
CivGlobal.getSessionDB().add(getBeakerSessionKey(civ), ""+beakers, civ.getId(), 0, 0);
current += beakers;
} else {
current = Double.valueOf(entries.get(0).value);
current += beakers;
CivGlobal.getSessionDB().update(entries.get(0).request_id, entries.get(0).key, ""+current);
}
//DecimalFormat df = new DecimalFormat("#.#");
//CivMessage.sendCiv(civ, "Added "+df.format(beakers)+" beakers to our scientific victory! We now have "+df.format(current)+" beakers saved up.");
}
public static Double getBeakersFor(Civilization civ) {
ArrayList<SessionEntry> entries = CivGlobal.getSessionDB().lookup(getBeakerSessionKey(civ));
if (entries.size() == 0) {
return 0.0;
} else {
return Double.valueOf(entries.get(0).value);
}
}
}
|
netizen539/civcraft
|
civcraft/src/com/avrgaming/civcraft/endgame/EndConditionScience.java
|
Java
|
gpl-2.0
| 3,584 |
/*
* Copyright 2010 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package org.visage.jdi.request;
import org.visage.jdi.VisageThreadReference;
import org.visage.jdi.VisageVirtualMachine;
import org.visage.jdi.VisageWrapper;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.request.StepRequest;
/**
*
* @author sundar
*/
public class VisageStepRequest extends VisageEventRequest implements StepRequest {
public VisageStepRequest(VisageVirtualMachine visagevm, StepRequest underlying) {
super(visagevm, underlying);
}
public void addClassExclusionFilter(String arg0) {
underlying().addClassExclusionFilter(arg0);
}
public void addClassFilter(ReferenceType arg0) {
underlying().addClassFilter(VisageWrapper.unwrap(arg0));
}
public void addClassFilter(String arg0) {
underlying().addClassFilter(arg0);
}
public void addInstanceFilter(ObjectReference ref) {
underlying().addInstanceFilter(VisageWrapper.unwrap(ref));
}
public int depth() {
return underlying().depth();
}
public int size() {
return underlying().size();
}
public VisageThreadReference thread() {
return VisageWrapper.wrap(virtualMachine(), underlying().thread());
}
@Override
protected StepRequest underlying() {
return (StepRequest) super.underlying();
}
}
|
pron/visage-compiler
|
visagejdi/src/org/visage/jdi/request/VisageStepRequest.java
|
Java
|
gpl-2.0
| 2,405 |
/*
* Copyright (C) 2014 Apple Inc. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "bmalloc.h"
#define EXPORT __attribute__((visibility("default")))
extern "C" {
EXPORT void* mbmalloc(size_t);
EXPORT void* mbmemalign(size_t, size_t);
EXPORT void mbfree(void*, size_t);
EXPORT void* mbrealloc(void*, size_t, size_t);
EXPORT void mbscavenge();
void* mbmalloc(size_t size)
{
return bmalloc::api::malloc(size);
}
void* mbmemalign(size_t alignment, size_t size)
{
return bmalloc::api::memalign(alignment, size);
}
void mbfree(void* p, size_t)
{
bmalloc::api::free(p);
}
void* mbrealloc(void* p, size_t, size_t size)
{
return bmalloc::api::realloc(p, size);
}
void mbscavenge()
{
bmalloc::api::scavenge();
}
} // extern "C"
|
qtproject/qtwebkit
|
Source/bmalloc/bmalloc/mbmalloc.cpp
|
C++
|
gpl-2.0
| 2,010 |
package gr.softaware.lib_1_3.data.convert.csv;
import java.util.List;
/**
*
* @author siggouroglou
* @param <T> A class that implements the CsvGenerationModel interface.
*/
final public class CsvGenerator<T extends CsvGenerationModel> {
private final List<CsvGenerationModel> modelList;
public CsvGenerator(List<T> modelList) {
this.modelList = (List<CsvGenerationModel>)modelList;
}
public StringBuilder getContent() {
return getContent("\t", "\\t");
}
public StringBuilder getContent(String separator, String separatorAsString) {
StringBuilder builder = new StringBuilder();
// First line contains the separator.
builder.append("sep=").append(separatorAsString).append("\n");
// Get the header.
if(!modelList.isEmpty()) {
builder.append(modelList.get(0).toCsvFormattedHeader(separator)).append("\n");
}
// Get the data.
modelList.stream().forEach((model) -> {
builder.append(model.toCsvFormattedRow(separator)).append("\n");
});
return builder;
}
}
|
siggouroglou/innovathens
|
webnew/src/main/java/gr/softaware/lib_1_3/data/convert/csv/CsvGenerator.java
|
Java
|
gpl-2.0
| 1,153 |
<?php
/**
Author: Musavir Ifitkahr:
kuala lumpur Malaysia
*/
class Admin_UserController extends Zend_Controller_Action
{
protected $user_session = null;
protected $db;
protected $language_id = null;
protected $filter = null;
protected $user = null;
protected $baseurl = '';
public function init(){
Zend_Layout::startMvc(
array('layoutPath' => APPLICATION_PATH . '/admin/layouts', 'layout' => 'layout')
);
$this->db = Zend_Db_Table::getDefaultAdapter();
$this->user = new Application_Model_User();
$this->baseurl = Zend_Controller_Front::getInstance()->getBaseUrl(); //actual base url function
$this->language_id = Zend_Registry::get('lang_id'); //get the instance of database adapter
$this->user_session = new Zend_Session_Namespace("user_session"); // default namespace
$this->filter = new Zend_Filter_StripTags;
//Zend_Registry::set('lang_id',2);
ini_set("max_execution_time", 0);
$auth = Zend_Auth::getInstance();
//if not loggedin redirect to login page
if (!$auth->hasIdentity()){
$this->_redirect('/admin/index/login');;
}
/* if(isset($this->user_session->role_id)){
$role = array('1' => 'Admin','2' => 'Payment Manager','3' => 'Content Manager','4' => 'Listing Manager', '3' => 'Deals Manager' );
$this->view->user = array(
'user_id' => $this->user_session->user_id,
'email' => $this->user_session->email,
'role_id' => $this->user_session->role_id,
'role_name' => $role[$this->user_session->role_id],
'user_name' =>$this->user_session->firstname,
);
} */
}
// this is default output function
public function indexAction() {
}
public function newAction(){
//if not admin redirect to admin index dash board
/* if ($this->user_session->role_id != 1){
$this->_redirect('/admin/index');
} */
//show message if it is set true
if (isset($this->user_session->msg)){
$this->view->msg = $this->user_session->msg;
unset($this->user_session->msg);
}
//$this->adapter = new Zend_File_Transfer_Adapter_Http();
$form = new Application_Form_UserForm();
$this->view->form = $form;
if (!$this->_request->isPost()) {
//$form->role->setValue($this->user_session->selected);
$this->view->form = $form;
return;
}
$formData = $this->_request->getPost();
if (!$form->isValid($formData)) {
$this->view->form = $form;
return;
}
$exist = $this->user->checkEmail($formData['email']);
if($exist == true){
$this->view->msg = "<div class='errors'>Email (User ID) already exists. Please make another one .</div>";
return;
}
$formData['date_added'] = date("Y-m-d");
$this->view->msg = $this->user->addUser($formData);
//$this->user_session->selected = $formData['role'];
$this->user_session->msg = $this->view->msg;
//$this->_redirect('/admin/user/new');
//clear all form fields
$form->reset();
}
public function messagePageAction(){
$this->view->msg = $this->user_session->msg;
unset($this->user_session->country);
unset($this->user_session->state);
unset($this->user_session->add_more);
}
public function listAction(){
$query_string = $this->_request->getParam("query_string");
$results = null;
$query_string = trim($query_string);
if($query_string !=''){
if(is_string($query_string)){
$results = $this->user->findUser($query_string);
}
}
else{
$results = $this->user->getUsers();
}
if (count($results) > 0) {
$this->Paginator($results);
} else {
$this->view->empty_rec = true;
}
}
// for delete users
public function deleteUsersAction(){
$user_id = $this->_request->getParam('id');
$delete = $this->user->deleteUsers($user_id);
$this->_redirect('/admin/user/list/');
//var_dump($delete);
}
public function findUsersAction(){
//$this->ajaxed();
$email = $this->_request->getParam('email');
$results = $this->user->findUser($email);
if (count($results) > 0) {
$this->Paginator($results);
} else {
$this->view->empty_rec = true;
}
}
public function editAction(){
$form = new Application_Form_UserForm();
$user_id = $this->_request->getParam('user_id');
$result = $this->user->getUser($user_id);
$form->removeElement("password");
$this->view->user_id = $result->user_id;
$form->email->setValue($result->email);
$form->user_name->setValue($result->user_name);
//$form->role->setValue($result->role);
$this->view->form = $form;
if (!$this->_request->isPost()) {
$this->view->form = $form;
return;
}
$formData = $this->_request->getPost();
if (!$form->isValid($formData)) {
$this->view->form = $form;
return;
}
$result = $this->user->updateUser($formData);
$this->_redirect('admin/user/list');
}
// for chNEGE password user
public function updatePasswordAction(){
$user_id=$this->user_session->user_id;
$this->view->user_id=$user_id;
$form = new Application_Form_ChangePasswordForm();
$this->view->form = $form;
$this->view->msg = "";
if (!$this->_request->isPost()) {
return;
}
$formData = $this->_request->getPost();
if (!$form->isValid($formData)) {
return;
}
//All business logics will come here
if(strcmp($formData['pwd_current'],$formData['pwd'] ) == 0){
$this->view->msg = "<div class='alert alert-danger'>Old and New password are same</div>";
$this->view->form = $form;
return;
}
if(strcmp($formData['pwd'],$formData['pwd_confirm'] ) != 0){
$this->view->msg = "<div class='alert alert-danger'>Passwords are not matching</div>";
$this->view->form = $form;
return;
}
// var_dump($formData);
if($this->user->passUpdate($user_id, $formData['pwd'])){
$this->view->msg = "<div class='alert alert-success'>Password successfully Updated</div>";
}else{
$this->view->msg = "<div class='alert alert-danger'>Password Update Failed. Try again</div>";
}
}
public function changePasswordAction(){
$form = new Application_Form_UserForm();
$form->removeElement("user_id");
$form->removeElement("firstname");
$form->removeElement("lastname");
$form->removeElement("email");
$user = new Application_Model_User();
$result = $user->getUser();
$form->password->setLabel("New Password");
$form->password->setValue($result->password);
$this->view->form = $form;
$formData;
if (!$this->_request->isPost()) {
$this->view->form = $form;
return;
}
$formData = $this->_request->getPost();
if (!$form->isValid($formData)) {
$this->view->form = $form;
return;
}
/*if(!$user->currentPass($formData['current_password'])){
$this->view->msg = "Wrong current password";
return;
}*/
else {
$result = $user->updatePassword($formData);
$this->view->msg = "Password is updated";
}
}
public function Paginator($results) {
$page = $this->_getParam('page', 1);
$paginator = Zend_Paginator::factory($results);
$paginator->setItemCountPerPage(20);
$paginator->setCurrentPageNumber($page);
$this->view->paginator = $paginator;
}
/*
public function confirmDeleteAction(){
$user_id = $this->_request->getParam('user_id');
$firstname = $this->_request->getParam('firstname');
$this->view->firstname = $firstname;
$this->view->user_id = $user_id;
}
*/
/* public function deleteAction(){
$user_id = $this->_request->getParam('user_id');
$user_table = new Application_Model_User();
$flag = $user_table->removeUser($user_id);
if($flag){
$this->view->user_remove_report = "user has been removed! Successfully";
}
} */
public function ajaxed() {
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout()->disableLayout();
if (!$this->_request->isXmlHttpRequest()
)return; // if not a ajax request leave function
}
public function __call($method, $args) {
if ('Action' == substr($method, -6)) {
// If the action method was not found, forward to the
// index action
return $this->_redirect('admin/index');
}
// all other methods throw an exception
throw new Exception('Invalid method "'
. $method
. '" called',
500);
}
}
|
mussawir/netefct
|
application/admin/controllers/UserController.php
|
PHP
|
gpl-2.0
| 8,735 |
/*
* This file is part of KITCard Reader.
* Ⓒ 2012 Philipp Kern <[email protected]>
*
* KITCard Reader 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.
*
* KITCard Reader 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 KITCard Reader. If not, see <http://www.gnu.org/licenses/>.
*/
package de.Ox539.kitcard.reader;
/**
* ReadCardTask: Read an NFC tag using the Wallet class asynchronously.
*
* This class provides the glue calling the Wallet class and passing
* the information back to the Android UI layer. Detailed error
* information is not provided yet.
*
* @author Philipp Kern <[email protected]>
*/
import de.Ox539.kitcard.reader.Wallet.ReadCardResult;
import android.nfc.Tag;
import android.nfc.tech.MifareClassic;
import android.os.AsyncTask;
import android.widget.Toast;
public class ReadCardTask extends AsyncTask<Tag, Integer, Pair<ReadCardResult, Wallet>> {
private ScanActivity mActivity;
public ReadCardTask(ScanActivity activity) {
super();
this.mActivity = activity;
}
protected Pair<ReadCardResult, Wallet> doInBackground(Tag... tags) {
MifareClassic card = null;
try {
card = MifareClassic.get(tags[0]);
} catch (NullPointerException e) {
/* Error while reading card. This problem occurs on HTC devices from the ONE series with Android Lollipop (status of June 2015)
* Try to repair the tag.
*/
card = MifareClassic.get(MifareUtils.repairTag(tags[0]));
}
if(card == null)
return new Pair<ReadCardResult, Wallet>(null, null);
final Wallet wallet = new Wallet(card);
final ReadCardResult result = wallet.readCard();
return new Pair<ReadCardResult, Wallet>(result, wallet);
}
protected void onPostExecute(Pair<ReadCardResult, Wallet> data) {
ReadCardResult result = data.getValue0();
if(result == ReadCardResult.FAILURE) {
// read failed
Toast.makeText(mActivity, mActivity.getResources().getString(R.string.kitcard_read_failed), Toast.LENGTH_LONG).show();
return;
} else if(result == ReadCardResult.OLD_STYLE_WALLET) {
// old-style wallet encountered
Toast.makeText(mActivity, mActivity.getResources().getString(R.string.kitcard_needs_reencode), Toast.LENGTH_LONG).show();
return;
}
final Wallet wallet = data.getValue1();
mActivity.updateCardNumber(wallet.getCardNumber());
mActivity.updateBalance(wallet.getCurrentBalance());
mActivity.updateLastTransaction(wallet.getLastTransactionValue());
mActivity.updateCardIssuer(wallet.getCardIssuer());
mActivity.updateCardType(wallet.getCardType());
}
}
|
simontb/kitcard-reader
|
src/de/Ox539/kitcard/reader/ReadCardTask.java
|
Java
|
gpl-2.0
| 3,022 |
/*
* Copyright 2002-2005, Instant802 Networks, Inc.
* Copyright 2005-2006, Devicescape Software, Inc.
* Copyright 2007 Johannes Berg <[email protected]>
* Copyright 2008 Luis R. Rodriguez <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/**
* DOC: Wireless regulatory infrastructure
*
* The usual implementation is for a driver to read a device EEPROM to
* determine which regulatory domain it should be operating under, then
* looking up the allowable channels in a driver-local table and finally
* registering those channels in the wiphy structure.
*
* Another set of compliance enforcement is for drivers to use their
* own compliance limits which can be stored on the EEPROM. The host
* driver or firmware may ensure these are used.
*
* In addition to all this we provide an extra layer of regulatory
* conformance. For drivers which do not have any regulatory
* information CRDA provides the complete regulatory solution.
* For others it provides a community effort on further restrictions
* to enhance compliance.
*
* Note: When number of rules --> infinity we will not be able to
* index on alpha2 any more, instead we'll probably have to
* rely on some SHA1 checksum of the regdomain for example.
*
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/random.h>
#include <linux/ctype.h>
#include <linux/nl80211.h>
#include <linux/platform_device.h>
#include <linux/moduleparam.h>
#include <net/cfg80211.h>
#include "core.h"
#include "reg.h"
#include "regdb.h"
#include "nl80211.h"
#ifdef CONFIG_CFG80211_REG_DEBUG
#define REG_DBG_PRINT(format, args...) \
printk(KERN_DEBUG pr_fmt(format), ##args)
#else
#define REG_DBG_PRINT(args...)
#endif
static struct regulatory_request core_request_world = {
.initiator = NL80211_REGDOM_SET_BY_CORE,
.alpha2[0] = '0',
.alpha2[1] = '0',
.intersect = false,
.processed = true,
.country_ie_env = ENVIRON_ANY,
};
/* Receipt of information from last regulatory request */
static struct regulatory_request *last_request = &core_request_world;
/* To trigger userspace events */
static struct platform_device *reg_pdev;
static struct device_type reg_device_type = {
.uevent = reg_device_uevent,
};
/*
* Central wireless core regulatory domains, we only need two,
* the current one and a world regulatory domain in case we have no
* information to give us an alpha2
*/
const struct ieee80211_regdomain *cfg80211_regdomain;
/*
* Protects static reg.c components:
* - cfg80211_world_regdom
* - cfg80211_regdom
* - last_request
*/
static DEFINE_MUTEX(reg_mutex);
static inline void assert_reg_lock(void)
{
lockdep_assert_held(®_mutex);
}
/* Used to queue up regulatory hints */
static LIST_HEAD(reg_requests_list);
static spinlock_t reg_requests_lock;
/* Used to queue up beacon hints for review */
static LIST_HEAD(reg_pending_beacons);
static spinlock_t reg_pending_beacons_lock;
/* Used to keep track of processed beacon hints */
static LIST_HEAD(reg_beacon_list);
struct reg_beacon {
struct list_head list;
struct ieee80211_channel chan;
};
static void reg_todo(struct work_struct *work);
static DECLARE_WORK(reg_work, reg_todo);
static void reg_timeout_work(struct work_struct *work);
static DECLARE_DELAYED_WORK(reg_timeout, reg_timeout_work);
/* We keep a static world regulatory domain in case of the absence of CRDA */
static const struct ieee80211_regdomain world_regdom = {
.n_reg_rules = 5,
.alpha2 = "00",
.reg_rules = {
/* IEEE 802.11b/g, channels 1..11 */
REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
/* IEEE 802.11b/g, channels 12..13. No HT40
* channel fits here. */
REG_RULE(2467-10, 2472+10, 20, 6, 20,
NL80211_RRF_PASSIVE_SCAN |
NL80211_RRF_NO_IBSS),
/* IEEE 802.11 channel 14 - Only JP enables
* this and for 802.11b only */
REG_RULE(2484-10, 2484+10, 20, 6, 20,
NL80211_RRF_PASSIVE_SCAN |
NL80211_RRF_NO_IBSS |
NL80211_RRF_NO_OFDM),
/* IEEE 802.11a, channel 36..48 */
REG_RULE(5180-10, 5240+10, 40, 6, 20,
NL80211_RRF_PASSIVE_SCAN |
NL80211_RRF_NO_IBSS),
/* NB: 5260 MHz - 5700 MHz requies DFS */
/* IEEE 802.11a, channel 149..165 */
REG_RULE(5745-10, 5825+10, 40, 6, 20,
NL80211_RRF_PASSIVE_SCAN |
NL80211_RRF_NO_IBSS),
}
};
static const struct ieee80211_regdomain *cfg80211_world_regdom =
&world_regdom;
static char *ieee80211_regdom = "00";
static char user_alpha2[2];
module_param(ieee80211_regdom, charp, 0444);
MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
static void reset_regdomains(bool full_reset)
{
/* avoid freeing static information or freeing something twice */
if (cfg80211_regdomain == cfg80211_world_regdom)
cfg80211_regdomain = NULL;
if (cfg80211_world_regdom == &world_regdom)
cfg80211_world_regdom = NULL;
if (cfg80211_regdomain == &world_regdom)
cfg80211_regdomain = NULL;
kfree(cfg80211_regdomain);
kfree(cfg80211_world_regdom);
cfg80211_world_regdom = &world_regdom;
cfg80211_regdomain = NULL;
if (!full_reset)
return;
if (last_request != &core_request_world)
kfree(last_request);
last_request = &core_request_world;
}
/*
* Dynamic world regulatory domain requested by the wireless
* core upon initialization
*/
static void update_world_regdomain(const struct ieee80211_regdomain *rd)
{
BUG_ON(!last_request);
reset_regdomains(false);
cfg80211_world_regdom = rd;
cfg80211_regdomain = rd;
}
bool is_world_regdom(const char *alpha2)
{
if (!alpha2)
return false;
if (alpha2[0] == '0' && alpha2[1] == '0')
return true;
return false;
}
static bool is_alpha2_set(const char *alpha2)
{
if (!alpha2)
return false;
if (alpha2[0] != 0 && alpha2[1] != 0)
return true;
return false;
}
static bool is_unknown_alpha2(const char *alpha2)
{
if (!alpha2)
return false;
/*
* Special case where regulatory domain was built by driver
* but a specific alpha2 cannot be determined
*/
if (alpha2[0] == '9' && alpha2[1] == '9')
return true;
return false;
}
static bool is_intersected_alpha2(const char *alpha2)
{
if (!alpha2)
return false;
/*
* Special case where regulatory domain is the
* result of an intersection between two regulatory domain
* structures
*/
if (alpha2[0] == '9' && alpha2[1] == '8')
return true;
return false;
}
static bool is_an_alpha2(const char *alpha2)
{
if (!alpha2)
return false;
if (isalpha(alpha2[0]) && isalpha(alpha2[1]))
return true;
return false;
}
static bool alpha2_equal(const char *alpha2_x, const char *alpha2_y)
{
if (!alpha2_x || !alpha2_y)
return false;
if (alpha2_x[0] == alpha2_y[0] &&
alpha2_x[1] == alpha2_y[1])
return true;
return false;
}
static bool regdom_changes(const char *alpha2)
{
assert_cfg80211_lock();
if (!cfg80211_regdomain)
return true;
if (alpha2_equal(cfg80211_regdomain->alpha2, alpha2))
return false;
return true;
}
/*
* The NL80211_REGDOM_SET_BY_USER regdom alpha2 is cached, this lets
* you know if a valid regulatory hint with NL80211_REGDOM_SET_BY_USER
* has ever been issued.
*/
static bool is_user_regdom_saved(void)
{
if (user_alpha2[0] == '9' && user_alpha2[1] == '7')
return false;
/* This would indicate a mistake on the design */
if (WARN((!is_world_regdom(user_alpha2) &&
!is_an_alpha2(user_alpha2)),
"Unexpected user alpha2: %c%c\n",
user_alpha2[0],
user_alpha2[1]))
return false;
return true;
}
static int reg_copy_regd(const struct ieee80211_regdomain **dst_regd,
const struct ieee80211_regdomain *src_regd)
{
struct ieee80211_regdomain *regd;
int size_of_regd = 0;
unsigned int i;
size_of_regd = sizeof(struct ieee80211_regdomain) +
((src_regd->n_reg_rules + 1) * sizeof(struct ieee80211_reg_rule));
regd = kzalloc(size_of_regd, GFP_KERNEL);
if (!regd)
return -ENOMEM;
memcpy(regd, src_regd, sizeof(struct ieee80211_regdomain));
for (i = 0; i < src_regd->n_reg_rules; i++)
memcpy(®d->reg_rules[i], &src_regd->reg_rules[i],
sizeof(struct ieee80211_reg_rule));
*dst_regd = regd;
return 0;
}
#ifdef CONFIG_CFG80211_INTERNAL_REGDB
struct reg_regdb_search_request {
char alpha2[2];
struct list_head list;
};
static LIST_HEAD(reg_regdb_search_list);
static DEFINE_MUTEX(reg_regdb_search_mutex);
static void reg_regdb_search(struct work_struct *work)
{
struct reg_regdb_search_request *request;
const struct ieee80211_regdomain *curdom, *regdom;
int i, r;
mutex_lock(®_regdb_search_mutex);
while (!list_empty(®_regdb_search_list)) {
request = list_first_entry(®_regdb_search_list,
struct reg_regdb_search_request,
list);
list_del(&request->list);
for (i=0; i<reg_regdb_size; i++) {
curdom = reg_regdb[i];
if (!memcmp(request->alpha2, curdom->alpha2, 2)) {
r = reg_copy_regd(®dom, curdom);
if (r)
break;
mutex_lock(&cfg80211_mutex);
set_regdom(regdom);
mutex_unlock(&cfg80211_mutex);
break;
}
}
kfree(request);
}
mutex_unlock(®_regdb_search_mutex);
}
static DECLARE_WORK(reg_regdb_work, reg_regdb_search);
static void reg_regdb_query(const char *alpha2)
{
struct reg_regdb_search_request *request;
if (!alpha2)
return;
request = kzalloc(sizeof(struct reg_regdb_search_request), GFP_KERNEL);
if (!request)
return;
memcpy(request->alpha2, alpha2, 2);
mutex_lock(®_regdb_search_mutex);
list_add_tail(&request->list, ®_regdb_search_list);
mutex_unlock(®_regdb_search_mutex);
schedule_work(®_regdb_work);
}
/* Feel free to add any other sanity checks here */
static void reg_regdb_size_check(void)
{
/* We should ideally BUILD_BUG_ON() but then random builds would fail */
WARN_ONCE(!reg_regdb_size, "db.txt is empty, you should update it...");
}
#else
static inline void reg_regdb_size_check(void) {}
static inline void reg_regdb_query(const char *alpha2) {}
#endif /* CONFIG_CFG80211_INTERNAL_REGDB */
/*
* This lets us keep regulatory code which is updated on a regulatory
* basis in userspace. Country information is filled in by
* reg_device_uevent
*/
static int call_crda(const char *alpha2)
{
if (!is_world_regdom((char *) alpha2))
pr_info("Calling CRDA for country: %c%c\n",
alpha2[0], alpha2[1]);
else
pr_info("Calling CRDA to update world regulatory domain\n");
/* query internal regulatory database (if it exists) */
reg_regdb_query(alpha2);
return kobject_uevent(®_pdev->dev.kobj, KOBJ_CHANGE);
}
/* Used by nl80211 before kmalloc'ing our regulatory domain */
bool reg_is_valid_request(const char *alpha2)
{
assert_cfg80211_lock();
if (!last_request)
return false;
return alpha2_equal(last_request->alpha2, alpha2);
}
/* Sanity check on a regulatory rule */
static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
{
const struct ieee80211_freq_range *freq_range = &rule->freq_range;
u32 freq_diff;
if (freq_range->start_freq_khz <= 0 || freq_range->end_freq_khz <= 0)
return false;
if (freq_range->start_freq_khz > freq_range->end_freq_khz)
return false;
freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
if (freq_range->end_freq_khz <= freq_range->start_freq_khz ||
freq_range->max_bandwidth_khz > freq_diff)
return false;
return true;
}
static bool is_valid_rd(const struct ieee80211_regdomain *rd)
{
const struct ieee80211_reg_rule *reg_rule = NULL;
unsigned int i;
if (!rd->n_reg_rules)
return false;
if (WARN_ON(rd->n_reg_rules > NL80211_MAX_SUPP_REG_RULES))
return false;
for (i = 0; i < rd->n_reg_rules; i++) {
reg_rule = &rd->reg_rules[i];
if (!is_valid_reg_rule(reg_rule))
return false;
}
return true;
}
static bool reg_does_bw_fit(const struct ieee80211_freq_range *freq_range,
u32 center_freq_khz,
u32 bw_khz)
{
u32 start_freq_khz, end_freq_khz;
start_freq_khz = center_freq_khz - (bw_khz/2);
end_freq_khz = center_freq_khz + (bw_khz/2);
if (start_freq_khz >= freq_range->start_freq_khz &&
end_freq_khz <= freq_range->end_freq_khz)
return true;
return false;
}
/**
* freq_in_rule_band - tells us if a frequency is in a frequency band
* @freq_range: frequency rule we want to query
* @freq_khz: frequency we are inquiring about
*
* This lets us know if a specific frequency rule is or is not relevant to
* a specific frequency's band. Bands are device specific and artificial
* definitions (the "2.4 GHz band" and the "5 GHz band"), however it is
* safe for now to assume that a frequency rule should not be part of a
* frequency's band if the start freq or end freq are off by more than 2 GHz.
* This resolution can be lowered and should be considered as we add
* regulatory rule support for other "bands".
**/
static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
u32 freq_khz)
{
#define ONE_GHZ_IN_KHZ 1000000
if (abs(freq_khz - freq_range->start_freq_khz) <= (2 * ONE_GHZ_IN_KHZ))
return true;
if (abs(freq_khz - freq_range->end_freq_khz) <= (2 * ONE_GHZ_IN_KHZ))
return true;
return false;
#undef ONE_GHZ_IN_KHZ
}
/*
* Helper for regdom_intersect(), this does the real
* mathematical intersection fun
*/
static int reg_rules_intersect(
const struct ieee80211_reg_rule *rule1,
const struct ieee80211_reg_rule *rule2,
struct ieee80211_reg_rule *intersected_rule)
{
const struct ieee80211_freq_range *freq_range1, *freq_range2;
struct ieee80211_freq_range *freq_range;
const struct ieee80211_power_rule *power_rule1, *power_rule2;
struct ieee80211_power_rule *power_rule;
u32 freq_diff;
freq_range1 = &rule1->freq_range;
freq_range2 = &rule2->freq_range;
freq_range = &intersected_rule->freq_range;
power_rule1 = &rule1->power_rule;
power_rule2 = &rule2->power_rule;
power_rule = &intersected_rule->power_rule;
freq_range->start_freq_khz = max(freq_range1->start_freq_khz,
freq_range2->start_freq_khz);
freq_range->end_freq_khz = min(freq_range1->end_freq_khz,
freq_range2->end_freq_khz);
freq_range->max_bandwidth_khz = min(freq_range1->max_bandwidth_khz,
freq_range2->max_bandwidth_khz);
freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
if (freq_range->max_bandwidth_khz > freq_diff)
freq_range->max_bandwidth_khz = freq_diff;
power_rule->max_eirp = min(power_rule1->max_eirp,
power_rule2->max_eirp);
power_rule->max_antenna_gain = min(power_rule1->max_antenna_gain,
power_rule2->max_antenna_gain);
intersected_rule->flags = (rule1->flags | rule2->flags);
if (!is_valid_reg_rule(intersected_rule))
return -EINVAL;
return 0;
}
/**
* regdom_intersect - do the intersection between two regulatory domains
* @rd1: first regulatory domain
* @rd2: second regulatory domain
*
* Use this function to get the intersection between two regulatory domains.
* Once completed we will mark the alpha2 for the rd as intersected, "98",
* as no one single alpha2 can represent this regulatory domain.
*
* Returns a pointer to the regulatory domain structure which will hold the
* resulting intersection of rules between rd1 and rd2. We will
* kzalloc() this structure for you.
*/
static struct ieee80211_regdomain *regdom_intersect(
const struct ieee80211_regdomain *rd1,
const struct ieee80211_regdomain *rd2)
{
int r, size_of_regd;
unsigned int x, y;
unsigned int num_rules = 0, rule_idx = 0;
const struct ieee80211_reg_rule *rule1, *rule2;
struct ieee80211_reg_rule *intersected_rule;
struct ieee80211_regdomain *rd;
/* This is just a dummy holder to help us count */
struct ieee80211_reg_rule irule;
/* Uses the stack temporarily for counter arithmetic */
intersected_rule = &irule;
memset(intersected_rule, 0, sizeof(struct ieee80211_reg_rule));
if (!rd1 || !rd2)
return NULL;
/*
* First we get a count of the rules we'll need, then we actually
* build them. This is to so we can malloc() and free() a
* regdomain once. The reason we use reg_rules_intersect() here
* is it will return -EINVAL if the rule computed makes no sense.
* All rules that do check out OK are valid.
*/
for (x = 0; x < rd1->n_reg_rules; x++) {
rule1 = &rd1->reg_rules[x];
for (y = 0; y < rd2->n_reg_rules; y++) {
rule2 = &rd2->reg_rules[y];
if (!reg_rules_intersect(rule1, rule2,
intersected_rule))
num_rules++;
memset(intersected_rule, 0,
sizeof(struct ieee80211_reg_rule));
}
}
if (!num_rules)
return NULL;
size_of_regd = sizeof(struct ieee80211_regdomain) +
((num_rules + 1) * sizeof(struct ieee80211_reg_rule));
rd = kzalloc(size_of_regd, GFP_KERNEL);
if (!rd)
return NULL;
for (x = 0; x < rd1->n_reg_rules; x++) {
rule1 = &rd1->reg_rules[x];
for (y = 0; y < rd2->n_reg_rules; y++) {
rule2 = &rd2->reg_rules[y];
/*
* This time around instead of using the stack lets
* write to the target rule directly saving ourselves
* a memcpy()
*/
intersected_rule = &rd->reg_rules[rule_idx];
r = reg_rules_intersect(rule1, rule2,
intersected_rule);
/*
* No need to memset here the intersected rule here as
* we're not using the stack anymore
*/
if (r)
continue;
rule_idx++;
}
}
if (rule_idx != num_rules) {
kfree(rd);
return NULL;
}
rd->n_reg_rules = num_rules;
rd->alpha2[0] = '9';
rd->alpha2[1] = '8';
return rd;
}
/*
* XXX: add support for the rest of enum nl80211_reg_rule_flags, we may
* want to just have the channel structure use these
*/
static u32 map_regdom_flags(u32 rd_flags)
{
u32 channel_flags = 0;
if (rd_flags & NL80211_RRF_PASSIVE_SCAN)
channel_flags |= IEEE80211_CHAN_PASSIVE_SCAN;
if (rd_flags & NL80211_RRF_NO_IBSS)
channel_flags |= IEEE80211_CHAN_NO_IBSS;
if (rd_flags & NL80211_RRF_DFS)
channel_flags |= IEEE80211_CHAN_RADAR;
return channel_flags;
}
static int freq_reg_info_regd(struct wiphy *wiphy,
u32 center_freq,
u32 desired_bw_khz,
const struct ieee80211_reg_rule **reg_rule,
const struct ieee80211_regdomain *custom_regd)
{
int i;
bool band_rule_found = false;
const struct ieee80211_regdomain *regd;
bool bw_fits = false;
if (!desired_bw_khz)
desired_bw_khz = MHZ_TO_KHZ(20);
regd = custom_regd ? custom_regd : cfg80211_regdomain;
/*
* Follow the driver's regulatory domain, if present, unless a country
* IE has been processed or a user wants to help complaince further
*/
if (!custom_regd &&
last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
last_request->initiator != NL80211_REGDOM_SET_BY_USER &&
wiphy->regd)
regd = wiphy->regd;
if (!regd)
return -EINVAL;
for (i = 0; i < regd->n_reg_rules; i++) {
const struct ieee80211_reg_rule *rr;
const struct ieee80211_freq_range *fr = NULL;
rr = ®d->reg_rules[i];
fr = &rr->freq_range;
/*
* We only need to know if one frequency rule was
* was in center_freq's band, that's enough, so lets
* not overwrite it once found
*/
if (!band_rule_found)
band_rule_found = freq_in_rule_band(fr, center_freq);
bw_fits = reg_does_bw_fit(fr,
center_freq,
desired_bw_khz);
if (band_rule_found && bw_fits) {
*reg_rule = rr;
return 0;
}
}
if (!band_rule_found)
return -ERANGE;
return -EINVAL;
}
int freq_reg_info(struct wiphy *wiphy,
u32 center_freq,
u32 desired_bw_khz,
const struct ieee80211_reg_rule **reg_rule)
{
assert_cfg80211_lock();
return freq_reg_info_regd(wiphy,
center_freq,
desired_bw_khz,
reg_rule,
NULL);
}
EXPORT_SYMBOL(freq_reg_info);
#ifdef CONFIG_CFG80211_REG_DEBUG
static const char *reg_initiator_name(enum nl80211_reg_initiator initiator)
{
switch (initiator) {
case NL80211_REGDOM_SET_BY_CORE:
return "Set by core";
case NL80211_REGDOM_SET_BY_USER:
return "Set by user";
case NL80211_REGDOM_SET_BY_DRIVER:
return "Set by driver";
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
return "Set by country IE";
default:
WARN_ON(1);
return "Set by bug";
}
}
static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan,
u32 desired_bw_khz,
const struct ieee80211_reg_rule *reg_rule)
{
const struct ieee80211_power_rule *power_rule;
const struct ieee80211_freq_range *freq_range;
char max_antenna_gain[32];
power_rule = ®_rule->power_rule;
freq_range = ®_rule->freq_range;
if (!power_rule->max_antenna_gain)
snprintf(max_antenna_gain, 32, "N/A");
else
snprintf(max_antenna_gain, 32, "%d", power_rule->max_antenna_gain);
REG_DBG_PRINT("Updating information on frequency %d MHz "
"for a %d MHz width channel with regulatory rule:\n",
chan->center_freq,
KHZ_TO_MHZ(desired_bw_khz));
REG_DBG_PRINT("%d KHz - %d KHz @ %d KHz), (%s mBi, %d mBm)\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
freq_range->max_bandwidth_khz,
max_antenna_gain,
power_rule->max_eirp);
}
#else
static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan,
u32 desired_bw_khz,
const struct ieee80211_reg_rule *reg_rule)
{
return;
}
#endif
/*
* Note that right now we assume the desired channel bandwidth
* is always 20 MHz for each individual channel (HT40 uses 20 MHz
* per channel, the primary and the extension channel). To support
* smaller custom bandwidths such as 5 MHz or 10 MHz we'll need a
* new ieee80211_channel.target_bw and re run the regulatory check
* on the wiphy with the target_bw specified. Then we can simply use
* that below for the desired_bw_khz below.
*/
static void handle_channel(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator,
enum ieee80211_band band,
unsigned int chan_idx)
{
int r;
u32 flags, bw_flags = 0;
u32 desired_bw_khz = MHZ_TO_KHZ(20);
const struct ieee80211_reg_rule *reg_rule = NULL;
const struct ieee80211_power_rule *power_rule = NULL;
const struct ieee80211_freq_range *freq_range = NULL;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *chan;
struct wiphy *request_wiphy = NULL;
assert_cfg80211_lock();
request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
sband = wiphy->bands[band];
BUG_ON(chan_idx >= sband->n_channels);
chan = &sband->channels[chan_idx];
flags = chan->orig_flags;
r = freq_reg_info(wiphy,
MHZ_TO_KHZ(chan->center_freq),
desired_bw_khz,
®_rule);
if (r) {
/*
* We will disable all channels that do not match our
* received regulatory rule unless the hint is coming
* from a Country IE and the Country IE had no information
* about a band. The IEEE 802.11 spec allows for an AP
* to send only a subset of the regulatory rules allowed,
* so an AP in the US that only supports 2.4 GHz may only send
* a country IE with information for the 2.4 GHz band
* while 5 GHz is still supported.
*/
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
r == -ERANGE)
return;
REG_DBG_PRINT("Disabling freq %d MHz\n", chan->center_freq);
chan->flags = IEEE80211_CHAN_DISABLED;
return;
}
chan_reg_rule_print_dbg(chan, desired_bw_khz, reg_rule);
power_rule = ®_rule->power_rule;
freq_range = ®_rule->freq_range;
if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40))
bw_flags = IEEE80211_CHAN_NO_HT40;
if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
request_wiphy && request_wiphy == wiphy &&
request_wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) {
/*
* This guarantees the driver's requested regulatory domain
* will always be used as a base for further regulatory
* settings
*/
chan->flags = chan->orig_flags =
map_regdom_flags(reg_rule->flags) | bw_flags;
chan->max_antenna_gain = chan->orig_mag =
(int) MBI_TO_DBI(power_rule->max_antenna_gain);
chan->max_power = chan->orig_mpwr =
(int) MBM_TO_DBM(power_rule->max_eirp);
return;
}
chan->beacon_found = false;
chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags);
chan->max_antenna_gain = min(chan->orig_mag,
(int) MBI_TO_DBI(power_rule->max_antenna_gain));
if (chan->orig_mpwr)
chan->max_power = min(chan->orig_mpwr,
(int) MBM_TO_DBM(power_rule->max_eirp));
else
chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp);
}
static void handle_band(struct wiphy *wiphy,
enum ieee80211_band band,
enum nl80211_reg_initiator initiator)
{
unsigned int i;
struct ieee80211_supported_band *sband;
BUG_ON(!wiphy->bands[band]);
sband = wiphy->bands[band];
for (i = 0; i < sband->n_channels; i++)
handle_channel(wiphy, initiator, band, i);
}
static bool ignore_reg_update(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
{
if (!last_request) {
REG_DBG_PRINT("Ignoring regulatory request %s since "
"last_request is not set\n",
reg_initiator_name(initiator));
return true;
}
if (initiator == NL80211_REGDOM_SET_BY_CORE &&
wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) {
REG_DBG_PRINT("Ignoring regulatory request %s "
"since the driver uses its own custom "
"regulatory domain\n",
reg_initiator_name(initiator));
return true;
}
/*
* wiphy->regd will be set once the device has its own
* desired regulatory domain set
*/
if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd &&
initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
!is_world_regdom(last_request->alpha2)) {
REG_DBG_PRINT("Ignoring regulatory request %s "
"since the driver requires its own regulatory "
"domain to be set first\n",
reg_initiator_name(initiator));
return true;
}
return false;
}
static void handle_reg_beacon(struct wiphy *wiphy,
unsigned int chan_idx,
struct reg_beacon *reg_beacon)
{
struct ieee80211_supported_band *sband;
struct ieee80211_channel *chan;
bool channel_changed = false;
struct ieee80211_channel chan_before;
assert_cfg80211_lock();
sband = wiphy->bands[reg_beacon->chan.band];
chan = &sband->channels[chan_idx];
if (likely(chan->center_freq != reg_beacon->chan.center_freq))
return;
if (chan->beacon_found)
return;
chan->beacon_found = true;
if (wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS)
return;
chan_before.center_freq = chan->center_freq;
chan_before.flags = chan->flags;
if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) {
chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
channel_changed = true;
}
if (chan->flags & IEEE80211_CHAN_NO_IBSS) {
chan->flags &= ~IEEE80211_CHAN_NO_IBSS;
channel_changed = true;
}
if (channel_changed)
nl80211_send_beacon_hint_event(wiphy, &chan_before, chan);
}
/*
* Called when a scan on a wiphy finds a beacon on
* new channel
*/
static void wiphy_update_new_beacon(struct wiphy *wiphy,
struct reg_beacon *reg_beacon)
{
unsigned int i;
struct ieee80211_supported_band *sband;
assert_cfg80211_lock();
if (!wiphy->bands[reg_beacon->chan.band])
return;
sband = wiphy->bands[reg_beacon->chan.band];
for (i = 0; i < sband->n_channels; i++)
handle_reg_beacon(wiphy, i, reg_beacon);
}
/*
* Called upon reg changes or a new wiphy is added
*/
static void wiphy_update_beacon_reg(struct wiphy *wiphy)
{
unsigned int i;
struct ieee80211_supported_band *sband;
struct reg_beacon *reg_beacon;
assert_cfg80211_lock();
if (list_empty(®_beacon_list))
return;
list_for_each_entry(reg_beacon, ®_beacon_list, list) {
if (!wiphy->bands[reg_beacon->chan.band])
continue;
sband = wiphy->bands[reg_beacon->chan.band];
for (i = 0; i < sband->n_channels; i++)
handle_reg_beacon(wiphy, i, reg_beacon);
}
}
static bool reg_is_world_roaming(struct wiphy *wiphy)
{
if (is_world_regdom(cfg80211_regdomain->alpha2) ||
(wiphy->regd && is_world_regdom(wiphy->regd->alpha2)))
return true;
if (last_request &&
last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)
return true;
return false;
}
/* Reap the advantages of previously found beacons */
static void reg_process_beacons(struct wiphy *wiphy)
{
/*
* Means we are just firing up cfg80211, so no beacons would
* have been processed yet.
*/
if (!last_request)
return;
if (!reg_is_world_roaming(wiphy))
return;
wiphy_update_beacon_reg(wiphy);
}
static bool is_ht40_not_allowed(struct ieee80211_channel *chan)
{
if (!chan)
return true;
if (chan->flags & IEEE80211_CHAN_DISABLED)
return true;
/* This would happen when regulatory rules disallow HT40 completely */
if (IEEE80211_CHAN_NO_HT40 == (chan->flags & (IEEE80211_CHAN_NO_HT40)))
return true;
return false;
}
static void reg_process_ht_flags_channel(struct wiphy *wiphy,
enum ieee80211_band band,
unsigned int chan_idx)
{
struct ieee80211_supported_band *sband;
struct ieee80211_channel *channel;
struct ieee80211_channel *channel_before = NULL, *channel_after = NULL;
unsigned int i;
assert_cfg80211_lock();
sband = wiphy->bands[band];
BUG_ON(chan_idx >= sband->n_channels);
channel = &sband->channels[chan_idx];
if (is_ht40_not_allowed(channel)) {
channel->flags |= IEEE80211_CHAN_NO_HT40;
return;
}
/*
* We need to ensure the extension channels exist to
* be able to use HT40- or HT40+, this finds them (or not)
*/
for (i = 0; i < sband->n_channels; i++) {
struct ieee80211_channel *c = &sband->channels[i];
if (c->center_freq == (channel->center_freq - 20))
channel_before = c;
if (c->center_freq == (channel->center_freq + 20))
channel_after = c;
}
/*
* Please note that this assumes target bandwidth is 20 MHz,
* if that ever changes we also need to change the below logic
* to include that as well.
*/
if (is_ht40_not_allowed(channel_before))
channel->flags |= IEEE80211_CHAN_NO_HT40MINUS;
else
channel->flags &= ~IEEE80211_CHAN_NO_HT40MINUS;
if (is_ht40_not_allowed(channel_after))
channel->flags |= IEEE80211_CHAN_NO_HT40PLUS;
else
channel->flags &= ~IEEE80211_CHAN_NO_HT40PLUS;
}
static void reg_process_ht_flags_band(struct wiphy *wiphy,
enum ieee80211_band band)
{
unsigned int i;
struct ieee80211_supported_band *sband;
BUG_ON(!wiphy->bands[band]);
sband = wiphy->bands[band];
for (i = 0; i < sband->n_channels; i++)
reg_process_ht_flags_channel(wiphy, band, i);
}
static void reg_process_ht_flags(struct wiphy *wiphy)
{
enum ieee80211_band band;
if (!wiphy)
return;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (wiphy->bands[band])
reg_process_ht_flags_band(wiphy, band);
}
}
static void wiphy_update_regulatory(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
{
enum ieee80211_band band;
assert_reg_lock();
if (ignore_reg_update(wiphy, initiator))
return;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (wiphy->bands[band])
handle_band(wiphy, band, initiator);
}
reg_process_beacons(wiphy);
reg_process_ht_flags(wiphy);
if (wiphy->reg_notifier)
wiphy->reg_notifier(wiphy, last_request);
}
void regulatory_update(struct wiphy *wiphy,
enum nl80211_reg_initiator setby)
{
mutex_lock(®_mutex);
wiphy_update_regulatory(wiphy, setby);
mutex_unlock(®_mutex);
}
static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator)
{
struct cfg80211_registered_device *rdev;
list_for_each_entry(rdev, &cfg80211_rdev_list, list)
wiphy_update_regulatory(&rdev->wiphy, initiator);
}
static void handle_channel_custom(struct wiphy *wiphy,
enum ieee80211_band band,
unsigned int chan_idx,
const struct ieee80211_regdomain *regd)
{
int r;
u32 desired_bw_khz = MHZ_TO_KHZ(20);
u32 bw_flags = 0;
const struct ieee80211_reg_rule *reg_rule = NULL;
const struct ieee80211_power_rule *power_rule = NULL;
const struct ieee80211_freq_range *freq_range = NULL;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *chan;
assert_reg_lock();
sband = wiphy->bands[band];
BUG_ON(chan_idx >= sband->n_channels);
chan = &sband->channels[chan_idx];
r = freq_reg_info_regd(wiphy,
MHZ_TO_KHZ(chan->center_freq),
desired_bw_khz,
®_rule,
regd);
if (r) {
REG_DBG_PRINT("Disabling freq %d MHz as custom "
"regd has no rule that fits a %d MHz "
"wide channel\n",
chan->center_freq,
KHZ_TO_MHZ(desired_bw_khz));
chan->flags = IEEE80211_CHAN_DISABLED;
return;
}
chan_reg_rule_print_dbg(chan, desired_bw_khz, reg_rule);
power_rule = ®_rule->power_rule;
freq_range = ®_rule->freq_range;
if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40))
bw_flags = IEEE80211_CHAN_NO_HT40;
chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags;
chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp);
}
static void handle_band_custom(struct wiphy *wiphy, enum ieee80211_band band,
const struct ieee80211_regdomain *regd)
{
unsigned int i;
struct ieee80211_supported_band *sband;
BUG_ON(!wiphy->bands[band]);
sband = wiphy->bands[band];
for (i = 0; i < sband->n_channels; i++)
handle_channel_custom(wiphy, band, i, regd);
}
/* Used by drivers prior to wiphy registration */
void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
const struct ieee80211_regdomain *regd)
{
enum ieee80211_band band;
unsigned int bands_set = 0;
mutex_lock(®_mutex);
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (!wiphy->bands[band])
continue;
handle_band_custom(wiphy, band, regd);
bands_set++;
}
mutex_unlock(®_mutex);
/*
* no point in calling this if it won't have any effect
* on your device's supportd bands.
*/
WARN_ON(!bands_set);
}
EXPORT_SYMBOL(wiphy_apply_custom_regulatory);
/*
* Return value which can be used by ignore_request() to indicate
* it has been determined we should intersect two regulatory domains
*/
#define REG_INTERSECT 1
/* This has the logic which determines when a new request
* should be ignored. */
static int ignore_request(struct wiphy *wiphy,
struct regulatory_request *pending_request)
{
struct wiphy *last_wiphy = NULL;
assert_cfg80211_lock();
/* All initial requests are respected */
if (!last_request)
return 0;
switch (pending_request->initiator) {
case NL80211_REGDOM_SET_BY_CORE:
return 0;
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
last_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
if (unlikely(!is_an_alpha2(pending_request->alpha2)))
return -EINVAL;
if (last_request->initiator ==
NL80211_REGDOM_SET_BY_COUNTRY_IE) {
if (last_wiphy != wiphy) {
/*
* Two cards with two APs claiming different
* Country IE alpha2s. We could
* intersect them, but that seems unlikely
* to be correct. Reject second one for now.
*/
if (regdom_changes(pending_request->alpha2))
return -EOPNOTSUPP;
return -EALREADY;
}
/*
* Two consecutive Country IE hints on the same wiphy.
* This should be picked up early by the driver/stack
*/
if (WARN_ON(regdom_changes(pending_request->alpha2)))
return 0;
return -EALREADY;
}
return 0;
case NL80211_REGDOM_SET_BY_DRIVER:
if (last_request->initiator == NL80211_REGDOM_SET_BY_CORE) {
if (regdom_changes(pending_request->alpha2))
return 0;
return -EALREADY;
}
/*
* This would happen if you unplug and plug your card
* back in or if you add a new device for which the previously
* loaded card also agrees on the regulatory domain.
*/
if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
!regdom_changes(pending_request->alpha2))
return -EALREADY;
return REG_INTERSECT;
case NL80211_REGDOM_SET_BY_USER:
if (last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)
return REG_INTERSECT;
/*
* If the user knows better the user should set the regdom
* to their country before the IE is picked up
*/
if (last_request->initiator == NL80211_REGDOM_SET_BY_USER &&
last_request->intersect)
return -EOPNOTSUPP;
/*
* Process user requests only after previous user/driver/core
* requests have been processed
*/
if (last_request->initiator == NL80211_REGDOM_SET_BY_CORE ||
last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
last_request->initiator == NL80211_REGDOM_SET_BY_USER) {
if (regdom_changes(last_request->alpha2))
return -EAGAIN;
}
if (!regdom_changes(pending_request->alpha2))
return -EALREADY;
return 0;
}
return -EINVAL;
}
static void reg_set_request_processed(void)
{
bool need_more_processing = false;
last_request->processed = true;
spin_lock(®_requests_lock);
if (!list_empty(®_requests_list))
need_more_processing = true;
spin_unlock(®_requests_lock);
if (last_request->initiator == NL80211_REGDOM_SET_BY_USER)
cancel_delayed_work_sync(®_timeout);
if (need_more_processing)
schedule_work(®_work);
}
/**
* __regulatory_hint - hint to the wireless core a regulatory domain
* @wiphy: if the hint comes from country information from an AP, this
* is required to be set to the wiphy that received the information
* @pending_request: the regulatory request currently being processed
*
* The Wireless subsystem can use this function to hint to the wireless core
* what it believes should be the current regulatory domain.
*
* Returns zero if all went fine, %-EALREADY if a regulatory domain had
* already been set or other standard error codes.
*
* Caller must hold &cfg80211_mutex and ®_mutex
*/
static int __regulatory_hint(struct wiphy *wiphy,
struct regulatory_request *pending_request)
{
bool intersect = false;
int r = 0;
assert_cfg80211_lock();
r = ignore_request(wiphy, pending_request);
if (r == REG_INTERSECT) {
if (pending_request->initiator ==
NL80211_REGDOM_SET_BY_DRIVER) {
r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain);
if (r) {
kfree(pending_request);
return r;
}
}
intersect = true;
} else if (r) {
/*
* If the regulatory domain being requested by the
* driver has already been set just copy it to the
* wiphy
*/
if (r == -EALREADY &&
pending_request->initiator ==
NL80211_REGDOM_SET_BY_DRIVER) {
r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain);
if (r) {
kfree(pending_request);
return r;
}
r = -EALREADY;
goto new_request;
}
kfree(pending_request);
return r;
}
new_request:
if (last_request != &core_request_world)
kfree(last_request);
last_request = pending_request;
last_request->intersect = intersect;
pending_request = NULL;
if (last_request->initiator == NL80211_REGDOM_SET_BY_USER) {
user_alpha2[0] = last_request->alpha2[0];
user_alpha2[1] = last_request->alpha2[1];
}
/* When r == REG_INTERSECT we do need to call CRDA */
if (r < 0) {
/*
* Since CRDA will not be called in this case as we already
* have applied the requested regulatory domain before we just
* inform userspace we have processed the request
*/
if (r == -EALREADY) {
nl80211_send_reg_change_event(last_request);
reg_set_request_processed();
}
return r;
}
return call_crda(last_request->alpha2);
}
/* This processes *all* regulatory hints */
static void reg_process_hint(struct regulatory_request *reg_request)
{
int r = 0;
struct wiphy *wiphy = NULL;
enum nl80211_reg_initiator initiator = reg_request->initiator;
BUG_ON(!reg_request->alpha2);
if (wiphy_idx_valid(reg_request->wiphy_idx))
wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx);
if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
!wiphy) {
kfree(reg_request);
return;
}
r = __regulatory_hint(wiphy, reg_request);
/* This is required so that the orig_* parameters are saved */
if (r == -EALREADY && wiphy &&
wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) {
wiphy_update_regulatory(wiphy, initiator);
return;
}
/*
* We only time out user hints, given that they should be the only
* source of bogus requests.
*/
if (r != -EALREADY &&
reg_request->initiator == NL80211_REGDOM_SET_BY_USER)
schedule_delayed_work(®_timeout, msecs_to_jiffies(3142));
}
/*
* Processes regulatory hints, this is all the NL80211_REGDOM_SET_BY_*
* Regulatory hints come on a first come first serve basis and we
* must process each one atomically.
*/
static void reg_process_pending_hints(void)
{
struct regulatory_request *reg_request;
mutex_lock(&cfg80211_mutex);
mutex_lock(®_mutex);
/* When last_request->processed becomes true this will be rescheduled */
if (last_request && !last_request->processed) {
REG_DBG_PRINT("Pending regulatory request, waiting "
"for it to be processed...\n");
goto out;
}
spin_lock(®_requests_lock);
if (list_empty(®_requests_list)) {
spin_unlock(®_requests_lock);
goto out;
}
reg_request = list_first_entry(®_requests_list,
struct regulatory_request,
list);
list_del_init(®_request->list);
spin_unlock(®_requests_lock);
reg_process_hint(reg_request);
out:
mutex_unlock(®_mutex);
mutex_unlock(&cfg80211_mutex);
}
/* Processes beacon hints -- this has nothing to do with country IEs */
static void reg_process_pending_beacon_hints(void)
{
struct cfg80211_registered_device *rdev;
struct reg_beacon *pending_beacon, *tmp;
/*
* No need to hold the reg_mutex here as we just touch wiphys
* and do not read or access regulatory variables.
*/
mutex_lock(&cfg80211_mutex);
/* This goes through the _pending_ beacon list */
spin_lock_bh(®_pending_beacons_lock);
if (list_empty(®_pending_beacons)) {
spin_unlock_bh(®_pending_beacons_lock);
goto out;
}
list_for_each_entry_safe(pending_beacon, tmp,
®_pending_beacons, list) {
list_del_init(&pending_beacon->list);
/* Applies the beacon hint to current wiphys */
list_for_each_entry(rdev, &cfg80211_rdev_list, list)
wiphy_update_new_beacon(&rdev->wiphy, pending_beacon);
/* Remembers the beacon hint for new wiphys or reg changes */
list_add_tail(&pending_beacon->list, ®_beacon_list);
}
spin_unlock_bh(®_pending_beacons_lock);
out:
mutex_unlock(&cfg80211_mutex);
}
static void reg_todo(struct work_struct *work)
{
reg_process_pending_hints();
reg_process_pending_beacon_hints();
}
static void queue_regulatory_request(struct regulatory_request *request)
{
if (isalpha(request->alpha2[0]))
request->alpha2[0] = toupper(request->alpha2[0]);
if (isalpha(request->alpha2[1]))
request->alpha2[1] = toupper(request->alpha2[1]);
spin_lock(®_requests_lock);
list_add_tail(&request->list, ®_requests_list);
spin_unlock(®_requests_lock);
schedule_work(®_work);
}
/*
* Core regulatory hint -- happens during cfg80211_init()
* and when we restore regulatory settings.
*/
static int regulatory_hint_core(const char *alpha2)
{
struct regulatory_request *request;
request = kzalloc(sizeof(struct regulatory_request),
GFP_KERNEL);
if (!request)
return -ENOMEM;
request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = NL80211_REGDOM_SET_BY_CORE;
queue_regulatory_request(request);
return 0;
}
/* User hints */
int regulatory_hint_user(const char *alpha2)
{
struct regulatory_request *request;
BUG_ON(!alpha2);
request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
if (!request)
return -ENOMEM;
request->wiphy_idx = WIPHY_IDX_STALE;
request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = NL80211_REGDOM_SET_BY_USER;
queue_regulatory_request(request);
return 0;
}
/* Driver hints */
int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
{
struct regulatory_request *request;
BUG_ON(!alpha2);
BUG_ON(!wiphy);
request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
if (!request)
return -ENOMEM;
request->wiphy_idx = get_wiphy_idx(wiphy);
/* Must have registered wiphy first */
BUG_ON(!wiphy_idx_valid(request->wiphy_idx));
request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = NL80211_REGDOM_SET_BY_DRIVER;
queue_regulatory_request(request);
return 0;
}
EXPORT_SYMBOL(regulatory_hint);
/*
* We hold wdev_lock() here so we cannot hold cfg80211_mutex() and
* therefore cannot iterate over the rdev list here.
*/
void regulatory_hint_11d(struct wiphy *wiphy,
enum ieee80211_band band,
u8 *country_ie,
u8 country_ie_len)
{
char alpha2[2];
enum environment_cap env = ENVIRON_ANY;
struct regulatory_request *request;
mutex_lock(®_mutex);
if (unlikely(!last_request))
goto out;
/* IE len must be evenly divisible by 2 */
if (country_ie_len & 0x01)
goto out;
if (country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN)
goto out;
alpha2[0] = country_ie[0];
alpha2[1] = country_ie[1];
if (country_ie[2] == 'I')
env = ENVIRON_INDOOR;
else if (country_ie[2] == 'O')
env = ENVIRON_OUTDOOR;
/*
* We will run this only upon a successful connection on cfg80211.
* We leave conflict resolution to the workqueue, where can hold
* cfg80211_mutex.
*/
if (likely(last_request->initiator ==
NL80211_REGDOM_SET_BY_COUNTRY_IE &&
wiphy_idx_valid(last_request->wiphy_idx)))
goto out;
request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
if (!request)
goto out;
request->wiphy_idx = get_wiphy_idx(wiphy);
request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = NL80211_REGDOM_SET_BY_COUNTRY_IE;
request->country_ie_env = env;
mutex_unlock(®_mutex);
queue_regulatory_request(request);
return;
out:
mutex_unlock(®_mutex);
}
static void restore_alpha2(char *alpha2, bool reset_user)
{
/* indicates there is no alpha2 to consider for restoration */
alpha2[0] = '9';
alpha2[1] = '7';
/* The user setting has precedence over the module parameter */
if (is_user_regdom_saved()) {
/* Unless we're asked to ignore it and reset it */
if (reset_user) {
REG_DBG_PRINT("Restoring regulatory settings "
"including user preference\n");
user_alpha2[0] = '9';
user_alpha2[1] = '7';
/*
* If we're ignoring user settings, we still need to
* check the module parameter to ensure we put things
* back as they were for a full restore.
*/
if (!is_world_regdom(ieee80211_regdom)) {
REG_DBG_PRINT("Keeping preference on "
"module parameter ieee80211_regdom: %c%c\n",
ieee80211_regdom[0],
ieee80211_regdom[1]);
alpha2[0] = ieee80211_regdom[0];
alpha2[1] = ieee80211_regdom[1];
}
} else {
REG_DBG_PRINT("Restoring regulatory settings "
"while preserving user preference for: %c%c\n",
user_alpha2[0],
user_alpha2[1]);
alpha2[0] = user_alpha2[0];
alpha2[1] = user_alpha2[1];
}
} else if (!is_world_regdom(ieee80211_regdom)) {
REG_DBG_PRINT("Keeping preference on "
"module parameter ieee80211_regdom: %c%c\n",
ieee80211_regdom[0],
ieee80211_regdom[1]);
alpha2[0] = ieee80211_regdom[0];
alpha2[1] = ieee80211_regdom[1];
} else
REG_DBG_PRINT("Restoring regulatory settings\n");
}
/*
* Restoring regulatory settings involves ingoring any
* possibly stale country IE information and user regulatory
* settings if so desired, this includes any beacon hints
* learned as we could have traveled outside to another country
* after disconnection. To restore regulatory settings we do
* exactly what we did at bootup:
*
* - send a core regulatory hint
* - send a user regulatory hint if applicable
*
* Device drivers that send a regulatory hint for a specific country
* keep their own regulatory domain on wiphy->regd so that does does
* not need to be remembered.
*/
static void restore_regulatory_settings(bool reset_user)
{
char alpha2[2];
struct reg_beacon *reg_beacon, *btmp;
struct regulatory_request *reg_request, *tmp;
LIST_HEAD(tmp_reg_req_list);
mutex_lock(&cfg80211_mutex);
mutex_lock(®_mutex);
reset_regdomains(true);
restore_alpha2(alpha2, reset_user);
/*
* If there's any pending requests we simply
* stash them to a temporary pending queue and
* add then after we've restored regulatory
* settings.
*/
spin_lock(®_requests_lock);
if (!list_empty(®_requests_list)) {
list_for_each_entry_safe(reg_request, tmp,
®_requests_list, list) {
if (reg_request->initiator !=
NL80211_REGDOM_SET_BY_USER)
continue;
list_del(®_request->list);
list_add_tail(®_request->list, &tmp_reg_req_list);
}
}
spin_unlock(®_requests_lock);
/* Clear beacon hints */
spin_lock_bh(®_pending_beacons_lock);
if (!list_empty(®_pending_beacons)) {
list_for_each_entry_safe(reg_beacon, btmp,
®_pending_beacons, list) {
list_del(®_beacon->list);
kfree(reg_beacon);
}
}
spin_unlock_bh(®_pending_beacons_lock);
if (!list_empty(®_beacon_list)) {
list_for_each_entry_safe(reg_beacon, btmp,
®_beacon_list, list) {
list_del(®_beacon->list);
kfree(reg_beacon);
}
}
/* First restore to the basic regulatory settings */
cfg80211_regdomain = cfg80211_world_regdom;
mutex_unlock(®_mutex);
mutex_unlock(&cfg80211_mutex);
regulatory_hint_core(cfg80211_regdomain->alpha2);
/*
* This restores the ieee80211_regdom module parameter
* preference or the last user requested regulatory
* settings, user regulatory settings takes precedence.
*/
if (is_an_alpha2(alpha2))
regulatory_hint_user(user_alpha2);
if (list_empty(&tmp_reg_req_list))
return;
mutex_lock(&cfg80211_mutex);
mutex_lock(®_mutex);
spin_lock(®_requests_lock);
list_for_each_entry_safe(reg_request, tmp, &tmp_reg_req_list, list) {
REG_DBG_PRINT("Adding request for country %c%c back "
"into the queue\n",
reg_request->alpha2[0],
reg_request->alpha2[1]);
list_del(®_request->list);
list_add_tail(®_request->list, ®_requests_list);
}
spin_unlock(®_requests_lock);
mutex_unlock(®_mutex);
mutex_unlock(&cfg80211_mutex);
REG_DBG_PRINT("Kicking the queue\n");
schedule_work(®_work);
}
void regulatory_hint_disconnect(void)
{
REG_DBG_PRINT("All devices are disconnected, going to "
"restore regulatory settings\n");
restore_regulatory_settings(false);
}
static bool freq_is_chan_12_13_14(u16 freq)
{
if (freq == ieee80211_channel_to_frequency(12, IEEE80211_BAND_2GHZ) ||
freq == ieee80211_channel_to_frequency(13, IEEE80211_BAND_2GHZ) ||
freq == ieee80211_channel_to_frequency(14, IEEE80211_BAND_2GHZ))
return true;
return false;
}
int regulatory_hint_found_beacon(struct wiphy *wiphy,
struct ieee80211_channel *beacon_chan,
gfp_t gfp)
{
struct reg_beacon *reg_beacon;
if (likely((beacon_chan->beacon_found ||
(beacon_chan->flags & IEEE80211_CHAN_RADAR) ||
(beacon_chan->band == IEEE80211_BAND_2GHZ &&
!freq_is_chan_12_13_14(beacon_chan->center_freq)))))
return 0;
reg_beacon = kzalloc(sizeof(struct reg_beacon), gfp);
if (!reg_beacon)
return -ENOMEM;
REG_DBG_PRINT("Found new beacon on "
"frequency: %d MHz (Ch %d) on %s\n",
beacon_chan->center_freq,
ieee80211_frequency_to_channel(beacon_chan->center_freq),
wiphy_name(wiphy));
memcpy(®_beacon->chan, beacon_chan,
sizeof(struct ieee80211_channel));
/*
* Since we can be called from BH or and non-BH context
* we must use spin_lock_bh()
*/
spin_lock_bh(®_pending_beacons_lock);
list_add_tail(®_beacon->list, ®_pending_beacons);
spin_unlock_bh(®_pending_beacons_lock);
schedule_work(®_work);
return 0;
}
static void print_rd_rules(const struct ieee80211_regdomain *rd)
{
unsigned int i;
const struct ieee80211_reg_rule *reg_rule = NULL;
const struct ieee80211_freq_range *freq_range = NULL;
const struct ieee80211_power_rule *power_rule = NULL;
pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)\n");
for (i = 0; i < rd->n_reg_rules; i++) {
reg_rule = &rd->reg_rules[i];
freq_range = ®_rule->freq_range;
power_rule = ®_rule->power_rule;
/*
* There may not be documentation for max antenna gain
* in certain regions
*/
if (power_rule->max_antenna_gain)
pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm)\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
freq_range->max_bandwidth_khz,
power_rule->max_antenna_gain,
power_rule->max_eirp);
else
pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm)\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
freq_range->max_bandwidth_khz,
power_rule->max_eirp);
}
}
static void print_regdomain(const struct ieee80211_regdomain *rd)
{
if (is_intersected_alpha2(rd->alpha2)) {
if (last_request->initiator ==
NL80211_REGDOM_SET_BY_COUNTRY_IE) {
struct cfg80211_registered_device *rdev;
rdev = cfg80211_rdev_by_wiphy_idx(
last_request->wiphy_idx);
if (rdev) {
pr_info("Current regulatory domain updated by AP to: %c%c\n",
rdev->country_ie_alpha2[0],
rdev->country_ie_alpha2[1]);
} else
pr_info("Current regulatory domain intersected:\n");
} else
pr_info("Current regulatory domain intersected:\n");
} else if (is_world_regdom(rd->alpha2))
pr_info("World regulatory domain updated:\n");
else {
if (is_unknown_alpha2(rd->alpha2))
pr_info("Regulatory domain changed to driver built-in settings (unknown country)\n");
else
pr_info("Regulatory domain changed to country: %c%c\n",
rd->alpha2[0], rd->alpha2[1]);
}
print_rd_rules(rd);
}
static void print_regdomain_info(const struct ieee80211_regdomain *rd)
{
pr_info("Regulatory domain: %c%c\n", rd->alpha2[0], rd->alpha2[1]);
print_rd_rules(rd);
}
/* Takes ownership of rd only if it doesn't fail */
static int __set_regdom(const struct ieee80211_regdomain *rd)
{
const struct ieee80211_regdomain *intersected_rd = NULL;
struct cfg80211_registered_device *rdev = NULL;
struct wiphy *request_wiphy;
/* Some basic sanity checks first */
if (is_world_regdom(rd->alpha2)) {
if (WARN_ON(!reg_is_valid_request(rd->alpha2)))
return -EINVAL;
update_world_regdomain(rd);
return 0;
}
if (!is_alpha2_set(rd->alpha2) && !is_an_alpha2(rd->alpha2) &&
!is_unknown_alpha2(rd->alpha2))
return -EINVAL;
if (!last_request)
return -EINVAL;
/*
* Lets only bother proceeding on the same alpha2 if the current
* rd is non static (it means CRDA was present and was used last)
* and the pending request came in from a country IE
*/
if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
/*
* If someone else asked us to change the rd lets only bother
* checking if the alpha2 changes if CRDA was already called
*/
if (!regdom_changes(rd->alpha2))
return -EINVAL;
}
/*
* Now lets set the regulatory domain, update all driver channels
* and finally inform them of what we have done, in case they want
* to review or adjust their own settings based on their own
* internal EEPROM data
*/
if (WARN_ON(!reg_is_valid_request(rd->alpha2)))
return -EINVAL;
if (!is_valid_rd(rd)) {
pr_err("Invalid regulatory domain detected:\n");
print_regdomain_info(rd);
return -EINVAL;
}
request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
if (!request_wiphy &&
(last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) {
schedule_delayed_work(®_timeout, 0);
return -ENODEV;
}
if (!last_request->intersect) {
int r;
if (last_request->initiator != NL80211_REGDOM_SET_BY_DRIVER) {
reset_regdomains(false);
cfg80211_regdomain = rd;
return 0;
}
/*
* For a driver hint, lets copy the regulatory domain the
* driver wanted to the wiphy to deal with conflicts
*/
/*
* Userspace could have sent two replies with only
* one kernel request.
*/
if (request_wiphy->regd)
return -EALREADY;
r = reg_copy_regd(&request_wiphy->regd, rd);
if (r)
return r;
reset_regdomains(false);
cfg80211_regdomain = rd;
return 0;
}
/* Intersection requires a bit more work */
if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
intersected_rd = regdom_intersect(rd, cfg80211_regdomain);
if (!intersected_rd)
return -EINVAL;
/*
* We can trash what CRDA provided now.
* However if a driver requested this specific regulatory
* domain we keep it for its private use
*/
if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER)
request_wiphy->regd = rd;
else
kfree(rd);
rd = NULL;
reset_regdomains(false);
cfg80211_regdomain = intersected_rd;
return 0;
}
if (!intersected_rd)
return -EINVAL;
rdev = wiphy_to_dev(request_wiphy);
rdev->country_ie_alpha2[0] = rd->alpha2[0];
rdev->country_ie_alpha2[1] = rd->alpha2[1];
rdev->env = last_request->country_ie_env;
BUG_ON(intersected_rd == rd);
kfree(rd);
rd = NULL;
reset_regdomains(false);
cfg80211_regdomain = intersected_rd;
return 0;
}
/*
* Use this call to set the current regulatory domain. Conflicts with
* multiple drivers can be ironed out later. Caller must've already
* kmalloc'd the rd structure. Caller must hold cfg80211_mutex
*/
int set_regdom(const struct ieee80211_regdomain *rd)
{
int r;
assert_cfg80211_lock();
mutex_lock(®_mutex);
/* Note that this doesn't update the wiphys, this is done below */
r = __set_regdom(rd);
if (r) {
kfree(rd);
mutex_unlock(®_mutex);
return r;
}
/* This would make this whole thing pointless */
if (!last_request->intersect)
BUG_ON(rd != cfg80211_regdomain);
/* update all wiphys now with the new established regulatory domain */
update_all_wiphy_regulatory(last_request->initiator);
print_regdomain(cfg80211_regdomain);
nl80211_send_reg_change_event(last_request);
reg_set_request_processed();
mutex_unlock(®_mutex);
return r;
}
#ifdef CONFIG_HOTPLUG
int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env)
{
if (last_request && !last_request->processed) {
if (add_uevent_var(env, "COUNTRY=%c%c",
last_request->alpha2[0],
last_request->alpha2[1]))
return -ENOMEM;
}
return 0;
}
#else
int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env)
{
return -ENODEV;
}
#endif /* CONFIG_HOTPLUG */
/* Caller must hold cfg80211_mutex */
void reg_device_remove(struct wiphy *wiphy)
{
struct wiphy *request_wiphy = NULL;
assert_cfg80211_lock();
mutex_lock(®_mutex);
kfree(wiphy->regd);
if (last_request)
request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
if (!request_wiphy || request_wiphy != wiphy)
goto out;
last_request->wiphy_idx = WIPHY_IDX_STALE;
last_request->country_ie_env = ENVIRON_ANY;
out:
mutex_unlock(®_mutex);
}
static void reg_timeout_work(struct work_struct *work)
{
REG_DBG_PRINT("Timeout while waiting for CRDA to reply, "
"restoring regulatory settings\n");
restore_regulatory_settings(true);
}
int __init regulatory_init(void)
{
int err = 0;
reg_pdev = platform_device_register_simple("regulatory", 0, NULL, 0);
if (IS_ERR(reg_pdev))
return PTR_ERR(reg_pdev);
reg_pdev->dev.type = ®_device_type;
spin_lock_init(®_requests_lock);
spin_lock_init(®_pending_beacons_lock);
reg_regdb_size_check();
cfg80211_regdomain = cfg80211_world_regdom;
user_alpha2[0] = '9';
user_alpha2[1] = '7';
/* We always try to get an update for the static regdomain */
err = regulatory_hint_core(cfg80211_regdomain->alpha2);
if (err) {
if (err == -ENOMEM)
return err;
/*
* N.B. kobject_uevent_env() can fail mainly for when we're out
* memory which is handled and propagated appropriately above
* but it can also fail during a netlink_broadcast() or during
* early boot for call_usermodehelper(). For now treat these
* errors as non-fatal.
*/
pr_err("kobject_uevent_env() was unable to call CRDA during init\n");
#ifdef CONFIG_CFG80211_REG_DEBUG
/* We want to find out exactly why when debugging */
WARN_ON(err);
#endif
}
/*
* Finally, if the user set the module parameter treat it
* as a user hint.
*/
if (!is_world_regdom(ieee80211_regdom))
regulatory_hint_user(ieee80211_regdom);
return 0;
}
void /* __init_or_exit */ regulatory_exit(void)
{
struct regulatory_request *reg_request, *tmp;
struct reg_beacon *reg_beacon, *btmp;
cancel_work_sync(®_work);
cancel_delayed_work_sync(®_timeout);
mutex_lock(&cfg80211_mutex);
mutex_lock(®_mutex);
reset_regdomains(true);
dev_set_uevent_suppress(®_pdev->dev, true);
platform_device_unregister(reg_pdev);
spin_lock_bh(®_pending_beacons_lock);
if (!list_empty(®_pending_beacons)) {
list_for_each_entry_safe(reg_beacon, btmp,
®_pending_beacons, list) {
list_del(®_beacon->list);
kfree(reg_beacon);
}
}
spin_unlock_bh(®_pending_beacons_lock);
if (!list_empty(®_beacon_list)) {
list_for_each_entry_safe(reg_beacon, btmp,
®_beacon_list, list) {
list_del(®_beacon->list);
kfree(reg_beacon);
}
}
spin_lock(®_requests_lock);
if (!list_empty(®_requests_list)) {
list_for_each_entry_safe(reg_request, tmp,
®_requests_list, list) {
list_del(®_request->list);
kfree(reg_request);
}
}
spin_unlock(®_requests_lock);
mutex_unlock(®_mutex);
mutex_unlock(&cfg80211_mutex);
}
|
maurillo71/beaglebone-linux
|
net/wireless/reg.c
|
C
|
gpl-2.0
| 61,442 |
/***************************************************************************
qgssourcefieldsproperties.cpp
---------------------
begin : July 2017
copyright : (C) 2017 by David Signer
email : david at opengis dot ch
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "qgssourcefieldsproperties.h"
#include "qgsvectorlayer.h"
#include "qgsproject.h"
QgsSourceFieldsProperties::QgsSourceFieldsProperties( QgsVectorLayer *layer, QWidget *parent )
: QWidget( parent )
, mLayer( layer )
{
if ( !layer )
return;
setupUi( this );
layout()->setContentsMargins( 0, 0, 0, 0 );
layout()->setMargin( 0 );
//button appearance
mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewAttribute.svg" ) ) );
mDeleteAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteAttribute.svg" ) ) );
mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionToggleEditing.svg" ) ) );
mCalculateFieldButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCalculateField.svg" ) ) );
//button signals
connect( mToggleEditingButton, &QAbstractButton::clicked, this, &QgsSourceFieldsProperties::toggleEditing );
connect( mAddAttributeButton, &QAbstractButton::clicked, this, &QgsSourceFieldsProperties::addAttributeClicked );
connect( mDeleteAttributeButton, &QAbstractButton::clicked, this, &QgsSourceFieldsProperties::deleteAttributeClicked );
connect( mCalculateFieldButton, &QAbstractButton::clicked, this, &QgsSourceFieldsProperties::calculateFieldClicked );
//slots
connect( mLayer, &QgsVectorLayer::editingStarted, this, &QgsSourceFieldsProperties::editingToggled );
connect( mLayer, &QgsVectorLayer::editingStopped, this, &QgsSourceFieldsProperties::editingToggled );
connect( mLayer, &QgsVectorLayer::attributeAdded, this, &QgsSourceFieldsProperties::attributeAdded );
connect( mLayer, &QgsVectorLayer::attributeDeleted, this, &QgsSourceFieldsProperties::attributeDeleted );
//field list appearance
mFieldsList->setColumnCount( AttrColCount );
mFieldsList->setSelectionBehavior( QAbstractItemView::SelectRows );
mFieldsList->setDragDropMode( QAbstractItemView::DragOnly );
mFieldsList->setHorizontalHeaderItem( AttrIdCol, new QTableWidgetItem( tr( "Id" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrNameCol, new QTableWidgetItem( tr( "Name" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrTypeCol, new QTableWidgetItem( tr( "Type" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrTypeNameCol, new QTableWidgetItem( tr( "Type name" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrLengthCol, new QTableWidgetItem( tr( "Length" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrPrecCol, new QTableWidgetItem( tr( "Precision" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrCommentCol, new QTableWidgetItem( tr( "Comment" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrWMSCol, new QTableWidgetItem( QStringLiteral( "WMS" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrWFSCol, new QTableWidgetItem( QStringLiteral( "WFS" ) ) );
mFieldsList->setHorizontalHeaderItem( AttrAliasCol, new QTableWidgetItem( tr( "Alias" ) ) );
mFieldsList->setSortingEnabled( true );
mFieldsList->sortByColumn( 0, Qt::AscendingOrder );
mFieldsList->setSelectionBehavior( QAbstractItemView::SelectRows );
mFieldsList->setSelectionMode( QAbstractItemView::ExtendedSelection );
mFieldsList->verticalHeader()->hide();
//load buttons and field list
updateButtons();
}
void QgsSourceFieldsProperties::init()
{
loadRows();
}
void QgsSourceFieldsProperties::loadRows()
{
disconnect( mFieldsList, &QTableWidget::cellChanged, this, &QgsSourceFieldsProperties::attributesListCellChanged );
const QgsFields &fields = mLayer->fields();
mIndexedWidgets.clear();
mFieldsList->setRowCount( 0 );
for ( int i = 0; i < fields.count(); ++i )
attributeAdded( i );
mFieldsList->resizeColumnsToContents();
connect( mFieldsList, &QTableWidget::cellChanged, this, &QgsSourceFieldsProperties::attributesListCellChanged );
connect( mFieldsList, &QTableWidget::cellPressed, this, &QgsSourceFieldsProperties::attributesListCellPressed );
updateButtons();
updateFieldRenamingStatus();
}
void QgsSourceFieldsProperties::updateFieldRenamingStatus()
{
bool canRenameFields = mLayer->isEditable() && ( mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::RenameAttributes ) && !mLayer->readOnly();
for ( int row = 0; row < mFieldsList->rowCount(); ++row )
{
if ( canRenameFields )
mFieldsList->item( row, AttrNameCol )->setFlags( mFieldsList->item( row, AttrNameCol )->flags() | Qt::ItemIsEditable );
else
mFieldsList->item( row, AttrNameCol )->setFlags( mFieldsList->item( row, AttrNameCol )->flags() & ~Qt::ItemIsEditable );
}
}
void QgsSourceFieldsProperties::updateExpression()
{
QToolButton *btn = qobject_cast<QToolButton *>( sender() );
Q_ASSERT( btn );
int index = btn->property( "Index" ).toInt();
const QString exp = mLayer->expressionField( index );
QgsExpressionContext context;
context << QgsExpressionContextUtils::globalScope()
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() );
QgsExpressionBuilderDialog dlg( mLayer, exp, nullptr, QStringLiteral( "generic" ), context );
if ( dlg.exec() )
{
mLayer->updateExpressionField( index, dlg.expressionText() );
loadRows();
}
}
void QgsSourceFieldsProperties::attributeAdded( int idx )
{
bool sorted = mFieldsList->isSortingEnabled();
if ( sorted )
mFieldsList->setSortingEnabled( false );
const QgsFields &fields = mLayer->fields();
int row = mFieldsList->rowCount();
mFieldsList->insertRow( row );
setRow( row, idx, fields.at( idx ) );
mFieldsList->setCurrentCell( row, idx );
//in case there are rows following, there is increased the id to the correct ones
for ( int i = idx + 1; i < mIndexedWidgets.count(); i++ )
mIndexedWidgets.at( i )->setData( Qt::DisplayRole, i );
if ( sorted )
mFieldsList->setSortingEnabled( true );
for ( int i = 0; i < mFieldsList->columnCount(); i++ )
{
switch ( mLayer->fields().fieldOrigin( idx ) )
{
case QgsFields::OriginExpression:
if ( i == 7 ) continue;
mFieldsList->item( row, i )->setBackgroundColor( QColor( 200, 200, 255 ) );
break;
case QgsFields::OriginJoin:
mFieldsList->item( row, i )->setBackgroundColor( QColor( 200, 255, 200 ) );
break;
default:
mFieldsList->item( row, i )->setBackgroundColor( QColor( 255, 255, 200 ) );
break;
}
}
}
void QgsSourceFieldsProperties::attributeDeleted( int idx )
{
mFieldsList->removeRow( mIndexedWidgets.at( idx )->row() );
mIndexedWidgets.removeAt( idx );
for ( int i = idx; i < mIndexedWidgets.count(); i++ )
{
mIndexedWidgets.at( i )->setData( Qt::DisplayRole, i );
}
}
void QgsSourceFieldsProperties::setRow( int row, int idx, const QgsField &field )
{
QTableWidgetItem *dataItem = new QTableWidgetItem();
dataItem->setData( Qt::DisplayRole, idx );
switch ( mLayer->fields().fieldOrigin( idx ) )
{
case QgsFields::OriginExpression:
dataItem->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconExpression.svg" ) ) );
break;
case QgsFields::OriginJoin:
dataItem->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/join.svg" ) ) );
break;
default:
dataItem->setIcon( mLayer->fields().iconForField( idx ) );
break;
}
mFieldsList->setItem( row, AttrIdCol, dataItem );
mIndexedWidgets.insert( idx, mFieldsList->item( row, 0 ) );
mFieldsList->setItem( row, AttrNameCol, new QTableWidgetItem( field.name() ) );
mFieldsList->setItem( row, AttrAliasCol, new QTableWidgetItem( field.alias() ) );
mFieldsList->setItem( row, AttrTypeCol, new QTableWidgetItem( QVariant::typeToName( field.type() ) ) );
mFieldsList->setItem( row, AttrTypeNameCol, new QTableWidgetItem( field.typeName() ) );
mFieldsList->setItem( row, AttrLengthCol, new QTableWidgetItem( QString::number( field.length() ) ) );
mFieldsList->setItem( row, AttrPrecCol, new QTableWidgetItem( QString::number( field.precision() ) ) );
if ( mLayer->fields().fieldOrigin( idx ) == QgsFields::OriginExpression )
{
QWidget *expressionWidget = new QWidget;
expressionWidget->setLayout( new QHBoxLayout );
QToolButton *editExpressionButton = new QToolButton;
editExpressionButton->setProperty( "Index", idx );
editExpressionButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconExpression.svg" ) ) );
connect( editExpressionButton, &QAbstractButton::clicked, this, &QgsSourceFieldsProperties::updateExpression );
expressionWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
expressionWidget->layout()->addWidget( editExpressionButton );
expressionWidget->layout()->addWidget( new QLabel( mLayer->expressionField( idx ) ) );
expressionWidget->setStyleSheet( "background-color: rgb( 200, 200, 255 )" );
mFieldsList->setCellWidget( row, AttrCommentCol, expressionWidget );
}
else
{
mFieldsList->setItem( row, AttrCommentCol, new QTableWidgetItem( field.comment() ) );
}
QList<int> notEditableCols = QList<int>()
<< AttrIdCol
<< AttrNameCol
<< AttrAliasCol
<< AttrTypeCol
<< AttrTypeNameCol
<< AttrLengthCol
<< AttrPrecCol
<< AttrCommentCol;
Q_FOREACH ( int i, notEditableCols )
{
if ( notEditableCols[i] != AttrCommentCol || mLayer->fields().fieldOrigin( idx ) != QgsFields::OriginExpression )
mFieldsList->item( row, i )->setFlags( mFieldsList->item( row, i )->flags() & ~Qt::ItemIsEditable );
if ( notEditableCols[i] == AttrAliasCol )
mFieldsList->item( row, i )->setToolTip( tr( "Edit alias in the Form config tab" ) );
}
bool canRenameFields = mLayer->isEditable() && ( mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::RenameAttributes ) && !mLayer->readOnly();
if ( canRenameFields )
mFieldsList->item( row, AttrNameCol )->setFlags( mFieldsList->item( row, AttrNameCol )->flags() | Qt::ItemIsEditable );
else
mFieldsList->item( row, AttrNameCol )->setFlags( mFieldsList->item( row, AttrNameCol )->flags() & ~Qt::ItemIsEditable );
//published WMS/WFS attributes
QTableWidgetItem *wmsAttrItem = new QTableWidgetItem();
wmsAttrItem->setCheckState( mLayer->excludeAttributesWms().contains( field.name() ) ? Qt::Unchecked : Qt::Checked );
wmsAttrItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
mFieldsList->setItem( row, AttrWMSCol, wmsAttrItem );
QTableWidgetItem *wfsAttrItem = new QTableWidgetItem();
wfsAttrItem->setCheckState( mLayer->excludeAttributesWfs().contains( field.name() ) ? Qt::Unchecked : Qt::Checked );
wfsAttrItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
mFieldsList->setItem( row, AttrWFSCol, wfsAttrItem );
}
bool QgsSourceFieldsProperties::addAttribute( const QgsField &field )
{
QgsDebugMsg( "inserting attribute " + field.name() + " of type " + field.typeName() );
mLayer->beginEditCommand( tr( "Added attribute" ) );
if ( mLayer->addAttribute( field ) )
{
mLayer->endEditCommand();
return true;
}
else
{
mLayer->destroyEditCommand();
QMessageBox::critical( this, tr( "Add Field" ), tr( "Failed to add field '%1' of type '%2'. Is the field name unique?" ).arg( field.name(), field.typeName() ) );
return false;
}
}
void QgsSourceFieldsProperties::apply()
{
QSet<QString> excludeAttributesWMS, excludeAttributesWFS;
for ( int i = 0; i < mFieldsList->rowCount(); i++ )
{
if ( mFieldsList->item( i, AttrWMSCol )->checkState() == Qt::Unchecked )
{
excludeAttributesWMS.insert( mFieldsList->item( i, AttrNameCol )->text() );
}
if ( mFieldsList->item( i, AttrWFSCol )->checkState() == Qt::Unchecked )
{
excludeAttributesWFS.insert( mFieldsList->item( i, AttrNameCol )->text() );
}
}
mLayer->setExcludeAttributesWms( excludeAttributesWMS );
mLayer->setExcludeAttributesWfs( excludeAttributesWFS );
}
//SLOTS
void QgsSourceFieldsProperties::editingToggled()
{
updateButtons();
updateFieldRenamingStatus();
}
void QgsSourceFieldsProperties::addAttributeClicked()
{
QgsAddAttrDialog dialog( mLayer, this );
if ( dialog.exec() == QDialog::Accepted )
{
addAttribute( dialog.field() );
loadRows();
}
}
void QgsSourceFieldsProperties::deleteAttributeClicked()
{
QSet<int> providerFields;
QSet<int> expressionFields;
Q_FOREACH ( QTableWidgetItem *item, mFieldsList->selectedItems() )
{
if ( item->column() == 0 )
{
int idx = mIndexedWidgets.indexOf( item );
if ( idx < 0 )
continue;
if ( mLayer->fields().fieldOrigin( idx ) == QgsFields::OriginExpression )
expressionFields << idx;
else
providerFields << idx;
}
}
if ( !expressionFields.isEmpty() )
mLayer->deleteAttributes( expressionFields.toList() );
if ( !providerFields.isEmpty() )
{
mLayer->beginEditCommand( tr( "Deleted attributes" ) );
if ( mLayer->deleteAttributes( providerFields.toList() ) )
mLayer->endEditCommand();
else
mLayer->destroyEditCommand();
}
}
void QgsSourceFieldsProperties::calculateFieldClicked()
{
if ( !mLayer )
{
return;
}
QgsFieldCalculator calc( mLayer, this );
if ( calc.exec() == QDialog::Accepted )
{
loadRows();
}
}
void QgsSourceFieldsProperties::attributesListCellChanged( int row, int column )
{
if ( column == AttrNameCol && mLayer && mLayer->isEditable() )
{
int idx = mIndexedWidgets.indexOf( mFieldsList->item( row, AttrIdCol ) );
QTableWidgetItem *nameItem = mFieldsList->item( row, column );
//avoiding that something will be changed, just because this is triggered by simple re-sorting
if ( !nameItem ||
nameItem->text().isEmpty() ||
!mLayer->fields().exists( idx ) ||
mLayer->fields().at( idx ).name() == nameItem->text()
)
return;
mLayer->beginEditCommand( tr( "Rename attribute" ) );
if ( mLayer->renameAttribute( idx, nameItem->text() ) )
{
mLayer->endEditCommand();
}
else
{
mLayer->destroyEditCommand();
QMessageBox::critical( this, tr( "Rename Field" ), tr( "Failed to rename field to '%1'. Is the field name unique?" ).arg( nameItem->text() ) );
}
}
}
void QgsSourceFieldsProperties::attributesListCellPressed( int /*row*/, int /*column*/ )
{
updateButtons();
}
//NICE FUNCTIONS
void QgsSourceFieldsProperties::updateButtons()
{
int cap = mLayer->dataProvider()->capabilities();
mToggleEditingButton->setEnabled( ( cap & QgsVectorDataProvider::ChangeAttributeValues ) && !mLayer->readOnly() );
if ( mLayer->isEditable() )
{
mDeleteAttributeButton->setEnabled( cap & QgsVectorDataProvider::DeleteAttributes );
mAddAttributeButton->setEnabled( cap & QgsVectorDataProvider::AddAttributes );
mToggleEditingButton->setChecked( true );
}
else
{
mToggleEditingButton->setChecked( false );
mAddAttributeButton->setEnabled( false );
// Enable delete button if items are selected
mDeleteAttributeButton->setEnabled( !mFieldsList->selectedItems().isEmpty() );
// and only if all selected items have their origin in an expression
Q_FOREACH ( QTableWidgetItem *item, mFieldsList->selectedItems() )
{
if ( item->column() == 0 )
{
int idx = mIndexedWidgets.indexOf( item );
if ( mLayer->fields().fieldOrigin( idx ) != QgsFields::OriginExpression )
{
mDeleteAttributeButton->setEnabled( false );
break;
}
}
}
}
}
|
dwadler/QGIS
|
src/app/qgssourcefieldsproperties.cpp
|
C++
|
gpl-2.0
| 16,637 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html lang="es_MX">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/estilo.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<?php echo link_tag('css/sistema.css'); ?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body style="background-color: #ffffff;">
<div class="container-fluid1">
<div id="foo">
<p id="spin_label" style="position:absolute; width: 100%; top: 50%; margin-top: 60px; text-align: center;">
</p>
</div>
<div class="row-fluid1" id="wrapper1">
<div class="alert" id="messages"></div>
<!-- Inicia Formulario -->
|
estrategasdigitales/Golone
|
iframe2/app/views/header1.php
|
PHP
|
gpl-2.0
| 1,200 |
/*
* IMG Pistachio USB PHY driver
*
* Copyright (C) 2015 Google, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*/
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <dt-bindings/phy/phy-pistachio-usb.h>
#define USB_PHY_CONTROL0 0x00
#define USB_PHY_CONTROL0_OTG_DRVVBUS_SHIFT 11
#define USB_PHY_CONTROL0_OTG_DRVVBUS_MASK 1
#define USB_PHY_CONTROL1 0x04
#define USB_PHY_CONTROL1_FSEL_SHIFT 2
#define USB_PHY_CONTROL1_FSEL_MASK 0x7
#define USB_PHY_STRAP_CONTROL 0x10
#define USB_PHY_STRAP_CONTROL_REFCLK_SHIFT 4
#define USB_PHY_STRAP_CONTROL_REFCLK_MASK 0x3
#define USB_PHY_STATUS 0x14
#define USB_PHY_STATUS_RX_PHY_CLK BIT(9)
#define USB_PHY_STATUS_RX_UTMI_CLK BIT(8)
#define USB_PHY_STATUS_VBUS_FAULT BIT(7)
struct pistachio_usb_phy {
struct device *dev;
struct regmap *cr_top;
struct clk *phy_clk;
bool vbus_drive;
unsigned int refclk;
};
static const unsigned long fsel_rate_map[] = {
9600000,
10000000,
12000000,
19200000,
20000000,
24000000,
0,
50000000,
};
static int pistachio_usb_phy_power_on(struct phy *phy)
{
struct pistachio_usb_phy *p_phy = phy_get_drvdata(phy);
unsigned long timeout, rate;
unsigned int i;
int ret;
ret = clk_prepare_enable(p_phy->phy_clk);
if (ret < 0) {
dev_err(p_phy->dev, "Failed to enable PHY clock: %d\n", ret);
return ret;
}
regmap_update_bits(p_phy->cr_top, USB_PHY_STRAP_CONTROL,
USB_PHY_STRAP_CONTROL_REFCLK_MASK <<
USB_PHY_STRAP_CONTROL_REFCLK_SHIFT,
p_phy->refclk << USB_PHY_STRAP_CONTROL_REFCLK_SHIFT);
if (p_phy->vbus_drive) {
/* allow USB block to control VBUS */
regmap_update_bits(p_phy->cr_top, USB_PHY_CONTROL0,
USB_PHY_CONTROL0_OTG_DRVVBUS_MASK <<
USB_PHY_CONTROL0_OTG_DRVVBUS_SHIFT,
1 << USB_PHY_CONTROL0_OTG_DRVVBUS_SHIFT);
}
rate = clk_get_rate(p_phy->phy_clk);
if (p_phy->refclk == REFCLK_XO_CRYSTAL && rate != 12000000) {
dev_err(p_phy->dev, "Unsupported rate for XO crystal: %ld\n",
rate);
ret = -EINVAL;
goto disable_clk;
}
for (i = 0; i < ARRAY_SIZE(fsel_rate_map); i++) {
if (rate == fsel_rate_map[i])
break;
}
if (i == ARRAY_SIZE(fsel_rate_map)) {
dev_err(p_phy->dev, "Unsupported clock rate: %lu\n", rate);
ret = -EINVAL;
goto disable_clk;
}
regmap_update_bits(p_phy->cr_top, USB_PHY_CONTROL1,
USB_PHY_CONTROL1_FSEL_MASK <<
USB_PHY_CONTROL1_FSEL_SHIFT,
i << USB_PHY_CONTROL1_FSEL_SHIFT);
timeout = jiffies + msecs_to_jiffies(200);
while (time_before(jiffies, timeout)) {
unsigned int val;
regmap_read(p_phy->cr_top, USB_PHY_STATUS, &val);
if (val & USB_PHY_STATUS_VBUS_FAULT) {
dev_err(p_phy->dev, "VBUS fault detected\n");
ret = -EIO;
goto disable_clk;
}
if ((val & USB_PHY_STATUS_RX_PHY_CLK) &&
(val & USB_PHY_STATUS_RX_UTMI_CLK))
return 0;
usleep_range(1000, 1500);
}
dev_err(p_phy->dev, "Timed out waiting for PHY to power on\n");
ret = -ETIMEDOUT;
disable_clk:
clk_disable_unprepare(p_phy->phy_clk);
return ret;
}
static int pistachio_usb_phy_power_off(struct phy *phy)
{
struct pistachio_usb_phy *p_phy = phy_get_drvdata(phy);
clk_disable_unprepare(p_phy->phy_clk);
return 0;
}
static const struct phy_ops pistachio_usb_phy_ops = {
.power_on = pistachio_usb_phy_power_on,
.power_off = pistachio_usb_phy_power_off,
.owner = THIS_MODULE,
};
static int pistachio_usb_phy_probe(struct platform_device *pdev)
{
struct pistachio_usb_phy *p_phy;
struct phy_provider *provider;
struct phy *phy;
int ret;
p_phy = devm_kzalloc(&pdev->dev, sizeof(*p_phy), GFP_KERNEL);
if (!p_phy)
return -ENOMEM;
p_phy->dev = &pdev->dev;
platform_set_drvdata(pdev, p_phy);
p_phy->cr_top = syscon_regmap_lookup_by_phandle(p_phy->dev->of_node,
"img,cr-top");
if (IS_ERR(p_phy->cr_top)) {
dev_err(p_phy->dev, "Failed to get CR_TOP registers: %ld\n",
PTR_ERR(p_phy->cr_top));
return PTR_ERR(p_phy->cr_top);
}
p_phy->phy_clk = devm_clk_get(p_phy->dev, "usb_phy");
if (IS_ERR(p_phy->phy_clk)) {
dev_err(p_phy->dev, "Failed to get usb_phy clock: %ld\n",
PTR_ERR(p_phy->phy_clk));
return PTR_ERR(p_phy->phy_clk);
}
ret = of_property_read_u32(p_phy->dev->of_node, "img,refclk",
&p_phy->refclk);
if (ret < 0) {
dev_err(p_phy->dev, "No reference clock selector specified\n");
return ret;
}
p_phy->vbus_drive = of_property_read_bool(p_phy->dev->of_node, "enable-vbus-drive");
phy = devm_phy_create(p_phy->dev, NULL, &pistachio_usb_phy_ops);
if (IS_ERR(phy)) {
dev_err(p_phy->dev, "Failed to create PHY: %ld\n",
PTR_ERR(phy));
return PTR_ERR(phy);
}
phy_set_drvdata(phy, p_phy);
provider = devm_of_phy_provider_register(p_phy->dev,
of_phy_simple_xlate);
if (IS_ERR(provider)) {
dev_err(p_phy->dev, "Failed to register PHY provider: %ld\n",
PTR_ERR(provider));
return PTR_ERR(provider);
}
return 0;
}
static const struct of_device_id pistachio_usb_phy_of_match[] = {
{ .compatible = "img,pistachio-usb-phy", },
{ },
};
MODULE_DEVICE_TABLE(of, pistachio_usb_phy_of_match);
static struct platform_driver pistachio_usb_phy_driver = {
.probe = pistachio_usb_phy_probe,
.driver = {
.name = "pistachio-usb-phy",
.of_match_table = pistachio_usb_phy_of_match,
},
};
module_platform_driver(pistachio_usb_phy_driver);
MODULE_AUTHOR("Andrew Bresticker <[email protected]>");
MODULE_DESCRIPTION("IMG Pistachio USB2.0 PHY driver");
MODULE_LICENSE("GPL v2");
|
chrisdearman/kernel-common
|
drivers/phy/phy-pistachio-usb.c
|
C
|
gpl-2.0
| 5,778 |
<?php
/**
* @package Joomla.Administrator
* @subpackage com_supperadmin
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$supperAdmin = JFactory::isSupperAdmin();
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$user = JFactory::getUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$canOrder = $user->authorise('core.edit.state', 'com_supperadmin');
$saveOrder = $listOrder == 'ordering';
if ($saveOrder) {
$saveOrderingUrl = 'index.php?option=com_supperadmin&task=modules.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'articleList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
$sortFields = $this->getSortFields();
?>
<script type="text/javascript">
Joomla.orderTable = function () {
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $listOrder; ?>') {
dirn = 'asc';
}
else {
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<div class="view-modules-default">
<?php echo $this->render_toolbar() ?>
<form action="<?php echo JRoute::_('index.php?option=com_supperadmin&view=modules'); ?>" method="post"
name="adminForm" id="adminForm">
<div id="main-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<?php
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-striped" id="itemList">
<thead>
<tr>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
</th>
<th width="1%" class="hidden-phone">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th width="1%" class="nowrap center">
<?php echo JHtml::_('grid.sort', 'JSTATUS', 'enabled', $listDirn, $listOrder); ?>
</th>
<th class="title">
<?php echo JHtml::_('grid.sort', 'module title', 'name', $listDirn, $listOrder); ?>
</th>
<th class="title">
<?php echo JHtml::_('grid.sort', 'module name', 'name', $listDirn, $listOrder); ?>
</th>
<th class="title">
<?php echo JHtml::_('grid.sort', 'website', 'a.website_name', $listDirn, $listOrder); ?>
</th>
<th class="title">
<?php echo JHtml::_('grid.sort', 'Is System', 'a.issystem', $listDirn, $listOrder); ?>
</th>
<th width="5%" class="hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="12">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) :
$ordering = ($listOrder == 'ordering');
$canEdit = $user->authorise('core.edit', 'com_supperadmin');
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state', 'com_supperadmin') && $canCheckin;
?>
<tr class="row<?php echo $i % 2; ?>" item-id="<?php echo $item->id ?>"
sortable-group-id="<?php echo $item->folder ?>">
<td class="order nowrap center hidden-phone">
<?php
$iconClass = '';
if (!$canChange) {
$iconClass = ' inactive';
} elseif (!$saveOrder) {
$iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass ?>">
<i class="icon-menu"></i>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order "/>
<?php endif; ?>
</td>
<td class="center hidden-phone">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<?php echo JHtml::_('jgrid.published', $item->enabled, $i, 'modules.', $canChange); ?>
</td>
<td>
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'supperadmin.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<a class="quick-edit-title"
href="<?php echo JRoute::_('index.php?option=com_supperadmin&task=module.edit&id=' . (int)$item->id); ?>">
<?php echo $item->title; ?></a>
<?php else : ?>
<?php echo $item->title; ?>
<?php endif; ?>
</td>
<td>
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'supperadmin.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<a class="quick-edit-title"
href="<?php echo JRoute::_('index.php?option=com_supperadmin&task=module.edit&id=' . (int)$item->id); ?>">
<?php echo $item->module; ?></a>
<?php else : ?>
<?php echo $item->module; ?>
<?php endif; ?>
</td>
<td class="center hidden-phone">
<?php echo $item->website_name ?>
</td>
<td class="center">
<?php echo JHtml::_('jgrid.is_system', $item->issystem, $i, 'modules.', $canChange); ?>
</td>
<td class="small hidden-phone">
<?php echo $this->escape($item->access_level); ?>
</td>
<td class="center hidden-phone">
<?php echo (int)$item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0"/>
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>"/>
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>"/>
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
</div>
<?php
// Search tools bar
echo JLayoutHelper::render('joomla.contextmenu.contextmenu', array('view' => $this), null, array('debug' => false));
?>
|
cuongnd/test_pro
|
components/website/website_supper_admin/com_supperadmin/views/modules/tmpl/default.php
|
PHP
|
gpl-2.0
| 11,749 |
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
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, version 2.0, 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-1335 USA */
/**
@file storage/perfschema/pfs_setup_object.cc
Performance schema setup object (implementation).
*/
#include "my_global.h"
#include "my_sys.h"
#include "my_base.h"
#include "sql_string.h"
#include "pfs.h"
#include "pfs_stat.h"
#include "pfs_instr.h"
#include "pfs_setup_object.h"
#include "pfs_global.h"
/**
@addtogroup Performance_schema_buffers
@{
*/
uint setup_objects_version= 0;
ulong setup_object_max;
PFS_setup_object *setup_object_array= NULL;
LF_HASH setup_object_hash;
static bool setup_object_hash_inited= false;
/**
Initialize the setup object buffers.
@param param sizing parameters
@return 0 on success
*/
int init_setup_object(const PFS_global_param *param)
{
setup_object_max= param->m_setup_object_sizing;
setup_object_array= NULL;
if (setup_object_max > 0)
{
setup_object_array= PFS_MALLOC_ARRAY(setup_object_max, sizeof(PFS_setup_object),
PFS_setup_object, MYF(MY_ZEROFILL));
if (unlikely(setup_object_array == NULL))
return 1;
}
return 0;
}
/** Cleanup all the setup object buffers. */
void cleanup_setup_object(void)
{
pfs_free(setup_object_array);
setup_object_array= NULL;
setup_object_max= 0;
}
C_MODE_START
static uchar *setup_object_hash_get_key(const uchar *entry, size_t *length,
my_bool)
{
const PFS_setup_object * const *typed_entry;
const PFS_setup_object *setup_object;
const void *result;
typed_entry= reinterpret_cast<const PFS_setup_object* const *> (entry);
DBUG_ASSERT(typed_entry != NULL);
setup_object= *typed_entry;
DBUG_ASSERT(setup_object != NULL);
*length= setup_object->m_key.m_key_length;
result= setup_object->m_key.m_hash_key;
return const_cast<uchar*> (reinterpret_cast<const uchar*> (result));
}
C_MODE_END
/**
Initialize the setup objects hash.
@return 0 on success
*/
int init_setup_object_hash(void)
{
if ((! setup_object_hash_inited) && (setup_object_max > 0))
{
lf_hash_init(&setup_object_hash, sizeof(PFS_setup_object*), LF_HASH_UNIQUE,
0, 0, setup_object_hash_get_key, &my_charset_bin);
/* setup_object_hash.size= setup_object_max; */
setup_object_hash_inited= true;
}
return 0;
}
/** Cleanup the setup objects hash. */
void cleanup_setup_object_hash(void)
{
if (setup_object_hash_inited)
{
setup_object_hash_inited= false;
lf_hash_destroy(&setup_object_hash);
}
}
static LF_PINS* get_setup_object_hash_pins(PFS_thread *thread)
{
if (unlikely(thread->m_setup_object_hash_pins == NULL))
{
if (! setup_object_hash_inited)
return NULL;
thread->m_setup_object_hash_pins= lf_hash_get_pins(&setup_object_hash);
}
return thread->m_setup_object_hash_pins;
}
static void set_setup_object_key(PFS_setup_object_key *key,
enum_object_type object_type,
const char *schema, uint schema_length,
const char *object, uint object_length)
{
DBUG_ASSERT(schema_length <= NAME_LEN);
DBUG_ASSERT(object_length <= NAME_LEN);
char *ptr= &key->m_hash_key[0];
ptr[0]= (char) object_type;
ptr++;
if (schema_length)
{
memcpy(ptr, schema, schema_length);
ptr+= schema_length;
}
ptr[0]= 0;
ptr++;
if (object_length)
{
memcpy(ptr, object, object_length);
ptr+= object_length;
}
ptr[0]= 0;
ptr++;
key->m_key_length= (uint)(ptr - &key->m_hash_key[0]);
}
int insert_setup_object(enum_object_type object_type, const String *schema,
const String *object, bool enabled, bool timed)
{
if (setup_object_max == 0)
return HA_ERR_RECORD_FILE_FULL;
PFS_thread *thread= PFS_thread::get_current_thread();
if (unlikely(thread == NULL))
return HA_ERR_OUT_OF_MEM;
LF_PINS* pins= get_setup_object_hash_pins(thread);
if (unlikely(pins == NULL))
return HA_ERR_OUT_OF_MEM;
static uint PFS_ALIGNED setup_object_monotonic_index= 0;
uint index;
uint attempts= 0;
PFS_setup_object *pfs;
while (++attempts <= setup_object_max)
{
/* See create_mutex() */
index= PFS_atomic::add_u32(& setup_object_monotonic_index, 1) % setup_object_max;
pfs= setup_object_array + index;
if (pfs->m_lock.is_free())
{
if (pfs->m_lock.free_to_dirty())
{
set_setup_object_key(&pfs->m_key, object_type,
schema->ptr(), schema->length(),
object->ptr(), object->length());
pfs->m_schema_name= &pfs->m_key.m_hash_key[1];
pfs->m_schema_name_length= schema->length();
pfs->m_object_name= pfs->m_schema_name + pfs->m_schema_name_length + 1;
pfs->m_object_name_length= object->length();
pfs->m_enabled= enabled;
pfs->m_timed= timed;
int res;
res= lf_hash_insert(&setup_object_hash, pins, &pfs);
if (likely(res == 0))
{
pfs->m_lock.dirty_to_allocated();
setup_objects_version++;
return 0;
}
pfs->m_lock.dirty_to_free();
if (res > 0)
return HA_ERR_FOUND_DUPP_KEY;
/* OOM in lf_hash_insert */
return HA_ERR_OUT_OF_MEM;
}
}
}
return HA_ERR_RECORD_FILE_FULL;
}
int delete_setup_object(enum_object_type object_type, const String *schema,
const String *object)
{
PFS_thread *thread= PFS_thread::get_current_thread();
if (unlikely(thread == NULL))
return HA_ERR_OUT_OF_MEM;
LF_PINS* pins= get_setup_object_hash_pins(thread);
if (unlikely(pins == NULL))
return HA_ERR_OUT_OF_MEM;
PFS_setup_object_key key;
set_setup_object_key(&key, object_type,
schema->ptr(), schema->length(),
object->ptr(), object->length());
PFS_setup_object **entry;
entry= reinterpret_cast<PFS_setup_object**>
(lf_hash_search(&setup_object_hash, pins, key.m_hash_key, key.m_key_length));
if (entry && (entry != MY_ERRPTR))
{
PFS_setup_object *pfs= *entry;
lf_hash_delete(&setup_object_hash, pins, key.m_hash_key, key.m_key_length);
pfs->m_lock.allocated_to_free();
}
lf_hash_search_unpin(pins);
setup_objects_version++;
return 0;
}
int reset_setup_object()
{
PFS_thread *thread= PFS_thread::get_current_thread();
if (unlikely(thread == NULL))
return HA_ERR_OUT_OF_MEM;
LF_PINS* pins= get_setup_object_hash_pins(thread);
if (unlikely(pins == NULL))
return HA_ERR_OUT_OF_MEM;
PFS_setup_object *pfs= setup_object_array;
PFS_setup_object *pfs_last= setup_object_array + setup_object_max;
for ( ; pfs < pfs_last; pfs++)
{
if (pfs->m_lock.is_populated())
{
lf_hash_delete(&setup_object_hash, pins,
pfs->m_key.m_hash_key, pfs->m_key.m_key_length);
pfs->m_lock.allocated_to_free();
}
}
setup_objects_version++;
return 0;
}
long setup_object_count()
{
return setup_object_hash.count;
}
void lookup_setup_object(PFS_thread *thread,
enum_object_type object_type,
const char *schema_name, int schema_name_length,
const char *object_name, int object_name_length,
bool *enabled, bool *timed)
{
PFS_setup_object_key key;
PFS_setup_object **entry;
PFS_setup_object *pfs;
int i;
/*
The table io instrumentation uses "TABLE" and "TEMPORARY TABLE".
SETUP_OBJECT uses "TABLE" for both concepts.
There is no way to provide a different setup for:
- TABLE foo.bar
- TEMPORARY TABLE foo.bar
*/
DBUG_ASSERT(object_type != OBJECT_TYPE_TEMPORARY_TABLE);
LF_PINS* pins= get_setup_object_hash_pins(thread);
if (unlikely(pins == NULL))
{
*enabled= false;
*timed= false;
return;
}
for (i= 1; i<=3; i++)
{
switch(i)
{
case 1:
/* Lookup OBJECT_TYPE + OBJECT_SCHEMA + OBJECT_NAME in SETUP_OBJECTS */
set_setup_object_key(&key,
object_type,
schema_name, schema_name_length,
object_name, object_name_length);
break;
case 2:
/* Lookup OBJECT_TYPE + OBJECT_SCHEMA + "%" in SETUP_OBJECTS */
set_setup_object_key(&key,
object_type,
schema_name, schema_name_length, "%", 1);
break;
case 3:
/* Lookup OBJECT_TYPE + "%" + "%" in SETUP_OBJECTS */
set_setup_object_key(&key, object_type, "%", 1, "%", 1);
break;
}
entry= reinterpret_cast<PFS_setup_object**>
(lf_hash_search(&setup_object_hash, pins, key.m_hash_key, key.m_key_length));
if (entry && (entry != MY_ERRPTR))
{
pfs= *entry;
*enabled= pfs->m_enabled;
*timed= pfs->m_timed;
lf_hash_search_unpin(pins);
return;
}
lf_hash_search_unpin(pins);
}
*enabled= false;
*timed= false;
return;
}
/** @} */
|
grooverdan/mariadb-server
|
storage/perfschema/pfs_setup_object.cc
|
C++
|
gpl-2.0
| 10,104 |
<?php
/** Neapolitan (Nnapulitano)
*
* See MessagesQqq.php for message documentation incl. usage of parameters
* To improve a translation please visit http://translatewiki.net
*
* @ingroup Language
* @file
*
* @author Carmine Colacino
* @author Cryptex
* @author E. abu Filumena
* @author SabineCretella
* @author לערי ריינהארט
*/
$fallback = 'it';
$namespaceNames = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Speciàle',
NS_TALK => 'Chiàcchiera',
NS_USER => 'Utente',
NS_USER_TALK => 'Utente_chiàcchiera',
NS_PROJECT_TALK => '$1_chiàcchiera',
NS_FILE => 'Fiùra',
NS_FILE_TALK => 'Fiùra_chiàcchiera',
NS_MEDIAWIKI => 'MediaWiki',
NS_MEDIAWIKI_TALK => 'MediaWiki_chiàcchiera',
NS_TEMPLATE => 'Modello',
NS_TEMPLATE_TALK => 'Modello_chiàcchiera',
NS_HELP => 'Ajùto',
NS_HELP_TALK => 'Ajùto_chiàcchiera',
NS_CATEGORY => 'Categurìa',
NS_CATEGORY_TALK => 'Categurìa_chiàcchiera',
);
$namespaceAliases = array(
'Speciale' => NS_SPECIAL,
'Discussione' => NS_TALK,
'Utente' => NS_USER,
'Discussioni_utente' => NS_USER_TALK,
'Discussioni_$1' => NS_PROJECT_TALK,
'Immagine' => NS_FILE,
'Discussioni_immagine' => NS_FILE_TALK,
'MediaWiki' => NS_MEDIAWIKI,
'Discussioni_MediaWiki' => NS_MEDIAWIKI_TALK,
'Discussioni_template' => NS_TEMPLATE_TALK,
'Aiuto' => NS_HELP,
'Discussioni_aiuto' => NS_HELP_TALK,
'Categoria' => NS_CATEGORY,
'Discussioni_categoria' => NS_CATEGORY_TALK,
);
$messages = array(
# User preference toggles
'tog-underline' => "Sottolinia 'e jonte:",
'tog-highlightbroken' => 'Formatta \'e jonte defettose <a href="" class="new">accussì</a> (oppure: accussì<a href="" class="internal">?</a>).',
'tog-justify' => "Alliniamento d''e paracrafe mpare",
'tog-hideminor' => "Annascunne 'e cagne piccirille 'int'a ll'úrdeme cagne",
'tog-extendwatchlist' => "Spanne ll'asservate speciale pe fà vedé tutte 'e cagne possíbbele",
'tog-usenewrc' => 'Urdeme cagne avanzate (JavaScript)',
'tog-numberheadings' => "Annúmmera automatecamente 'e títule",
'tog-showtoolbar' => "Aspone 'a barra d''e stromiente 'e cagno (JavaScript)",
'tog-editondblclick' => "Cagna 'e pàggene cliccanno ddoje vote (JavaScript)",
'tog-editsection' => "Permette 'e cagnà 'e sezzione cu a jonta [cagna]",
'tog-editsectiononrightclick' => "Permette 'e cangne 'e sezzione cliccanno p''o tasto destro ncopp 'e titule 'e sezzione (JavaScript)",
'tog-showtoc' => "Mosta ll'innece pe 'e paggene cu cchiù 'e 3 sezzione",
'tog-rememberpassword' => "Ricurda 'a registrazzione pe' cchiu sessione",
'tog-editwidth' => "Larghezza massima d''a casella pe scrivere",
'underline-always' => 'Sèmpe',
'underline-never' => 'Màje',
# Dates
'sunday' => 'dumméneca',
'monday' => 'lunnerì',
'tuesday' => 'marterì',
'wednesday' => 'miercurì',
'thursday' => 'gioverì',
'friday' => 'viernarì',
'saturday' => 'sàbbato',
'sun' => 'dum',
'mon' => 'lun',
'tue' => 'mar',
'wed' => 'mier',
'thu' => 'gio',
'fri' => 'ven',
'sat' => 'sab',
'january' => 'jennaro',
'february' => 'frevàro',
'march' => 'màrzo',
'april' => 'abbrile',
'may_long' => 'màjo',
'june' => 'giùgno',
'july' => 'luglio',
'august' => 'aústo',
'september' => 'settembre',
'october' => 'ottobbre',
'november' => 'nuvembre',
'december' => 'dicèmbre',
'january-gen' => 'jennaro',
'february-gen' => 'frevaro',
'march-gen' => 'màrzo',
'april-gen' => 'abbrile',
'may-gen' => 'maggio',
'june-gen' => 'giùgno',
'july-gen' => 'luglio',
'august-gen' => 'aùsto',
'september-gen' => 'settembre',
'october-gen' => 'ottovre',
'november-gen' => 'nuvembre',
'december-gen' => 'dicembre',
'jan' => 'jen',
'feb' => 'fre',
'mar' => 'mar',
'apr' => 'abb',
'may' => 'maj',
'jun' => 'giu',
'jul' => 'lug',
'aug' => 'aus',
'sep' => 'set',
'oct' => 'ott',
'nov' => 'nuv',
'dec' => 'dic',
# Categories related messages
'category_header' => 'Paggene rìnt\'a categurìa "$1"',
'subcategories' => 'Categurìe secunnarie',
'about' => 'Nfromma',
'article' => 'Articulo',
'newwindow' => "(s'arape n'ata fenèsta)",
'cancel' => 'Scancèlla',
'mypage' => "'A paggena mia",
'mytalk' => "'E mmie chiacchieriàte",
'anontalk' => 'Chiacchierate pe chisto IP',
# Cologne Blue skin
'qbfind' => 'Truòva',
'qbedit' => 'Càgna',
'qbpageoptions' => 'Chesta paggena',
'qbpageinfo' => "Nfrummazzione ncopp'â paggena",
'qbmyoptions' => "'E ppaggene mie",
'qbspecialpages' => 'Pàggene speciàle',
'errorpagetitle' => 'Sbaglio',
'returnto' => 'Torna a $1.',
'help' => 'Ajùto',
'search' => 'Truova',
'searchbutton' => 'Truova',
'go' => 'Vàje',
'history' => "Verziune 'e primma",
'history_short' => 'Cronologgia',
'info_short' => 'Nfurmazzione',
'printableversion' => "Verzione pe' stampa",
'permalink' => 'Jonta permanente',
'edit' => 'Càgna',
'editthispage' => 'Càgna chesta paggena',
'delete' => 'Scancèlla',
'deletethispage' => 'Scancèlla chésta paggena',
'protect' => 'Ferma',
'protectthispage' => 'Ferma chesta paggena',
'unprotect' => 'Sferma',
'unprotectthispage' => 'Sferma chesta paggena',
'newpage' => 'Paggena nòva',
'talkpage' => "Paggena 'e chiàcchiera",
'talkpagelinktext' => 'Chiàcchiera',
'specialpage' => 'Paggena speciàle',
'talk' => 'Chiàcchiera',
'toolbox' => 'Strumiente',
'imagepage' => 'Paggena fiùra',
'otherlanguages' => 'Ate léngue',
'redirectedfrom' => "(Redirect 'a $1)",
'lastmodifiedat' => "Urdema cagnamiénto pe' a paggena: $2, $1.",
'viewcount' => 'Chesta paggena è stata lètta {{PLURAL:$1|una vòta|$1 vòte}}.',
'jumpto' => 'Vaje a:',
'jumptonavigation' => 'navigazione',
'jumptosearch' => 'truova',
# 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' => "'Nfrummazione ncòpp'a {{SITENAME}}",
'aboutpage' => "Project:'Nfrummazione",
'disclaimers' => 'Avvertimiènte',
'disclaimerpage' => 'Project:Avvertimiènte generale',
'edithelp' => 'Guida',
'helppage' => 'Help:Ajùto',
'mainpage' => 'Paggena prencepale',
'mainpage-description' => 'Paggena prencepale',
'portal' => "Porta d''a cummunetà",
'portal-url' => "Project:Porta d''a cummunetà",
'badaccess' => "Nun haje 'e premmesse abbastante.",
'newmessageslink' => "nuove 'mmasciàte",
'newmessagesdifflink' => "differenze cu 'a revisione precedente",
'youhavenewmessagesmulti' => 'Tiene nuove mmasciate $1',
'editsection' => 'càgna',
'editold' => 'càgna',
'toc' => 'Énnece',
'showtoc' => 'faje vedé',
'hidetoc' => 'annascunne',
'viewdeleted' => 'Vire $1?',
# Short words for each namespace, by default used in the namespace tab in monobook
'nstab-main' => 'Articulo',
'nstab-user' => 'Paggena utente',
'nstab-project' => "Paggena 'e servizio",
'nstab-image' => 'Fiura',
'nstab-mediawiki' => "'Mmasciata",
'nstab-help' => 'Ajùto',
'nstab-category' => 'Categurìa',
# General errors
'filedeleteerror' => 'Nun se pô scancellà \'o file "$1"',
'cannotdelete' => "Nun è possibbele scassà 'a paggena o 'a fiura addamannata. (Putria éssere stato già scancellato.)",
'badtitle' => "'O nnomme nun è jùsto",
# Login and logout pages
'logouttext' => "'''Site asciùte.'''
Putite cuntinuà a ausà {{SITENAME}} comme n'utente senza nomme, o si nò putite trasì n'ata vota, cu 'o stesso nomme o cu n'ato nomme.",
'welcomecreation' => "== Bemmenuto, $1! ==
'O cunto è stato criato currettamente. Nun scurdà 'e perzonalizzà 'e ppreferenze 'e {{SITENAME}}.",
'remembermypassword' => 'Allicuordate d"a password',
'yourdomainname' => "Spiecà 'o dumminio",
'login' => 'Tràse',
'userlogin' => "Tràse o cria n'acciesso nuovo",
'logout' => 'Jèsce',
'userlogout' => 'Jèsce',
'notloggedin' => 'Acciesso nun affettuato',
'nologin' => "Nun haje ancora n'acciesso? '''$1'''.",
'nologinlink' => 'Crialo mmo',
'createaccount' => 'Cria nu cunto nuovo',
'gotaccount' => "Tiene già nu cunto? '''$1'''.",
'gotaccountlink' => 'Tràse',
'loginerror' => "Probblema 'e accièsso",
'loginsuccesstitle' => 'Acciesso affettuato',
'nosuchusershort' => 'Nun ce stanno utente cu o nòmme "<nowiki>$1</nowiki>". Cuntrolla si scrivìste buòno.',
'nouserspecified' => "Tiene 'a dìcere nu nomme pricìso.",
'acct_creation_throttle_hit' => 'Ce dispiace, haje già criato $1 utente. Nun ne pô crià ate.',
'accountcreated' => 'Cunto criato',
'loginlanguagelabel' => 'Lengua: $1',
# Edit page toolbar
'image_sample' => 'Essempio.jpg',
'image_tip' => 'Fiura ncuorporata',
# Edit pages
'minoredit' => 'Chisto è nu cagnamiénto piccerillo',
'watchthis' => "Tiene d'uocchio chesta paggena",
'savearticle' => "Sarva 'a paggena",
'preview' => 'Anteprimma',
'showpreview' => 'Vere anteprimma',
'showdiff' => "Fa veré 'e cagnamiente",
'blockededitsource' => "Ccà sotto venono mmustate 'e '''cagnamiente fatte''' â paggena '''$1''':",
'loginreqtitle' => "Pe' cagnà chesta paggena abbesognate aseguì ll'acciesso ô sito.",
'loginreqlink' => "aseguì ll'acciesso",
'loginreqpagetext' => "Pe' veré ate ppaggene abbesognate $1.",
'accmailtitle' => "'O password è stato mannato.",
'accmailtext' => '\'A password pe ll\'utente "$1" fuje mannata ô nnerizzo $2.',
'previewnote' => "'''Chesta è sola n'anteprimma; 'e cagnamiénte â paggena NUN songo ancora sarvate!'''",
'editing' => "Cagnamiento 'e $1",
'templatesused' => "Template ausate 'a chesta paggena:",
# "Undo" feature
'undo-summary' => "Canciella 'o cagnamiento $1 'e [[Special:Contributions/$2|$2]] ([[User talk:$2|Chiàcchiera]])",
# History pages
'currentrev' => "Verzione 'e mmo",
# Revision deletion
'rev-delundel' => 'faje vedé/annascunne',
# Search results
'searchresults' => "Risultato d''a recerca",
'searchresulttext' => "Pe sapé de cchiù ncopp'â comme ascia 'a {{SITENAME}}, vere [[{{MediaWiki:Helppage}}|Ricerca in {{SITENAME}}]].",
'notitlematches' => "Voce addemannata nun truvata dint' 'e titule 'e articulo",
'notextmatches' => "Voce addemannata nun truvata dint' 'e teste 'e articulo",
'searchhelp-url' => 'Help:Ajùto',
'powersearch' => 'Truova',
# Preferences page
'mypreferences' => "Preferenze d''e mie",
'changepassword' => 'Cagna password',
'prefs-rc' => 'Urdeme nove',
'prefs-watchlist' => 'Asservate speciale',
'columns' => 'Culonne:',
'timezoneregion-africa' => 'Afreca',
'username' => 'Nomme utente',
'yourlanguage' => 'Lengua:',
# User rights log
'rightsnone' => '(nisciuno)',
# Recent changes
'recentchanges' => 'Urdeme nove',
'recentchangestext' => "Ncoppa chesta paggena song' appresentate ll'urdeme cagnamiente fatto ê cuntenute d\"o sito.",
'rcnote' => "Ccà sotto nce songo ll'urdeme {{PLURAL:$1|cangiamiento|'''$1''' cangiamiente}} 'e ll'urdeme {{PLURAL:$2|juorno|'''$2''' juorne}}, agghiuornate a $3.",
'rclistfrom' => "Faje vedé 'e cagnamiénte fatte a partì 'a $1",
'rcshowhideminor' => "$1 'e cagnamiénte piccerille",
'rcshowhidebots' => "$1 'e bot",
'rcshowhideliu' => "$1 ll'utente reggìstrate",
'rcshowhideanons' => "$1 ll'utente anonime",
'rcshowhidemine' => "$1 'e ffatiche mmee",
'rclinks' => "Faje vedé ll'urdeme $1 cagnamiente dint' ll'urdeme $2 juorne<br />$3",
'hide' => 'annascunne',
'show' => 'faje vedé',
'rc_categories_any' => 'Qualònca',
# Recent changes linked
'recentchangeslinked' => 'Cagnamiénte cullegate',
'recentchangeslinked-feed' => 'Cagnamiénte cullegate',
'recentchangeslinked-toolbox' => 'Cagnamiénte cullegate',
# Upload
'upload' => 'Careca file',
'uploadedimage' => 'ha carecato "[[$1]]"',
# Special:ListFiles
'listfiles_name' => 'Nomme',
# File description page
'file-anchor-link' => 'Fiura',
'filehist-user' => 'Utente',
'imagelinks' => 'Jonte ê ffiure',
# Random page
'randompage' => 'Na paggena qualsiase',
'randompage-nopages' => 'Nessuna pagina nel namespace selezionato.',
'disambiguations' => "Paggene 'e disambigua",
'doubleredirects' => 'Redirect duppie',
# Miscellaneous special pages
'nbytes' => '$1 {{PLURAL:$1|byte|byte}}',
'ncategories' => '$1 {{PLURAL:$1|categoria|categorie}}',
'nlinks' => '$1 {{PLURAL:$1|cullegamiento|cullegamiente}}',
'popularpages' => "Paggene cchiù 'speziunate",
'wantedpages' => 'Paggene cchiù addemannate',
'shortpages' => 'Paggene curte',
'longpages' => 'Paggene cchiú longhe',
'newpages' => 'Paggene cchiù frische',
'move' => 'Spusta',
'movethispage' => 'Spusta chesta paggena',
# Special:AllPages
'allpages' => "Tutte 'e ppaggene",
'allarticles' => "Tutt' 'e vvoce",
'allinnamespace' => "Tutt' 'e ppaggene d''o namespace $1",
# Special:Categories
'categories' => 'Categurìe',
'categoriespagetext' => "Lista cumpleta d\"e categurie presente ncopp' 'o sito.",
# Special:LinkSearch
'linksearch-ok' => 'Truova',
# Watchlist
'addedwatch' => 'Aggiunto ai Osservate Speciale tue',
'watch' => 'Secuta',
'notanarticle' => 'Chesta paggena nun è na voce',
'enotif_newpagetext' => 'Chesta è na paggena nòva.',
'changed' => 'cagnata',
# Delete
'deletepage' => 'Scancella paggena',
'excontent' => "'o cuntenuto era: '$1'",
'excontentauthor' => "'o cuntenuto era: '$1' (e ll'unneco cuntribbutore era '[[Special:Contributions/$2|$2]]')",
'exbeforeblank' => "'O cuntenuto apprimm' 'a ll'arrevacamento era: '$1'",
'exblank' => "'a paggena era vacante",
'actioncomplete' => 'Azzione fernuta',
'deletedtext' => 'Qauccheruno ha scancellata \'a paggena "<nowiki>$1</nowiki>". Addumannà \'o $2 pe na lista d"e ppaggene scancellate urdemamente.',
'deletedarticle' => 'ha scancellato "[[$1]]"',
'dellogpage' => 'Scancellazione',
'deletionlog' => 'Log d"e scancellazione',
'deletecomment' => 'Raggióne',
# Rollback
'rollback' => "Ausa na revizione 'e primma",
'revertpage' => "Cangiaje 'e cagnamiénte 'e [[Special:Contributions/$2|$2]] ([[User talk:$2|discussione]]), cu â verzione 'e pprimma 'e [[User:$1|$1]]",
# Protect
'prot_1movedto2' => 'ha spustato [[$1]] a [[$2]]',
'protect-expiry-options' => '2 ore:2 hours,1 juorno:1 day,3 juorne:3 days,1 semmana:1 week,2 semmane:2 weeks,1 mise:1 month,3 mese:3 months,6 mese:6 months,1 anno:1 year,infinito:infinite',
# Undelete
'viewdeletedpage' => "Vìre 'e ppàggine scancellate",
# Namespace form on various pages
'invert' => "abbarruca 'a sceveta",
# Contributions
'contributions' => 'Contribbute utente',
'mycontris' => 'Mie contribbute',
'sp-contributions-talk' => 'Chiàcchiera',
# What links here
'whatlinkshere' => 'Paggene ca cullegano a chesta',
'whatlinkshere-title' => 'Paggene ca cullegano a $1',
'nolinkshere' => "Nisciuna paggena cuntene jonte ca mpuntano a '''[[:$1]]'''.",
# Block/unblock
'blockip' => 'Ferma utelizzatóre',
'ipadressorusername' => 'Nnerizzo IP o nomme utente',
'ipboptions' => '2 ore:2 hours,1 juorno:1 day,3 juorne:3 days,1 semmana:1 week,2 semmane:2 weeks,1 mise:1 month,3 mese:3 months,6 mese:6 months,1 anno:1 year,infinito:infinite',
'blockipsuccesssub' => 'Blocco aseguito',
'blocklistline' => '$1, $2 ha fermato $3 ($4)',
'blocklink' => 'ferma',
'blocklogpage' => 'Blocche',
'blocklogentry' => 'ha fermato "[[$1]]" pe\' nu mumento \'e $2 $3',
'blocklogtext' => "Chesta è 'a lista d''e azzione 'e blocco e sblocco utente. 'E nnerizze IP bloccate automaticamente nun nce so'. Addumannà 'a [[Special:IPBlockList|lista IP bloccate]] pp' 'a lista d''e nnerizze e nomme utente 'o ca blocco nce sta.",
# Move page
'movearticle' => "Spusta 'a paggena",
'newtitle' => 'Titulo nuovo:',
'movepagebtn' => "Spusta 'a paggena",
'articleexists' => "Na paggena cu chisto nomme asiste già, o pure 'o nomme scegliuto nun è buono. Scegliere n'ato titulo.",
'movedto' => 'spustata a',
'1movedto2' => 'ha spustato [[$1]] a [[$2]]',
'1movedto2_redir' => '[[$1]] spustata a [[$2]] trammeto redirect',
'movereason' => 'Raggióne',
'delete_and_move' => 'Scancèlla e spusta',
'delete_and_move_confirm' => "Sì, suprascrivi 'a paggena asistente",
# Export
'export' => "Spurta 'e ppaggene",
# Namespace 8 related
'allmessages' => "'Mmasciate d''o sistema",
'allmessagesname' => 'Nomme',
'allmessagescurrent' => "Testo 'e mo",
# Special:Import
'import' => 'Mpurta paggene',
'import-interwiki-submit' => 'Mpurta',
# Import log
'import-logentry-upload' => 'ha mpurtato [[$1]] trammeto upload',
# Tooltip help for the actions
'tooltip-pt-logout' => 'Jésce (logout)',
'tooltip-minoredit' => 'Rénne chìsto cagnamiénto cchiù ppiccirìllo.',
'tooltip-save' => "Sàrva 'e cagnamiénte.",
'tooltip-preview' => "Primma 'e sarvà, vìre primma chille ca hê cagnàte!",
# Attribution
'others' => 'ate',
# Info page
'numedits' => "Nummero 'e cagnamiente (articulo): $1",
'numwatchers' => "Nummero 'e asservature: $1",
# Special:NewFiles
'noimages' => "Nun nc'è nind' 'a veré.",
'ilsubmit' => 'Truova',
'exif-xyresolution-i' => '$1 punte pe pollice (dpi)',
'exif-meteringmode-0' => 'Scanusciuto',
'exif-meteringmode-255' => 'Ato',
'exif-lightsource-0' => 'Scanusciuta',
'exif-lightsource-10' => "'Ntruvulato",
'exif-lightsource-11' => 'Aumbruso',
'exif-gaincontrol-0' => 'Nisciuno',
'exif-subjectdistancerange-0' => 'Scanusciuta',
# External editor support
'edit-externally-help' => "Pe piglià cchiù nfromma veré 'e [http://www.mediawiki.org/wiki/Manual:External_editors struzione] ('n ngrese)",
# 'all' in various places, this might be different for inflected languages
'namespacesall' => 'Tutte',
# E-mail address confirmation
'confirmemail_needlogin' => "Abbesognate $1 pe cunfirmà 'o nnerizzo 'e e-mail d''o vuosto.",
'confirmemail_loggedin' => "'O nnerizzo 'e e-mail è vàleto",
# Trackbacks
'trackbackremove' => '([$1 Scarta])',
# Delete conflict
'deletedwhileediting' => 'Attenziòne: quaccherùno have scancellàto chesta pàggena prìmma ca tu accuminciàste â scrìvere!',
# Auto-summaries
'autoredircomment' => 'Redirect â paggena [[$1]]',
'autosumm-new' => 'Paggena nuova: $1',
# Special:SpecialPages
'specialpages' => 'Paggene speciale',
);
|
thewebmind/docs
|
languages/messages/MessagesNap.php
|
PHP
|
gpl-2.0
| 19,725 |
#!/usr/bin/env python
import glob, os, sys
import sipconfig
from PyQt4 import pyqtconfig
def get_diana_version():
depends = filter(lambda line: line.startswith("Depends:"),
open("debian/control").readlines())
for line in depends:
pieces = line.split()
for piece in pieces:
name_pieces = piece.strip(",").split("-")
if len(name_pieces) == 2 and name_pieces[0] == "diana":
return name_pieces[1]
return None
def get_python_diana_version():
line = open("debian/changelog").readline()
pieces = line.split()
return pieces[1][1:-1]
if __name__ == "__main__":
if len(sys.argv) not in (1, 3, 5):
sys.stderr.write("Usage: %s [<directory containing diana headers> <directory containing libdiana>] "
"[<directory containing metlibs headers> <directory containing metlibs libraries>]\n" % sys.argv[0])
sys.exit(1)
if len(sys.argv) == 5:
metlibs_inc_dir = sys.argv[3]
metlibs_lib_dir = sys.argv[4]
else:
metlibs_inc_dir = "/usr/include/metlibs"
metlibs_lib_dir = "/usr/lib"
if len(sys.argv) >= 3:
diana_inc_dir = sys.argv[1]
diana_lib_dir = sys.argv[2]
else:
diana_inc_dir = "/usr/include/diana"
diana_lib_dir = "/usr/lib"
qt_pkg_dir = os.getenv("qt_pkg_dir")
python_diana_pkg_dir = os.getenv("python_diana_pkg_dir")
dest_pkg_dir = os.path.join(python_diana_pkg_dir, "metno")
config = pyqtconfig.Configuration()
# The name of the SIP build file generated by SIP and used by the build
# system.
sip_files_dir = "sip"
modules = ["std", "metlibs", "diana"]
if not os.path.exists("modules"):
os.mkdir("modules")
# Run SIP to generate the code.
output_dirs = []
for module in modules:
output_dir = os.path.join("modules", module)
build_file = module + ".sbf"
build_path = os.path.join(output_dir, build_file)
if not os.path.exists(output_dir):
os.mkdir(output_dir)
sip_file = os.path.join("sip", module, module+".sip")
command = " ".join([config.sip_bin,
"-c", output_dir,
"-b", build_path,
"-I"+config.sip_inc_dir,
"-I"+config.pyqt_sip_dir,
"-I"+diana_inc_dir,
"-I/usr/include",
"-I"+metlibs_inc_dir,
"-I"+qt_pkg_dir+"/include",
"-I"+qt_pkg_dir+"/share/sip/PyQt4",
"-Isip",
config.pyqt_sip_flags,
"-w",
"-o", # generate docstrings for signatures
sip_file])
sys.stdout.write(command+"\n")
sys.stdout.flush()
if os.system(command) != 0:
sys.exit(1)
# Create the Makefile (within the diana directory).
makefile = pyqtconfig.QtGuiModuleMakefile(
config, build_file, dir=output_dir,
install_dir=dest_pkg_dir,
qt=["QtCore", "QtGui", "QtNetwork", "QtXml", "QtXmlPatterns"]
)
if module == "diana":
makefile.extra_include_dirs += [
diana_inc_dir,
os.path.join(diana_inc_dir, "PaintGL"),
metlibs_inc_dir,
qt_pkg_dir+"/include"
]
makefile.extra_lib_dirs += [diana_lib_dir, qt_pkg_dir+"/lib"]
makefile.extra_lflags += ["-Wl,-rpath="+diana_lib_dir, "-Wl,-fPIC"]
makefile.extra_libs += ["diana"]
if module == "metlibs":
makefile.extra_include_dirs.append(diana_inc_dir)
makefile.extra_include_dirs.append("/usr/include/metlibs")
makefile.extra_lib_dirs += [diana_lib_dir, "/usr/lib", metlibs_lib_dir, qt_pkg_dir+"/lib"]
makefile.extra_lflags += ["-Wl,-rpath="+diana_lib_dir, "-Wl,-fPIC"]
makefile.extra_libs += ["miLogger", "coserver", "diana"]
makefile.generate()
output_dirs.append(output_dir)
# Update the metno package version.
diana_version = get_diana_version()
python_diana_version = get_python_diana_version()
if not diana_version or not python_diana_version:
sys.stderr.write("Failed to find version information for Diana (%s) "
"or python-diana (%s)\n" % (repr(diana_version),
repr(python_diana_version)))
sys.exit(1)
f = open("python/metno/versions.py", "w")
f.write('\ndiana_version = "%s"\npython_diana_version = "%s"\n' % (
diana_version, python_diana_version))
# Generate the top-level Makefile.
python_files = glob.glob(os.path.join("python", "metno", "*.py"))
sipconfig.ParentMakefile(
configuration = config,
subdirs = output_dirs,
installs = [(python_files, dest_pkg_dir)]
).generate()
sys.exit()
|
dboddie/python-diana
|
configure.py
|
Python
|
gpl-2.0
| 5,321 |
// SPDX-License-Identifier: GPL-2.0
#include "core/subsurface-string.h"
#include "qPrefDisplay.h"
#include "qPrefPrivate.h"
#include <QApplication>
#include <QFont>
static const QString group = QStringLiteral("Display");
QPointF qPrefDisplay::st_tooltip_position;
static const QPointF st_tooltip_position_default = QPointF(0,0);
QString qPrefDisplay::st_lastDir;
static const QString st_lastDir_default = "";
QString qPrefDisplay::st_theme;
static const QString st_theme_default = "Blue";
QString qPrefDisplay::st_userSurvey;
static const QString st_userSurvey_default = "";
QByteArray qPrefDisplay::st_mainSplitter;
static const QByteArray st_mainSplitter_default = "";
QByteArray qPrefDisplay::st_topSplitter;
static const QByteArray st_topSplitter_default = "";
QByteArray qPrefDisplay::st_bottomSplitter;
static const QByteArray st_bottomSplitter_default = "";
bool qPrefDisplay::st_maximized;
static bool st_maximized_default = false;
QByteArray qPrefDisplay::st_geometry;
static const QByteArray st_geometry_default = 0;
QByteArray qPrefDisplay::st_windowState;
static const QByteArray st_windowState_default = 0;
int qPrefDisplay::st_lastState;
static int st_lastState_default = false;
qPrefDisplay::qPrefDisplay(QObject *parent) : QObject(parent)
{
}
qPrefDisplay *qPrefDisplay::instance()
{
static qPrefDisplay *self = new qPrefDisplay;
return self;
}
void qPrefDisplay::loadSync(bool doSync)
{
disk_animation_speed(doSync);
disk_divelist_font(doSync);
disk_font_size(doSync);
disk_mobile_scale(doSync);
disk_display_invalid_dives(doSync);
disk_show_developer(doSync);
if (!doSync) {
load_tooltip_position();
load_theme();
load_userSurvey();
load_mainSplitter();
load_topSplitter();
load_bottomSplitter();
load_maximized();
load_geometry();
load_windowState();
load_lastState();
}
}
void qPrefDisplay::set_divelist_font(const QString &value)
{
QString newValue = value;
if (value.contains(","))
newValue = value.left(value.indexOf(","));
if (newValue != prefs.divelist_font &&
!subsurface_ignore_font(qPrintable(newValue))) {
qPrefPrivate::copy_txt(&prefs.divelist_font, value);
disk_divelist_font(true);
qApp->setFont(QFont(newValue));
emit instance()->divelist_fontChanged(value);
}
}
void qPrefDisplay::disk_divelist_font(bool doSync)
{
if (doSync)
qPrefPrivate::propSetValue(keyFromGroupAndName(group, "divelist_font"), prefs.divelist_font, default_prefs.divelist_font);
else
setCorrectFont();
}
void qPrefDisplay::set_font_size(double value)
{
if (!IS_FP_SAME(value, prefs.font_size)) {
prefs.font_size = value;
disk_font_size(true);
QFont defaultFont = qApp->font();
defaultFont.setPointSizeF(prefs.font_size * prefs.mobile_scale);
qApp->setFont(defaultFont);
emit instance()->font_sizeChanged(value);
}
}
void qPrefDisplay::disk_font_size(bool doSync)
{
// inverted logic compared to the other disk_xxx functions
if (!doSync)
setCorrectFont();
#if !defined(SUBSURFACE_MOBILE)
// we never want to save the font_size to disk - we always want to grab that from the system default
else
qPrefPrivate::propSetValue(keyFromGroupAndName(group, "font_size"), prefs.font_size, default_prefs.font_size);
#endif
}
void qPrefDisplay::set_mobile_scale(double value)
{
if (!IS_FP_SAME(value, prefs.mobile_scale)) {
prefs.mobile_scale = value;
disk_mobile_scale(true);
QFont defaultFont = qApp->font();
defaultFont.setPointSizeF(prefs.font_size * prefs.mobile_scale);
qApp->setFont(defaultFont);
emit instance()->mobile_scaleChanged(value);
emit instance()->font_sizeChanged(value);
}
}
void qPrefDisplay::disk_mobile_scale(bool doSync)
{
if (doSync) {
qPrefPrivate::propSetValue(keyFromGroupAndName(group, "mobile_scale"), prefs.mobile_scale, default_prefs.mobile_scale);
} else {
prefs.mobile_scale = qPrefPrivate::propValue(keyFromGroupAndName(group, "mobile_scale"), default_prefs.mobile_scale).toDouble();
setCorrectFont();
}
}
//JAN static const QString group = QStringLiteral("Animations");
HANDLE_PREFERENCE_INT(Display, "animation_speed", animation_speed);
HANDLE_PREFERENCE_BOOL(Display, "displayinvalid", display_invalid_dives);
HANDLE_PREFERENCE_BOOL(Display, "show_developer", show_developer);
void qPrefDisplay::setCorrectFont()
{
// get the font from the settings or our defaults
// respect the system default font size if none is explicitly set
QFont defaultFont = qPrefPrivate::propValue(keyFromGroupAndName(group, "divelist_font"), prefs.divelist_font).value<QFont>();
if (IS_FP_SAME(system_divelist_default_font_size, -1.0)) {
prefs.font_size = qApp->font().pointSizeF();
system_divelist_default_font_size = prefs.font_size; // this way we don't save it on exit
}
prefs.font_size = qPrefPrivate::propValue(keyFromGroupAndName(group, "font_size"), prefs.font_size).toFloat();
// painful effort to ignore previous default fonts on Windows - ridiculous
QString fontName = defaultFont.toString();
if (fontName.contains(","))
fontName = fontName.left(fontName.indexOf(","));
if (subsurface_ignore_font(qPrintable(fontName))) {
defaultFont = QFont(prefs.divelist_font);
} else {
free((void *)prefs.divelist_font);
prefs.divelist_font = copy_qstring(fontName);
}
defaultFont.setPointSizeF(prefs.font_size * prefs.mobile_scale);
qApp->setFont(defaultFont);
prefs.display_invalid_dives = qPrefPrivate::propValue(keyFromGroupAndName(group, "displayinvalid"), default_prefs.display_invalid_dives).toBool();
}
HANDLE_PROP_QSTRING(Display, "FileDialog/LastDir", lastDir);
HANDLE_PROP_QSTRING(Display, "Theme/currentTheme", theme);
HANDLE_PROP_QPOINTF(Display, "ProfileMap/tooltip_position", tooltip_position);
HANDLE_PROP_QSTRING(Display, "UserSurvey/SurveyDone", userSurvey);
HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/mainSplitter", mainSplitter);
HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/topSplitter", topSplitter);
HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/bottomSplitter", bottomSplitter);
HANDLE_PROP_BOOL(Display, "MainWindow/maximized", maximized);
HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/geometry", geometry);
HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/windowState", windowState);
HANDLE_PROP_INT(Display, "MainWindow/lastState", lastState);
|
dirkhh/subsurface
|
core/settings/qPrefDisplay.cpp
|
C++
|
gpl-2.0
| 6,241 |
from datetime import datetime
from flask import current_app
from flask.cli import with_appcontext
from invenio_db import db
from hepdata.cli import fix
from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords
from hepdata.modules.submission.models import HEPSubmission, DataSubmission
from hepdata.modules.records.utils.common import get_record_by_id
from hepdata.modules.records.utils.doi_minter import generate_doi_for_table
from hepdata.modules.records.utils.submission import finalise_datasubmission
@fix.command()
@with_appcontext
def create_missing_datasubmission_records():
# Get submissions with missing IDs
missing_submissions = DataSubmission.query \
.join(HEPSubmission, HEPSubmission.publication_recid == DataSubmission.publication_recid) \
.filter(
DataSubmission.associated_recid == None,
DataSubmission.publication_inspire_id == None,
DataSubmission.version == HEPSubmission.version,
HEPSubmission.overall_status == 'finished')
missing_submissions = missing_submissions.all()
if not missing_submissions:
print("No datasubmissions found with missing record or inspire ids.")
return
# Organise missing submissions by publication
submissions_by_publication = {}
for submission in missing_submissions:
if submission.publication_recid in submissions_by_publication:
submissions_by_publication[submission.publication_recid].append(submission)
else:
submissions_by_publication[submission.publication_recid] = [submission]
# Loop through each publication
for publication_recid, submissions in submissions_by_publication.items():
publication_record = get_record_by_id(publication_recid)
current_time = "{:%Y-%m-%d %H:%M:%S}".format(datetime.utcnow())
generated_record_ids = []
for submission in submissions:
# Finalise each data submission that does not have a record
finalise_datasubmission(current_time, {},
generated_record_ids,
publication_record, publication_recid,
submission,
submission.version)
# Register the datasubmission's DOI
if not current_app.config.get('TESTING', False):
generate_doi_for_table.delay(submission.doi)
print(f"Generated DOI {submission.doi}")
else:
print(f"Would generate DOI {submission.doi}")
# finalise_datasubmission does not commit, so commit once for each publication
db.session.commit()
# Reindex the publication and its updated datasubmissions
index_record_ids([publication_recid] + generated_record_ids)
push_data_keywords(pub_ids=[publication_recid])
|
HEPData/hepdata3
|
fixes/missing_record_ids.py
|
Python
|
gpl-2.0
| 2,910 |
/*
Core.css for Mocha UI
Theme: Default
Copyright:
Copyright (c) 2007-2009 Greg Houston, <http://greghoustondesign.com/>.
License:
MIT-style license.
Required by:
Layout.js
*/
/* Layout
---------------------------------------------------------------- */
html, body {
background: #fff;
}
body {
margin: 0; /* Required */
}
#desktop {
position: relative;
min-width: 400px; /* Helps keep header content from wrapping */
height: 100%;
min-height: 100%;
overflow: hidden;
cursor: default; /* Fix for issue in IE7. IE7 wants to use the I-bar text cursor */
}
#desktopHeader {
background: #f2f2f2;
}
#desktopTitlebarWrapper {
position: relative;
height: 45px;
overflow: hidden;
background: #718BA6 url(../images/skin/bg-header.gif) repeat-x;
}
#desktopTitlebar {
padding: 7px 8px 6px 8px;
height: 32px;
background: url(../images/skin/logo.gif) no-repeat;
background-position: left 0;
}
#desktopTitlebar h1.applicationTitle {
display: none;
margin: 0;
padding: 0 5px 0 0;
font-size: 20px;
line-height: 25px;
font-weight: bold;
color: #fff;
}
#desktopTitlebar h2.tagline {
padding: 7px 0 0 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #d4dce4;
font-weight: bold;
text-align: center;
text-transform: uppercase;
}
#desktopTitlebar h2.tagline .taglineEm {
color: #fff;
font-weight: bold;
}
#topNav {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
position: absolute;
right: 0;
top: 0;
color: #d4dce4;
text-align: right;
padding: 13px 10px 0 0;
}
#topNav a {
color: #fff;
font-weight: normal;
}
#topNav a:hover {
text-decoration: none;
}
/* Navbar */
#desktopNavbar {
background: #f2f2f2;
/*height: 30px;*/
margin: 0 0px;
overflow: hidden; /* Remove this line if you want the menu to be backward compatible with Firefox 2 */
/* Fixes by Chris */
/*background-color: #ccc;*/
height: 20px;
margin-bottom: 5px;
border-bottom: 1px solid #3f3f3f;
}
#desktopNavbar ul {
padding: 0;
margin: 0;
list-style: none;
font-size: 12px;
}
#desktopNavbar li {
float: left;
}
#desktopNavbar a {
display: block;
}
#desktopNavbar ul li a {
/*padding: 6px 10px 6px 10px;*/
color: #333;
font-weight: normal;
/* Fix by Chris */
padding: 2px 10px 6px 10px;
}
#desktopNavbar ul li a:hover {
color: #333;
/* Fix By Chris */
background-color: #fff;
}
#desktopNavbar ul li a.arrow-right, #desktopNavbar ul li a:hover.arrow-right {
background-image: url(../images/skin/arrow-right.gif);
background-repeat: no-repeat;
background-position: right 7px;
}
#desktopNavbar li ul {
padding: 2px;
border: 1px solid #3f3f3f;
background: #fff url(../images/skin/bg-dropdown.gif) repeat-y;
position: absolute;
width: 164px;
left: -999em;
z-index: 8000;
/* Fix by Chris */
margin-top: -6px;
}
#desktopNavbar li:hover ul ul,
#desktopNavbar li.ieHover ul ul,
#desktopNavbar li:hover ul ul ul,
#desktopNavbar li.ieHover ul ul ul {
left: -999em;
}
#desktopNavbar li ul ul { /* third-and-above-level lists */
margin: -22px 0 0 163px;
}
#desktopNavbar li ul li .check {
position: absolute;
top: 8px;
left: 6px;
width: 5px;
height: 5px;
background: #555;
overflow: hidden;
line-height: 1px;
font-size: 1px;
}
#desktopNavbar li ul li a {
position: relative;
/*padding: 1px 9px 1px 25px;*/
width: 130px;
color: #3f3f3f;
font-weight: normal;
/* Fix By Chris */
padding: 1px 9px 1px 20px; /* Reduce left padding */
}
#desktopNavbar li ul li a:hover {
background: #6C98D9;
color: #fff;
-moz-border-radius: 2px;
}
#desktopNavbar li ul li a:hover .check {
background: #fff;
}
#desktopNavbar li:hover ul,
#desktopNavbar li.ieHover ul,
#desktopNavbar li li.ieHover ul,
#desktopNavbar li li li.ieHover ul,
#desktopNavbar li li:hover ul,
#desktopNavbar li li li:hover ul { /* lists nested under hovered list items */
left: auto;
}
#desktopNavbar li:hover { /* For IE7 */
position: static;
}
li.divider {
margin-top: 2px;
padding-top: 3px;
border-top: 1px solid #ebebeb;
}
#pageWrapper {
position: relative;
overflow: hidden; /* This can be set to hidden or auto */
border-top: 1px solid #909090;
border-bottom: 1px solid #909090;
/*height: 100%;*/
}
/* Footer */
#desktopFooterWrapper {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 30px;
overflow: hidden;
}
#desktopFooter {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
height: 24px;
padding: 6px 8px 0 8px;
background: #f2f2f2;
}
/* Panel Layout
---------------------------------------------------------------- */
/* Columns */
.column {
position: relative;
float: left;
overflow: hidden; /* Required by IE6 */
}
/* Panels */
.panel {
position: relative;
overflow: auto;
background: #f8f8f8;
border-bottom: 1px solid #b9b9b9;
}
.panelWrapper.collapsed .panel-header {
border-bottom: 0;
}
.panelAlt {
background: #f2f2f2;
}
.bottomPanel {
border-bottom: 0;
}
.pad {
padding: 8px;
}
#mainPanel {
background: #fff;
}
.panel-header {
position: relative;
background: #f1f1f1 url(../images/skin/bg-panel-header.gif) repeat-x;
height: 30px;
overflow: hidden;
border-bottom: 1px solid #d3d3d3;
}
.panel-headerContent {
padding-top: 2px;
}
.panel-headerContent.tabs {
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left -68px;
}
.panel-header h2 {
display: inline-block;
font-size: 12px;
margin: 0;
padding: 3px 8px 0 8px;
height: 22px;
overflow: hidden;
color: #333;
}
.panel-collapse {
background: url(../images/skin/collapse-expand.gif) left top no-repeat;
}
.panel-expand {
background: url(../images/skin/collapse-expand.gif) left -16px no-repeat;
}
.icon16 {
margin: 4px 0 0 2px;
cursor: pointer;
}
/* Column and Panel Handles */
.horizontalHandle {
height: 4px;
line-height: 1px;
font-size: 1px;
overflow: hidden;
background: #eee url(../images/skin/bg-handle-horizontal.gif) repeat-x;
}
.horizontalHandle.detached .handleIcon {
background: transparent;
}
.horizontalHandle .handleIcon {
margin: 0 auto;
height: 4px;
line-height: 1px;
font-size: 1px;
overflow: hidden;
background: url(../images/skin/handle-icon-horizontal.gif) center center no-repeat;
}
.columnHandle {
min-height: 10px;
float: left;
width: 4px;
overflow: hidden;
background: #c3c3c3 url(../images/skin/handle-icon.gif) center center no-repeat;
border: 1px solid #909090;
border-top: 0;
border-bottom: 0;
}
/* Toolboxes */
.toolbox {
float: right;
margin-top: 3px;
padding: 0 5px;
height: 24px;
overflow: hidden;
text-align: right;
}
.panel-header-toolbox {
}
div.toolbox.divider { /* Have to specify div here for IE6's sake */
background: url(../images/skin/toolbox-divider.gif) repeat-y;
padding-left: 8px;
}
.toolbox img.disabled {
cursor: default;
}
.iconWrapper {
display: inline-block;
height: 22px;
min-width: 22px;
overflow: hidden;
border: 1px solid transparent;
}
* html .iconWrapper {
padding: 1px;
border: 0;
}
.iconWrapper img {
cursor: pointer;
margin: 0;
padding: 3px;
}
.iconWrapper:hover {
border: 1px solid #a0a0a0;
-moz-border-radius: 3px;
}
#spinnerWrapper {
width: 16px;
height: 16px;
background: url(../images/skin/spinner-placeholder.gif) no-repeat;
margin: 4px 5px 0 5px;
}
#spinner {
display: none;
background: url(../images/skin/spinner.gif) no-repeat;
width: 16px;
height: 16px;
}
|
pmzqla/qBittorrent
|
src/webui/www/public/css/Layout.css
|
CSS
|
gpl-2.0
| 7,846 |
/******************************************************************************
*
* rawverse.cpp - code for class 'RawVerse'- a module that reads raw text
* files: ot and nt using indexs ??.bks ??.cps ??.vss
* and provides lookup and parsing functions based on
* class VerseKey
*
* $Id$
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
*
* 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 version 2.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*/
#include <ctype.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <utilstr.h>
#include <rawverse.h>
#include <versekey.h>
#include <sysdata.h>
#include <filemgr.h>
#include <swbuf.h>
SWORD_NAMESPACE_START
/******************************************************************************
* RawVerse Statics
*/
int RawVerse::instance = 0;
const char RawVerse::nl = '\n';
/******************************************************************************
* RawVerse Constructor - Initializes data for instance of RawVerse
*
* ENT: ipath - path of the directory where data and index files are located.
* be sure to include the trailing separator (e.g. '/' or '\')
* (e.g. 'modules/texts/rawtext/webster/')
*/
RawVerse::RawVerse(const char *ipath, int fileMode)
{
SWBuf buf;
path = 0;
stdstr(&path, ipath);
if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '\\'))
path[strlen(path)-1] = 0;
if (fileMode == -1) { // try read/write if possible
fileMode = FileMgr::RDWR;
}
buf.setFormatted("%s/ot.vss", path);
idxfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
buf.setFormatted("%s/nt.vss", path);
idxfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
buf.setFormatted("%s/ot", path);
textfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
buf.setFormatted("%s/nt", path);
textfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true);
instance++;
}
/******************************************************************************
* RawVerse Destructor - Cleans up instance of RawVerse
*/
RawVerse::~RawVerse()
{
int loop1;
if (path)
delete [] path;
--instance;
for (loop1 = 0; loop1 < 2; loop1++) {
FileMgr::getSystemFileMgr()->close(idxfp[loop1]);
FileMgr::getSystemFileMgr()->close(textfp[loop1]);
}
}
/******************************************************************************
* RawVerse::findoffset - Finds the offset of the key verse from the indexes
*
* ENT: testmt - testament to find (0 - Bible/module introduction)
* idxoff - offset into .vss
* start - address to store the starting offset
* size - address to store the size of the entry
*/
void RawVerse::findOffset(char testmt, long idxoff, long *start, unsigned short *size) const {
idxoff *= 6;
if (!testmt)
testmt = ((idxfp[1]) ? 1:2);
if (idxfp[testmt-1]->getFd() >= 0) {
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
__s32 tmpStart;
__u16 tmpSize;
idxfp[testmt-1]->read(&tmpStart, 4);
long len = idxfp[testmt-1]->read(&tmpSize, 2); // read size
*start = swordtoarch32(tmpStart);
*size = swordtoarch16(tmpSize);
if (len < 2) {
*size = (unsigned short)((*start) ? (textfp[testmt-1]->seek(0, SEEK_END) - (long)*start) : 0); // if for some reason we get an error reading size, make size to end of file
}
}
else {
*start = 0;
*size = 0;
}
}
/******************************************************************************
* RawVerse::readtext - gets text at a given offset
*
* ENT: testmt - testament file to search in (0 - Old; 1 - New)
* start - starting offset where the text is located in the file
* size - size of text entry + 2 (null)(null)
* buf - buffer to store text
*
*/
void RawVerse::readText(char testmt, long start, unsigned short size, SWBuf &buf) const {
buf = "";
buf.setFillByte(0);
buf.setSize(size + 1);
if (!testmt)
testmt = ((idxfp[1]) ? 1:2);
if (size) {
if (textfp[testmt-1]->getFd() >= 0) {
textfp[testmt-1]->seek(start, SEEK_SET);
textfp[testmt-1]->read(buf.getRawData(), (int)size);
}
}
}
/******************************************************************************
* RawVerse::settext - Sets text for current offset
*
* ENT: testmt - testament to find (0 - Bible/module introduction)
* idxoff - offset into .vss
* buf - buffer to store
* len - length of buffer (0 - null terminated)
*/
void RawVerse::doSetText(char testmt, long idxoff, const char *buf, long len)
{
__s32 start;
__u16 size;
idxoff *= 6;
if (!testmt)
testmt = ((idxfp[1]) ? 1:2);
size = (len < 0) ? strlen(buf) : len;
start = (__s32)textfp[testmt-1]->seek(0, SEEK_END);
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
if (size) {
textfp[testmt-1]->seek(start, SEEK_SET);
textfp[testmt-1]->write(buf, (int)size);
// add a new line to make data file easier to read in an editor
textfp[testmt-1]->write(&nl, 1);
}
else {
start = 0;
}
start = archtosword32(start);
size = archtosword16(size);
idxfp[testmt-1]->write(&start, 4);
idxfp[testmt-1]->write(&size, 2);
}
/******************************************************************************
* RawVerse::linkentry - links one entry to another
*
* ENT: testmt - testament to find (0 - Bible/module introduction)
* destidxoff - dest offset into .vss
* srcidxoff - source offset into .vss
*/
void RawVerse::doLinkEntry(char testmt, long destidxoff, long srcidxoff) {
__s32 start;
__u16 size;
destidxoff *= 6;
srcidxoff *= 6;
if (!testmt)
testmt = ((idxfp[1]) ? 1:2);
// get source
idxfp[testmt-1]->seek(srcidxoff, SEEK_SET);
idxfp[testmt-1]->read(&start, 4);
idxfp[testmt-1]->read(&size, 2);
// write dest
idxfp[testmt-1]->seek(destidxoff, SEEK_SET);
idxfp[testmt-1]->write(&start, 4);
idxfp[testmt-1]->write(&size, 2);
}
/******************************************************************************
* RawVerse::createModule - Creates new module files
*
* ENT: path - directory to store module files
* RET: error status
*/
char RawVerse::createModule(const char *ipath, const char *v11n)
{
char *path = 0;
char *buf = new char [ strlen (ipath) + 20 ];
FileDesc *fd, *fd2;
stdstr(&path, ipath);
if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '\\'))
path[strlen(path)-1] = 0;
sprintf(buf, "%s/ot", path);
FileMgr::removeFile(buf);
fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
fd->getFd();
FileMgr::getSystemFileMgr()->close(fd);
sprintf(buf, "%s/nt", path);
FileMgr::removeFile(buf);
fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
fd->getFd();
FileMgr::getSystemFileMgr()->close(fd);
sprintf(buf, "%s/ot.vss", path);
FileMgr::removeFile(buf);
fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
fd->getFd();
sprintf(buf, "%s/nt.vss", path);
FileMgr::removeFile(buf);
fd2 = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
fd2->getFd();
VerseKey vk;
vk.setVersificationSystem(v11n);
vk.setIntros(1);
__s32 offset = 0;
__u16 size = 0;
offset = archtosword32(offset);
size = archtosword16(size);
for (vk = TOP; !vk.popError(); vk++) {
if (vk.getTestament() < 2) {
fd->write(&offset, 4);
fd->write(&size, 2);
}
else {
fd2->write(&offset, 4);
fd2->write(&size, 2);
}
}
fd2->write(&offset, 4);
fd2->write(&size, 2);
FileMgr::getSystemFileMgr()->close(fd);
FileMgr::getSystemFileMgr()->close(fd2);
delete [] path;
delete [] buf;
return 0;
}
SWORD_NAMESPACE_END
|
greg-hellings/sword
|
src/modules/common/rawverse.cpp
|
C++
|
gpl-2.0
| 8,079 |
// KinematicObjectSphereConstraint.h
//
// Breannan Smith
// Last updated: 09/16/2015
#ifndef KINEMATIC_OBJECT_SPHERE_CONSTRAINT_H
#define KINEMATIC_OBJECT_SPHERE_CONSTRAINT_H
#include "scisim/Constraints/Constraint.h"
class KinematicObjectSphereConstraint final : public Constraint
{
public:
// sphere_idx: index of sphere
// r: radius of sphere
// n: collision normal
// kinematic_index: index of the kinematic body
// X: center of mass of kinematic object
// V: velocity of kinematic object
// omega: angular velocity of kinematic object
KinematicObjectSphereConstraint( const unsigned sphere_idx, const scalar& r, const Vector3s& n, const unsigned kinematic_index, const Vector3s& X, const Vector3s& V, const Vector3s& omega );
virtual ~KinematicObjectSphereConstraint() override;
// Inherited from Constraint
virtual scalar evalNdotV( const VectorXs& q, const VectorXs& v ) const override;
virtual void evalgradg( const VectorXs& q, const int col, SparseMatrixsc& G, const FlowableSystem& fsys ) const override;
virtual void computeGeneralizedFrictionGivenTangentSample( const VectorXs& q, const VectorXs& t, const unsigned column, SparseMatrixsc& D ) const override;
virtual int impactStencilSize() const override;
virtual int frictionStencilSize() const override;
virtual void getSimulatedBodyIndices( std::pair<int,int>& bodies ) const override;
virtual void getBodyIndices( std::pair<int,int>& bodies ) const override;
virtual void evalKinematicNormalRelVel( const VectorXs& q, const int strt_idx, VectorXs& gdotN ) const override;
virtual void evalH( const VectorXs& q, const MatrixXXsc& basis, MatrixXXsc& H0, MatrixXXsc& H1 ) const override;
virtual bool conservesTranslationalMomentum() const override;
virtual bool conservesAngularMomentumUnderImpact() const override;
virtual bool conservesAngularMomentumUnderImpactAndFriction() const override;
virtual std::string name() const override;
// For binary force output
virtual void getWorldSpaceContactPoint( const VectorXs& q, VectorXs& contact_point ) const override;
virtual void getWorldSpaceContactNormal( const VectorXs& q, VectorXs& contact_normal ) const override;
unsigned sphereIdx() const;
private:
virtual void computeContactBasis( const VectorXs& q, const VectorXs& v, MatrixXXsc& basis ) const override;
virtual VectorXs computeRelativeVelocity( const VectorXs& q, const VectorXs& v ) const override;
virtual void setBodyIndex0( const unsigned idx ) override;
virtual VectorXs computeKinematicRelativeVelocity( const VectorXs& q, const VectorXs& v ) const override;
//Vector3s computeKinematicCollisionPointVelocity( const VectorXs& q ) const;
// Index of the colliding sphere
unsigned m_sphere_idx;
// Sphere's radius
const scalar m_r;
// Normal to prevent penetration along
const Vector3s m_n;
// Index of the kinematic body
const unsigned m_kinematic_index;
// Center of the kinematic object
const Vector3s m_X;
// Translational velocity of the kinematic object
const Vector3s m_V;
// Rotational velocity of the kinematic object
const Vector3s m_omega;
};
#endif
|
horzelski/scisim
|
rigidbody3d/Constraints/KinematicObjectSphereConstraint.h
|
C
|
gpl-2.0
| 3,156 |
#pragma once
#ifndef __TRINITY_UPDATEFIELDFLAGS_H__
#define __TRINITY_UPDATEFIELDFLAGS_H__
#include "UpdateFieldFlags.h"
// Auto generated for version 17359
// > Object
uint32 ObjectUpdateFieldFlags[OBJECT_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
};
// > Object > Item
uint32 ItemUpdateFieldFlags[ITEM_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // ITEM_FIELD_OWNER
UF_FLAG_PUBLIC, // ITEM_FIELD_OWNER
UF_FLAG_PUBLIC, // ITEM_FIELD_CONTAINED_IN
UF_FLAG_PUBLIC, // ITEM_FIELD_CONTAINED_IN
UF_FLAG_PUBLIC, // ITEM_FIELD_CREATOR
UF_FLAG_PUBLIC, // ITEM_FIELD_CREATOR
UF_FLAG_PUBLIC, // ITEM_FIELD_GIFT_CREATOR
UF_FLAG_PUBLIC, // ITEM_FIELD_GIFT_CREATOR
UF_FLAG_OWNER, // ITEM_FIELD_STACK_COUNT
UF_FLAG_OWNER, // ITEM_FIELD_EXPIRATION
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_PUBLIC, // ITEM_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_PROPERTY_SEED
UF_FLAG_PUBLIC, // ITEM_FIELD_RANDOM_PROPERTIES_ID
UF_FLAG_OWNER, // ITEM_FIELD_DURABILITY
UF_FLAG_OWNER, // ITEM_FIELD_MAX_DURABILITY
UF_FLAG_PUBLIC, // ITEM_FIELD_CREATE_PLAYED_TIME
UF_FLAG_OWNER, // ITEM_FIELD_MODIFIERS_MASK
};
// > Object > Item > Container
uint32 ContainerUpdateFieldFlags[CONTAINER_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // ITEM_FIELD_OWNER
UF_FLAG_PUBLIC, // ITEM_FIELD_OWNER
UF_FLAG_PUBLIC, // ITEM_FIELD_CONTAINED_IN
UF_FLAG_PUBLIC, // ITEM_FIELD_CONTAINED_IN
UF_FLAG_PUBLIC, // ITEM_FIELD_CREATOR
UF_FLAG_PUBLIC, // ITEM_FIELD_CREATOR
UF_FLAG_PUBLIC, // ITEM_FIELD_GIFT_CREATOR
UF_FLAG_PUBLIC, // ITEM_FIELD_GIFT_CREATOR
UF_FLAG_OWNER, // ITEM_FIELD_STACK_COUNT
UF_FLAG_OWNER, // ITEM_FIELD_EXPIRATION
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_OWNER, // ITEM_FIELD_SPELL_CHARGES
UF_FLAG_PUBLIC, // ITEM_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_ENCHANTMENT
UF_FLAG_PUBLIC, // ITEM_FIELD_PROPERTY_SEED
UF_FLAG_PUBLIC, // ITEM_FIELD_RANDOM_PROPERTIES_ID
UF_FLAG_OWNER, // ITEM_FIELD_DURABILITY
UF_FLAG_OWNER, // ITEM_FIELD_MAX_DURABILITY
UF_FLAG_PUBLIC, // ITEM_FIELD_CREATE_PLAYED_TIME
UF_FLAG_OWNER, // ITEM_FIELD_MODIFIERS_MASK
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_SLOTS
UF_FLAG_PUBLIC, // CONTAINER_FIELD_NUM_SLOTS
};
// > Object > Unit
uint32 UnitUpdateFieldFlags[UNIT_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_PUBLIC | UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARM
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARM
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMON
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMON
UF_FLAG_PRIVATE, // UNIT_FIELD_CRITTER
UF_FLAG_PRIVATE, // UNIT_FIELD_CRITTER
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARMED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARMED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_DEMON_CREATOR
UF_FLAG_PUBLIC, // UNIT_FIELD_DEMON_CREATOR
UF_FLAG_PUBLIC, // UNIT_FIELD_TARGET
UF_FLAG_PUBLIC, // UNIT_FIELD_TARGET
UF_FLAG_PUBLIC, // UNIT_FIELD_BATTLE_PET_COMPANION_GUID
UF_FLAG_PUBLIC, // UNIT_FIELD_BATTLE_PET_COMPANION_GUID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_CHANNEL_OBJECT
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_CHANNEL_OBJECT
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_CHANNEL_SPELL
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONED_BY_HOME_REALM
UF_FLAG_PUBLIC, // UNIT_FIELD_SEX
UF_FLAG_PUBLIC, // UNIT_FIELD_DISPLAY_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_HEALTH
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_HEALTH
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PUBLIC, // UNIT_FIELD_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_EFFECTIVE_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_FACTION_TEMPLATE
UF_FLAG_PUBLIC, // UNIT_FIELD_VIRTUAL_ITEM_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_VIRTUAL_ITEM_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_VIRTUAL_ITEM_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_FLAGS
UF_FLAG_PUBLIC, // UNIT_FIELD_FLAGS2
UF_FLAG_PUBLIC, // UNIT_FIELD_AURA_STATE
UF_FLAG_PUBLIC, // UNIT_FIELD_ATTACK_ROUND_BASE_TIME
UF_FLAG_PUBLIC, // UNIT_FIELD_ATTACK_ROUND_BASE_TIME
UF_FLAG_PRIVATE, // UNIT_FIELD_RANGED_ATTACK_ROUND_BASE_TIME
UF_FLAG_PUBLIC, // UNIT_FIELD_BOUNDING_RADIUS
UF_FLAG_PUBLIC, // UNIT_FIELD_COMBAT_REACH
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // UNIT_FIELD_DISPLAY_ID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_NATIVE_DISPLAY_ID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_MOUNT_DISPLAY_ID
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MIN_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MAX_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MIN_OFF_HAND_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MAX_OFF_HAND_DAMAGE
UF_FLAG_PUBLIC, // UNIT_FIELD_ANIM_TIER
UF_FLAG_PUBLIC, // UNIT_FIELD_PET_NUMBER
UF_FLAG_PUBLIC, // UNIT_FIELD_PET_NAME_TIMESTAMP
UF_FLAG_OWNER, // UNIT_FIELD_PET_EXPERIENCE
UF_FLAG_OWNER, // UNIT_FIELD_PET_NEXT_LEVEL_EXPERIENCE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_CASTING_SPEED
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_SPELL_HASTE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_HASTE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_RANGED_HASTE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_HASTE_REGEN
UF_FLAG_PUBLIC, // UNIT_FIELD_CREATED_BY_SPELL
UF_FLAG_PUBLIC | UF_FLAG_VIEWER_DEPENDENT, // UNIT_FIELD_NPC_FLAGS
UF_FLAG_PUBLIC, // UNIT_FIELD_NPC_FLAGS
UF_FLAG_PUBLIC, // UNIT_FIELD_EMOTE_STATE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PUBLIC, // UNIT_FIELD_BASE_MANA
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_BASE_HEALTH
UF_FLAG_PUBLIC, // UNIT_FIELD_SHAPESHIFT_FORM
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MOD_POS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MOD_NEG
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MIN_RANGED_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MAX_RANGED_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MAX_HEALTH_MODIFIER
UF_FLAG_PUBLIC, // UNIT_FIELD_HOVER_HEIGHT
UF_FLAG_PUBLIC, // UNIT_FIELD_MIN_ITEM_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_ITEM_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_WILD_BATTLE_PET_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_BATTLE_PET_COMPANION_NAME_TIMESTAMP
UF_FLAG_PUBLIC, // UNIT_FIELD_INTERACT_SPELL_ID
};
// > Object > Unit > Player
uint32 PlayerUpdateFieldFlags[PLAYER_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_PUBLIC | UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARM
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARM
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMON
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMON
UF_FLAG_PRIVATE, // UNIT_FIELD_CRITTER
UF_FLAG_PRIVATE, // UNIT_FIELD_CRITTER
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARMED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_CHARMED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // UNIT_FIELD_DEMON_CREATOR
UF_FLAG_PUBLIC, // UNIT_FIELD_DEMON_CREATOR
UF_FLAG_PUBLIC, // UNIT_FIELD_TARGET
UF_FLAG_PUBLIC, // UNIT_FIELD_TARGET
UF_FLAG_PUBLIC, // UNIT_FIELD_BATTLE_PET_COMPANION_GUID
UF_FLAG_PUBLIC, // UNIT_FIELD_BATTLE_PET_COMPANION_GUID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_CHANNEL_OBJECT
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_CHANNEL_OBJECT
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_CHANNEL_SPELL
UF_FLAG_PUBLIC, // UNIT_FIELD_SUMMONED_BY_HOME_REALM
UF_FLAG_PUBLIC, // UNIT_FIELD_SEX
UF_FLAG_PUBLIC, // UNIT_FIELD_DISPLAY_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_HEALTH
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_HEALTH
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_POWER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_ALL_UNITS, // UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
UF_FLAG_PUBLIC, // UNIT_FIELD_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_EFFECTIVE_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_FACTION_TEMPLATE
UF_FLAG_PUBLIC, // UNIT_FIELD_VIRTUAL_ITEM_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_VIRTUAL_ITEM_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_VIRTUAL_ITEM_ID
UF_FLAG_PUBLIC, // UNIT_FIELD_FLAGS
UF_FLAG_PUBLIC, // UNIT_FIELD_FLAGS2
UF_FLAG_PUBLIC, // UNIT_FIELD_AURA_STATE
UF_FLAG_PUBLIC, // UNIT_FIELD_ATTACK_ROUND_BASE_TIME
UF_FLAG_PUBLIC, // UNIT_FIELD_ATTACK_ROUND_BASE_TIME
UF_FLAG_PRIVATE, // UNIT_FIELD_RANGED_ATTACK_ROUND_BASE_TIME
UF_FLAG_PUBLIC, // UNIT_FIELD_BOUNDING_RADIUS
UF_FLAG_PUBLIC, // UNIT_FIELD_COMBAT_REACH
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // UNIT_FIELD_DISPLAY_ID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_NATIVE_DISPLAY_ID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // UNIT_FIELD_MOUNT_DISPLAY_ID
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MIN_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MAX_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MIN_OFF_HAND_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_MAX_OFF_HAND_DAMAGE
UF_FLAG_PUBLIC, // UNIT_FIELD_ANIM_TIER
UF_FLAG_PUBLIC, // UNIT_FIELD_PET_NUMBER
UF_FLAG_PUBLIC, // UNIT_FIELD_PET_NAME_TIMESTAMP
UF_FLAG_OWNER, // UNIT_FIELD_PET_EXPERIENCE
UF_FLAG_OWNER, // UNIT_FIELD_PET_NEXT_LEVEL_EXPERIENCE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_CASTING_SPEED
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_SPELL_HASTE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_HASTE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_RANGED_HASTE
UF_FLAG_PUBLIC, // UNIT_FIELD_MOD_HASTE_REGEN
UF_FLAG_PUBLIC, // UNIT_FIELD_CREATED_BY_SPELL
UF_FLAG_PUBLIC | UF_FLAG_VIEWER_DEPENDENT, // UNIT_FIELD_NPC_FLAGS
UF_FLAG_PUBLIC, // UNIT_FIELD_NPC_FLAGS
UF_FLAG_PUBLIC, // UNIT_FIELD_EMOTE_STATE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STATS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_POS_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_STAT_NEG_BUFF
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER | UF_FLAG_EMPATH, // UNIT_FIELD_RESISTANCES
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
UF_FLAG_PUBLIC, // UNIT_FIELD_BASE_MANA
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_BASE_HEALTH
UF_FLAG_PUBLIC, // UNIT_FIELD_SHAPESHIFT_FORM
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MOD_POS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MOD_NEG
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_ATTACK_POWER_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MIN_RANGED_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MAX_RANGED_DAMAGE
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MODIFIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_POWER_COST_MULTIPLIER
UF_FLAG_PRIVATE | UF_FLAG_OWNER, // UNIT_FIELD_MAX_HEALTH_MODIFIER
UF_FLAG_PUBLIC, // UNIT_FIELD_HOVER_HEIGHT
UF_FLAG_PUBLIC, // UNIT_FIELD_MIN_ITEM_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_MAX_ITEM_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_WILD_BATTLE_PET_LEVEL
UF_FLAG_PUBLIC, // UNIT_FIELD_BATTLE_PET_COMPANION_NAME_TIMESTAMP
UF_FLAG_PUBLIC, // UNIT_FIELD_INTERACT_SPELL_ID
UF_FLAG_PUBLIC, // PLAYER_FIELD_DUEL_ARBITER
UF_FLAG_PUBLIC, // PLAYER_FIELD_DUEL_ARBITER
UF_FLAG_PUBLIC, // PLAYER_FIELD_PLAYER_FLAGS
UF_FLAG_PUBLIC, // PLAYER_FIELD_GUILD_RANK_ID
UF_FLAG_PUBLIC, // PLAYER_FIELD_GUILD_DELETE_DATE
UF_FLAG_PUBLIC, // PLAYER_FIELD_GUILD_LEVEL
UF_FLAG_PUBLIC, // PLAYER_FIELD_HAIR_COLOR_ID
UF_FLAG_PUBLIC, // PLAYER_FIELD_REST_STATE
UF_FLAG_PUBLIC, // PLAYER_FIELD_ARENA_FACTION
UF_FLAG_PUBLIC, // PLAYER_FIELD_DUEL_TEAM
UF_FLAG_PUBLIC, // PLAYER_FIELD_GUILD_TIME_STAMP
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PARTY_MEMBER, // PLAYER_FIELD_QUEST_LOG
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_VISIBLE_ITEMS
UF_FLAG_PUBLIC, // PLAYER_FIELD_PLAYER_TITLE
UF_FLAG_PUBLIC, // PLAYER_FIELD_FAKE_INEBRIATION
UF_FLAG_PUBLIC, // PLAYER_FIELD_VIRTUAL_PLAYER_REALM
UF_FLAG_PUBLIC, // PLAYER_FIELD_CURRENT_SPEC_ID
UF_FLAG_PUBLIC, // PLAYER_FIELD_TAXI_MOUNT_ANIM_KIT_ID
UF_FLAG_PUBLIC, // PLAYER_FIELD_CURRENT_BATTLE_PET_BREED_QUALITY
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_INV_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_FARSIGHT_OBJECT
UF_FLAG_PRIVATE, // PLAYER_FIELD_FARSIGHT_OBJECT
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_KNOWN_TITLES
UF_FLAG_PRIVATE, // PLAYER_FIELD_COINAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_COINAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_XP
UF_FLAG_PRIVATE, // PLAYER_FIELD_NEXT_LEVEL_XP
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_SKILL
UF_FLAG_PRIVATE, // PLAYER_FIELD_CHARACTER_POINTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MAX_TALENT_TIERS
UF_FLAG_PRIVATE, // PLAYER_FIELD_TRACK_CREATURE_MASK
UF_FLAG_PRIVATE, // PLAYER_FIELD_TRACK_RESOURCE_MASK
UF_FLAG_PRIVATE, // PLAYER_FIELD_MAINHAND_EXPERTISE
UF_FLAG_PRIVATE, // PLAYER_FIELD_OFFHAND_EXPERTISE
UF_FLAG_PRIVATE, // PLAYER_FIELD_RANGED_EXPERTISE
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATING_EXPERTISE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BLOCK_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_DODGE_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_PARRY_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_RANGED_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SHIELD_BLOCK
UF_FLAG_PRIVATE, // PLAYER_FIELD_SHIELD_BLOCK_CRIT_PERCENTAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_MASTERY
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_POWER_DAMAGE
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_POWER_HEALING
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_EXPLORED_ZONES
UF_FLAG_PRIVATE, // PLAYER_FIELD_REST_STATE_BONUS_POOL
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_DAMAGE_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_HEALING_DONE_POS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_HEALING_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_HEALING_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_PERIODIC_HEALING_DONE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS
UF_FLAG_PRIVATE, // PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS
UF_FLAG_PRIVATE, // PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_SPELL_POWER_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_RESILIENCE_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_APPERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_OVERRIDE_APBY_SPELL_POWER_PERCENT
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_TARGET_RESISTANCE
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE
UF_FLAG_PRIVATE, // PLAYER_FIELD_LIFETIME_MAX_RANK
UF_FLAG_PRIVATE, // PLAYER_FIELD_SELF_RES_SPELL
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_MEDALS
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_PRICE
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_BUYBACK_TIMESTAMP
UF_FLAG_PRIVATE, // PLAYER_FIELD_YESTERDAY_HONORABLE_KILLS
UF_FLAG_PRIVATE, // PLAYER_FIELD_LIFETIME_HONORABLE_KILLS
UF_FLAG_PRIVATE, // PLAYER_FIELD_WATCHED_FACTION_INDEX
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_COMBAT_RATINGS
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_PVP_INFO
UF_FLAG_PRIVATE, // PLAYER_FIELD_MAX_LEVEL
UF_FLAG_PRIVATE, // PLAYER_FIELD_RUNE_REGEN
UF_FLAG_PRIVATE, // PLAYER_FIELD_RUNE_REGEN
UF_FLAG_PRIVATE, // PLAYER_FIELD_RUNE_REGEN
UF_FLAG_PRIVATE, // PLAYER_FIELD_RUNE_REGEN
UF_FLAG_PRIVATE, // PLAYER_FIELD_NO_REAGENT_COST_MASK
UF_FLAG_PRIVATE, // PLAYER_FIELD_NO_REAGENT_COST_MASK
UF_FLAG_PRIVATE, // PLAYER_FIELD_NO_REAGENT_COST_MASK
UF_FLAG_PRIVATE, // PLAYER_FIELD_NO_REAGENT_COST_MASK
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPHS
UF_FLAG_PRIVATE, // PLAYER_FIELD_GLYPH_SLOTS_ENABLED
UF_FLAG_PRIVATE, // PLAYER_FIELD_PET_SPELL_POWER
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_RESEARCHING
UF_FLAG_PRIVATE, // PLAYER_FIELD_PROFESSION_SKILL_LINE
UF_FLAG_PRIVATE, // PLAYER_FIELD_PROFESSION_SKILL_LINE
UF_FLAG_PRIVATE, // PLAYER_FIELD_UI_HIT_MODIFIER
UF_FLAG_PRIVATE, // PLAYER_FIELD_UI_SPELL_HIT_MODIFIER
UF_FLAG_PRIVATE, // PLAYER_FIELD_HOME_REALM_TIME_OFFSET
UF_FLAG_PRIVATE, // PLAYER_FIELD_MOD_PET_HASTE
UF_FLAG_PRIVATE, // PLAYER_FIELD_SUMMONED_BATTLE_PET_GUID
UF_FLAG_PRIVATE, // PLAYER_FIELD_SUMMONED_BATTLE_PET_GUID
UF_FLAG_PRIVATE | UF_FLAG_URGENT_SELF_ONLY, // PLAYER_FIELD_OVERRIDE_SPELLS_ID
UF_FLAG_PRIVATE, // PLAYER_FIELD_LFG_BONUS_FACTION_ID
UF_FLAG_PRIVATE, // PLAYER_FIELD_LOOT_SPEC_ID
UF_FLAG_PRIVATE | UF_FLAG_URGENT_SELF_ONLY, // PLAYER_FIELD_OVERRIDE_ZONE_PVPTYPE
UF_FLAG_PRIVATE, // PLAYER_FIELD_ITEM_LEVEL_DELTA
};
// > Object > GameObject
uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_DISPLAY_ID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // GAMEOBJECT_FIELD_FLAGS
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_PARENT_ROTATION
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_PARENT_ROTATION
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_PARENT_ROTATION
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_PARENT_ROTATION
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_FACTION_TEMPLATE
UF_FLAG_PUBLIC, // GAMEOBJECT_FIELD_LEVEL
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // GAMEOBJECT_FIELD_PERCENT_HEALTH
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // GAMEOBJECT_FIELD_STATE_SPELL_VISUAL_ID
};
// > Object > DynamicObject
uint32 DynamicObjectUpdateFieldFlags[DYNAMICOBJECT_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // DYNAMICOBJECT_FIELD_CASTER
UF_FLAG_PUBLIC, // DYNAMICOBJECT_FIELD_CASTER
UF_FLAG_VIEWER_DEPENDENT, // DYNAMICOBJECT_FIELD_TYPE_AND_VISUAL_ID
UF_FLAG_PUBLIC, // DYNAMICOBJECT_FIELD_SPELL_ID
UF_FLAG_PUBLIC, // DYNAMICOBJECT_FIELD_RADIUS
UF_FLAG_PUBLIC, // DYNAMICOBJECT_FIELD_CAST_TIME
};
// > Object > Corpse
uint32 CorpseUpdateFieldFlags[CORPSE_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // CORPSE_FIELD_OWNER
UF_FLAG_PUBLIC, // CORPSE_FIELD_OWNER
UF_FLAG_PUBLIC, // CORPSE_FIELD_PARTY_GUID
UF_FLAG_PUBLIC, // CORPSE_FIELD_PARTY_GUID
UF_FLAG_PUBLIC, // CORPSE_FIELD_DISPLAY_ID
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_ITEMS
UF_FLAG_PUBLIC, // CORPSE_FIELD_SKIN_ID
UF_FLAG_PUBLIC, // CORPSE_FIELD_FACIAL_HAIR_STYLE_ID
UF_FLAG_PUBLIC, // CORPSE_FIELD_FLAGS
UF_FLAG_VIEWER_DEPENDENT, // CORPSE_FIELD_DYNAMIC_FLAGS
};
// > Object > AreaTrigger
uint32 AreaTriggerUpdateFieldFlags[AREATRIGGER_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // AREATRIGGER_FIELD_CASTER
UF_FLAG_PUBLIC, // AREATRIGGER_FIELD_CASTER
UF_FLAG_PUBLIC, // AREATRIGGER_FIELD_DURATION
UF_FLAG_PUBLIC, // AREATRIGGER_FIELD_SPELL_ID
UF_FLAG_VIEWER_DEPENDENT, // AREATRIGGER_FIELD_SPELL_VISUAL_ID
UF_FLAG_PUBLIC | UF_FLAG_URGENT, // AREATRIGGER_FIELD_EXPLICIT_SCALE
};
// > Object > SceneObject
uint32 SceneObjectUpdateFieldFlags[SCENE_END] =
{
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_GUID
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_DATA
UF_FLAG_PUBLIC, // OBJECT_FIELD_TYPE
UF_FLAG_VIEWER_DEPENDENT, // OBJECT_FIELD_ENTRY_ID
UF_FLAG_VIEWER_DEPENDENT | UF_FLAG_URGENT, // OBJECT_FIELD_DYNAMIC_FLAGS
UF_FLAG_PUBLIC, // OBJECT_FIELD_SCALE
UF_FLAG_PUBLIC, // SCENEOBJECT_FIELD_SCRIPT_PACKAGE_ID
UF_FLAG_PUBLIC, // SCENEOBJECT_FIELD_RND_SEED_VAL
UF_FLAG_PUBLIC, // SCENEOBJECT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // SCENEOBJECT_FIELD_CREATED_BY
UF_FLAG_PUBLIC, // SCENEOBJECT_FIELD_SCENE_TYPE
};
#endif
|
CaffCore/5.4.0.17399
|
src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp
|
C++
|
gpl-2.0
| 126,099 |
package gitmad.bitter.ui;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import gitmad.bitter.R;
import gitmad.bitter.model.Comment;
import gitmad.bitter.model.User;
import java.util.Map;
/**
* Created by prabh on 10/19/2015.
*/
public class CommentAdapter extends ArrayAdapter<Comment> {
private Comment[] comments;
private Map<Comment, User> commentAuthors;
public CommentAdapter(Context context, Comment[] comments, Map<Comment,
User> commentAuthors) {
super(context, 0, comments); // TODO is the zero here correct?
this.comments = comments;
this.commentAuthors = commentAuthors;
}
public View getView(int position, View convertView, ViewGroup parent) {
Comment comment = comments[position];
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout
.view_comment, parent, false);
}
TextView userText = (TextView) convertView.findViewById(R.id.user_text);
TextView commentText = (TextView) convertView.findViewById(R.id
.comment_text);
userText.setText(commentAuthors.get(comment).getName());
commentText.setText(comment.getText());
return convertView;
}
}
|
nareddyt/Bitter
|
app/src/main/java/gitmad/bitter/ui/CommentAdapter.java
|
Java
|
gpl-2.0
| 1,425 |
<?php
if (!defined ('UPDRAFTPLUS_DIR')) die('No direct access allowed');
// Admin-area code lives here. This gets called in admin_menu, earlier than admin_init
global $updraftplus_admin;
if (!is_a($updraftplus_admin, 'UpdraftPlus_Admin')) $updraftplus_admin = new UpdraftPlus_Admin();
class UpdraftPlus_Admin {
public $logged = array();
public function __construct() {
$this->admin_init();
}
private function setup_all_admin_notices_global($service){
if ('googledrive' === $service || (is_array($service) && in_array('googledrive', $service))) {
$opts = UpdraftPlus_Options::get_updraft_option('updraft_googledrive');
if (empty($opts)) {
$clientid = UpdraftPlus_Options::get_updraft_option('updraft_googledrive_clientid', '');
$token = UpdraftPlus_Options::get_updraft_option('updraft_googledrive_token', '');
} else {
$clientid = $opts['clientid'];
$token = (empty($opts['token'])) ? '' : $opts['token'];
}
if (!empty($clientid) && empty($token)) add_action('all_admin_notices', array($this,'show_admin_warning_googledrive'));
}
if ('googlecloud' === $service || (is_array($service) && in_array('googlecloud', $service))) {
$opts = UpdraftPlus_Options::get_updraft_option('updraft_googlecloud');
if (!empty($opts)) {
$clientid = $opts['clientid'];
$token = (empty($opts['token'])) ? '' : $opts['token'];
}
if (!empty($clientid) && empty($token)) add_action('all_admin_notices', array($this,'show_admin_warning_googlecloud'));
}
if ('dropbox' === $service || (is_array($service) && in_array('dropbox', $service))) {
$opts = UpdraftPlus_Options::get_updraft_option('updraft_dropbox');
if (empty($opts['tk_request_token'])) {
add_action('all_admin_notices', array($this,'show_admin_warning_dropbox') );
}
}
if ('bitcasa' === $service || (is_array($service) && in_array('bitcasa', $service))) {
$opts = UpdraftPlus_Options::get_updraft_option('updraft_bitcasa');
if (!empty($opts['clientid']) && !empty($opts['secret']) && empty($opts['token'])) add_action('all_admin_notices', array($this,'show_admin_warning_bitcasa') );
}
if ('copycom' === $service || (is_array($service) && in_array('copycom', $service))) {
$opts = UpdraftPlus_Options::get_updraft_option('updraft_copycom');
if (!empty($opts['clientid']) && !empty($opts['secret']) && empty($opts['token'])) add_action('all_admin_notices', array($this,'show_admin_warning_copycom') );
}
if ('onedrive' === $service || (is_array($service) && in_array('onedrive', $service))) {
$opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive');
if (!empty($opts['clientid']) && !empty($opts['secret']) && empty($opts['refresh_token'])) add_action('all_admin_notices', array($this,'show_admin_warning_onedrive') );
}
if ('updraftvault' === $service || (is_array($service) && in_array('updraftvault', $service))) {
$vault_settings = UpdraftPlus_Options::get_updraft_option('updraft_updraftvault');
$connected = (is_array($vault_settings) && !empty($vault_settings['token']) && !empty($vault_settings['email'])) ? true : false;
if (!$connected) add_action('all_admin_notices', array($this,'show_admin_warning_updraftvault') );
}
if ($this->disk_space_check(1048576*35) === false) add_action('all_admin_notices', array($this, 'show_admin_warning_diskspace'));
}
private function setup_all_admin_notices_udonly($service, $override = false){
global $wp_version;
if (UpdraftPlus_Options::user_can_manage() && defined('DISABLE_WP_CRON') && DISABLE_WP_CRON == true) {
add_action('all_admin_notices', array($this, 'show_admin_warning_disabledcron'));
}
if (UpdraftPlus_Options::get_updraft_option('updraft_debug_mode')) {
@ini_set('display_errors',1);
@error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
add_action('all_admin_notices', array($this, 'show_admin_debug_warning'));
}
if (null === UpdraftPlus_Options::get_updraft_option('updraft_interval')) {
add_action('all_admin_notices', array($this, 'show_admin_nosettings_warning'));
$this->no_settings_warning = true;
}
# Avoid false positives, by attempting to raise the limit (as happens when we actually do a backup)
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
$max_execution_time = (int)@ini_get('max_execution_time');
if ($max_execution_time>0 && $max_execution_time<20) {
add_action('all_admin_notices', array($this, 'show_admin_warning_execution_time'));
}
// LiteSpeed has a generic problem with terminating cron jobs
if (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false) {
if (!is_file(ABSPATH.'.htaccess') || !preg_match('/noabort/i', file_get_contents(ABSPATH.'.htaccess'))) {
add_action('all_admin_notices', array($this, 'show_admin_warning_litespeed'));
}
}
if (version_compare($wp_version, '3.2', '<')) add_action('all_admin_notices', array($this, 'show_admin_warning_wordpressversion'));
}
/*
private function reset_all_updraft_admin_notices() {
$actions_to_remove = array('show_admin_warning_googledrive', 'show_admin_warning_googlecloud', 'show_admin_warning_dropbox', 'show_admin_warning_bitcasa', 'show_admin_warning_copycom', 'show_admin_warning_onedrive', 'show_admin_warning_updraftvault', 'show_admin_warning_diskspace', 'show_admin_warning_disabledcron', 'show_admin_debug_warning', 'show_admin_warning_execution_time', 'show_admin_warning_litespeed', 'show_admin_warning_wordpressversion');
foreach ($actions_to_remove as $action) {
remove_action('all_admin_notices', $action);
}
}
*/
//Used to output the information for the next scheduled backup
//**// moved to function for the ajax saves
private function next_scheduled_backups_output() {
// UNIX timestamp
$next_scheduled_backup = wp_next_scheduled('updraft_backup');
if ($next_scheduled_backup) {
// Convert to GMT
$next_scheduled_backup_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup);
// Convert to blog time zone
$next_scheduled_backup = get_date_from_gmt($next_scheduled_backup_gmt, 'D, F j, Y H:i');
// $next_scheduled_backup = date_i18n('D, F j, Y H:i', $next_scheduled_backup);
} else {
$next_scheduled_backup = __('Nothing currently scheduled', 'updraftplus');
$files_not_scheduled = true;
}
$next_scheduled_backup_database = wp_next_scheduled('updraft_backup_database');
if (UpdraftPlus_Options::get_updraft_option('updraft_interval_database',UpdraftPlus_Options::get_updraft_option('updraft_interval')) == UpdraftPlus_Options::get_updraft_option('updraft_interval')) {
if (isset($files_not_scheduled)) {
$next_scheduled_backup_database = $next_scheduled_backup;
$database_not_scheduled = true;
} else {
$next_scheduled_backup_database = __("At the same time as the files backup", 'updraftplus');
$next_scheduled_backup_database_same_time = true;
}
} else {
if ($next_scheduled_backup_database) {
// Convert to GMT
$next_scheduled_backup_database_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup_database);
// Convert to blog time zone
$next_scheduled_backup_database = get_date_from_gmt($next_scheduled_backup_database_gmt, 'D, F j, Y H:i');
// $next_scheduled_backup_database = date_i18n('D, F j, Y H:i', $next_scheduled_backup_database);
} else {
$next_scheduled_backup_database = __('Nothing currently scheduled', 'updraftplus');
$database_not_scheduled = true;
}
}
?>
<tr>
<?php if (isset($files_not_scheduled) && isset($database_not_scheduled)) { ?>
<td colspan="2" class="not-scheduled"><?php _e('Nothing currently scheduled','updraftplus'); ?></td>
<?php } else { ?>
<td class="updraft_scheduled"><?php echo empty($next_scheduled_backup_database_same_time) ? __('Files','updraftplus') : __('Files and database', 'updraftplus'); ?>:</td><td class="updraft_all-files"><?php echo $next_scheduled_backup; ?></td>
</tr>
<?php if (empty($next_scheduled_backup_database_same_time)) { ?>
<tr>
<td class="updraft_scheduled"><?php _e('Database','updraftplus');?>: </td><td class="updraft_all-files"><?php echo $next_scheduled_backup_database; ?></td>
</tr>
<?php } ?>
<?php
}
}
private function admin_init() {
add_action('core_upgrade_preamble', array($this, 'core_upgrade_preamble'));
add_action('admin_action_upgrade-plugin', array($this, 'admin_action_upgrade_pluginortheme'));
add_action('admin_action_upgrade-theme', array($this, 'admin_action_upgrade_pluginortheme'));
add_action('admin_head', array($this,'admin_head'));
add_filter((is_multisite() ? 'network_admin_' : '').'plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
add_action('wp_ajax_updraft_download_backup', array($this, 'updraft_download_backup'));
add_action('wp_ajax_updraft_ajax', array($this, 'updraft_ajax_handler'));
add_action('wp_ajax_updraft_ajaxrestore', array($this, 'updraft_ajaxrestore'));
add_action('wp_ajax_nopriv_updraft_ajaxrestore', array($this, 'updraft_ajaxrestore'));
add_action('wp_ajax_plupload_action', array($this, 'plupload_action'));
add_action('wp_ajax_plupload_action2', array($this, 'plupload_action2'));
add_action('wp_before_admin_bar_render', array($this, 'wp_before_admin_bar_render'));
// Add a new Ajax action for saving settings
add_action('wp_ajax_updraft_savesettings', array($this, 'updraft_ajax_savesettings'));
global $updraftplus, $wp_version, $pagenow;
add_filter('updraftplus_dirlist_others', array($updraftplus, 'backup_others_dirlist'));
add_filter('updraftplus_dirlist_uploads', array($updraftplus, 'backup_uploads_dirlist'));
// First, the checks that are on all (admin) pages:
$service = UpdraftPlus_Options::get_updraft_option('updraft_service');
if (UpdraftPlus_Options::user_can_manage()) {
$this->print_restore_in_progress_box_if_needed();
// Main dashboard page advert
// Since our nonce is printed, make sure they have sufficient credentials
if (!file_exists(UPDRAFTPLUS_DIR.'/udaddons') && $pagenow == 'index.php' && current_user_can('update_plugins')) {
$dismissed_until = UpdraftPlus_Options::get_updraft_option('updraftplus_dismisseddashnotice', 0);
$backup_dir = $updraftplus->backups_dir_location();
// N.B. Not an exact proxy for the installed time; they may have tweaked the expert option to move the directory
$installed = @filemtime($backup_dir.'/index.html');
$installed_for = time() - $installed;
if (($installed && time() > $dismissed_until && $installed_for > 28*86400 && !defined('UPDRAFTPLUS_NOADS_B')) || (defined('UPDRAFTPLUS_FORCE_DASHNOTICE') && UPDRAFTPLUS_FORCE_DASHNOTICE)) {
add_action('all_admin_notices', array($this, 'show_admin_notice_upgradead') );
}
}
//Moved out for use with Ajax saving
$this->setup_all_admin_notices_global($service);
}
// Next, the actions that only come on the UpdraftPlus page
if ($pagenow != UpdraftPlus_Options::admin_page() || empty($_REQUEST['page']) || 'updraftplus' != $_REQUEST['page']) return;
$this->setup_all_admin_notices_udonly($service);
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'), 99999);
}
public function updraft_ajaxrestore() {
// TODO: All needs testing with restricted filesystem permissions. Those credentials need to be POST-ed too - currently not.
// TODO
// error_log(serialize($_POST));
if (empty($_POST['subaction']) || 'restore' != $_POST['subaction']) {
echo json_encode(array('e' => 'Illegitimate data sent (0)'));
die();
}
if (empty($_POST['restorenonce'])) {
echo json_encode(array('e' => 'Illegitimate data sent (1)'));
die();
}
$restore_nonce = (string)$_POST['restorenonce'];
if (empty($_POST['ajaxauth'])) {
echo json_encode(array('e' => 'Illegitimate data sent (2)'));
die();
}
global $updraftplus;
$ajax_auth = get_site_option('updraft_ajax_restore_'.$restore_nonce);
if (!$ajax_auth) {
echo json_encode(array('e' => 'Illegitimate data sent (3)'));
die();
}
if (!preg_match('/^([0-9a-f]+):(\d+)/i', $ajax_auth, $matches)) {
echo json_encode(array('e' => 'Illegitimate data sent (4)'));
die();
}
$nonce_time = $matches[2];
$auth_code_sent = $matches[1];
if (time() > $nonce_time + 600) {
echo json_encode(array('e' => 'Illegitimate data sent (5)'));
die();
}
// TODO: Deactivate the auth code whilst the operation is underway
$last_one = empty($_POST['lastone']) ? false : true;
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
$updraftplus->backup_time_nonce($restore_nonce);
$updraftplus->logfile_open($restore_nonce);
$timestamp = empty($_POST['timestamp']) ? false : (int)$_POST['timestamp'];
$multisite = empty($_POST['multisite']) ? false : (bool)$_POST['multisite'];
$created_by_version = empty($_POST['created_by_version']) ? false : (int)$_POST['created_by_version'];
// TODO: We need to know about first_one (not yet sent), as well as last_one
// TODO: Verify the values of these
$type = empty($_POST['type']) ? false : (int)$_POST['type'];
$backupfile = empty($_POST['backupfile']) ? false : (string)$_POST['backupfile'];
$updraftplus->log("Deferred restore resumption: $type: $backupfile (timestamp=$timestamp, last_one=$last_one)");
$backupable_entities = $updraftplus->get_backupable_file_entities(true);
if (!isset($backupable_entities[$type])) {
echo json_encode(array('e' => 'Illegitimate data sent (6 - no such entity)', 'data' => $type));
die();
}
if ($last_one) {
// Remove the auth nonce from the DB to prevent abuse
delete_site_option('updraft_ajax_restore_'.$restore_nonce);
} else {
// Reset the counter after a successful operation
update_site_option('updraft_ajax_restore_'.$restore_nonce, $auth_code_sent.':'.time());
}
echo json_encode(array('e' => 'TODO', 'd' => $_POST));
die;
}
public function wp_before_admin_bar_render() {
global $wp_admin_bar;
if (!UpdraftPlus_Options::user_can_manage()) return;
if (defined('UPDRAFTPLUS_ADMINBAR_DISABLE') && UPDRAFTPLUS_ADMINBAR_DISABLE) return;
if (false == apply_filters('updraftplus_settings_page_render', true)) return;
$option_location = UpdraftPlus_Options::admin_page_url();
$args = array(
'id' => 'updraft_admin_node',
'title' => 'UpdraftPlus'
);
$wp_admin_bar->add_node($args);
$args = array(
'id' => 'updraft_admin_node_status',
'title' => __('Current Status', 'updraftplus').' / '.__('Backup Now', 'updraftplus'),
'parent' => 'updraft_admin_node',
'href' => $option_location.'?page=updraftplus&tab=status'
);
$wp_admin_bar->add_node($args);
$args = array(
'id' => 'updraft_admin_node_backups',
'title' => __('Existing Backups', 'updraftplus'),
'parent' => 'updraft_admin_node',
'href' => $option_location.'?page=updraftplus&tab=backups'
);
$wp_admin_bar->add_node($args);
$args = array(
'id' => 'updraft_admin_node_settings',
'title' => __('Settings', 'updraftplus'),
'parent' => 'updraft_admin_node',
'href' => $option_location.'?page=updraftplus&tab=settings'
);
$wp_admin_bar->add_node($args);
$args = array(
'id' => 'updraft_admin_node_expert_content',
'title' => __('Advanced Tools', 'updraftplus'),
'parent' => 'updraft_admin_node',
'href' => $option_location.'?page=updraftplus&tab=expert'
);
$wp_admin_bar->add_node($args);
$args = array(
'id' => 'updraft_admin_node_addons',
'title' => __('Extensions', 'updraftplus'),
'parent' => 'updraft_admin_node',
'href' => $option_location.'?page=updraftplus&tab=addons'
);
$wp_admin_bar->add_node($args);
global $updraftplus;
if (!$updraftplus->have_addons) {
$args = array(
'id' => 'updraft_admin_node_premium',
'title' => 'UpdraftPlus Premium',
'parent' => 'updraft_admin_node',
'href' => 'https://updraftplus.com/shop/updraftplus-premium/'
);
$wp_admin_bar->add_node($args);
}
}
// // Defeat other plugins/themes which dump their jQuery UI CSS onto our settings page
// public function style_loader_tag($link, $handle) {
// if ('jquery-ui' != $handle || false === strpos) return $link;
// return "<link rel='stylesheet' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n";
// }
public function show_admin_notice_upgradead() {
?>
<div id="updraft-dashnotice" class="updated">
<div style="float:right;"><a href="#" onclick="jQuery('#updraft-dashnotice').slideUp(); jQuery.post(ajaxurl, {action: 'updraft_ajax', subaction: 'dismissdashnotice', nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>' });"><?php echo sprintf(__('Dismiss (for %s months)', 'updraftplus'), 12); ?></a></div>
<h3 class="thank-you"><?php _e('Thank you for backing up with UpdraftPlus!', 'updraftplus');?></h3>
<a href="https://updraftplus.com/"><img class="udp-logo" alt="UpdraftPlus" src="<?php echo UPDRAFTPLUS_URL.'/images/ud-logo-150.png' ?>"></a>
<?php
echo '<p><strong>'.__('Free Newsletter', 'updraftplus').'</strong> <br>'.__('UpdraftPlus news, high-quality training materials for WordPress developers and site-owners, and general WordPress news. You can de-subscribe at any time.', 'updraftplus').' <a href="https://updraftplus.com/newsletter-signup">'.__('Follow this link to sign up.', 'updraftplus').'</a></p>';
echo '<p><strong>'.__('UpdraftPlus Premium', 'updraftplus').'</strong> <br>'.__('For personal support, the ability to copy sites, more storage destinations, encrypted backups for security, multiple backup destinations, better reporting, no adverts and plenty more, take a look at the premium version of UpdraftPlus - the world’s most popular backup plugin.', 'updraftplus').' <a href="https://updraftplus.com/comparison-updraftplus-free-updraftplus-premium/">'.__('Compare with the free version', 'updraftplus').'</a> / <a href="https://updraftplus.com/shop/updraftplus-premium/">'.__('Go to the shop.', 'updraftplus').'</a></p>';
echo '<p><strong>'.__('More Quality Plugins', 'updraftplus').'</strong> <br> <a href="https://wordpress.org/plugins/two-factor-authentication/">'.__('Free two-factor security plugin', 'updraftplus').'</a> | <a href="https://www.simbahosting.co.uk/s3/shop/">'.__('Premium WooCommerce plugins', 'updraftplus').'</a></p>';
?>
<div class="dismiss-dash-notice"><a href="#" onclick="jQuery('#updraft-dashnotice').slideUp(); jQuery.post(ajaxurl, {action: 'updraft_ajax', subaction: 'dismissdashnotice', nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>' });"><?php echo sprintf(__('Dismiss (for %s months)', 'updraftplus'), 12); ?></a></div>
</div>
<?php
}
private function ensure_sufficient_jquery_and_enqueue() {
global $updraftplus, $wp_version;
$enqueue_version = @constant('WP_DEBUG') ? $updraftplus->version.'-'.time() : $updraftplus->version;
if (version_compare($wp_version, '3.3', '<')) {
// Require a newer jQuery (3.2.1 has 1.6.1, so we go for something not too much newer). We use .on() in a way that is incompatible with < 1.7
wp_deregister_script('jquery');
wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', false, '1.7.2', false);
wp_enqueue_script('jquery');
// No plupload until 3.3
wp_enqueue_script('updraftplus-admin-ui', UPDRAFTPLUS_URL.'/includes/updraft-admin-ui.js', array('jquery', 'jquery-ui-dialog'), $enqueue_version, true);
} else {
wp_enqueue_script('updraftplus-admin-ui', UPDRAFTPLUS_URL.'/includes/updraft-admin-ui.js', array('jquery', 'jquery-ui-dialog', 'plupload-all'), $enqueue_version);
}
}
// This is also called directly from the auto-backup add-on
public function admin_enqueue_scripts() {
global $updraftplus, $wp_locale;
// Defeat other plugins/themes which dump their jQuery UI CSS onto our settings page
wp_deregister_style('jquery-ui');
wp_enqueue_style('jquery-ui', UPDRAFTPLUS_URL.'/includes/jquery-ui.custom.css', array(), '1.11.4');
$our_version = @constant('SCRIPT_DEBUG') ? $updraftplus->version.'.'.time() : $updraftplus->version;
wp_enqueue_style('updraft-admin-css', UPDRAFTPLUS_URL.'/css/admin.css', array(), $our_version);
// add_filter('style_loader_tag', array($this, 'style_loader_tag'), 10, 2);
$this->ensure_sufficient_jquery_and_enqueue();
wp_enqueue_script('jquery-blockui', UPDRAFTPLUS_URL.'/includes/jquery.blockUI.js', array('jquery'), '2.70.0');
wp_enqueue_script('jquery-labelauty', UPDRAFTPLUS_URL.'/includes/labelauty/jquery-labelauty.js', array('jquery'), '20160622-ud');
wp_enqueue_style('jquery-labelauty', UPDRAFTPLUS_URL.'/includes/labelauty/jquery-labelauty.css', array(), '20150925');
do_action('updraftplus_admin_enqueue_scripts');
$day_selector = '';
for ($day_index = 0; $day_index <= 6; $day_index++) {
// $selected = ($opt == $day_index) ? 'selected="selected"' : '';
$selected = '';
$day_selector .= "\n\t<option value='" . $day_index . "' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
}
$mday_selector = '';
for ($mday_index = 1; $mday_index <= 28; $mday_index++) {
// $selected = ($opt == $mday_index) ? 'selected="selected"' : '';
$selected = '';
$mday_selector .= "\n\t<option value='" . $mday_index . "' $selected>" . $mday_index . '</option>';
}
wp_localize_script('updraftplus-admin-ui', 'updraftlion', array(
'sendonlyonwarnings' => __('Send a report only when there are warnings/errors', 'updraftplus'),
'wholebackup' => __('When the Email storage method is enabled, also send the entire backup', 'updraftplus'),
'emailsizelimits' => esc_attr(sprintf(__('Be aware that mail servers tend to have size limits; typically around %s Mb; backups larger than any limits will likely not arrive.','updraftplus'), '10-20')),
'rescanning' => __('Rescanning (looking for backups that you have uploaded manually into the internal backup store)...','updraftplus'),
'rescanningremote' => __('Rescanning remote and local storage for backup sets...','updraftplus'),
'enteremailhere' => esc_attr(__('To send to more than one address, separate each address with a comma.', 'updraftplus')),
'excludedeverything' => __('If you exclude both the database and the files, then you have excluded everything!', 'updraftplus'),
'nofileschosen' => __('You have chosen to backup files, but no file entities have been selected', 'updraftplus'),
'restoreproceeding' => __('The restore operation has begun. Do not press stop or close your browser until it reports itself as having finished.', 'updraftplus'),
'unexpectedresponse' => __('Unexpected response:','updraftplus'),
'servererrorcode' => __('The web server returned an error code (try again, or check your web server logs)', 'updraftplus'),
'newuserpass' => __("The new user's RackSpace console password is (this will not be shown again):", 'updraftplus'),
'trying' => __('Trying...', 'updraftplus'),
'fetching' => __('Fetching...', 'updraftplus'),
'calculating' => __('calculating...','updraftplus'),
'begunlooking' => __('Begun looking for this entity','updraftplus'),
'stilldownloading' => __('Some files are still downloading or being processed - please wait.', 'updraftplus'),
'processing' => __('Processing files - please wait...', 'updraftplus'),
'emptyresponse' => __('Error: the server sent an empty response.', 'updraftplus'),
'warnings' => __('Warnings:','updraftplus'),
'errors' => __('Errors:','updraftplus'),
'jsonnotunderstood' => __('Error: the server sent us a response which we did not understand.', 'updraftplus'),
'errordata' => __('Error data:', 'updraftplus'),
'error' => __('Error:','updraftplus'),
'errornocolon' => __('Error','updraftplus'),
'fileready' => __('File ready.','updraftplus'),
'youshould' => __('You should:','updraftplus'),
'deletefromserver' => __('Delete from your web server','updraftplus'),
'downloadtocomputer' => __('Download to your computer','updraftplus'),
'andthen' => __('and then, if you wish,', 'updraftplus'),
'notunderstood' => __('Download error: the server sent us a response which we did not understand.', 'updraftplus'),
'requeststart' => __('Requesting start of backup...', 'updraftplus'),
'phpinfo' => __('PHP information', 'updraftplus'),
'delete_old_dirs' => __('Delete Old Directories', 'updraftplus'),
'raw' => __('Raw backup history', 'updraftplus'),
'notarchive' => __('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').' '.__('However, UpdraftPlus archives are standard zip/SQL files - so if you are sure that your file has the right format, then you can rename it to match that pattern.','updraftplus'),
'notarchive2' => '<p>'.__('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').'</p> '.apply_filters('updraftplus_if_foreign_then_premium_message', '<p><a href="https://updraftplus.com/shop/updraftplus-premium/">'.__('If this is a backup created by a different backup plugin, then UpdraftPlus Premium may be able to help you.', 'updraftplus').'</a></p>'),
'makesure' => __('(make sure that you were trying to upload a zip file previously created by UpdraftPlus)','updraftplus'),
'uploaderror' => __('Upload error:','updraftplus'),
'notdba' => __('This file does not appear to be an UpdraftPlus encrypted database archive (such files are .gz.crypt files which have a name like: backup_(time)_(site name)_(code)_db.crypt.gz).','updraftplus'),
'uploaderr' => __('Upload error', 'updraftplus'),
'followlink' => __('Follow this link to attempt decryption and download the database file to your computer.','updraftplus'),
'thiskey' => __('This decryption key will be attempted:','updraftplus'),
'unknownresp' => __('Unknown server response:','updraftplus'),
'ukrespstatus' => __('Unknown server response status:','updraftplus'),
'uploaded' => __('The file was uploaded.','updraftplus'),
'backupnow' => __('Backup Now', 'updraftplus'),
'cancel' => __('Cancel', 'updraftplus'),
'deletebutton' => __('Delete', 'updraftplus'),
'createbutton' => __('Create', 'updraftplus'),
'youdidnotselectany' => __('You did not select any components to restore. Please select at least one, and then try again.', 'updraftplus'),
'proceedwithupdate' => __('Proceed with update', 'updraftplus'),
'close' => __('Close', 'updraftplus'),
'restore' => __('Restore', 'updraftplus'),
'downloadlogfile' => __('Download log file', 'updraftplus'),
'automaticbackupbeforeupdate' => __('Automatic backup before update', 'updraftplus'),
'unsavedsettings' => __('You have made changes to your settings, and not saved.', 'updraftplus'),
'saving' => __('Saving...', 'updraftplus'),
'connect' => __('Connect', 'updraftplus'),
'connecting' => __('Connecting...', 'updraftplus'),
'disconnect' => __('Disconnect', 'updraftplus'),
'disconnecting' => __('Disconnecting...', 'updraftplus'),
'counting' => __('Counting...', 'updraftplus'),
'updatequotacount' => __('Update quota count', 'updraftplus'),
'addingsite' => __('Adding...', 'updraftplus'),
'addsite' => __('Add site', 'updraftplus'),
// 'resetting' => __('Resetting...', 'updraftplus'),
'creating' => __('Creating...', 'updraftplus'),
'sendtosite' => __('Send to site:', 'updraftplus'),
'checkrpcsetup' => sprintf(__('You should check that the remote site is online, not firewalled, does not have security modules that may be blocking access, has UpdraftPlus version %s or later active and that the keys have been entered correctly.', 'updraftplus'), '2.10.3'),
'pleasenamekey' => __('Please give this key a name (e.g. indicate the site it is for):', 'updraftplus'),
'key' => __('Key', 'updraftplus'),
'nokeynamegiven' => sprintf(__("Failure: No %s was given.",'updraftplus'), __('key name','updraftplus')),
'deleting' => __('Deleting...', 'updraftplus'),
'enter_mothership_url' => __('Please enter a valid URL', 'updraftplus'),
'delete_response_not_understood' => __("We requested to delete the file, but could not understand the server's response", 'updraftplus'),
'testingconnection' => __('Testing connection...', 'updraftplus'),
'send' => __('Send', 'updraftplus'),
'migratemodalheight' => class_exists('UpdraftPlus_Addons_Migrator') ? 555 : 300,
'migratemodalwidth' => class_exists('UpdraftPlus_Addons_Migrator') ? 770 : 500,
'download' => _x('Download', '(verb)', 'updraftplus'),
'unsavedsettingsbackup' => __('You have made changes to your settings, and not saved.', 'updraftplus')."\n".__('You should save your changes to ensure that they are used for making your backup.','updraftplus'),
'dayselector' => $day_selector,
'mdayselector' => $mday_selector,
'day' => __('day', 'updraftplus'),
'inthemonth' => __('in the month', 'updraftplus'),
'days' => __('day(s)', 'updraftplus'),
'hours' => __('hour(s)', 'updraftplus'),
'weeks' => __('week(s)', 'updraftplus'),
'forbackupsolderthan' => __('For backups older than', 'updraftplus'),
'ud_url' => UPDRAFTPLUS_URL,
'processing' => __('Processing...', 'updraftplus'),
'pleasefillinrequired' => __('Please fill in the required information.', 'updraftplus'),
'test_settings' => __('Test %s Settings', 'updraftplus'),
'testing_settings' => __('Testing %s Settings...', 'updraftplus'),
'settings_test_result' => __('%s settings test result:', 'updraftplus'),
'nothing_yet_logged' => __('Nothing yet logged', 'updraftplus'),
) );
}
// Despite the name, this fires irrespective of what capabilities the user has (even none - so be careful)
public function core_upgrade_preamble() {
// They need to be able to perform backups, and to perform updates
if (!UpdraftPlus_Options::user_can_manage() || (!current_user_can('update_core') && !current_user_can('update_plugins') && !current_user_can('update_themes'))) return;
if (!class_exists('UpdraftPlus_Addon_Autobackup')) {
if (defined('UPDRAFTPLUS_NOADS_B')) return;
$dismissed_until = UpdraftPlus_Options::get_updraft_option('updraftplus_dismissedautobackup', 0);
if ($dismissed_until > time()) return;
}
?>
<div id="updraft-autobackup" class="updated autobackup">
<?php if (!class_exists('UpdraftPlus_Addon_Autobackup')) { ?>
<div style="float:right;"><a href="#" onclick="jQuery('#updraft-autobackup').slideUp(); jQuery.post(ajaxurl, {action: 'updraft_ajax', subaction: 'dismissautobackup', nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>' });"><?php echo sprintf(__('Dismiss (for %s weeks)', 'updraftplus'), 12); ?></a></div> <?php } ?>
<h3 style="margin-top: 2px;"><?php _e('Be safe with an automatic backup','updraftplus');?></h3>
<?php echo apply_filters('updraftplus_autobackup_blurb', $this->autobackup_ad_content()); ?>
</div>
<script>
jQuery(document).ready(function() {
jQuery('#updraft-autobackup').appendTo('.wrap p:first');
});
</script>
<?php
}
private function autobackup_ad_content(){
global $updraftplus;
$our_version = @constant('SCRIPT_DEBUG') ? $updraftplus->version.'.'.time() : $updraftplus->version;
wp_enqueue_style('updraft-admin-css', UPDRAFTPLUS_URL.'/css/admin.css', array(), $our_version);
$ret = '<div class="autobackup-description"><img class="autobackup-image" src="'.UPDRAFTPLUS_URL.'/images/automaticbackup.png" class="automation-icon"/>';
$ret .= '<div class="advert-description">'.__('UpdraftPlus Premium can automatically take a backup of your plugins or themes and database before you update. <a href="https://updraftplus.com/shop/autobackup/" target="_blank">Be safe every time, without needing to remember - follow this link to learn more</a>', 'updraftplus').'</div></div>';
$ret .= '<div class="advert-btn"><a href="https://updraftplus.com/shop/autobackup/" class="btn btn-get-started">'.__('Just this add-on', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
$ret .= '<div class="advert-btn"><a href="https://updraftplus.com/shop/updraftplus-premium/" class="btn btn-get-started">'.__('Full Premium plugin', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
return $ret;
}
public function admin_head() {
global $pagenow;
if ($pagenow != UpdraftPlus_Options::admin_page() || !isset($_REQUEST['page']) || 'updraftplus' != $_REQUEST['page'] || !UpdraftPlus_Options::user_can_manage()) return;
$chunk_size = min(wp_max_upload_size()-1024, 1048576*2);
# The multiple_queues argument is ignored in plupload 2.x (WP3.9+) - http://make.wordpress.org/core/2014/04/11/plupload-2-x-in-wordpress-3-9/
# max_file_size is also in filters as of plupload 2.x, but in its default position is still supported for backwards-compatibility. Likewise, our use of filters.extensions below is supported by a backwards-compatibility option (the current way is filters.mime-types.extensions
$plupload_init = array(
'runtimes' => 'html5,flash,silverlight,html4',
'browse_button' => 'plupload-browse-button',
'container' => 'plupload-upload-ui',
'drop_element' => 'drag-drop-area',
'file_data_name' => 'async-upload',
'multiple_queues' => true,
'max_file_size' => '100Gb',
'chunk_size' => $chunk_size.'b',
'url' => admin_url('admin-ajax.php', 'relative'),
'multipart' => true,
'multi_selection' => true,
'urlstream_upload' => true,
// additional post data to send to our ajax hook
'multipart_params' => array(
'_ajax_nonce' => wp_create_nonce('updraft-uploader'),
'action' => 'plupload_action'
)
);
// 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
// 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
// We want to receive -db files also...
// if (1) {
// $plupload_init['filters'] = array(array('title' => __('Allowed Files'), 'extensions' => 'zip,tar,gz,bz2,crypt,sql,txt'));
// } else {
// }
# WP 3.9 updated to plupload 2.0 - https://core.trac.wordpress.org/ticket/25663
if (is_file(ABSPATH.WPINC.'/js/plupload/Moxie.swf')) {
$plupload_init['flash_swf_url'] = includes_url('js/plupload/Moxie.swf');
} else {
$plupload_init['flash_swf_url'] = includes_url('js/plupload/plupload.flash.swf');
}
if (is_file(ABSPATH.WPINC.'/js/plupload/Moxie.xap')) {
$plupload_init['silverlight_xap_url'] = includes_url('js/plupload/Moxie.xap');
} else {
$plupload_init['silverlight_xap_url'] = includes_url('js/plupload/plupload.silverlight.swf');
}
?><script type="text/javascript">
var updraft_credentialtest_nonce='<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>';
var updraftplus_settings_nonce='<?php echo wp_create_nonce('updraftplus-settings-nonce');?>';
var updraft_siteurl = '<?php echo esc_js(site_url('', 'relative'));?>';
var updraft_plupload_config=<?php echo json_encode($plupload_init); ?>;
var updraft_download_nonce='<?php echo wp_create_nonce('updraftplus_download');?>';
var updraft_accept_archivename = <?php echo apply_filters('updraftplus_accept_archivename_js', "[]");?>;
<?php
$plupload_init['browse_button'] = 'plupload-browse-button2';
$plupload_init['container'] = 'plupload-upload-ui2';
$plupload_init['drop_element'] = 'drag-drop-area2';
$plupload_init['multipart_params']['action'] = 'plupload_action2';
$plupload_init['filters'] = array(array('title' => __('Allowed Files'), 'extensions' => 'crypt'));
?>
var updraft_plupload_config2=<?php echo json_encode($plupload_init); ?>;
var updraft_downloader_nonce = '<?php wp_create_nonce("updraftplus_download"); ?>'
<?php
$overdue = $this->howmany_overdue_crons();
if ($overdue >= 4) { ?>
jQuery(document).ready(function(){
setTimeout(function(){updraft_check_overduecrons();}, 11000);
function updraft_check_overduecrons() {
jQuery.get(ajaxurl, { action: 'updraft_ajax', subaction: 'checkoverduecrons', nonce: updraft_credentialtest_nonce }, function(data, response) {
if ('success' == response) {
try {
resp = jQuery.parseJSON(data);
if (resp.m) {
jQuery('#updraft-insert-admin-warning').html(resp.m);
}
} catch(err) {
console.log(data);
}
}
});
}
});
<?php } ?>
</script>
<?php
}
private function disk_space_check($space) {
global $updraftplus;
$updraft_dir = $updraftplus->backups_dir_location();
$disk_free_space = @disk_free_space($updraft_dir);
if ($disk_free_space == false) return -1;
return ($disk_free_space > $space) ? true : false;
}
# Adds the settings link under the plugin on the plugin screen.
public function plugin_action_links($links, $file) {
if (is_array($links) && $file == 'updraftplus/updraftplus.php'){
$settings_link = '<a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__("Settings", "updraftplus").'</a>';
array_unshift($links, $settings_link);
// $settings_link = '<a href="http://david.dw-perspective.org.uk/donate">'.__("Donate","UpdraftPlus").'</a>';
// array_unshift($links, $settings_link);
$settings_link = '<a href="https://updraftplus.com">'.__("Add-Ons / Pro Support","updraftplus").'</a>';
array_unshift($links, $settings_link);
}
return $links;
}
public function admin_action_upgrade_pluginortheme() {
if (isset($_GET['action']) && ($_GET['action'] == 'upgrade-plugin' || $_GET['action'] == 'upgrade-theme') && !class_exists('UpdraftPlus_Addon_Autobackup') && !defined('UPDRAFTPLUS_NOADS_B')) {
if ($_GET['action'] == 'upgrade-plugin') {
if (!current_user_can('update_plugins')) return;
} else {
if (!current_user_can('update_themes')) return;
}
$dismissed_until = UpdraftPlus_Options::get_updraft_option('updraftplus_dismissedautobackup', 0);
if ($dismissed_until > time()) return;
if ( 'upgrade-plugin' == $_GET['action'] ) {
$title = __('Update Plugin');
$parent_file = 'plugins.php';
$submenu_file = 'plugins.php';
} else {
$title = __('Update Theme');
$parent_file = 'themes.php';
$submenu_file = 'themes.php';
}
require_once(ABSPATH.'wp-admin/admin-header.php');
?>
<div id="updraft-autobackup" class="updated" style="float:left; padding: 6px; margin:8px 0px;">
<div style="float: right;"><a href="#" onclick="jQuery('#updraft-autobackup').slideUp(); jQuery.post(ajaxurl, {action: 'updraft_ajax', subaction: 'dismissautobackup', nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>' });"><?php echo sprintf(__('Dismiss (for %s weeks)', 'updraftplus'), 10); ?></a></div>
<h3 style="margin-top: 0px;"><?php _e('Be safe with an automatic backup','updraftplus');?></h3>
<p><?php echo $this->autobackup_ad_content(); ?></p>
</div>
<?php
}
}
public function show_admin_warning($message, $class = "updated") {
echo '<div class="updraftmessage '.$class.'">'."<p>$message</p></div>";
}
//
public function show_admin_warning_unwritable(){
$unwritable_mess = htmlspecialchars(__("The 'Backup Now' button is disabled as your backup directory is not writable (go to the 'Settings' tab and find the relevant option).", 'updraftplus'));
$this->show_admin_warning($unwritable_mess, "error");
}
public function show_admin_nosettings_warning() {
$this->show_admin_warning('<strong>'.__('Welcome to UpdraftPlus!', 'updraftplus').'</strong> '.__('To make a backup, just press the Backup Now button.', 'updraftplus').' <a href="#" id="updraft-navtab-settings2">'.__('To change any of the default settings of what is backed up, to configure scheduled backups, to send your backups to remote storage (recommended), and more, go to the settings tab.', 'updraftplus').'</a>', 'updated notice is-dismissible');
}
public function show_admin_warning_execution_time() {
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('The amount of time allowed for WordPress plugins to run is very low (%s seconds) - you should increase it to avoid backup failures due to time-outs (consult your web hosting company for more help - it is the max_execution_time PHP setting; the recommended value is %s seconds or more)', 'updraftplus'), (int)@ini_get('max_execution_time'), 90));
}
public function show_admin_warning_disabledcron() {
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.__('The scheduler is disabled in your WordPress install, via the DISABLE_WP_CRON setting. No backups can run (even "Backup Now") unless either you have set up a facility to call the scheduler manually, or until it is enabled.','updraftplus').' <a href="https://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/#disablewpcron">'.__('Go here for more information.','updraftplus').'</a>', 'updated updraftplus-disable-wp-cron-warning');
}
public function show_admin_warning_diskspace() {
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('You have less than %s of free disk space on the disk which UpdraftPlus is configured to use to create backups. UpdraftPlus could well run out of space. Contact your the operator of your server (e.g. your web hosting company) to resolve this issue.','updraftplus'),'35 MB'));
}
public function show_admin_warning_wordpressversion() {
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('UpdraftPlus does not officially support versions of WordPress before %s. It may work for you, but if it does not, then please be aware that no support is available until you upgrade WordPress.', 'updraftplus'), '3.2'));
}
public function show_admin_warning_litespeed() {
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('Your website is hosted using the %s web server.','updraftplus'),'LiteSpeed').' <a href="https://updraftplus.com/faqs/i-am-having-trouble-backing-up-and-my-web-hosting-company-uses-the-litespeed-webserver/">'.__('Please consult this FAQ if you have problems backing up.', 'updraftplus').'</a>');
}
public function show_admin_debug_warning() {
$this->show_admin_warning('<strong>'.__('Notice','updraftplus').':</strong> '.__('UpdraftPlus\'s debug mode is on. You may see debugging notices on this page not just from UpdraftPlus, but from any other plugin installed. Please try to make sure that the notice you are seeing is from UpdraftPlus before you raise a support request.', 'updraftplus').'</a>');
}
public function show_admin_warning_overdue_crons($howmany) {
$ret = '<div class="updraftmessage updated"><p>';
$ret .= '<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working.', 'updraftplus'), $howmany).' <a href="https://updraftplus.com/faqs/scheduler-wordpress-installation-working/">'.__('Read this page for a guide to possible causes and how to fix it.', 'updraftplus').'</a>';
$ret .= '</p></div>';
return $ret;
}
public function show_admin_warning_dropbox() {
$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:','updraftplus').'</strong> <a class="updraft_authlink" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=updraftmethod-dropbox-auth&updraftplus_dropboxauth=doit">'.sprintf(__('Click here to authenticate your %s account (you will not be able to back up to %s without it).','updraftplus'), 'Dropbox', 'Dropbox').'</a>');
}
public function show_admin_warning_bitcasa() {
$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:','updraftplus').'</strong> <a class="updraft_authlink" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=updraftmethod-bitcasa-auth&updraftplus_bitcasaauth=doit">'.sprintf(__('Click here to authenticate your %s account (you will not be able to back up to %s without it).','updraftplus'), 'Bitcasa', 'Bitcasa').'</a>');
}
public function show_admin_warning_copycom() {
$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:','updraftplus').'</strong> <a class="updraft_authlink" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=updraftmethod-copycom-auth&updraftplus_copycomauth=doit">'.sprintf(__('Click here to authenticate your %s account (you will not be able to back up to %s without it).','updraftplus'), 'Copy.Com', 'Copy').'</a>');
}
public function show_admin_warning_onedrive() {
$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:','updraftplus').'</strong> <a class="updraft_authlink" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=updraftmethod-onedrive-auth&updraftplus_onedriveauth=doit">'.sprintf(__('Click here to authenticate your %s account (you will not be able to back up to %s without it).','updraftplus'), 'OneDrive', 'OneDrive').'</a>');
}
public function show_admin_warning_updraftvault() {
$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:','updraftplus').'</strong> '.sprintf(__('%s has been chosen for remote storage, but you are not currently connected.', 'updraftplus'), 'UpdraftPlus Vault').' '.__('Go to the remote storage settings in order to connect.', 'updraftplus'));
}
public function show_admin_warning_googledrive() {
$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:','updraftplus').'</strong> <a class="updraft_authlink" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=updraftmethod-googledrive-auth&updraftplus_googleauth=doit">'.sprintf(__('Click here to authenticate your %s account (you will not be able to back up to %s without it).','updraftplus'), 'Google Drive', 'Google Drive').'</a>');
}
public function show_admin_warning_googlecloud() {
$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:','updraftplus').'</strong> <a class="updraft_authlink" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=updraftmethod-googlecloud-auth&updraftplus_googleauth=doit">'.sprintf(__('Click here to authenticate your %s account (you will not be able to back up to %s without it).','updraftplus'), 'Google Cloud', 'Google Cloud').'</a>');
}
// This options filter removes ABSPATH off the front of updraft_dir, if it is given absolutely and contained within it
public function prune_updraft_dir_prefix($updraft_dir) {
if ('/' == substr($updraft_dir, 0, 1) || "\\" == substr($updraft_dir, 0, 1) || preg_match('/^[a-zA-Z]:/', $updraft_dir)) {
$wcd = trailingslashit(WP_CONTENT_DIR);
if (strpos($updraft_dir, $wcd) === 0) {
$updraft_dir = substr($updraft_dir, strlen($wcd));
}
# Legacy
// if (strpos($updraft_dir, ABSPATH) === 0) {
// $updraft_dir = substr($updraft_dir, strlen(ABSPATH));
// }
}
return $updraft_dir;
}
public function updraft_download_backup() {
if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'], 'updraftplus_download')) die;
if (empty($_REQUEST['timestamp']) || !is_numeric($_REQUEST['timestamp']) || empty($_REQUEST['type'])) exit;
$findex = empty($_REQUEST['findex']) ? 0 : (int)$_REQUEST['findex'];
$stage = empty($_REQUEST['stage']) ? '' : $_REQUEST['stage'];
// This call may not actually return, depending upon what mode it is called in
echo json_encode($this->do_updraft_download_backup($findex, $_REQUEST['type'], $_REQUEST['timestamp'], $stage));
die();
}
// This function may die(), depending on the request being made in $stage
public function do_updraft_download_backup($findex, $type, $timestamp, $stage, $close_connection_callable = false) {
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
global $updraftplus;
// This is a bit ugly; these variables get placed back into $_POST (where they may possibly have come from), so that UpdraftPlus::log() can detect exactly where to log the download status.
$_POST['findex'] = $findex;
$_POST['type'] = $type;
$_POST['timestamp'] = $timestamp;
// Check that it is a known entity type; if not, die
if ('db' != substr($type, 0, 2)) {
$backupable_entities = $updraftplus->get_backupable_file_entities(true);
foreach ($backupable_entities as $t => $info) {
if ($type == $t) $type_match = true;
}
if (empty($type_match)) return array('result' => 'error', 'code' => 'no_such_type');
}
// We already know that no possible entities have an MD5 clash (even after 2 characters)
// Also, there's nothing enforcing a requirement that nonces are hexadecimal
$job_nonce = dechex($timestamp).$findex.substr(md5($type), 0, 3);
// You need a nonce before you can set job data. And we certainly don't yet have one.
$updraftplus->backup_time_nonce($job_nonce);
$debug_mode = UpdraftPlus_Options::get_updraft_option('updraft_debug_mode');
// Set the job type before logging, as there can be different logging destinations
$updraftplus->jobdata_set('job_type', 'download');
$updraftplus->jobdata_set('job_time_ms', $updraftplus->job_time_ms);
// Retrieve the information from our backup history
$backup_history = $updraftplus->get_backup_history();
// Base name
$file = $backup_history[$timestamp][$type];
// Deal with multi-archive sets
if (is_array($file)) $file=$file[$findex];
// Where it should end up being downloaded to
$fullpath = $updraftplus->backups_dir_location().'/'.$file;
if (2 == $stage) {
$updraftplus->spool_file($fullpath);
// Do not return - we do not want the caller to add any output
die;
}
if ('delete' == $stage) {
@unlink($fullpath);
$updraftplus->log("The file has been deleted ($file)");
return array('result' => 'deleted');
}
// TODO: FIXME: Failed downloads may leave log files forever (though they are small)
if ($debug_mode) $updraftplus->logfile_open($updraftplus->nonce);
set_error_handler(array($updraftplus, 'php_error'), E_ALL & ~E_STRICT);
$updraftplus->log("Requested to obtain file: timestamp=$timestamp, type=$type, index=$findex");
$itext = empty($findex) ? '' : $findex;
$known_size = isset($backup_history[$timestamp][$type.$itext.'-size']) ? $backup_history[$timestamp][$type.$itext.'-size'] : 0;
$services = (isset($backup_history[$timestamp]['service'])) ? $backup_history[$timestamp]['service'] : false;
if (is_string($services)) $services = array($services);
$updraftplus->jobdata_set('service', $services);
// Fetch it from the cloud, if we have not already got it
$needs_downloading = false;
if (!file_exists($fullpath)) {
//if the file doesn't exist and they're using one of the cloud options, fetch it down from the cloud.
$needs_downloading = true;
$updraftplus->log('File does not yet exist locally - needs downloading');
} elseif ($known_size > 0 && filesize($fullpath) < $known_size) {
$updraftplus->log("The file was found locally (".filesize($fullpath).") but did not match the size in the backup history ($known_size) - will resume downloading");
$needs_downloading = true;
} elseif ($known_size > 0) {
$updraftplus->log('The file was found locally and matched the recorded size from the backup history ('.round($known_size/1024,1).' KB)');
} else {
$updraftplus->log('No file size was found recorded in the backup history. We will assume the local one is complete.');
$known_size = filesize($fullpath);
}
// The AJAX responder that updates on progress wants to see this
$updraftplus->jobdata_set('dlfile_'.$timestamp.'_'.$type.'_'.$findex, "downloading:$known_size:$fullpath");
if ($needs_downloading) {
$msg = array(
'result' => 'needs_download'
);
if ($close_connection_callable && is_callable($close_connection_callable)) {
call_user_func($close_connection_callable, $msg);
} else {
$updraftplus->close_browser_connection(json_encode($msg));
}
$is_downloaded = false;
add_action('http_request_args', array($updraftplus, 'modify_http_options'));
foreach ($services as $service) {
if ($is_downloaded) continue;
$download = $this->download_file($file, $service);
if (is_readable($fullpath) && $download !== false) {
clearstatcache();
$updraftplus->log('Remote fetch was successful (file size: '.round(filesize($fullpath)/1024,1).' KB)');
$is_downloaded = true;
} else {
clearstatcache();
if (0 === @filesize($fullpath)) @unlink($fullpath);
$updraftplus->log('Remote fetch failed');
}
}
remove_action('http_request_args', array($updraftplus, 'modify_http_options'));
}
// Now, be ready to spool the thing to the browser
if (is_file($fullpath) && is_readable($fullpath)) {
// That message is then picked up by the AJAX listener
$updraftplus->jobdata_set('dlfile_'.$timestamp.'_'.$type.'_'.$findex, 'downloaded:'.filesize($fullpath).":$fullpath");
$result = 'downloaded';
} else {
$updraftplus->jobdata_set('dlfile_'.$timestamp.'_'.$type.'_'.$findex, 'failed');
$updraftplus->jobdata_set('dlerrors_'.$timestamp.'_'.$type.'_'.$findex, $updraftplus->errors);
$updraftplus->log('Remote fetch failed. File '.$fullpath.' did not exist or was unreadable. If you delete local backups then remote retrieval may have failed.');
$result = 'download_failed';
}
restore_error_handler();
@fclose($updraftplus->logfile_handle);
if (!$debug_mode) @unlink($updraftplus->logfile_name);
// The browser connection was possibly already closed, but not necessarily
return array('result' => $result);
}
# Pass only a single service, as a string, into this function
private function download_file($file, $service) {
global $updraftplus;
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
$updraftplus->log("Requested file from remote service: $service: $file");
$method_include = UPDRAFTPLUS_DIR.'/methods/'.$service.'.php';
if (file_exists($method_include)) require_once($method_include);
$objname = "UpdraftPlus_BackupModule_${service}";
if (method_exists($objname, "download")) {
$remote_obj = new $objname;
return $remote_obj->download($file);
} else {
$updraftplus->log("Automatic backup restoration is not available with the method: $service.");
$updraftplus->log("$file: ".sprintf(__("The backup archive for this file could not be found. The remote storage method in use (%s) does not allow us to retrieve files. To perform any restoration using UpdraftPlus, you will need to obtain a copy of this file and place it inside UpdraftPlus's working folder", 'updraftplus'), $service)." (".$this->prune_updraft_dir_prefix($updraftplus->backups_dir_location()).")", 'error');
return false;
}
}
public function updraft_ajax_handler() {
global $updraftplus;
$nonce = (empty($_REQUEST['nonce'])) ? "" : $_REQUEST['nonce'];
if (!wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce') || empty($_REQUEST['subaction'])) die('Security check');
// Mitigation in case the nonce leaked to an unauthorised user
if (isset($_REQUEST['subaction']) && 'dismissautobackup' == $_REQUEST['subaction']) {
if (!current_user_can('update_plugins') && !current_user_can('update_themes')) return;
} elseif (isset($_REQUEST['subaction']) && ('dismissexpiry' == $_REQUEST['subaction'] || 'dismissdashnotice' == $_REQUEST['subaction'])) {
if (!current_user_can('update_plugins')) return;
} else {
if (!UpdraftPlus_Options::user_can_manage()) return;
}
// Some of this checks that _REQUEST['subaction'] is set, which is redundant (done already in the nonce check)
/*
// This one is no longer used anywhere
if (isset($_REQUEST['subaction']) && 'lastlog' == $_REQUEST['subaction']) {
$last_message = UpdraftPlus_Options::get_updraft_option('updraft_lastmessage');
echo htmlspecialchars( '('.__('Nothing yet logged', 'updraftplus').')'));
} else
*/
if ('forcescheduledresumption' == $_REQUEST['subaction'] && !empty($_REQUEST['resumption']) && !empty($_REQUEST['job_id']) && is_numeric($_REQUEST['resumption'])) {
// Casting $resumption to int is absolutely necessary, as the WP cron system uses a hashed serialisation of the parameters for identifying jobs. Different type => different hash => does not match
$resumption = (int)$_REQUEST['resumption'];
$job_id = $_REQUEST['job_id'];
$get_cron = $this->get_cron($job_id);
if (!is_array($get_cron)) {
echo json_encode(array('r' => false));
} else {
$updraftplus->log("Forcing resumption: job id=$job_id, resumption=$resumption");
$time = $get_cron[0];
// wp_unschedule_event($time, 'updraft_backup_resume', array($resumption, $job_id));
wp_clear_scheduled_hook('updraft_backup_resume', array($resumption, $job_id));
$updraftplus->close_browser_connection(json_encode(array('r' => true)));
$updraftplus->jobdata_set_from_array($get_cron[1]);
$updraftplus->backup_resume($resumption, $job_id);
}
} elseif (isset($_GET['subaction']) && 'activejobs_list' == $_GET['subaction']) {
echo json_encode($this->get_activejobs_list($_GET));
} elseif (isset($_REQUEST['subaction']) && 'updraftcentral_delete_key' == $_REQUEST['subaction'] && isset($_REQUEST['key_id'])) {
global $updraftplus_updraftcentral_main;
if (!is_a($updraftplus_updraftcentral_main, 'UpdraftPlus_UpdraftCentral_Main')) {
echo json_encode(array('error' => 'UpdraftPlus_UpdraftCentral_Main object not found'));
die;
}
echo json_encode($updraftplus_updraftcentral_main->delete_key($_REQUEST['key_id']));
die;
} elseif (isset($_REQUEST['subaction']) && ('updraftcentral_create_key' == $_REQUEST['subaction'] || 'updraftcentral_get_log' == $_REQUEST['subaction'])) {
global $updraftplus_updraftcentral_main;
if (!is_a($updraftplus_updraftcentral_main, 'UpdraftPlus_UpdraftCentral_Main')) {
echo json_encode(array('error' => 'UpdraftPlus_UpdraftCentral_Main object not found'));
die;
}
$call_method = substr($_REQUEST['subaction'], 15);
echo json_encode(call_user_func(array($updraftplus_updraftcentral_main, $call_method), $_REQUEST));
die;
} elseif (isset($_REQUEST['subaction']) && 'callwpaction' == $_REQUEST['subaction'] && !empty($_REQUEST['wpaction'])) {
ob_start();
$res = '<em>Request received: </em>';
if (preg_match('/^([^:]+)+:(.*)$/', stripslashes($_REQUEST['wpaction']), $matches)) {
$action = $matches[1];
if (null === ($args = json_decode($matches[2], true))) {
$res .= "The parameters (should be JSON) could not be decoded";
$action = false;
} else {
$res .= "Will despatch action: ".htmlspecialchars($action).", parameters: ".htmlspecialchars(implode(',', $args));
}
} else {
$action = $_REQUEST['wpaction'];
$res .= "Will despatch action: ".htmlspecialchars($action).", no parameters";
}
echo json_encode(array('r' => $res));
$ret = ob_get_clean();
$updraftplus->close_browser_connection($ret);
if (!empty($action)) {
if (!empty($args)) {
do_action_ref_array($action, $args);
} else {
do_action($action);
}
}
die;
} elseif (isset($_REQUEST['subaction']) && 'whichdownloadsneeded' == $_REQUEST['subaction'] && is_array($_REQUEST['downloads']) && isset($_REQUEST['timestamp']) && is_numeric($_REQUEST['timestamp'])) {
// The purpose of this is to look at the list of indicated downloads, and indicate which are not already fully downloaded. i.e. Which need further action.
$send_back = array();
$backup = $updraftplus->get_backup_history($_REQUEST['timestamp']);
$updraft_dir = $updraftplus->backups_dir_location();
$backupable_entities = $updraftplus->get_backupable_file_entities();
if (empty($backup)) {
echo json_encode(array('result' => 'asyouwere'));
} else {
foreach ($_REQUEST['downloads'] as $i => $download) {
if (is_array($download) && 2 == count($download) && isset($download[0]) && isset($download[1])) {
$entity = $download[0];
if (('db' == $entity || isset($backupable_entities[$entity])) && isset($backup[$entity])) {
$indexes = explode(',', $download[1]);
$retain_string = '';
foreach ($indexes as $index) {
$retain = true; // default
$findex = (0 == $index) ? '' : (string)$index;
$files = $backup[$entity];
if (!is_array($files)) $files = array($files);
$size_key = $entity.$findex.'-size';
if (isset($files[$index]) && isset($backup[$size_key])) {
$file = $updraft_dir.'/'.$files[$index];
if (file_exists($file) && filesize($file) >= $backup[$size_key]) {
$retain = false;
}
}
if ($retain) {
$retain_string .= ('' === $retain_string) ? $index : ','.$index;
$send_back[$i][0] = $entity;
$send_back[$i][1] = $retain_string;
}
}
} else {
$send_back[$i][0] = $entity;
$send_back[$i][1] = $download[$i][1];
}
} else {
// Format not understood. Just send it back as-is.
$send_back[$i] = $download[$i];
}
}
// Finally, renumber the keys (to usual PHP style - 0, 1, ...). Otherwise, in order to preserve the indexes, json_encode() will create an object instead of an array in the case where $send_back only has one element (and is indexed with an index > 0)
$send_back = array_values($send_back);
echo json_encode(array('downloads' => $send_back));
}
} elseif (isset($_REQUEST['subaction']) && 'httpget' == $_REQUEST['subaction']) {
if (empty($_REQUEST['uri'])) {
echo json_encode(array('r' => ''));
die;
}
$uri = $_REQUEST['uri'];
if (!empty($_REQUEST['curl'])) {
if (!function_exists('curl_exec')) {
echo json_encode(array('e' => 'No Curl installed'));
die;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR, $output=fopen('php://temp', "w+"));
$response = curl_exec($ch);
$error = curl_error($ch);
$getinfo = curl_getinfo($ch);
curl_close($ch);
$resp = array();
if (false === $response) {
$resp['e'] = htmlspecialchars($error);
# json_encode(array('e' => htmlspecialchars($error)));
}
$resp['r'] = (empty($response)) ? '' : htmlspecialchars(substr($response, 0, 2048));
rewind($output);
$verb = stream_get_contents($output);
if (!empty($verb)) $resp['r'] = htmlspecialchars($verb)."\n\n".$resp['r'];
echo json_encode($resp);
// echo json_encode(array('r' => htmlspecialchars(substr($response, 0, 2048))));
} else {
$response = wp_remote_get($uri, array('timeout' => 10));
if (is_wp_error($response)) {
echo json_encode(array('e' => htmlspecialchars($response->get_error_message())));
die;
}
echo json_encode(array('r' => wp_remote_retrieve_response_code($response).': '.htmlspecialchars(substr(wp_remote_retrieve_body($response), 0, 2048))));
}
die;
} elseif (isset($_REQUEST['subaction']) && 'dismissautobackup' == $_REQUEST['subaction']) {
UpdraftPlus_Options::update_updraft_option('updraftplus_dismissedautobackup', time() + 84*86400);
} elseif (isset($_REQUEST['subaction']) && 'set_autobackup_default' == $_REQUEST['subaction']) {
// This option when set should have integers, not bools
$default = empty($_REQUEST['default']) ? 0 : 1;
UpdraftPlus_Options::update_updraft_option('updraft_autobackup_default', $default);
} elseif (isset($_REQUEST['subaction']) && 'dismissexpiry' == $_REQUEST['subaction']) {
UpdraftPlus_Options::update_updraft_option('updraftplus_dismissedexpiry', time() + 14*86400);
} elseif (isset($_REQUEST['subaction']) && 'dismissdashnotice' == $_REQUEST['subaction']) {
UpdraftPlus_Options::update_updraft_option('updraftplus_dismisseddashnotice', time() + 366*86400);
} elseif (isset($_REQUEST['subaction']) && 'poplog' == $_REQUEST['subaction']){
echo json_encode($this->fetch_log($_REQUEST['backup_nonce']));
} elseif (isset($_REQUEST['subaction']) && 'restore_alldownloaded' == $_REQUEST['subaction'] && isset($_REQUEST['restoreopts']) && isset($_REQUEST['timestamp'])) {
$backups = $updraftplus->get_backup_history();
$updraft_dir = $updraftplus->backups_dir_location();
$timestamp = (int)$_REQUEST['timestamp'];
if (!isset($backups[$timestamp])) {
echo json_encode(array('m' => '', 'w' => '', 'e' => __('No such backup set exists', 'updraftplus')));
die;
}
$mess = array();
parse_str(stripslashes($_REQUEST['restoreopts']), $res);
if (isset($res['updraft_restore'])) {
set_error_handler(array($this, 'get_php_errors'), E_ALL & ~E_STRICT);
$elements = array_flip($res['updraft_restore']);
$warn = array(); $err = array();
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
$max_execution_time = (int)@ini_get('max_execution_time');
if ($max_execution_time>0 && $max_execution_time<61) {
$warn[] = sprintf(__('The PHP setup on this webserver allows only %s seconds for PHP to run, and does not allow this limit to be raised. If you have a lot of data to import, and if the restore operation times out, then you will need to ask your web hosting company for ways to raise this limit (or attempt the restoration piece-by-piece).', 'updraftplus'), $max_execution_time);
}
if (isset($backups[$timestamp]['native']) && false == $backups[$timestamp]['native']) {
$warn[] = __('This backup set was not known by UpdraftPlus to be created by the current WordPress installation, but was either found in remote storage, or was sent from a remote site.', 'updraftplus').' '.__('You should make sure that this really is a backup set intended for use on this website, before you restore (rather than a backup set of an unrelated website).', 'updraftplus');
}
if (isset($elements['db'])) {
// Analyse the header of the database file + display results
list ($mess2, $warn2, $err2, $info) = $updraftplus->analyse_db_file($timestamp, $res);
$mess = array_merge($mess, $mess2);
$warn = array_merge($warn, $warn2);
$err = array_merge($err, $err2);
foreach ($backups[$timestamp] as $bid => $bval) {
if ('db' != $bid && 'db' == substr($bid, 0, 2) && '-size' != substr($bid, -5, 5)) {
$warn[] = __('Only the WordPress database can be restored; you will need to deal with the external database manually.', 'updraftplus');
break;
}
}
}
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
$backupable_plus_db = $backupable_entities;
$backupable_plus_db['db'] = array('path' => 'path-unused', 'description' => __('Database', 'updraftplus'));
if (!empty($backups[$timestamp]['meta_foreign'])) {
$foreign_known = apply_filters('updraftplus_accept_archivename', array());
if (!is_array($foreign_known) || empty($foreign_known[$backups[$timestamp]['meta_foreign']])) {
$err[] = sprintf(__('Backup created by unknown source (%s) - cannot be restored.', 'updraftplus'), $backups[$timestamp]['meta_foreign']);
} else {
// For some reason, on PHP 5.5 passing by reference in a single array stopped working with apply_filters_ref_array (though not with do_action_ref_array).
$backupable_plus_db = apply_filters_ref_array("updraftplus_importforeign_backupable_plus_db", array($backupable_plus_db, array($foreign_known[$backups[$timestamp]['meta_foreign']], &$mess, &$warn, &$err)));
}
}
foreach ($backupable_plus_db as $type => $entity_info) {
if (!isset($elements[$type])) continue;
$whatwegot = $backups[$timestamp][$type];
if (is_string($whatwegot)) $whatwegot = array($whatwegot);
$expected_index = 0;
$missing = '';
ksort($whatwegot);
$outof = false;
foreach ($whatwegot as $index => $file) {
if (preg_match('/\d+of(\d+)\.zip/', $file, $omatch)) { $outof = max($matches[1], 1); }
if ($index != $expected_index) {
$missing .= ($missing == '') ? (1+$expected_index) : ",".(1+$expected_index);
}
if (!file_exists($updraft_dir.'/'.$file)) {
$err[] = sprintf(__('File not found (you need to upload it): %s', 'updraftplus'), $updraft_dir.'/'.$file);
} elseif (filesize($updraft_dir.'/'.$file) == 0) {
$err[] = sprintf(__('File was found, but is zero-sized (you need to re-upload it): %s', 'updraftplus'), $file);
} else {
$itext = (0 == $index) ? '' : $index;
if (!empty($backups[$timestamp][$type.$itext.'-size']) && $backups[$timestamp][$type.$itext.'-size'] != filesize($updraft_dir.'/'.$file)) {
if (empty($warn['doublecompressfixed'])) {
$warn[] = sprintf(__('File (%s) was found, but has a different size (%s) from what was expected (%s) - it may be corrupt.', 'updraftplus'), $file, filesize($updraft_dir.'/'.$file), $backups[$timestamp][$type.$itext.'-size']);
}
}
do_action_ref_array("updraftplus_checkzip_$type", array($updraft_dir.'/'.$file, &$mess, &$warn, &$err));
}
$expected_index++;
}
do_action_ref_array("updraftplus_checkzip_end_$type", array(&$mess, &$warn, &$err));
// Detect missing archives where they are missing from the end of the set
if ($outof>0 && $expected_index < $outof) {
for ($j = $expected_index; $j<$outof; $j++) {
$missing .= ($missing == '') ? (1+$j) : ",".(1+$j);
}
}
if ('' != $missing) {
$warn[] = sprintf(__("This multi-archive backup set appears to have the following archives missing: %s", 'updraftplus'), $missing.' ('.$entity_info['description'].')');
}
}
if (0 == count($err) && 0 == count($warn)) {
$mess_first = __('The backup archive files have been successfully processed. Now press Restore again to proceed.', 'updraftplus');
} elseif (0 == count($err)) {
$mess_first = __('The backup archive files have been processed, but with some warnings. If all is well, then now press Restore again to proceed. Otherwise, cancel and correct any problems first.', 'updraftplus');
} else {
$mess_first = __('The backup archive files have been processed, but with some errors. You will need to cancel and correct any problems before retrying.', 'updraftplus');
}
if (count($this->logged) >0) {
foreach ($this->logged as $lwarn) $warn[] = $lwarn;
}
restore_error_handler();
// Get the info if it hasn't already come from the DB scan
if (!isset($info) || !is_array($info)) $info = array();
// Not all chracters can be json-encoded, and we don't need this potentially-arbitrary user-supplied info.
unset($info['label']);
if (!isset($info['created_by_version']) && !empty($backups[$timestamp]['created_by_version'])) $info['created_by_version'] = $backups[$timestamp]['created_by_version'];
if (!isset($info['multisite']) && !empty($backups[$timestamp]['is_multisite'])) $info['multisite'] = $backups[$timestamp]['is_multisite'];
do_action_ref_array('updraftplus_restore_all_downloaded_postscan', array($backups, $timestamp, $elements, &$info, &$mess, &$warn, &$err));
echo json_encode(array('m' => '<p>'.$mess_first.'</p>'.implode('<br>', $mess), 'w' => implode('<br>', $warn), 'e' => implode('<br>', $err), 'i' => json_encode($info)));
}
} elseif ('sid_reset' == $_REQUEST['subaction']) {
delete_site_option('updraftplus-addons_siteid');
echo json_encode(array('newsid' => $updraftplus->siteid()));
} elseif (('vault_connect' == $_REQUEST['subaction'] && isset($_REQUEST['email']) && isset($_REQUEST['pass'])) || 'vault_disconnect' == $_REQUEST['subaction'] || 'vault_recountquota' == $_REQUEST['subaction']) {
require_once(UPDRAFTPLUS_DIR.'/methods/updraftvault.php');
$vault = new UpdraftPlus_BackupModule_updraftvault();
call_user_func(array($vault, 'ajax_'.$_REQUEST['subaction']));
} elseif (isset($_POST['backup_timestamp']) && 'deleteset' == $_REQUEST['subaction']) {
echo json_encode($this->delete_set($_POST));
} elseif ('rawbackuphistory' == $_REQUEST['subaction']) {
echo '<h3 id="ud-debuginfo-rawbackups">'.__('Known backups (raw)', 'updraftplus').'</h3><pre>';
var_dump($updraftplus->get_backup_history());
echo '</pre>';
echo '<h3 id="ud-debuginfo-files">Files</h3><pre>';
$updraft_dir = $updraftplus->backups_dir_location();
$raw_output = array();
$d = dir($updraft_dir);
while (false !== ($entry = $d->read())) {
$fp = $updraft_dir.'/'.$entry;
$mtime = filemtime($fp);
if (is_dir($fp)) {
$size = ' d';
} elseif (is_link($fp)) {
$size = ' l';
} elseif (is_file($fp)) {
$size = sprintf("%8.1f", round(filesize($fp)/1024, 1)).' '.gmdate('r', $mtime);
} else {
$size = ' ?';
}
if (preg_match('/^log\.(.*)\.txt$/', $entry, $lmatch)) $entry = '<a target="_top" href="?action=downloadlog&page=updraftplus&updraftplus_backup_nonce='.htmlspecialchars($lmatch[1]).'">'.$entry.'</a>';
$raw_output[$mtime] = empty($raw_output[$mtime]) ? sprintf("%s %s\n", $size, $entry) : $raw_output[$mtime].sprintf("%s %s\n", $size, $entry);
}
@$d->close();
krsort($raw_output, SORT_NUMERIC);
foreach ($raw_output as $line) echo $line;
echo '</pre>';
echo '<h3 id="ud-debuginfo-options">'.__('Options (raw)', 'updraftplus').'</h3>';
$opts = $updraftplus->get_settings_keys();
asort($opts);
// <tr><th>'.__('Key','updraftplus').'</th><th>'.__('Value','updraftplus').'</th></tr>
echo '<table><thead></thead><tbody>';
foreach ($opts as $opt) {
echo '<tr><td>'.htmlspecialchars($opt).'</td><td>'.htmlspecialchars(print_r(UpdraftPlus_Options::get_updraft_option($opt), true)).'</td>';
}
echo '</tbody></table>';
do_action('updraftplus_showrawinfo');
} elseif ('countbackups' == $_REQUEST['subaction']) {
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
$backup_history = (is_array($backup_history))?$backup_history:array();
#echo sprintf(__('%d set(s) available', 'updraftplus'), count($backup_history));
echo __('Existing Backups', 'updraftplus').' ('.count($backup_history).')';
} elseif ('ping' == $_REQUEST['subaction']) {
// The purpose of this is to detect brokenness caused by extra line feeds in plugins/themes - before it breaks other AJAX operations and leads to support requests
echo 'pong';
} elseif ('checkoverduecrons' == $_REQUEST['subaction']) {
$how_many_overdue = $this->howmany_overdue_crons();
if ($how_many_overdue >= 4) echo json_encode(array('m' => $this->show_admin_warning_overdue_crons($how_many_overdue)));
} elseif ('delete_old_dirs' == $_REQUEST['subaction']) {
$this->delete_old_dirs_go(false);
} elseif ('phpinfo' == $_REQUEST['subaction']) {
phpinfo(INFO_ALL ^ (INFO_CREDITS | INFO_LICENSE));
echo '<h3 id="ud-debuginfo-constants">'.__('Constants', 'updraftplus').'</h3>';
$opts = @get_defined_constants();
ksort($opts);
// <tr><th>'.__('Key','updraftplus').'</th><th>'.__('Value','updraftplus').'</th></tr>
echo '<table><thead></thead><tbody>';
foreach ($opts as $key => $opt) {
echo '<tr><td>'.htmlspecialchars($key).'</td><td>'.htmlspecialchars(print_r($opt, true)).'</td>';
}
echo '</tbody></table>';
} elseif ('doaction' == $_REQUEST['subaction'] && !empty($_REQUEST['subsubaction']) && 'updraft_' == substr($_REQUEST['subsubaction'], 0, 8)) {
do_action($_REQUEST['subsubaction']);
} elseif ('backupnow' == $_REQUEST['subaction']) {
$this->request_backupnow($_REQUEST);
# Old-style: schedule an event in 5 seconds time. This has the advantage of testing out the scheduler, and alerting the user if it doesn't work... but has the disadvantage of not working in that case.
# I don't think the </div>s should be here - in case this is ever re-activated
// if (wp_schedule_single_event(time()+5, $event, array($backupnow_nocloud)) === false) {
// $updraftplus->log("A backup run failed to schedule");
// echo __("Failed.", 'updraftplus');
// } else {
// echo htmlspecialchars(__('OK. You should soon see activity in the "Last log message" field below.','updraftplus'))." <a href=\"https://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/\"><br>".__('Nothing happening? Follow this link for help.','updraftplus')."</a>";
// $updraftplus->log("A backup run has been scheduled");
// }
} elseif (isset($_GET['subaction']) && 'lastbackup' == $_GET['subaction']) {
echo $this->last_backup_html();
} elseif (isset($_GET['subaction']) && 'activejobs_delete' == $_GET['subaction'] && isset($_GET['jobid'])) {
echo json_encode($this->activejobs_delete((string)$_GET['jobid']));
} elseif (isset($_GET['subaction']) && 'diskspaceused' == $_GET['subaction'] && isset($_GET['entity'])) {
$entity = $_GET['entity'];
// This can count either the size of the Updraft directory, or of the data to be backed up
echo $this->get_disk_space_used($entity);
} elseif (isset($_GET['subaction']) && 'historystatus' == $_GET['subaction']) {
$remotescan = !empty($_GET['remotescan']);
$rescan = ($remotescan || !empty($_GET['rescan']));
$history_status = $this->get_history_status($rescan, $remotescan);
echo @json_encode($history_status);
} elseif (isset($_POST['subaction']) && $_POST['subaction'] == 'credentials_test') {
$this->do_credentials_test($_POST);
die;
}
die;
}
// This echoes output; so, you will need to do output buffering if you want to capture it
public function do_credentials_test($test_settings) {
$method = (!empty($test_settings['method']) && preg_match("/^[a-z0-9]+$/", $test_settings['method'])) ? $test_settings['method'] : "";
$objname = "UpdraftPlus_BackupModule_$method";
$this->logged = array();
# TODO: Add action for WP HTTP SSL stuff
set_error_handler(array($this, 'get_php_errors'), E_ALL & ~E_STRICT);
if (!class_exists($objname)) include_once(UPDRAFTPLUS_DIR."/methods/$method.php");
# TODO: Add action for WP HTTP SSL stuff
if (method_exists($objname, "credentials_test")) {
$obj = new $objname;
$obj->credentials_test($test_settings);
}
if (count($this->logged) >0) {
echo "\n\n".__('Messages:', 'updraftplus')."\n";
foreach ($this->logged as $err) {
echo "* $err\n";
}
}
restore_error_handler();
}
// Relevant options (array keys): backup_timestamp, delete_remote,
public function delete_set($opts) {
global $updraftplus;
$backups = $updraftplus->get_backup_history();
$timestamps = (string)$opts['backup_timestamp'];
$timestamps = explode(',', $timestamps);
$delete_remote = empty($opts['delete_remote']) ? false : true;
// You need a nonce before you can set job data. And we certainly don't yet have one.
$updraftplus->backup_time_nonce();
// Set the job type before logging, as there can be different logging destinations
$updraftplus->jobdata_set('job_type', 'delete');
$updraftplus->jobdata_set('job_time_ms', $updraftplus->job_time_ms);
if (UpdraftPlus_Options::get_updraft_option('updraft_debug_mode')) {
$updraftplus->logfile_open($updraftplus->nonce);
set_error_handler(array($updraftplus, 'php_error'), E_ALL & ~E_STRICT);
}
$updraft_dir = $updraftplus->backups_dir_location();
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
$local_deleted = 0;
$remote_deleted = 0;
$sets_removed = 0;
foreach ($timestamps as $i => $timestamp) {
if (!isset($backups[$timestamp])) {
echo json_encode(array('result' => 'error', 'message' => __('Backup set not found', 'updraftplus')));
die;
}
$nonce = isset($backups[$timestamp]['nonce']) ? $backups[$timestamp]['nonce'] : '';
$delete_from_service = array();
if ($delete_remote) {
// Locate backup set
if (isset($backups[$timestamp]['service'])) {
$services = is_string($backups[$timestamp]['service']) ? array($backups[$timestamp]['service']) : $backups[$timestamp]['service'];
if (is_array($services)) {
foreach ($services as $service) {
if ($service && $service != 'none' && $service != 'email') $delete_from_service[] = $service;
}
}
}
}
$files_to_delete = array();
foreach ($backupable_entities as $key => $ent) {
if (isset($backups[$timestamp][$key])) {
$files_to_delete[$key] = $backups[$timestamp][$key];
}
}
// Delete DB
if (isset($backups[$timestamp]['db'])) $files_to_delete['db'] = $backups[$timestamp]['db'];
// Also delete the log
if ($nonce && !UpdraftPlus_Options::get_updraft_option('updraft_debug_mode')) {
$files_to_delete['log'] = "log.$nonce.txt";
}
unset($backups[$timestamp]);
$sets_removed++;
UpdraftPlus_Options::update_updraft_option('updraft_backup_history', $backups);
add_action('http_request_args', array($updraftplus, 'modify_http_options'));
foreach ($files_to_delete as $key => $files) {
# Local deletion
if (is_string($files)) $files=array($files);
foreach ($files as $file) {
if (is_file($updraft_dir.'/'.$file)) {
if (@unlink($updraft_dir.'/'.$file)) $local_deleted++;
}
}
if ('log' != $key && count($delete_from_service) > 0) {
foreach ($delete_from_service as $service) {
if ('email' == $service) continue;
if (file_exists(UPDRAFTPLUS_DIR."/methods/$service.php")) require_once(UPDRAFTPLUS_DIR."/methods/$service.php");
$objname = "UpdraftPlus_BackupModule_".$service;
$deleted = -1;
if (class_exists($objname)) {
# TODO: Re-use the object (i.e. prevent repeated connection setup/teardown)
$remote_obj = new $objname;
$deleted = $remote_obj->delete($files);
}
if ($deleted === -1) {
//echo __('Did not know how to delete from this cloud service.', 'updraftplus');
} elseif ($deleted !== false) {
$remote_deleted = $remote_deleted + count($files);
} else {
// Do nothing
}
}
}
}
remove_action('http_request_args', array($updraftplus, 'modify_http_options'));
}
$message = sprintf(__('Backup sets removed: %d', 'updraftplus'),$sets_removed)."\n";
$message .= sprintf(__('Local archives deleted: %d', 'updraftplus'),$local_deleted)."\n";
$message .= sprintf(__('Remote archives deleted: %d', 'updraftplus'),$remote_deleted)."\n";
$updraftplus->log("Local archives deleted: ".$local_deleted);
$updraftplus->log("Remote archives deleted: ".$remote_deleted);
if (UpdraftPlus_Options::get_updraft_option('updraft_debug_mode')) {
restore_error_handler();
}
return array('result' => 'success', 'message' => $message, 'removed' => array('sets' => $sets_removed, 'local' => $local_deleted, 'remote' => $remote_deleted));
}
public function get_history_status($rescan, $remotescan) {
global $updraftplus;
if ($rescan) $messages = $updraftplus->rebuild_backup_history($remotescan);
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
$backup_history = (is_array($backup_history)) ? $backup_history : array();
$output = $this->existing_backup_table($backup_history);
if (!empty($messages) && is_array($messages)) {
$noutput = '<div style="margin-left: 100px; margin-top: 10px;"><ul style="list-style: disc inside;">';
foreach ($messages as $msg) {
$noutput .= '<li>'.(($msg['desc']) ? $msg['desc'].': ' : '').'<em>'.$msg['message'].'</em></li>';
}
$noutput .= '</ul></div>';
$output = $noutput.$output;
}
$logs_exist = (false !== strpos($output, 'downloadlog'));
if (!$logs_exist) {
list($mod_time, $log_file, $nonce) = $updraftplus->last_modified_log();
if ($mod_time) $logs_exist = true;
}
return apply_filters('updraftplus_get_history_status_result', array(
'n' => sprintf(__('Existing Backups', 'updraftplus').' (%d)', count($backup_history)),
't' => $output,
'cksum' => md5($output),
'logs_exist' => $logs_exist,
));
}
public function get_disk_space_used($entity) {
global $updraftplus;
if ('updraft' == $entity) {
return $this->recursive_directory_size($updraftplus->backups_dir_location());
} else {
$backupable_entities = $updraftplus->get_backupable_file_entities(true, false);
if ('all' == $entity) {
$total_size = 0;
foreach ($backupable_entities as $entity => $data) {
# Might be an array
$basedir = $backupable_entities[$entity];
$dirs = apply_filters('updraftplus_dirlist_'.$entity, $basedir);
$size = $this->recursive_directory_size($dirs, $updraftplus->get_exclude($entity), $basedir, 'numeric');
if (is_numeric($size) && $size>0) $total_size += $size;
}
return $updraftplus->convert_numeric_size_to_text($total_size);
} elseif (!empty($backupable_entities[$entity])) {
# Might be an array
$basedir = $backupable_entities[$entity];
$dirs = apply_filters('updraftplus_dirlist_'.$entity, $basedir);
return $this->recursive_directory_size($dirs, $updraftplus->get_exclude($entity), $basedir);
}
}
return __('Error', 'updraftplus');
}
public function activejobs_delete($job_id) {
if (preg_match("/^[0-9a-f]{12}$/", $job_id)) {
global $updraftplus;
$cron = get_option('cron');
$found_it = false;
$updraft_dir = $updraftplus->backups_dir_location();
if (file_exists($updraft_dir.'/log.'.$job_id.'.txt')) touch($updraft_dir.'/deleteflag-'.$job_id.'.txt');
foreach ($cron as $time => $job) {
if (isset($job['updraft_backup_resume'])) {
foreach ($job['updraft_backup_resume'] as $hook => $info) {
if (isset($info['args'][1]) && $info['args'][1] == $job_id) {
$args = $cron[$time]['updraft_backup_resume'][$hook]['args'];
wp_unschedule_event($time, 'updraft_backup_resume', $args);
if (!$found_it) return array('ok' => 'Y', 'c' => 'deleted', 'm' => __('Job deleted', 'updraftplus'));
$found_it = true;
}
}
}
}
}
if (!$found_it) return array('ok' => 'N', 'c' => 'not_found', 'm' => __('Could not find that job - perhaps it has already finished?', 'updraftplus'));
}
// Input: an array of items
// Each item is in the format: <base>,<timestamp>,<type>(,<findex>)
// The 'base' is not for us: we just pass it straight back
public function get_download_statuses($downloaders) {
global $updraftplus;
$download_status = array();
foreach ($downloaders as $downloader) {
# prefix, timestamp, entity, index
if (preg_match('/^([^,]+),(\d+),([-a-z]+|db[0-9]+),(\d+)$/', $downloader, $matches)) {
$findex = (empty($matches[4])) ? '0' : $matches[4];
$updraftplus->nonce = dechex($matches[2]).$findex.substr(md5($matches[3]), 0, 3);
$updraftplus->jobdata_reset();
$status = $this->download_status($matches[2], $matches[3], $matches[4]);
if (is_array($status)) {
$status['base'] = $matches[1];
$status['timestamp'] = $matches[2];
$status['what'] = $matches[3];
$status['findex'] = $findex;
$download_status[] = $status;
}
}
}
return $download_status;
}
public function get_activejobs_list($request) {
global $updraftplus;
$download_status = empty($request['downloaders']) ? array(): $this->get_download_statuses(explode(':', $request['downloaders']));
if (!empty($request['oneshot'])) {
$job_id = get_site_option('updraft_oneshotnonce', false);
// print_active_job() for one-shot jobs that aren't in cron
$active_jobs = (false === $job_id) ? '' : $this->print_active_job($job_id, true);
} elseif (!empty($request['thisjobonly'])) {
// print_active_jobs() is for resumable jobs where we want the cron info to be included in the output
$active_jobs = $this->print_active_jobs($request['thisjobonly']);
} else {
$active_jobs = $this->print_active_jobs();
}
$logupdate_array = array();
if (!empty($request['log_fetch'])) {
if (isset($request['log_nonce'])) {
$log_nonce = $request['log_nonce'];
$log_pointer = isset($request['log_pointer']) ? absint($request['log_pointer']) : 0;
$logupdate_array = $this->fetch_log($log_nonce, $log_pointer);
}
}
return array(
// We allow the front-end to decide what to do if there's nothing logged - we used to (up to 1.11.29) send a pre-defined message
'l' => htmlspecialchars(UpdraftPlus_Options::get_updraft_option('updraft_lastmessage', '')),
'j' => $active_jobs,
'ds' => $download_status,
'u' => $logupdate_array
);
}
public function request_backupnow($request, $close_connection_callable = false) {
global $updraftplus;
$backupnow_nocloud = (empty($request['backupnow_nocloud'])) ? false : true;
$event = (!empty($request['backupnow_nofiles'])) ? 'updraft_backupnow_backup_database' : ((!empty($request['backupnow_nodb'])) ? 'updraft_backupnow_backup' : 'updraft_backupnow_backup_all');
// The call to backup_time_nonce() allows us to know the nonce in advance, and return it
$nonce = $updraftplus->backup_time_nonce();
$msg = array(
'nonce' => $nonce,
'm' => '<strong>'.__('Start backup', 'updraftplus').':</strong> '.htmlspecialchars(__('OK. You should soon see activity in the "Last log message" field below.','updraftplus'))
);
if ($close_connection_callable && is_callable($close_connection_callable)) {
call_user_func($close_connection_callable, $msg);
} else {
$updraftplus->close_browser_connection(json_encode($msg));
}
$options = array('nocloud' => $backupnow_nocloud, 'use_nonce' => $nonce);
if (!empty($request['onlythisfileentity']) && is_string($request['onlythisfileentity'])) {
// Something to see in the 'last log' field when it first appears, before the backup actually starts
$updraftplus->log(__('Start backup','updraftplus'));
$options['restrict_files_to_override'] = explode(',', $request['onlythisfileentity']);
}
if (!empty($request['extradata'])) {
$options['extradata'] = $request['extradata'];
}
do_action($event, apply_filters('updraft_backupnow_options', $options, $request));
}
public function fetch_log($backup_nonce, $log_pointer=0) {
global $updraftplus;
if (empty($backup_nonce)) {
list($mod_time, $log_file, $nonce) = $updraftplus->last_modified_log();
} else {
$nonce = $backup_nonce;
}
if (!preg_match('/^[0-9a-f]+$/', $nonce)) die('Security check');
$log_content = '';
$new_pointer = $log_pointer;
if (!empty($nonce)) {
$updraft_dir = $updraftplus->backups_dir_location();
$potential_log_file = $updraft_dir."/log.".$nonce.".txt";
if (is_readable($potential_log_file)){
$templog_array = array();
$log_file = fopen($potential_log_file, "r");
if ($log_pointer > 0) fseek($log_file, $log_pointer);
while (($buffer = fgets($log_file, 4096)) !== false) {
$templog_array[] = $buffer;
}
if (!feof($log_file)) {
$templog_array[] = __('Error: unexpected file read fail', 'updraftplus');
}
$new_pointer = ftell($log_file);
$log_content = implode("", $templog_array);
} else {
$log_content .= __('The log file could not be read.','updraftplus');
}
} else {
$log_content .= __('The log file could not be read.','updraftplus');
}
$ret_array = array(
'html' => $log_content,
'nonce' => $nonce,
'pointer' => $new_pointer
);
return $ret_array;
}
public function howmany_overdue_crons() {
$how_many_overdue = 0;
if (function_exists('_get_cron_array') || (is_file(ABSPATH.WPINC.'/cron.php') && include_once(ABSPATH.WPINC.'/cron.php') && function_exists('_get_cron_array'))) {
$crons = _get_cron_array();
if (is_array($crons)) {
$timenow = time();
foreach ($crons as $jt => $job) {
if ($jt < $timenow) {
$how_many_overdue++;
}
}
}
}
return $how_many_overdue;
}
public function get_php_errors($errno, $errstr, $errfile, $errline) {
global $updraftplus;
if (0 == error_reporting()) return true;
$logline = $updraftplus->php_error_to_logline($errno, $errstr, $errfile, $errline);
if (false !== $logline) $this->logged[] = $logline;
# Don't pass it up the chain (since it's going to be output to the user always)
return true;
}
private function download_status($timestamp, $type, $findex) {
global $updraftplus;
$response = array( 'm' => $updraftplus->jobdata_get('dlmessage_'.$timestamp.'_'.$type.'_'.$findex).'<br>' );
if ($file = $updraftplus->jobdata_get('dlfile_'.$timestamp.'_'.$type.'_'.$findex)) {
if ('failed' == $file) {
$response['e'] = __('Download failed', 'updraftplus').'<br>';
$response['failed'] = true;
$errs = $updraftplus->jobdata_get('dlerrors_'.$timestamp.'_'.$type.'_'.$findex);
if (is_array($errs) && !empty($errs)) {
$response['e'] .= '<ul class="disc">';
foreach ($errs as $err) {
if (is_array($err)) {
$response['e'] .= '<li>'.htmlspecialchars($err['message']).'</li>';
} else {
$response['e'] .= '<li>'.htmlspecialchars($err).'</li>';
}
}
$response['e'] .= '</ul>';
}
} elseif (preg_match('/^downloaded:(\d+):(.*)$/', $file, $matches) && file_exists($matches[2])) {
$response['p'] = 100;
$response['f'] = $matches[2];
$response['s'] = (int)$matches[1];
$response['t'] = (int)$matches[1];
$response['m'] = __('File ready.', 'updraftplus');
} elseif (preg_match('/^downloading:(\d+):(.*)$/', $file, $matches) && file_exists($matches[2])) {
// Convert to bytes
$response['f'] = $matches[2];
$total_size = (int)max($matches[1], 1);
$cur_size = filesize($matches[2]);
$response['s'] = $cur_size;
$file_age = time() - filemtime($matches[2]);
if ($file_age > 20) $response['a'] = time() - filemtime($matches[2]);
$response['t'] = $total_size;
$response['m'] .= __("Download in progress", 'updraftplus').' ('.round($cur_size/1024).' / '.round(($total_size/1024)).' KB)';
$response['p'] = round(100*$cur_size/$total_size);
} else {
$response['m'] .= __('No local copy present.', 'updraftplus');
$response['p'] = 0;
$response['s'] = 0;
$response['t'] = 1;
}
}
return $response;
}
public function upload_dir($uploads) {
global $updraftplus;
$updraft_dir = $updraftplus->backups_dir_location();
if (is_writable($updraft_dir)) $uploads['path'] = $updraft_dir;
return $uploads;
}
// We do actually want to over-write
public function unique_filename_callback($dir, $name, $ext) {
return $name.$ext;
}
public function sanitize_file_name($filename) {
// WordPress 3.4.2 on multisite (at least) adds in an unwanted underscore
return preg_replace('/-db(.*)\.gz_\.crypt$/', '-db$1.gz.crypt', $filename);
}
public function plupload_action() {
// check ajax nonce
global $updraftplus;
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
if (!UpdraftPlus_Options::user_can_manage()) exit;
check_ajax_referer('updraft-uploader');
$updraft_dir = $updraftplus->backups_dir_location();
if (!@$updraftplus->really_is_writable($updraft_dir)) {
echo json_encode(array('e' => sprintf(__("Backup directory (%s) is not writable, or does not exist.", 'updraftplus'), $updraft_dir).' '.__('You will find more information about this in the Settings section.', 'updraftplus')));
exit;
}
add_filter('upload_dir', array($this, 'upload_dir'));
add_filter('sanitize_file_name', array($this, 'sanitize_file_name'));
// handle file upload
$farray = array('test_form' => true, 'action' => 'plupload_action');
$farray['test_type'] = false;
$farray['ext'] = 'x-gzip';
$farray['type'] = 'application/octet-stream';
if (!isset($_POST['chunks'])) {
$farray['unique_filename_callback'] = array($this, 'unique_filename_callback');
}
$status = wp_handle_upload(
$_FILES['async-upload'],
$farray
);
remove_filter('upload_dir', array($this, 'upload_dir'));
remove_filter('sanitize_file_name', array($this, 'sanitize_file_name'));
if (isset($status['error'])) {
echo json_encode(array('e' => $status['error']));
exit;
}
// If this was the chunk, then we should instead be concatenating onto the final file
if (isset($_POST['chunks']) && isset($_POST['chunk']) && preg_match('/^[0-9]+$/',$_POST['chunk'])) {
$final_file = basename($_POST['name']);
if (!rename($status['file'], $updraft_dir.'/'.$final_file.'.'.$_POST['chunk'].'.zip.tmp')) {
@unlink($status['file']);
echo json_encode(array('e' => sprintf(__('Error: %s', 'updraftplus'), __('This file could not be uploaded', 'updraftplus'))));
exit;
}
$status['file'] = $updraft_dir.'/'.$final_file.'.'.$_POST['chunk'].'.zip.tmp';
// Final chunk? If so, then stich it all back together
if ($_POST['chunk'] == $_POST['chunks']-1) {
if ($wh = fopen($updraft_dir.'/'.$final_file, 'wb')) {
for ($i=0 ; $i<$_POST['chunks']; $i++) {
$rf = $updraft_dir.'/'.$final_file.'.'.$i.'.zip.tmp';
if ($rh = fopen($rf, 'rb')) {
while ($line = fread($rh, 32768)) fwrite($wh, $line);
fclose($rh);
@unlink($rf);
}
}
fclose($wh);
$status['file'] = $updraft_dir.'/'.$final_file;
if ('.tar' == substr($final_file, -4, 4)) {
if (file_exists($status['file'].'.gz')) unlink($status['file'].'.gz');
if (file_exists($status['file'].'.bz2')) unlink($status['file'].'.bz2');
} elseif ('.tar.gz' == substr($final_file, -7, 7)) {
if (file_exists(substr($status['file'], 0, strlen($status['file'])-3))) unlink(substr($status['file'], 0, strlen($status['file'])-3));
if (file_exists(substr($status['file'], 0, strlen($status['file'])-3).'.bz2')) unlink(substr($status['file'], 0, strlen($status['file'])-3).'.bz2');
} elseif ('.tar.bz2' == substr($final_file, -8, 8)) {
if (file_exists(substr($status['file'], 0, strlen($status['file'])-4))) unlink(substr($status['file'], 0, strlen($status['file'])-4));
if (file_exists(substr($status['file'], 0, strlen($status['file'])-4).'.gz')) unlink(substr($status['file'], 0, strlen($status['file'])-3).'.gz');
}
}
}
}
$response = array();
if (!isset($_POST['chunks']) || (isset($_POST['chunk']) && $_POST['chunk'] == $_POST['chunks']-1)) {
$file = basename($status['file']);
if (!preg_match('/^log\.[a-f0-9]{12}\.txt/i', $file) && !preg_match('/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-([\-a-z]+)([0-9]+)?(\.(zip|gz|gz\.crypt))?$/i', $file, $matches)) {
$accept = apply_filters('updraftplus_accept_archivename', array());
if (is_array($accept)) {
foreach ($accept as $acc) {
if (preg_match('/'.$acc['pattern'].'/i', $file)) $accepted = $acc['desc'];
}
}
if (!empty($accepted)) {
$response['dm'] = sprintf(__('This backup was created by %s, and can be imported.', 'updraftplus'), $accepted);
} else {
@unlink($status['file']);
echo json_encode(array('e' => sprintf(__('Error: %s', 'updraftplus'),__('Bad filename format - this does not look like a file created by UpdraftPlus','updraftplus'))));
exit;
}
} else {
$backupable_entities = $updraftplus->get_backupable_file_entities(true);
$type = isset($matches[3]) ? $matches[3] : '';
if (!preg_match('/^log\.[a-f0-9]{12}\.txt/', $file) && 'db' != $type && !isset($backupable_entities[$type])) {
@unlink($status['file']);
echo json_encode(array('e' => sprintf(__('Error: %s', 'updraftplus'),sprintf(__('This looks like a file created by UpdraftPlus, but this install does not know about this type of object: %s. Perhaps you need to install an add-on?','updraftplus'), htmlspecialchars($type)))));
exit;
}
}
}
// send the uploaded file url in response
$response['m'] = $status['url'];
echo json_encode($response);
exit;
}
# Database decrypter
public function plupload_action2() {
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
global $updraftplus;
if (!UpdraftPlus_Options::user_can_manage()) exit;
check_ajax_referer('updraft-uploader');
$updraft_dir = $updraftplus->backups_dir_location();
if (!is_writable($updraft_dir)) exit;
add_filter('upload_dir', array($this, 'upload_dir'));
add_filter('sanitize_file_name', array($this, 'sanitize_file_name'));
// handle file upload
$farray = array( 'test_form' => true, 'action' => 'plupload_action2' );
$farray['test_type'] = false;
$farray['ext'] = 'crypt';
$farray['type'] = 'application/octet-stream';
if (isset($_POST['chunks'])) {
// $farray['ext'] = 'zip';
// $farray['type'] = 'application/zip';
} else {
$farray['unique_filename_callback'] = array($this, 'unique_filename_callback');
}
$status = wp_handle_upload(
$_FILES['async-upload'],
$farray
);
remove_filter('upload_dir', array($this, 'upload_dir'));
remove_filter('sanitize_file_name', array($this, 'sanitize_file_name'));
if (isset($status['error'])) {
echo 'ERROR:'.$status['error'];
exit;
}
// If this was the chunk, then we should instead be concatenating onto the final file
if (isset($_POST['chunks']) && isset($_POST['chunk']) && preg_match('/^[0-9]+$/',$_POST['chunk'])) {
$final_file = basename($_POST['name']);
rename($status['file'], $updraft_dir.'/'.$final_file.'.'.$_POST['chunk'].'.zip.tmp');
$status['file'] = $updraft_dir.'/'.$final_file.'.'.$_POST['chunk'].'.zip.tmp';
// Final chunk? If so, then stich it all back together
if ($_POST['chunk'] == $_POST['chunks']-1) {
if ($wh = fopen($updraft_dir.'/'.$final_file, 'wb')) {
for ($i=0 ; $i<$_POST['chunks']; $i++) {
$rf = $updraft_dir.'/'.$final_file.'.'.$i.'.zip.tmp';
if ($rh = fopen($rf, 'rb')) {
while ($line = fread($rh, 32768)) fwrite($wh, $line);
fclose($rh);
@unlink($rf);
}
}
fclose($wh);
$status['file'] = $updraft_dir.'/'.$final_file;
}
}
}
if (!isset($_POST['chunks']) || (isset($_POST['chunk']) && $_POST['chunk'] == $_POST['chunks']-1)) {
$file = basename($status['file']);
if (!preg_match('/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i', $file)) {
@unlink($status['file']);
echo 'ERROR:'.__('Bad filename format - this does not look like an encrypted database file created by UpdraftPlus','updraftplus');
exit;
}
}
// send the uploaded file url in response
// echo 'OK:'.$status['url'];
echo 'OK:'.$file;
exit;
}
public function settings_header() {
global $updraftplus;
?>
<div class="wrap" id="updraft-wrap">
<h1><?php echo $updraftplus->plugin_title; ?></h1>
<a href="https://updraftplus.com">UpdraftPlus.Com</a> |
<?php if (!defined('UPDRAFTPLUS_NOADS_B')) { ?><a href="https://updraftplus.com/shop/updraftplus-premium/"><?php _e("Premium",'updraftplus');?></a> | <?php } ?>
<a href="https://updraftplus.com/news/"><?php _e('News','updraftplus');?></a> |
<a href="https://twitter.com/updraftplus"><?php _e('Twitter', 'updraftplus');?></a> |
<a href="https://updraftplus.com/support/"><?php _e("Support",'updraftplus');?></a> |
<?php if (!is_file(UPDRAFTPLUS_DIR.'/udaddons/updraftplus-addons.php')) { ?><a href="https://updraftplus.com/newsletter-signup"><?php _e("Newsletter sign-up", 'updraftplus');?></a> | <?php } ?>
<a href="http://david.dw-perspective.org.uk"><?php _e("Lead developer's homepage",'updraftplus');?></a> |
<a href="https://updraftplus.com/support/frequently-asked-questions/"><?php _e('FAQs', 'updraftplus'); ?></a> | <a href="https://www.simbahosting.co.uk/s3/shop/"><?php _e('More plugins', 'updraftplus');?></a> - <?php _e('Version','updraftplus');?>: <?php echo $updraftplus->version; ?>
<br>
<?php
}
public function settings_output() {
if (false == ($render = apply_filters('updraftplus_settings_page_render', true))) {
do_action('updraftplus_settings_page_render_abort', $render);
return;
}
do_action('updraftplus_settings_page_init');
global $updraftplus;
/*
we use request here because the initial restore is triggered by a POSTed form. we then may need to obtain credentials
for the WP_Filesystem. to do this WP outputs a form, but we don't pass our parameters via that. So the values are
passed back in as GET parameters.
*/
if (isset($_REQUEST['action']) && (($_REQUEST['action'] == 'updraft_restore' && isset($_REQUEST['backup_timestamp'])) || ('updraft_restore_continue' == $_REQUEST['action'] && !empty($_REQUEST['restoreid'])))) {
$is_continuation = ('updraft_restore_continue' == $_REQUEST['action']) ? true : false;
if ($is_continuation) {
$restore_in_progress = get_site_option('updraft_restore_in_progress');
if ($restore_in_progress != $_REQUEST['restoreid']) {
$abort_restore_already = true;
$updraftplus->log(__('Sufficient information about the in-progress restoration operation could not be found.', 'updraftplus').' (restoreid_mismatch)', 'error', 'restoreid_mismatch');
} else {
$restore_jobdata = $updraftplus->jobdata_getarray($restore_in_progress);
if (is_array($restore_jobdata) && isset($restore_jobdata['job_type']) && 'restore' == $restore_jobdata['job_type'] && isset($restore_jobdata['second_loop_entities']) && !empty($restore_jobdata['second_loop_entities']) && isset($restore_jobdata['job_time_ms']) && isset($restore_jobdata['backup_timestamp'])) {
$backup_timestamp = $restore_jobdata['backup_timestamp'];
$continuation_data = $restore_jobdata;
} else {
$abort_restore_already = true;
$updraftplus->log(__('Sufficient information about the in-progress restoration operation could not be found.', 'updraftplus').' (restoreid_nojobdata)', 'error', 'restoreid_nojobdata');
}
}
} else {
$backup_timestamp = $_REQUEST['backup_timestamp'];
$continuation_data = null;
}
if (empty($abort_restore_already)) {
$backup_success = $this->restore_backup($backup_timestamp, $continuation_data);
} else {
$backup_success = false;
}
if (empty($updraftplus->errors) && $backup_success === true) {
// TODO: Deal with the case of some of the work having been deferred
// If we restored the database, then that will have out-of-date information which may confuse the user - so automatically re-scan for them.
$updraftplus->rebuild_backup_history();
echo '<p><strong>';
$updraftplus->log_e('Restore successful!');
echo '</strong></p>';
$updraftplus->log("Restore successful");
$s_val = 1;
if (!empty($this->entities_to_restore) && is_array($this->entities_to_restore)) {
foreach ($this->entities_to_restore as $k => $v) {
if ('db' != $v) $s_val = 2;
}
}
$pval = ($updraftplus->have_addons) ? 1 : 0;
echo '<strong>'.__('Actions','updraftplus').':</strong> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&updraft_restore_success='.$s_val.'&pval='.$pval.'">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
return;
} elseif (is_wp_error($backup_success)) {
echo '<p>';
$updraftplus->log_e('Restore failed...');
echo '</p>';
$updraftplus->log_wp_error($backup_success);
$updraftplus->log("Restore failed");
$updraftplus->list_errors();
echo '<strong>'.__('Actions','updraftplus').':</strong> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
return;
} elseif (false === $backup_success) {
# This means, "not yet - but stay on the page because we may be able to do it later, e.g. if the user types in the requested information"
echo '<p>';
$updraftplus->log_e('Restore failed...');
echo '</p>';
$updraftplus->log("Restore failed");
$updraftplus->list_errors();
echo '<strong>'.__('Actions','updraftplus').':</strong> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
return;
}
}
if (isset($_REQUEST['action']) && 'updraft_delete_old_dirs' == $_REQUEST['action']) {
$nonce = (empty($_REQUEST['_wpnonce'])) ? "" : $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce')) die('Security check');
$this->delete_old_dirs_go();
return;
}
if (!empty($_REQUEST['action']) && 'updraftplus_broadcastaction' == $_REQUEST['action'] && !empty($_REQUEST['subaction'])) {
$nonce = (empty($_REQUEST['nonce'])) ? "" : $_REQUEST['nonce'];
if (!wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce')) die('Security check');
do_action($_REQUEST['subaction']);
return;
}
if (isset($_GET['error'])) {
// This is used by Microsoft OneDrive authorisation failures (May 15). I am not sure what may have been using the 'error' GET parameter otherwise - but it is harmless.
if (!empty($_GET['error_description'])) {
$this->show_admin_warning(htmlspecialchars($_GET['error_description']).' ('.htmlspecialchars($_GET['error']).')', 'error');
} else {
$this->show_admin_warning(htmlspecialchars($_GET['error']), 'error');
}
}
if (isset($_GET['message'])) $this->show_admin_warning(htmlspecialchars($_GET['message']));
if (isset($_GET['action']) && $_GET['action'] == 'updraft_create_backup_dir' && isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'], 'create_backup_dir')) {
$created = $this->create_backup_dir();
if (is_wp_error($created)) {
echo '<p>'.__('Backup directory could not be created', 'updraftplus').'...<br/>';
echo '<ul class="disc">';
foreach ($created->get_error_messages() as $key => $msg) {
echo '<li>'.htmlspecialchars($msg).'</li>';
}
echo '</ul></p>';
} elseif ($created !== false) {
echo '<p>'.__('Backup directory successfully created.', 'updraftplus').'</p><br/>';
}
echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration', 'updraftplus').'</a>';
return;
}
echo '<div id="updraft_backup_started" class="updated updraft-hidden" style="display:none;"></div>';
if (isset($_POST['action']) && 'updraft_backup_debug_all' == $_POST['action']) {
$updraftplus->boot_backup(true,true);
} elseif (isset($_POST['action']) && 'updraft_backup_debug_db' == $_POST['action']) {
$updraftplus->boot_backup(false, true, false, true);
} elseif (isset($_POST['action']) && 'updraft_wipesettings' == $_POST['action']) {
$settings = $updraftplus->get_settings_keys();
foreach ($settings as $s) UpdraftPlus_Options::delete_updraft_option($s);
// These aren't in get_settings_keys() because they are always in the options table, regardless of context
global $wpdb;
$wpdb->query("DELETE FROM $wpdb->options WHERE ( option_name LIKE 'updraftplus_unlocked_%' OR option_name LIKE 'updraftplus_locked_%' OR option_name LIKE 'updraftplus_last_lock_time_%' OR option_name LIKE 'updraftplus_semaphore_%' OR option_name LIKE 'updraft_jobdata_%' OR option_name LIKE 'updraft_last_scheduled_%' )");
$site_options = array('updraft_oneshotnonce');
foreach ($site_options as $s) delete_site_option($s);
$this->show_admin_warning(__("Your settings have been wiped.", 'updraftplus'));
}
// This opens a div
$this->settings_header();
?>
<div id="updraft-hidethis">
<p>
<strong><?php _e('Warning:', 'updraftplus'); ?> <?php _e("If you can still read these words after the page finishes loading, then there is a JavaScript or jQuery problem in the site.", 'updraftplus'); ?></strong>
<?php if (false !== strpos(basename(UPDRAFTPLUS_URL), ' ')) { ?>
<strong><?php _e('The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem.', 'updraftplus');?></strong>
<?php } else { ?>
<a href="https://updraftplus.com/do-you-have-a-javascript-or-jquery-error/"><?php _e('Go here for more information.', 'updraftplus'); ?></a>
<?php } ?>
</p>
</div>
<?php
$include_deleteform_div = true;
// Opens a div, which needs closing later
if (isset($_GET['updraft_restore_success'])) {
$success_advert = (isset($_GET['pval']) && 0 == $_GET['pval'] && !$updraftplus->have_addons) ? '<p>'.__('For even more features and personal support, check out ','updraftplus').'<strong><a href="https://updraftplus.com/shop/updraftplus-premium/" target="_blank">UpdraftPlus Premium</a>.</strong></p>' : "";
echo "<div class=\"updated backup-restored\"><span><strong>".__('Your backup has been restored.','updraftplus').'</strong></span><br>';
// Unnecessary - will be advised of this below
// if (2 == $_GET['updraft_restore_success']) echo ' '.__('Your old (themes, uploads, plugins, whatever) directories have been retained with "-old" appended to their name. Remove them when you are satisfied that the backup worked properly.');
echo $success_advert;
$include_deleteform_div = false;
}
// $this->print_restore_in_progress_box_if_needed();
if ($this->scan_old_dirs(true)) $this->print_delete_old_dirs_form(true, $include_deleteform_div);
// Close the div opened by the earlier section
if (isset($_GET['updraft_restore_success'])) echo '</div>';
$ws_advert = $updraftplus->wordshell_random_advert(1);
if ($ws_advert && empty($success_advert) && empty($this->no_settings_warning)) { echo '<div class="updated ws_advert" style="clear:left;">'.$ws_advert.'</div>'; }
if (!$updraftplus->memory_check(64)) {?>
<div class="updated memory-limit"><?php _e("Your PHP memory limit (set by your web hosting company) is very low. UpdraftPlus attempted to raise it but was unsuccessful. This plugin may struggle with a memory limit of less than 64 Mb - especially if you have very large files uploaded (though on the other hand, many sites will be successful with a 32Mb limit - your experience may vary).",'updraftplus');?> <?php _e('Current limit is:','updraftplus');?> <?php echo $updraftplus->memory_check_current(); ?> MB</div>
<?php
}
if (!empty($updraftplus->errors)) {
echo '<div class="error updraft_list_errors">';
$updraftplus->list_errors();
echo '</div>';
}
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
if (empty($backup_history)) {
$updraftplus->rebuild_backup_history();
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
}
$backup_history = is_array($backup_history) ? $backup_history : array();
?>
<h2 class="nav-tab-wrapper">
<?php
$tabflag = 1;
if (isset($_REQUEST['tab'])){
switch($_REQUEST['tab']) {
case 'status': $tabflag = 1; break;
case 'backups': $tabflag = 2; break;
case 'settings': $tabflag = 3; break;
case 'expert': $tabflag = 4; break;
case 'addons': $tabflag = 5; break;
default : $tabflag = 1;
}
}
?>
<a class="nav-tab <?php if (1 == $tabflag) echo 'nav-tab-active'; ?>" id="updraft-navtab-status" href="#updraft-navtab-status-content" ><?php _e('Current Status', 'updraftplus');?> </span></a>
<a class="nav-tab <?php if (2 == $tabflag) echo 'nav-tab-active'; ?>" id="updraft-navtab-backups" href="#updraft-navtab-backups-contents" ><?php echo __('Existing Backups', 'updraftplus').' ('.count($backup_history).')';?> </span></a>
<a class="nav-tab <?php if (3 == $tabflag) echo 'nav-tab-active'; ?>" id="updraft-navtab-settings" href="#updraft-navtab-settings-content"><?php _e('Settings', 'updraftplus');?> </span></a>
<a class="nav-tab<?php if (4 == $tabflag) echo ' nav-tab-active'; ?>" id="updraft-navtab-expert" href="#updraft-navtab-expert-content"><?php _e('Advanced Tools', 'updraftplus');?> </span></a>
<a class="nav-tab<?php if (5 == $tabflag) echo ' nav-tab-active'; ?>" id="updraft-navtab-addons" href="#updraft-navtab-addons-content"><?php _e('Premium / Extensions', 'updraftplus');?> </span></a>
<?php //do_action('updraftplus_settings_afternavtabs'); ?>
</h2>
<?php
$updraft_dir = $updraftplus->backups_dir_location();
$backup_disabled = ($updraftplus->really_is_writable($updraft_dir)) ? '' : 'disabled="disabled"';
?>
<div id="updraft-poplog" >
<pre id="updraft-poplog-content"></pre>
</div>
<div id="updraft-navtab-status-content" class="<?php if (1 != $tabflag) echo 'updraft-hidden'; ?>" style="<?php if (1 != $tabflag) echo 'display:none;'; ?>">
<div id="updraft-insert-admin-warning"></div>
<table class="form-table" style="float:left; clear:both;">
<noscript>
<tr>
<th><?php _e('JavaScript warning','updraftplus');?>:</th>
<td style="color:red"><?php _e('This admin interface uses JavaScript heavily. You either need to activate it within your browser, or to use a JavaScript-capable browser.','updraftplus');?></td>
</tr>
</noscript>
<tr>
<th></th>
<td>
<?php
if ($backup_disabled) {
$unwritable_mess = htmlspecialchars(__("The 'Backup Now' button is disabled as your backup directory is not writable (go to the 'Settings' tab and find the relevant option).", 'updraftplus'));
$this->show_admin_warning($unwritable_mess, "error");
}
?>
<button id="updraft-backupnow-button" type="button" <?php echo $backup_disabled ?> class="updraft-bigbutton button-primary" <?php if ($backup_disabled) echo 'title="'.esc_attr(__('This button is disabled because your backup directory is not writable (see the settings).', 'updraftplus')).'" ';?> onclick="updraft_backup_dialog_open();"><?php _e('Backup Now', 'updraftplus');?></button>
<button type="button" class="updraft-bigbutton button-primary" onclick="updraft_openrestorepanel();">
<?php _e('Restore','updraftplus');?>
</button>
<button type="button" class="updraft-bigbutton button-primary" onclick="updraft_migrate_dialog_open();"><?php _e('Clone/Migrate','updraftplus');?></button>
</td>
</tr>
<?php
$last_backup_html = $this->last_backup_html();
$current_time = get_date_from_gmt(gmdate('Y-m-d H:i:s'), 'D, F j, Y H:i');
// $current_time = date_i18n('D, F j, Y H:i');
?>
<script>var lastbackup_laststatus = '<?php echo esc_js($last_backup_html);?>';</script>
<tr>
<th><span title="<?php esc_attr_e("All the times shown in this section are using WordPress's configured time zone, which you can set in Settings -> General", 'updraftplus'); ?>"><?php _e('Next scheduled backups', 'updraftplus');?>:<br>
<span style="font-weight:normal;"><em><?php _e('Now', 'updraftplus');?>: <?php echo $current_time; ?></span></span></em></th>
<td>
<table id="next-backup-table-inner" class="next-backup">
<?php $this->next_scheduled_backups_output(); ?>
</table>
</td>
</tr>
<tr>
<th><?php _e('Last backup job run:','updraftplus');?></th>
<td id="updraft_last_backup"><?php echo $last_backup_html ?></td>
</tr>
</table>
<br style="clear:both;" />
<?php $this->render_active_jobs_and_log_table(); ?>
<div id="updraft-migrate-modal" title="<?php _e('Migrate Site', 'updraftplus'); ?>" style="display:none;">
<?php
if (class_exists('UpdraftPlus_Addons_Migrator')) {
do_action('updraftplus_migrate_modal_output');
} else {
echo '<p id="updraft_migrate_modal_main">'.__('Do you want to migrate or clone/duplicate a site?', 'updraftplus').'</p><p>'.__('Then, try out our "Migrator" add-on. After using it once, you\'ll have saved the purchase price compared to the time needed to copy a site by hand.', 'updraftplus').'</p><p><a href="https://updraftplus.com/landing/migrator">'.__('Get it here.', 'updraftplus').'</a></p>';
}
?>
</div>
<div id="updraft-iframe-modal">
<div id="updraft-iframe-modal-innards">
</div>
</div>
<div id="updraft-backupnow-modal" title="UpdraftPlus - <?php _e('Perform a one-time backup', 'updraftplus'); ?>">
<!-- <p>
<?php _e("To proceed, press 'Backup Now'. Then, watch the 'Last Log Message' field for activity.", 'updraftplus');?>
</p>-->
<?php echo $this->backupnow_modal_contents(); ?>
</div>
<?php
if (is_multisite() && !file_exists(UPDRAFTPLUS_DIR.'/addons/multisite.php')) {
?>
<h2>UpdraftPlus <?php _e('Multisite','updraftplus');?></h2>
<table>
<tr>
<td>
<p class="multisite-advert-width"><?php echo __('Do you need WordPress Multisite support?','updraftplus').' <a href="https://updraftplus.com/shop/updraftplus-premium/">'. __('Please check out UpdraftPlus Premium, or the stand-alone Multisite add-on.','updraftplus');?></a>.</p>
</td>
</tr>
</table>
<?php } ?>
</div>
<div id="updraft-navtab-backups-content" <?php if (2 != $tabflag) echo 'class="updraft-hidden"'; ?> style="<?php if (2 != $tabflag) echo 'display:none;'; ?>">
<?php
$is_opera = (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') || false !== strpos($_SERVER['HTTP_USER_AGENT'], 'OPR/'));
$tmp_opts = array('include_opera_warning' => $is_opera);
$this->settings_downloading_and_restoring($backup_history, false, $tmp_opts);
$this->settings_delete_and_restore_modals();
?>
</div>
<div id="updraft-navtab-settings-content" <?php if (3 != $tabflag) echo 'class="updraft-hidden"'; ?> style="<?php if (3 != $tabflag) echo 'display:none;'; ?>">
<h2 class="updraft_settings_sectionheading"><?php _e('Backup Contents And Schedule','updraftplus');?></h2>
<?php UpdraftPlus_Options::options_form_begin(); ?>
<?php $this->settings_formcontents(); ?>
</form>
</div>
<div id="updraft-navtab-expert-content"<?php if (4 != $tabflag) echo ' class="updraft-hidden"'; ?> style="<?php if (4 != $tabflag) echo 'display:none;'; ?>">
<?php $this->settings_expertsettings($backup_disabled); ?>
</div>
<div id="updraft-navtab-addons-content"<?php if (5 != $tabflag) echo ' class="updraft-hidden"'; ?> style="<?php if (5 != $tabflag) echo 'display:none;'; ?>">
<?php
$tick = UPDRAFTPLUS_URL.'/images/updraft_tick.png';
$cross = UPDRAFTPLUS_URL.'/images/updraft_cross.png';
$freev = UPDRAFTPLUS_URL.'/images/updraft_freev.png';
$premv = UPDRAFTPLUS_URL.'/images/updraft_premv.png';
ob_start();
?>
<div>
<h2>UpdraftPlus Premium</h2>
<p>
<span class="premium-upgrade-prompt"><?php _e('You are currently using the free version of UpdraftPlus from wordpress.org.', 'updraftplus');?> <a href="https://updraftplus.com/support/installing-updraftplus-premium-your-add-on/"><br><?php echo __('If you have made a purchase from UpdraftPlus.Com, then follow this link to the instructions to install your purchase.', 'updraftplus').' '.__('The first step is to de-install the free version.', 'updraftplus')?></a></span>
<ul class="updraft_premium_description_list">
<li><a href="https://updraftplus.com/shop/updraftplus-premium/"><strong><?php _e('Get UpdraftPlus Premium', 'updraftplus');?></strong></a></li>
<li><a href="https://updraftplus.com/updraftplus-full-feature-list/"><?php _e('Full feature list', 'updraftplus');?></a></li>
<li><a href="https://updraftplus.com/faq-category/general-and-pre-sales-questions/"><?php _e('Pre-sales FAQs', 'updraftplus');?></a></li>
<li class="last"><a href="https://updraftplus.com/ask-a-pre-sales-question/"><?php _e('Ask a pre-sales question', 'updraftplus');?></a> - <a href="https://updraftplus.com/support/"><?php _e('Support', 'updraftplus');?></a></li>
</ul>
</p>
</div>
<div>
<table class="updraft_feat_table">
<tr>
<th class="updraft_feat_th" style="text-align:left;"></th>
<th class="updraft_feat_th"><img src="<?php echo $freev;?>" height="120"></th>
<th class="updraft_feat_th" style='background-color:#DF6926;'><a href="https://updraftplus.com/shop/updraftplus-premium/"><img src="<?php echo $premv;?>" height="120"></a></th>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Get it from', 'updraftplus');?></td>
<td class="updraft_tick_cell" style="vertical-align:top; line-height: 120%; margin-top:6px; padding-top:6px;">WordPress.Org</td>
<td class="updraft_tick_cell" style="padding: 6px; line-height: 120%;">
UpdraftPlus.Com<br>
<a href="https://updraftplus.com/shop/updraftplus-premium/"><strong><?php _e('Buy It Now!', 'updraftplus');?></strong></a><br>
</td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Backup WordPress files and database', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php echo sprintf(__('Translated into over %s languages', 'updraftplus'), 16);?></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Restore from backup', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Backup to remote storage', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Dropbox, Google Drive, FTP, S3, Rackspace, Email', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('WebDAV, Copy.Com, SFTP/SCP, encrypted FTP', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Microsoft OneDrive, Microsoft Azure, Google Cloud Storage', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Free 1GB for UpdraftPlus Vault', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Backup extra files and databases', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Migrate / clone (i.e. copy) websites', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Basic email reporting', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Advanced reporting features', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Automatic backup when updating WP/plugins/themes', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Send backups to multiple remote destinations', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Database encryption', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Restore backups from other plugins', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('No advertising links on UpdraftPlus settings page', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Scheduled backups', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Fix backup time', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Network/Multisite support', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Lock settings access', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
<tr>
<td class="updraft_feature_cell"><?php _e('Personal support', 'updraftplus');?></td>
<td class="updraft_tick_cell"><img src="<?php echo $cross;?>"></td>
<td class="updraft_tick_cell"><img src="<?php echo $tick;?>"></td>
</tr>
</table>
</div>
<?php
echo apply_filters('updraftplus_addonstab_content', ob_get_clean());
// Close addons tab
echo '</div>';
// settings_header() opens a div
echo '</div>';
}
private function print_restore_in_progress_box_if_needed() {
$restore_in_progress = get_site_option('updraft_restore_in_progress');
if (!empty($restore_in_progress)) {
global $updraftplus;
$restore_jobdata = $updraftplus->jobdata_getarray($restore_in_progress);
if (is_array($restore_jobdata) && !empty($restore_jobdata)) {
// Only print if within the last 24 hours; and only after 2 minutes
if (isset($restore_jobdata['job_type']) && 'restore' == $restore_jobdata['job_type'] && isset($restore_jobdata['second_loop_entities']) && !empty($restore_jobdata['second_loop_entities']) && isset($restore_jobdata['job_time_ms']) && (time() - $restore_jobdata['job_time_ms'] > 120 || (defined('UPDRAFTPLUS_RESTORE_PROGRESS_ALWAYS_SHOW') && UPDRAFTPLUS_RESTORE_PROGRESS_ALWAYS_SHOW)) && time() - $restore_jobdata['job_time_ms'] < 86400 && (empty($_REQUEST['action']) || ('updraft_restore' != $_REQUEST['action'] && 'updraft_restore_continue' != $_REQUEST['action']))) {
$restore_jobdata['jobid'] = $restore_in_progress;
$this->restore_in_progress_jobdata = $restore_jobdata;
add_action('all_admin_notices', array($this, 'show_admin_restore_in_progress_notice') );
}
}
}
}
public function show_admin_restore_in_progress_notice() {
if (isset($_REQUEST['action']) && 'updraft_restore_abort' == $_REQUEST['action'] && !empty($_REQUEST['restoreid'])) {
delete_site_option('updraft_restore_in_progress');
return;
}
$restore_jobdata = $this->restore_in_progress_jobdata;
$seconds_ago = time() - (int)$restore_jobdata['job_time_ms'];
$minutes_ago = floor($seconds_ago/60);
$seconds_ago = $seconds_ago - $minutes_ago*60;
$time_ago = sprintf(__("%s minutes, %s seconds", 'updraftplus'), $minutes_ago, $seconds_ago);
?><div class="updated show_admin_restore_in_progress_notice">
<span class="unfinished-restoration"><strong><?php echo 'UpdraftPlus: '.__('Unfinished restoration', 'updraftplus'); ?> </strong></span><br>
<p><?php printf(__('You have an unfinished restoration operation, begun %s ago.', 'updraftplus'), $time_ago);?></p>
<form method="post" action="<?php echo UpdraftPlus_Options::admin_page_url().'?page=updraftplus'; ?>">
<?php wp_nonce_field('updraftplus-credentialtest-nonce'); ?>
<input id="updraft_restore_continue_action" type="hidden" name="action" value="updraft_restore_continue">
<input type="hidden" name="restoreid" value="<?php echo $restore_jobdata['jobid'];?>" value="<?php echo esc_attr($restore_jobdata['jobid']);?>">
<button onclick="jQuery('#updraft_restore_continue_action').val('updraft_restore_continue'); jQuery(this).parent('form').submit();" type="submit" class="button-primary"><?php _e('Continue restoration', 'updraftplus'); ?></button>
<button onclick="jQuery('#updraft_restore_continue_action').val('updraft_restore_abort'); jQuery(this).parent('form').submit();" class="button-secondary"><?php _e('Dismiss', 'updraftplus');?></button>
</form><?php
echo "</div>";
}
public function backupnow_modal_contents() {
$ret = $this->backup_now_widgetry();
// $ret .= '<p>'.__('Does nothing happen when you attempt backups?','updraftplus').' <a href="https://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/">'.__('Go here for help.', 'updraftplus').'</a></p>';
return $ret;
}
private function backup_now_widgetry() {
$ret = '';
$ret .= '<p>
<input type="checkbox" id="backupnow_includedb" checked="checked"> <label for="backupnow_includedb">'.__("Include the database in the backup", 'updraftplus').'</label><br>';
$ret .= '<input type="checkbox" id="backupnow_includefiles" checked="checked"> <label for="backupnow_includefiles">'.__("Include any files in the backup", 'updraftplus').'</label> (<a href="#" id="backupnow_includefiles_showmoreoptions">...</a>)<br>';
$ret .= '<div id="backupnow_includefiles_moreoptions" class="updraft-hidden" style="display:none;"><em>'.__('Your saved settings also affect what is backed up - e.g. files excluded.', 'updraftplus').'</em><br>'.$this->files_selector_widgetry('backupnow_files_', false, 'sometimes').'</div>';
$ret .= '<span id="backupnow_remote_container">'.$this->backup_now_remote_message().'</span>';
$ret .= '</p>';
$ret .= apply_filters('updraft_backupnow_modal_afteroptions', '', '');
return $ret;
}
// Also used by the auto-backups add-on
public function render_active_jobs_and_log_table($wide_format = false, $print_active_jobs = true) {
?>
<table class="form-table" id="updraft_activejobs_table">
<?php $active_jobs = ($print_active_jobs) ? $this->print_active_jobs() : '';?>
<tr id="updraft_activejobsrow" class="<?php
if (!$active_jobs && !$wide_format) { echo 'hidden'; }
if ($wide_format) { echo ".minimum-height"; }
?>">
<?php if ($wide_format) { ?>
<td id="updraft_activejobs" colspan="2">
<?php echo $active_jobs;?>
</td>
<?php } else { ?>
<th><?php _e('Backups in progress:', 'updraftplus');?></th>
<td id="updraft_activejobs"><?php echo $active_jobs;?></td>
<?php } ?>
</tr>
<tr id="updraft_lastlogmessagerow">
<?php if ($wide_format) {
// Hide for now - too ugly
?>
<td colspan="2" class="last-message"><strong><?php _e('Last log message','updraftplus');?>:</strong><br>
<span id="updraft_lastlogcontainer"><?php echo htmlspecialchars(UpdraftPlus_Options::get_updraft_option('updraft_lastmessage', __('(Nothing yet logged)','updraftplus'))); ?></span><br>
<?php $this->most_recently_modified_log_link(); ?>
</td>
<?php } else { ?>
<th><?php _e('Last log message','updraftplus');?>:</th>
<td>
<span id="updraft_lastlogcontainer"><?php echo htmlspecialchars(UpdraftPlus_Options::get_updraft_option('updraft_lastmessage', __('(Nothing yet logged)','updraftplus'))); ?></span><br>
<?php $this->most_recently_modified_log_link(); ?>
</td>
<?php } ?>
</tr>
<?php
# Currently disabled - not sure who we want to show this to
if (1==0 && !defined('UPDRAFTPLUS_NOADS_B')) {
$feed = $updraftplus->get_updraftplus_rssfeed();
if (is_a($feed, 'SimplePie')) {
echo '<tr><th style="vertical-align:top;">'.__('Latest UpdraftPlus.com news:', 'updraftplus').'</th><td class="updraft_simplepie">';
echo '<ul class="disc;">';
foreach ($feed->get_items(0, 5) as $item) {
echo '<li>';
echo '<a href="'.esc_attr($item->get_permalink()).'">';
echo htmlspecialchars($item->get_title());
# D, F j, Y H:i
echo "</a> (".htmlspecialchars($item->get_date('j F Y')).")";
echo '</li>';
}
echo '</ul></td></tr>';
}
}
?>
</table>
<?php
}
private function most_recently_modified_log_link() {
global $updraftplus;
list($mod_time, $log_file, $nonce) = $updraftplus->last_modified_log();
?>
<a href="?page=updraftplus&action=downloadlatestmodlog&wpnonce=<?php echo wp_create_nonce('updraftplus_download') ?>" <?php if (!$mod_time) echo 'style="display:none;"'; ?> class="updraft-log-link" onclick="event.preventDefault(); updraft_popuplog('');"><?php _e('Download most recently modified log file', 'updraftplus');?></a>
<?php
}
public function settings_downloading_and_restoring($backup_history = array(), $return_result = false, $options = array()) {
global $updraftplus;
if ($return_result) ob_start();
$default_options = array(
'include_uploader' => true,
'include_opera_warning' => false,
'will_immediately_calculate_disk_space' => true,
'include_whitespace_warning' => true,
'include_header' => false,
);
foreach ($default_options as $k => $v) {
if (!isset($options[$k])) $options[$k] = $v;
}
if (false === $backup_history) $backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
if (!is_array($backup_history)) $backup_history=array();
if (!empty($options['include_header'])) echo '<h2>'.__('Existing Backups', 'updraftplus').' ('.count($backup_history).')</h2>';
?>
<div class="download-backups form-table">
<?php /* echo '<h2>'.__('Existing Backups: Downloading And Restoring', 'updraftplus').'</h2>'; */ ?>
<?php if (!empty($options['include_whitespace_warning'])) { ?>
<p class="ud-whitespace-warning updraft-hidden" style="display:none;">
<?php echo '<strong>'.__('Warning','updraftplus').':</strong> '.__('Your WordPress installation has a problem with outputting extra whitespace. This can corrupt backups that you download from here.','updraftplus').' <a href="https://updraftplus.com/problems-with-extra-white-space/">'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</a>';?>
</p>
<?php } ?>
<ul>
<li title="<?php esc_attr_e('This is a count of the contents of your Updraft directory', 'updraftplus');?>"><strong><?php _e('Web-server disk space in use by UpdraftPlus', 'updraftplus');?>:</strong> <span class="updraft_diskspaceused"><em><?php echo empty($options['will_immediately_calculate_disk_space']) ? '' : __('calculating...', 'updraftplus'); ?></em></span> <a class="updraft_diskspaceused_update" href="#"><?php echo empty($options['will_immediately_calculate_disk_space']) ? __('calculate', 'updraftplus') : __('refresh','updraftplus');?></a></li>
<li>
<strong><?php _e('More tasks:', 'updraftplus');?></strong>
<?php if (!empty($options['include_uploader'])) { ?><a class="updraft_uploader_toggle" href="#"><?php _e('Upload backup files', 'updraftplus');?></a> | <?php } ?>
<a href="#" class="updraft_rescan_local" title="<?php echo __('Press here to look inside your UpdraftPlus directory (in your web hosting space) for any new backup sets that you have uploaded.', 'updraftplus').' '.__('The location of this directory is set in the expert settings, in the Settings tab.', 'updraftplus'); ?>"><?php _e('Rescan local folder for new backup sets', 'updraftplus');?></a>
| <a href="#" class="updraft_rescan_remote" title="<?php _e('Press here to look inside your remote storage methods for any existing backup sets (from any site, if they are stored in the same folder).', 'updraftplus'); ?>"><?php _e('Rescan remote storage','updraftplus');?></a>
</li>
<?php if (!empty($options['include_opera_warning'])) { ?>
<li><strong><?php _e('Opera web browser', 'updraftplus');?>:</strong> <?php _e('If you are using this, then turn Turbo/Road mode off.', 'updraftplus');?></li>
<?php } ?>
</ul>
<?php if (!empty($options['include_uploader'])) { ?>
<div id="updraft-plupload-modal" style="display:none;" title="<?php _e('UpdraftPlus - Upload backup files','updraftplus'); ?>">
<p class="upload"><em><?php _e("Upload files into UpdraftPlus." ,'updraftplus');?> <?php echo htmlspecialchars(__('Or, you can place them manually into your UpdraftPlus directory (usually wp-content/updraft), e.g. via FTP, and then use the "rescan" link above.', 'updraftplus'));?></em></p>
<?php
global $wp_version;
if (version_compare($wp_version, '3.3', '<')) {
echo '<em>'.sprintf(__('This feature requires %s version %s or later', 'updraftplus'), 'WordPress', '3.3').'</em>';
} else {
?>
<div id="plupload-upload-ui">
<div id="drag-drop-area">
<div class="drag-drop-inside">
<p class="drag-drop-info"><?php _e('Drop backup files here', 'updraftplus'); ?></p>
<p><?php _ex('or', 'Uploader: Drop backup files here - or - Select Files'); ?></p>
<p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
</div>
</div>
<div id="filelist">
</div>
</div>
<?php
}
?>
</div>
<?php } ?>
<div class="ud_downloadstatus"></div>
<div class="updraft_existing_backups">
<?php echo $this->existing_backup_table($backup_history); ?>
</div>
</div>
<?php
if ($return_result) return ob_get_clean();
}
public function settings_delete_and_restore_modals($return_result = false) {
global $updraftplus;
if ($return_result) ob_start();
?>
<div id="ud_massactions" class="updraft-hidden" style="display:none;">
<strong><?php _e('Actions upon selected backups', 'updraftplus');?></strong> <br>
<div class="updraftplus-remove" style="float: left;"><a href="#" onclick="updraft_deleteallselected(); return false;"><?php _e('Delete', 'updraftplus');?></a></div>
<div class="updraft-viewlogdiv"><a href="#" onclick="jQuery('#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row').addClass('backuprowselected'); return false;"><?php _e('Select all', 'updraftplus');?></a></div>
<div class="updraft-viewlogdiv"><a href="#" onclick="jQuery('#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row').removeClass('backuprowselected'); jQuery('#ud_massactions').hide(); return false;"><?php _e('Deselect', 'updraftplus');?></a></div>
</div>
<div id="updraft-message-modal" title="UpdraftPlus">
<div id="updraft-message-modal-innards">
</div>
</div>
<div id="updraft-delete-modal" title="<?php _e('Delete backup set', 'updraftplus');?>">
<form id="updraft_delete_form" method="post">
<p id="updraft_delete_question_singular">
<?php echo sprintf(__('Are you sure that you wish to remove %s from UpdraftPlus?', 'updraftplus'), __('this backup set', 'updraftplus')); ?>
</p>
<p id="updraft_delete_question_plural" class="updraft-hidden" style="display:none;">
<?php echo sprintf(__('Are you sure that you wish to remove %s from UpdraftPlus?', 'updraftplus'), __('these backup sets', 'updraftplus')); ?>
</p>
<fieldset>
<input type="hidden" name="nonce" value="<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>">
<input type="hidden" name="action" value="updraft_ajax">
<input type="hidden" name="subaction" value="deleteset">
<input type="hidden" name="backup_timestamp" value="0" id="updraft_delete_timestamp">
<input type="hidden" name="backup_nonce" value="0" id="updraft_delete_nonce">
<div id="updraft-delete-remote-section"><input checked="checked" type="checkbox" name="delete_remote" id="updraft_delete_remote" value="1"> <label for="updraft_delete_remote"><?php _e('Also delete from remote storage', 'updraftplus');?></label><br>
<p id="updraft-delete-waitwarning" class="updraft-hidden" style="display:none;"><em><?php _e('Deleting... please allow time for the communications with the remote storage to complete.', 'updraftplus');?></em></p>
</div>
</fieldset>
</form>
</div>
<div id="updraft-restore-modal" title="UpdraftPlus - <?php _e('Restore backup','updraftplus');?>">
<p><strong><?php _e('Restore backup from','updraftplus');?>:</strong> <span class="updraft_restore_date"></span></p>
<div id="updraft-restore-modal-stage2">
<p><strong><?php _e('Retrieving (if necessary) and preparing backup files...', 'updraftplus');?></strong></p>
<div id="ud_downloadstatus2"></div>
<div id="updraft-restore-modal-stage2a"></div>
</div>
<div id="updraft-restore-modal-stage1">
<p><?php _e("Restoring will replace this site's themes, plugins, uploads, database and/or other content directories (according to what is contained in the backup set, and your selection).",'updraftplus');?> <?php _e('Choose the components to restore','updraftplus');?>:</p>
<form id="updraft_restore_form" method="post">
<fieldset>
<input type="hidden" name="action" value="updraft_restore">
<input type="hidden" name="backup_timestamp" value="0" id="updraft_restore_timestamp">
<input type="hidden" name="meta_foreign" value="0" id="updraft_restore_meta_foreign">
<input type="hidden" name="updraft_restorer_backup_info" value="" id="updraft_restorer_backup_info">
<input type="hidden" name="updraft_restorer_restore_options" value="" id="updraft_restorer_restore_options">
<?php
# The 'off' check is for badly configured setups - http://wordpress.org/support/topic/plugin-wp-super-cache-warning-php-safe-mode-enabled-but-safe-mode-is-off
if ($updraftplus->detect_safe_mode()) {
echo "<p><em>".__("Your web server has PHP's so-called safe_mode active.", 'updraftplus').' '.__('This makes time-outs much more likely. You are recommended to turn safe_mode off, or to restore only one entity at a time, <a href="https://updraftplus.com/faqs/i-want-to-restore-but-have-either-cannot-or-have-failed-to-do-so-from-the-wp-admin-console/">or to restore manually</a>.', 'updraftplus')."</em></p><br/>";
}
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
foreach ($backupable_entities as $type => $info) {
if (!isset($info['restorable']) || $info['restorable'] == true) {
echo '<div><input id="updraft_restore_'.$type.'" type="checkbox" name="updraft_restore[]" value="'.$type.'"> <label id="updraft_restore_label_'.$type.'" for="updraft_restore_'.$type.'">'.$info['description'].'</label><br>';
do_action("updraftplus_restore_form_$type");
echo '</div>';
} else {
$sdescrip = isset($info['shortdescription']) ? $info['shortdescription'] : $info['description'];
echo "<div class=\"cannot-restore\"><em>".htmlspecialchars(sprintf(__('The following entity cannot be restored automatically: "%s".', 'updraftplus'), $sdescrip))." ".__('You will need to restore it manually.', 'updraftplus')."</em><br>".'<input id="updraft_restore_'.$type.'" type="hidden" name="updraft_restore[]" value="'.$type.'">';
echo '</div>';
}
}
?>
<div><input id="updraft_restore_db" type="checkbox" name="updraft_restore[]" value="db"> <label for="updraft_restore_db"><?php _e('Database','updraftplus'); ?></label><br>
<div id="updraft_restorer_dboptions" class="updraft-hidden" style="display:none;"><h4><?php echo sprintf(__('%s restoration options:','updraftplus'),__('Database','updraftplus')); ?></h4>
<?php
do_action("updraftplus_restore_form_db");
if (!class_exists('UpdraftPlus_Addons_Migrator')) {
echo '<a href="https://updraftplus.com/faqs/tell-me-more-about-the-search-and-replace-site-location-in-the-database-option/">'.__('You can search and replace your database (for migrating a website to a new location/URL) with the Migrator add-on - follow this link for more information','updraftplus').'</a>';
}
?>
</div>
</div>
</fieldset>
</form>
<p><em><a href="https://updraftplus.com/faqs/what-should-i-understand-before-undertaking-a-restoration/" target="_blank"><?php _e('Do read this helpful article of useful things to know before restoring.','updraftplus');?></a></em></p>
</div>
</div>
<?php
if ($return_result) return ob_get_clean();
}
public function settings_debugrow($head, $content) {
echo "<tr class=\"updraft_debugrow\"><th>$head</th><td>$content</td></tr>";
}
private function settings_expertsettings($backup_disabled) {
global $updraftplus, $wpdb;
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
?>
<div class="expertmode">
<p><em><?php _e('Unless you have a problem, you can completely ignore everything here.', 'updraftplus');?></em></p>
<table>
<?php
// It appears (Mar 2015) that some mod_security distributions block the output of the string el6.x86_64 in PHP output, on the silly assumption that only hackers are interested in knowing what environment PHP is running on.
// $uname_info = @php_uname();
$uname_info = @php_uname('s').' '.@php_uname('n').' ';
$release_name = @php_uname('r');
if (preg_match('/^(.*)\.(x86_64|[3456]86)$/', $release_name, $matches)) {
$release_name = $matches[1].' ';
} else {
$release_name = '';
}
// In case someone does something similar with just the processor type string
$mtype = @php_uname('m');
if ('x86_64' == $mtype) {
$mtype = '64-bit';
} elseif (preg_match('/^i([3456]86)$/', $mtype, $matches)) {
$mtype = $matches[1];
}
$uname_info .= $release_name.$mtype.' '.@php_uname('v');
$this->settings_debugrow(__('Web server:','updraftplus'), htmlspecialchars($_SERVER["SERVER_SOFTWARE"]).' ('.htmlspecialchars($uname_info).')');
$this->settings_debugrow('ABSPATH:', htmlspecialchars(ABSPATH));
$this->settings_debugrow('WP_CONTENT_DIR:', htmlspecialchars(WP_CONTENT_DIR));
$this->settings_debugrow('WP_PLUGIN_DIR:', htmlspecialchars(WP_PLUGIN_DIR));
$this->settings_debugrow('Table prefix:', htmlspecialchars($updraftplus->get_table_prefix()));
$peak_memory_usage = memory_get_peak_usage(true)/1024/1024;
$memory_usage = memory_get_usage(true)/1024/1024;
$this->settings_debugrow(__('Peak memory usage','updraftplus').':', $peak_memory_usage.' MB');
$this->settings_debugrow(__('Current memory usage','updraftplus').':', $memory_usage.' MB');
$this->settings_debugrow(__('Memory limit', 'updraftplus').':', htmlspecialchars(ini_get('memory_limit')));
$this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'PHP'), htmlspecialchars(phpversion()).' - <a href="admin-ajax.php?page=updraftplus&action=updraft_ajax&subaction=phpinfo&nonce='.wp_create_nonce('updraftplus-credentialtest-nonce').'" id="updraftplus-phpinfo">'.__('show PHP information (phpinfo)', 'updraftplus').'</a>');
$this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'MySQL'), htmlspecialchars($wpdb->db_version()));
if (function_exists('curl_version') && function_exists('curl_exec')) {
$cv = curl_version();
$cvs = $cv['version'].' / SSL: '.$cv['ssl_version'].' / libz: '.$cv['libz_version'];
} else {
$cvs = __('Not installed', 'updraftplus').' ('.__('required for some remote storage providers', 'updraftplus').')';
}
$this->settings_debugrow(sprintf(__('%s version:', 'updraftplus'), 'Curl'), htmlspecialchars($cvs));
$this->settings_debugrow(sprintf(__('%s version:', 'updraftplus'), 'OpenSSL'), defined('OPENSSL_VERSION_TEXT') ? OPENSSL_VERSION_TEXT : '-');
$this->settings_debugrow('MCrypt:', function_exists('mcrypt_encrypt') ? __('Yes') : __('No'));
if (version_compare(phpversion(), '5.2.0', '>=') && extension_loaded('zip')) {
$ziparchive_exists = __('Yes', 'updraftplus');
} else {
# First do class_exists, because method_exists still sometimes segfaults due to a rare PHP bug
$ziparchive_exists = (class_exists('ZipArchive') && method_exists('ZipArchive', 'addFile')) ? __('Yes', 'updraftplus') : __('No', 'updraftplus');
}
$this->settings_debugrow('ZipArchive::addFile:', $ziparchive_exists);
$binzip = $updraftplus->find_working_bin_zip(false, false);
$this->settings_debugrow(__('zip executable found:', 'updraftplus'), ((is_string($binzip)) ? __('Yes').': '.$binzip : __('No')));
$hosting_bytes_free = $updraftplus->get_hosting_disk_quota_free();
if (is_array($hosting_bytes_free)) {
$perc = round(100*$hosting_bytes_free[1]/(max($hosting_bytes_free[2], 1)), 1);
$this->settings_debugrow(__('Free disk space in account:', 'updraftplus'), sprintf(__('%s (%s used)', 'updraftplus'), round($hosting_bytes_free[3]/1048576, 1)." MB", "$perc %"));
}
$this->settings_debugrow(__('Plugins for debugging:', 'updraftplus'),'<a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=wp-crontrol'), 'install-plugin_wp-crontrol').'">WP Crontrol</a> | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=sql-executioner'), 'install-plugin_sql-executioner').'">SQL Executioner</a> | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=advanced-code-editor'), 'install-plugin_advanced-code-editor').'">Advanced Code Editor</a> '.(current_user_can('edit_plugins') ? '<a href="'.self_admin_url('plugin-editor.php?file=updraftplus/updraftplus.php').'">(edit UpdraftPlus)</a>' : '').' | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=wp-filemanager'), 'install-plugin_wp-filemanager').'">WP Filemanager</a>');
$this->settings_debugrow("HTTP Get: ", '<input id="updraftplus_httpget_uri" type="text" class="call-action"> <a href="#" id="updraftplus_httpget_go">'.__('Fetch', 'updraftplus').'</a> <a href="#" id="updraftplus_httpget_gocurl">'.__('Fetch', 'updraftplus').' (Curl)</a><p id="updraftplus_httpget_results"></p>');
$this->settings_debugrow(__("Call WordPress action:", 'updraftplus'), '<input id="updraftplus_callwpaction" type="text" class="call-action"> <a href="#" id="updraftplus_callwpaction_go">'.__('Call', 'updraftplus').'</a><div id="updraftplus_callwpaction_results"></div>');
$this->settings_debugrow('Site ID:', '(used to identify any Vault connections) <span id="updraft_show_sid">'.htmlspecialchars($updraftplus->siteid()).'</span> - <a href="#" id="updraft_reset_sid">'.__('reset', 'updraftplus')."</a>");
$this->settings_debugrow('', '<a href="admin-ajax.php?page=updraftplus&action=updraft_ajax&subaction=backuphistoryraw&nonce='.wp_create_nonce('updraftplus-credentialtest-nonce').'" id="updraftplus-rawbackuphistory">'.__('Show raw backup and file list', 'updraftplus').'</a>');
echo '</table>';
do_action('updraftplus_debugtools_dashboard');
if (!class_exists('UpdraftPlus_Addon_LockAdmin')) {
echo '<p class="updraftplus-lock-advert"><a href="https://updraftplus.com/shop/updraftplus-premium/"><em>'.__('For the ability to lock access to UpdraftPlus settings with a password, upgrade to UpdraftPlus Premium.', 'updraftplus').'</em></a></p>';
}
echo '<h3>'.__('Total (uncompressed) on-disk data:','updraftplus').'</h3>';
echo '<p class="uncompressed-data"><em>'.__('N.B. This count is based upon what was, or was not, excluded the last time you saved the options.', 'updraftplus').'</em></p><table>';
foreach ($backupable_entities as $key => $info) {
$sdescrip = preg_replace('/ \(.*\)$/', '', $info['description']);
if (strlen($sdescrip) > 20 && isset($info['shortdescription'])) $sdescrip = $info['shortdescription'];
// echo '<div style="clear: left;float:left; width:150px;">'.ucfirst($sdescrip).':</strong></div><div style="float:left;"><span id="updraft_diskspaceused_'.$key.'"><em></em></span> <a href="#" onclick="updraftplus_diskspace_entity(\''.$key.'\'); return false;">'.__('count','updraftplus').'</a></div>';
$this->settings_debugrow(ucfirst($sdescrip).':', '<span id="updraft_diskspaceused_'.$key.'"><em></em></span> <a href="#" onclick="updraftplus_diskspace_entity(\''.$key.'\'); return false;">'.__('count','updraftplus').'</a>');
}
?>
</table>
<p class="immediate-run"><?php _e('The buttons below will immediately execute a backup run, independently of WordPress\'s scheduler. If these work whilst your scheduled backups do absolutely nothing (i.e. not even produce a log file), then it means that your scheduler is broken.','updraftplus');?> <a href="https://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/"><?php _e('Go here for more information.', 'updraftplus'); ?></a></p>
<table border="0" class="debug-table">
<tbody>
<tr>
<td>
<form method="post" action="<?php echo esc_url(add_query_arg(array('error' => false, 'updraft_restore_success' => false, 'action' => false, 'page' => 'updraftplus'))); ?>">
<input type="hidden" name="action" value="updraft_backup_debug_all" />
<p><input type="submit" class="button-primary" <?php echo $backup_disabled ?> value="<?php _e('Debug Full Backup','updraftplus');?>" onclick="return(confirm('<?php echo htmlspecialchars(__('This will cause an immediate backup. The page will stall loading until it finishes (ie, unscheduled).','updraftplus'));?>'))" /></p>
</form>
</td><td>
<form method="post" action="<?php echo esc_url(add_query_arg(array('error' => false, 'updraft_restore_success' => false, 'action' => false, 'page' => 'updraftplus'))); ?>">
<input type="hidden" name="action" value="updraft_backup_debug_db" />
<p><input type="submit" class="button-primary" <?php echo $backup_disabled ?> value="<?php _e('Debug Database Backup','updraftplus');?>" onclick="return(confirm('<?php echo htmlspecialchars(__('This will cause an immediate DB backup. The page will stall loading until it finishes (ie, unscheduled). The backup may well run out of time; really this button is only helpful for checking that the backup is able to get through the initial stages, or for small WordPress sites..','updraftplus'));?>'))" /></p>
</form>
</td>
</tr>
</tbody>
</table>
<h3><?php _e('Wipe settings', 'updraftplus');?></h3>
<p class="max-width-600"><?php echo __('This button will delete all UpdraftPlus settings and progress information for in-progress backups (but not any of your existing backups from your cloud storage).', 'updraftplus').' '.__('You will then need to enter all your settings again. You can also do this before deactivating/deinstalling UpdraftPlus if you wish.','updraftplus');?></p>
<form method="post" action="<?php echo esc_url(add_query_arg(array('error' => false, 'updraft_restore_success' => false, 'action' => false, 'page' => 'updraftplus'))); ?>">
<input type="hidden" name="action" value="updraft_wipesettings" />
<p><input type="submit" class="button-primary" value="<?php _e('Wipe settings','updraftplus'); ?>" onclick="return(confirm('<?php echo esc_js(__('This will delete all your UpdraftPlus settings - are you sure you want to do this?', 'updraftplus'));?>'))" /></p>
</form>
</div>
<?php
}
private function print_delete_old_dirs_form($include_blurb = true, $include_div = true) {
if ($include_blurb) {
if ($include_div) {
echo '<div id="updraft_delete_old_dirs_pagediv" class="updated delete-old-directories">';
}
echo '<p>'.__('Your WordPress install has old directories from its state before you restored/migrated (technical information: these are suffixed with -old). You should press this button to delete them as soon as you have verified that the restoration worked.','updraftplus').'</p>';
}
?>
<form method="post" onsubmit="return updraft_delete_old_dirs();" action="<?php echo esc_url(add_query_arg(array('error' => false, 'updraft_restore_success' => false, 'action' => false, 'page' => 'updraftplus'))); ?>">
<?php wp_nonce_field('updraftplus-credentialtest-nonce'); ?>
<input type="hidden" name="action" value="updraft_delete_old_dirs">
<input type="submit" class="button-primary" value="<?php echo esc_attr(__('Delete Old Directories', 'updraftplus'));?>" />
</form>
<?php
if ($include_blurb && $include_div) echo '</div>';
}
private function get_cron($job_id = false) {
$cron = get_option('cron');
if (!is_array($cron)) $cron = array();
if (false === $job_id) return $cron;
foreach ($cron as $time => $job) {
if (isset($job['updraft_backup_resume'])) {
foreach ($job['updraft_backup_resume'] as $hook => $info) {
if (isset($info['args'][1]) && $job_id == $info['args'][1]) {
global $updraftplus;
$jobdata = $updraftplus->jobdata_getarray($job_id);
return (!is_array($jobdata)) ? false : array($time, $jobdata);
}
}
}
}
}
// A value for $this_job_only also causes something to always be returned (to allow detection of the job having started on the front-end)
private function print_active_jobs($this_job_only = false) {
$cron = $this->get_cron();
// $found_jobs = 0;
$ret = '';
foreach ($cron as $time => $job) {
if (isset($job['updraft_backup_resume'])) {
foreach ($job['updraft_backup_resume'] as $hook => $info) {
if (isset($info['args'][1])) {
// $found_jobs++;
$job_id = $info['args'][1];
if (false === $this_job_only || $job_id == $this_job_only) {
$ret .= $this->print_active_job($job_id, false, $time, $info['args'][0]);
}
}
}
}
}
// A value for $this_job_only implies that output is required
if (false !== $this_job_only && !$ret) {
$ret = $this->print_active_job($this_job_only);
if ('' == $ret) {
// The presence of the exact ID matters to the front-end - indicates that the backup job has at least begun
$ret = '<div class="active-jobs updraft_finished" id="updraft-jobid-'.$this_job_only.'"><em>'.__('The backup has finished running', 'updraftplus').'</em> - <a class="updraft-log-link" data-jobid="'.$this_job_only.'">'.__('View Log', 'updraftplus').'</a></div>';
}
}
// if (0 == $found_jobs) $ret .= '<p><em>'.__('(None)', 'updraftplus').'</em></p>';
return $ret;
}
private function print_active_job($job_id, $is_oneshot = false, $time = false, $next_resumption = false) {
$ret = '';
global $updraftplus;
$jobdata = $updraftplus->jobdata_getarray($job_id);
if (false == apply_filters('updraftplus_print_active_job_continue', true, $is_oneshot, $next_resumption, $jobdata)) return '';
#if (!is_array($jobdata)) $jobdata = array();
if (!isset($jobdata['backup_time'])) return '';
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
$began_at = (isset($jobdata['backup_time'])) ? get_date_from_gmt(gmdate('Y-m-d H:i:s', (int)$jobdata['backup_time']), 'D, F j, Y H:i') : '?';
$jobstatus = empty($jobdata['jobstatus']) ? 'unknown' : $jobdata['jobstatus'];
$stage = 0;
switch ($jobstatus) {
# Stage 0
case 'begun':
$curstage = __('Backup begun', 'updraftplus');
break;
# Stage 1
case 'filescreating':
$stage = 1;
$curstage = __('Creating file backup zips', 'updraftplus');
if (!empty($jobdata['filecreating_substatus']) && isset($backupable_entities[$jobdata['filecreating_substatus']['e']]['description'])) {
$sdescrip = preg_replace('/ \(.*\)$/', '', $backupable_entities[$jobdata['filecreating_substatus']['e']]['description']);
if (strlen($sdescrip) > 20 && isset($jobdata['filecreating_substatus']['e']) && is_array($jobdata['filecreating_substatus']['e']) && isset($backupable_entities[$jobdata['filecreating_substatus']['e']]['shortdescription'])) $sdescrip = $backupable_entities[$jobdata['filecreating_substatus']['e']]['shortdescription'];
$curstage .= ' ('.$sdescrip.')';
if (isset($jobdata['filecreating_substatus']['i']) && isset($jobdata['filecreating_substatus']['t'])) {
$stage = min(2, 1 + ($jobdata['filecreating_substatus']['i']/max($jobdata['filecreating_substatus']['t'],1)));
}
}
break;
case 'filescreated':
$stage = 2;
$curstage = __('Created file backup zips', 'updraftplus');
break;
# Stage 4
case 'clouduploading':
$stage = 4;
$curstage = __('Uploading files to remote storage', 'updraftplus');
if (isset($jobdata['uploading_substatus']['t']) && isset($jobdata['uploading_substatus']['i'])) {
$t = max((int)$jobdata['uploading_substatus']['t'], 1);
$i = min($jobdata['uploading_substatus']['i']/$t, 1);
$p = min($jobdata['uploading_substatus']['p'], 1);
$pd = $i + $p/$t;
$stage = 4 + $pd;
$curstage .= ' '.sprintf(__('(%s%%, file %s of %s)', 'updraftplus'), floor(100*$pd), $jobdata['uploading_substatus']['i']+1, $t);
}
break;
case 'pruning':
$stage = 5;
$curstage = __('Pruning old backup sets', 'updraftplus');
break;
case 'resumingforerrors':
$stage = -1;
$curstage = __('Waiting until scheduled time to retry because of errors', 'updraftplus');
break;
# Stage 6
case 'finished':
$stage = 6;
$curstage = __('Backup finished', 'updraftplus');
break;
default:
# Database creation and encryption occupies the space from 2 to 4. Databases are created then encrypted, then the next databae is created/encrypted, etc.
if ('dbcreated' == substr($jobstatus, 0, 9)) {
$jobstatus = 'dbcreated';
$whichdb = substr($jobstatus, 9);
if (!is_numeric($whichdb)) $whichdb = 0;
$howmanydbs = max((empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']), 1);
$perdbspace = 2/$howmanydbs;
$stage = min(4, 2 + ($whichdb+2)*$perdbspace);
$curstage = __('Created database backup', 'updraftplus');
} elseif ('dbcreating' == substr($jobstatus, 0, 10)) {
$whichdb = substr($jobstatus, 10);
if (!is_numeric($whichdb)) $whichdb = 0;
$howmanydbs = (empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']);
$perdbspace = 2/$howmanydbs;
$jobstatus = 'dbcreating';
$stage = min(4, 2 + $whichdb*$perdbspace);
$curstage = __('Creating database backup', 'updraftplus');
if (!empty($jobdata['dbcreating_substatus']['t'])) {
$curstage .= ' ('.sprintf(__('table: %s', 'updraftplus'), $jobdata['dbcreating_substatus']['t']).')';
if (!empty($jobdata['dbcreating_substatus']['i']) && !empty($jobdata['dbcreating_substatus']['a'])) {
$substage = max(0.001, ($jobdata['dbcreating_substatus']['i'] / max($jobdata['dbcreating_substatus']['a'],1)));
$stage += $substage * $perdbspace * 0.5;
}
}
} elseif ('dbencrypting' == substr($jobstatus, 0, 12)) {
$whichdb = substr($jobstatus, 12);
if (!is_numeric($whichdb)) $whichdb = 0;
$howmanydbs = (empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']);
$perdbspace = 2/$howmanydbs;
$stage = min(4, 2 + $whichdb*$perdbspace + $perdbspace*0.5);
$jobstatus = 'dbencrypting';
$curstage = __('Encrypting database', 'updraftplus');
} elseif ('dbencrypted' == substr($jobstatus, 0, 11)) {
$whichdb = substr($jobstatus, 11);
if (!is_numeric($whichdb)) $whichdb = 0;
$howmanydbs = (empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']);
$jobstatus = 'dbencrypted';
$perdbspace = 2/$howmanydbs;
$stage = min(4, 2 + $whichdb*$perdbspace + $perdbspace);
$curstage = __('Encrypted database', 'updraftplus');
} else {
$curstage = __('Unknown', 'updraftplus');
}
}
$runs_started = (empty($jobdata['runs_started'])) ? array() : $jobdata['runs_started'];
$time_passed = (empty($jobdata['run_times'])) ? array() : $jobdata['run_times'];
$last_checkin_ago = -1;
if (is_array($time_passed)) {
foreach ($time_passed as $run => $passed) {
if (isset($runs_started[$run])) {
$time_ago = microtime(true) - ($runs_started[$run] + $time_passed[$run]);
if ($time_ago < $last_checkin_ago || $last_checkin_ago == -1) $last_checkin_ago = $time_ago;
}
}
}
$next_res_after = (int)$time-time();
$next_res_txt = ($is_oneshot) ? '' : ' - '.sprintf(__("next resumption: %d (after %ss)", 'updraftplus'), $next_resumption, $next_res_after). ' ';
$last_activity_txt = ($last_checkin_ago >= 0) ? ' - '.sprintf(__('last activity: %ss ago', 'updraftplus'), floor($last_checkin_ago)).' ' : '';
if (($last_checkin_ago < 50 && $next_res_after>30) || $is_oneshot) {
$show_inline_info = $last_activity_txt;
$title_info = $next_res_txt;
} else {
$show_inline_info = $next_res_txt;
$title_info = $last_activity_txt;
}
// Existence of the 'updraft-jobid-(id)' id is checked for in other places, so do not modify this
$ret .= '<div class="job-id" id="updraft-jobid-'.$job_id.'"><span class="updraft_jobtimings next-resumption';
if (!empty($jobdata['is_autobackup'])) $ret .= ' isautobackup';
$ret .= '" data-jobid="'.$job_id.'" data-lastactivity="'.(int)$last_checkin_ago.'" data-nextresumption="'.$next_resumption.'" data-nextresumptionafter="'.$next_res_after.'" title="'.esc_attr(sprintf(__('Job ID: %s', 'updraftplus'), $job_id)).$title_info.'">'.$began_at.'</span> ';
$ret .= $show_inline_info;
$ret .= '- <a data-jobid="'.$job_id.'" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=downloadlog&updraftplus_backup_nonce='.$job_id.'" class="updraft-log-link">'.__('show log', 'updraftplus').'</a>';
if (!$is_oneshot) $ret .=' - <a href="#" data-jobid="'.$job_id.'" title="'.esc_attr(__('Note: the progress bar below is based on stages, NOT time. Do not stop the backup simply because it seems to have remained in the same place for a while - that is normal.', 'updraftplus')).'" class="updraft_jobinfo_delete">'.__('stop', 'updraftplus').'</a>';
$ret .= apply_filters('updraft_printjob_beforewarnings', '', $jobdata, $job_id);
if (!empty($jobdata['warnings']) && is_array($jobdata['warnings'])) {
$ret .= '<ul class="disc">';
foreach ($jobdata['warnings'] as $warning) {
$ret .= '<li>'.sprintf(__('Warning: %s', 'updraftplus'), make_clickable(htmlspecialchars($warning))).'</li>';
}
$ret .= '</ul>';
}
$ret .= '<div class="curstage">';
$ret .= htmlspecialchars($curstage);
$ret .= '<div class="updraft_percentage" style="height: 100%; width:'.(($stage>0) ? (ceil((100/6)*$stage)) : '0').'%"></div>';
$ret .= '</div></div>';
$ret .= '</div>';
return $ret;
}
private function delete_old_dirs_go($show_return = true) {
echo ($show_return) ? '<h1>UpdraftPlus - '.__('Remove old directories', 'updraftplus').'</h1>' : '<h2>'.__('Remove old directories', 'updraftplus').'</h2>';
if ($this->delete_old_dirs()) {
echo '<p>'.__('Old directories successfully removed.','updraftplus').'</p><br/>';
} else {
echo '<p>',__('Old directory removal failed for some reason. You may want to do this manually.','updraftplus').'</p><br/>';
}
if ($show_return) echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
}
//deletes the -old directories that are created when a backup is restored.
private function delete_old_dirs() {
global $wp_filesystem, $updraftplus;
$credentials = request_filesystem_credentials(wp_nonce_url(UpdraftPlus_Options::admin_page_url()."?page=updraftplus&action=updraft_delete_old_dirs", 'updraftplus-credentialtest-nonce'));
WP_Filesystem($credentials);
if ($wp_filesystem->errors->get_error_code()) {
foreach ($wp_filesystem->errors->get_error_messages() as $message)
show_message($message);
exit;
}
// From WP_CONTENT_DIR - which contains 'themes'
$ret = $this->delete_old_dirs_dir($wp_filesystem->wp_content_dir());
$updraft_dir = $updraftplus->backups_dir_location();
if ($updraft_dir) {
$ret4 = ($updraft_dir) ? $this->delete_old_dirs_dir($updraft_dir, false) : true;
} else {
$ret4 = true;
}
// $ret2 = $this->delete_old_dirs_dir($wp_filesystem->abspath());
$plugs = untrailingslashit($wp_filesystem->wp_plugins_dir());
if ($wp_filesystem->is_dir($plugs.'-old')) {
print "<strong>".__('Delete','updraftplus').": </strong>plugins-old: ";
if (!$wp_filesystem->delete($plugs.'-old', true)) {
$ret3 = false;
print "<strong>".__('Failed', 'updraftplus')."</strong><br>";
} else {
$ret3 = true;
print "<strong>".__('OK', 'updraftplus')."</strong><br>";
}
} else {
$ret3 = true;
}
return $ret && $ret3 && $ret4;
}
private function delete_old_dirs_dir($dir, $wpfs = true) {
$dir = trailingslashit($dir);
global $wp_filesystem, $updraftplus;
if ($wpfs) {
$list = $wp_filesystem->dirlist($dir);
} else {
$list = scandir($dir);
}
if (!is_array($list)) return false;
$ret = true;
foreach ($list as $item) {
$name = (is_array($item)) ? $item['name'] : $item;
if ("-old" == substr($name, -4, 4)) {
//recursively delete
print "<strong>".__('Delete','updraftplus').": </strong>".htmlspecialchars($name).": ";
if ($wpfs) {
if (!$wp_filesystem->delete($dir.$name, true)) {
$ret = false;
echo "<strong>".__('Failed', 'updraftplus')."</strong><br>";
} else {
echo "<strong>".__('OK', 'updraftplus')."</strong><br>";
}
} else {
if ($updraftplus->remove_local_directory($dir.$name)) {
echo "<strong>".__('OK', 'updraftplus')."</strong><br>";
} else {
$ret = false;
echo "<strong>".__('Failed', 'updraftplus')."</strong><br>";
}
}
}
}
return $ret;
}
// The aim is to get a directory that is writable by the webserver, because that's the only way we can create zip files
private function create_backup_dir() {
global $wp_filesystem, $updraftplus;
if (false === ($credentials = request_filesystem_credentials(UpdraftPlus_Options::admin_page().'?page=updraftplus&action=updraft_create_backup_dir&nonce='.wp_create_nonce('create_backup_dir')))) {
return false;
}
if ( ! WP_Filesystem($credentials) ) {
// our credentials were no good, ask the user for them again
request_filesystem_credentials(UpdraftPlus_Options::admin_page().'?page=updraftplus&action=updraft_create_backup_dir&nonce='.wp_create_nonce('create_backup_dir'), '', true);
return false;
}
$updraft_dir = $updraftplus->backups_dir_location();
$default_backup_dir = $wp_filesystem->find_folder(dirname($updraft_dir)).basename($updraft_dir);
$updraft_dir = ($updraft_dir) ? $wp_filesystem->find_folder(dirname($updraft_dir)).basename($updraft_dir) : $default_backup_dir;
if (!$wp_filesystem->is_dir($default_backup_dir) && !$wp_filesystem->mkdir($default_backup_dir, 0775)) {
$wperr = new WP_Error;
if ( $wp_filesystem->errors->get_error_code() ) {
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) {
$wperr->add('mkdir_error', $message);
}
return $wperr;
} else {
return new WP_Error('mkdir_error', __('The request to the filesystem to create the directory failed.', 'updraftplus'));
}
}
if ($wp_filesystem->is_dir($default_backup_dir)) {
if ($updraftplus->really_is_writable($updraft_dir)) return true;
@$wp_filesystem->chmod($default_backup_dir, 0775);
if ($updraftplus->really_is_writable($updraft_dir)) return true;
@$wp_filesystem->chmod($default_backup_dir, 0777);
if ($updraftplus->really_is_writable($updraft_dir)) {
echo '<p>'.__('The folder was created, but we had to change its file permissions to 777 (world-writable) to be able to write to it. You should check with your hosting provider that this will not cause any problems', 'updraftplus').'</p>';
return true;
} else {
@$wp_filesystem->chmod($default_backup_dir, 0775);
$show_dir = (0 === strpos($default_backup_dir, ABSPATH)) ? substr($default_backup_dir, strlen(ABSPATH)) : $default_backup_dir;
return new WP_Error('writable_error', __('The folder exists, but your webserver does not have permission to write to it.', 'updraftplus').' '.__('You will need to consult with your web hosting provider to find out how to set permissions for a WordPress plugin to write to the directory.', 'updraftplus').' ('.$show_dir.')');
}
}
return true;
}
//scans the content dir to see if any -old dirs are present
private function scan_old_dirs($print_as_comment = false) {
global $updraftplus;
$dirs = scandir(untrailingslashit(WP_CONTENT_DIR));
if (!is_array($dirs)) $dirs = array();
$dirs_u = @scandir($updraftplus->backups_dir_location());
if (!is_array($dirs_u)) $dirs_u = array();
foreach (array_merge($dirs, $dirs_u) as $dir) {
if (preg_match('/-old$/', $dir)) {
if ($print_as_comment) echo '<!--'.htmlspecialchars($dir).'-->';
return true;
}
}
# No need to scan ABSPATH - we don't backup there
if (is_dir(untrailingslashit(WP_PLUGIN_DIR).'-old')) {
if ($print_as_comment) echo '<!--'.htmlspecialchars(untrailingslashit(WP_PLUGIN_DIR).'-old').'-->';
return true;
}
return false;
}
public function storagemethod_row($method, $header, $contents) {
?>
<tr class="updraftplusmethod <?php echo $method;?>">
<th><?php echo $header;?></th>
<td><?php echo $contents;?></td>
</tr>
<?php
}
private function last_backup_html() {
global $updraftplus;
$updraft_last_backup = UpdraftPlus_Options::get_updraft_option('updraft_last_backup');
if ($updraft_last_backup) {
// Convert to GMT, then to blog time
$backup_time = (int)$updraft_last_backup['backup_time'];
$print_time = get_date_from_gmt(gmdate('Y-m-d H:i:s', $backup_time), 'D, F j, Y H:i');
// $print_time = date_i18n('D, F j, Y H:i', $backup_time);
if (empty($updraft_last_backup['backup_time_incremental'])) {
$last_backup_text = "<span style=\"color:".(($updraft_last_backup['success']) ? 'green' : 'black').";\">".$print_time.'</span>';
} else {
$inc_time = get_date_from_gmt(gmdate('Y-m-d H:i:s', $updraft_last_backup['backup_time_incremental']), 'D, F j, Y H:i');
// $inc_time = date_i18n('D, F j, Y H:i', $updraft_last_backup['backup_time_incremental']);
$last_backup_text = "<span style=\"color:".(($updraft_last_backup['success']) ? 'green' : 'black').";\">$inc_time</span> (".sprintf(__('incremental backup; base backup: %s', 'updraftplus'), $print_time).')';
}
$last_backup_text .= '<br>';
// Show errors + warnings
if (is_array($updraft_last_backup['errors'])) {
foreach ($updraft_last_backup['errors'] as $err) {
$level = (is_array($err)) ? $err['level'] : 'error';
$message = (is_array($err)) ? $err['message'] : $err;
$last_backup_text .= ('warning' == $level) ? "<span style=\"color:orange;\">" : "<span style=\"color:red;\">";
if ('warning' == $level) {
$message = sprintf(__("Warning: %s", 'updraftplus'), make_clickable(htmlspecialchars($message)));
} else {
$message = htmlspecialchars($message);
}
$last_backup_text .= $message;
$last_backup_text .= '</span><br>';
}
}
// Link log
if (!empty($updraft_last_backup['backup_nonce'])) {
$updraft_dir = $updraftplus->backups_dir_location();
$potential_log_file = $updraft_dir."/log.".$updraft_last_backup['backup_nonce'].".txt";
if (is_readable($potential_log_file)) $last_backup_text .= "<a href=\"?page=updraftplus&action=downloadlog&updraftplus_backup_nonce=".$updraft_last_backup['backup_nonce']."\" class=\"updraft-log-link\" onclick=\"event.preventDefault(); updraft_popuplog('".$updraft_last_backup['backup_nonce']."');\">".__('Download log file','updraftplus')."</a>";
}
} else {
$last_backup_text = "<span style=\"color:blue;\">".__('No backup has been completed','updraftplus')."</span>";
}
return $last_backup_text;
}
public function get_intervals() {
return apply_filters('updraftplus_backup_intervals', array(
'manual' => _x("Manual", 'i.e. Non-automatic', 'updraftplus'),
'every4hours' => sprintf(__("Every %s hours", 'updraftplus'), '4'),
'every8hours' => sprintf(__("Every %s hours", 'updraftplus'), '8'),
'twicedaily' => sprintf(__("Every %s hours", 'updraftplus'), '12'),
'daily' => __("Daily", 'updraftplus'),
'weekly' => __("Weekly", 'updraftplus'),
'fortnightly' => __("Fortnightly", 'updraftplus'),
'monthly' => __("Monthly", 'updraftplus')
));
}
private function really_writable_message($really_is_writable, $updraft_dir){
if ($really_is_writable) {
$dir_info = '<span style="color:green;">'.__('Backup directory specified is writable, which is good.','updraftplus').'</span>';
} else {
$dir_info = '<span style="color:red;">';
if (!is_dir($updraft_dir)) {
$dir_info .= __('Backup directory specified does <b>not</b> exist.','updraftplus');
} else {
$dir_info .= __('Backup directory specified exists, but is <b>not</b> writable.','updraftplus');
}
$dir_info .= '<span class="updraft-directory-not-writable-blurb"><span class="directory-permissions"><a class="updraft_create_backup_dir" href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=updraft_create_backup_dir&nonce='.wp_create_nonce('create_backup_dir').'">'.__('Click here to attempt to create the directory and set the permissions','updraftplus').'</a></span>, '.__('or, to reset this option','updraftplus').' <a href="#" class="updraft_backup_dir_reset">'.__('click here','updraftplus').'</a>. '.__('If that is unsuccessful check the permissions on your server or change it to another directory that is writable by your web server process.','updraftplus').'</span>';
}
return $dir_info;
}
public function settings_formcontents($options = array()) {
global $updraftplus;
$updraft_dir = $updraftplus->backups_dir_location();
$really_is_writable = $updraftplus->really_is_writable($updraft_dir);
$default_options = array(
'include_database_decrypter' => true,
'include_adverts' => true,
'include_save_button' => true
);
foreach ($default_options as $k => $v) {
if (!isset($options[$k])) $options[$k] = $v;
}
?>
<table class="form-table">
<tr>
<th><?php _e('Files backup schedule','updraftplus'); ?>:</th>
<td>
<div style="float:left; clear:both;">
<select class="updraft_interval" name="updraft_interval">
<?php
$intervals = $this->get_intervals();
$selected_interval = UpdraftPlus_Options::get_updraft_option('updraft_interval', 'manual');
foreach ($intervals as $cronsched => $descrip) {
echo "<option value=\"$cronsched\" ";
if ($cronsched == $selected_interval) echo 'selected="selected"';
echo ">".htmlspecialchars($descrip)."</option>\n";
}
?>
</select> <span class="updraft_files_timings"><?php echo apply_filters('updraftplus_schedule_showfileopts', '<input type="hidden" name="updraftplus_starttime_files" value="">', $selected_interval); ?></span>
<?php
$updraft_retain = max((int)UpdraftPlus_Options::get_updraft_option('updraft_retain', 2), 1);
$retain_files_config = __('and retain this many scheduled backups', 'updraftplus').': <input type="number" min="1" step="1" name="updraft_retain" value="'.$updraft_retain.'" class="retain-files" />';
// echo apply_filters('updraftplus_retain_files_intervalline', $retain_files_config, $updraft_retain);
echo $retain_files_config;
?>
</div>
<?php do_action('updraftplus_after_filesconfig'); ?>
</td>
</tr>
<?php if (defined('UPDRAFTPLUS_EXPERIMENTAL') && UPDRAFTPLUS_EXPERIMENTAL) { ?>
<tr class="updraft_incremental_row">
<th><?php _e('Incremental file backup schedule', 'updraftplus'); ?>:</th>
<td>
<?php do_action('updraftplus_incremental_cell', $selected_interval); ?>
<a href="https://updraftplus.com/support/tell-me-more-about-incremental-backups/"><em><?php _e('Tell me more about incremental backups', 'updraftplus'); ?><em></a>
</td>
</tr>
<?php } ?>
<?php apply_filters('updraftplus_after_file_intervals', false, $selected_interval); ?>
<tr>
<th><?php _e('Database backup schedule','updraftplus'); ?>:</th>
<td>
<div style="float:left; clear:both;">
<select class="updraft_interval_database" name="updraft_interval_database">
<?php
$selected_interval_db = UpdraftPlus_Options::get_updraft_option('updraft_interval_database', UpdraftPlus_Options::get_updraft_option('updraft_interval'));
foreach ($intervals as $cronsched => $descrip) {
echo "<option value=\"$cronsched\" ";
if ($cronsched == $selected_interval_db) echo 'selected="selected"';
echo ">$descrip</option>\n";
}
?>
</select> <span class="updraft_same_schedules_message"><?php echo apply_filters('updraftplus_schedule_sametimemsg', '');?></span><span class="updraft_db_timings"><?php echo apply_filters('updraftplus_schedule_showdbopts', '<input type="hidden" name="updraftplus_starttime_db" value="">', $selected_interval_db); ?></span>
<?php
$updraft_retain_db = max((int)UpdraftPlus_Options::get_updraft_option('updraft_retain_db', $updraft_retain), 1);
$retain_dbs_config = __('and retain this many scheduled backups', 'updraftplus').': <input type="number" min="1" step="1" name="updraft_retain_db" value="'.$updraft_retain_db.'" class="retain-files" />';
// echo apply_filters('updraftplus_retain_db_intervalline', $retain_dbs_config, $updraft_retain_db);
echo $retain_dbs_config;
?>
</div>
<?php do_action('updraftplus_after_dbconfig'); ?>
</td>
</tr>
<tr class="backup-interval-description">
<th></th>
<td><div>
<?php
echo apply_filters('updraftplus_fixtime_ftinfo', '<p>'.__('To fix the time at which a backup should take place,','updraftplus').' ('.__('e.g. if your server is busy at day and you want to run overnight','updraftplus').'), '.__('or to configure more complex schedules', 'updraftplus').', <a href="https://updraftplus.com/shop/updraftplus-premium/">'.htmlspecialchars(__('use UpdraftPlus Premium', 'updraftplus')).'</a></p>');
?>
</div></td>
</tr>
</table>
<h2 class="updraft_settings_sectionheading"><?php _e('Sending Your Backup To Remote Storage','updraftplus');?></h2>
<?php
$debug_mode = UpdraftPlus_Options::get_updraft_option('updraft_debug_mode') ? 'checked="checked"' : "";
$active_service = UpdraftPlus_Options::get_updraft_option('updraft_service');
?>
<table class="form-table width-900">
<tr>
<th><?php
echo __('Choose your remote storage','updraftplus').'<br>'.apply_filters('updraftplus_after_remote_storage_heading_message', '<em>'.__('(tap on an icon to select or unselect)', 'updraftplus').'</em>');
?>:</th>
<td>
<div id="remote-storage-container">
<?php
if (is_array($active_service)) $active_service = $updraftplus->just_one($active_service);
//Change this to give a class that we can exclude
$multi = apply_filters('updraftplus_storage_printoptions_multi', '');
foreach($updraftplus->backup_methods as $method => $description) {
$backup_using = esc_attr(sprintf(__("Backup using %s?", 'updraftplus'), $description));
echo "<input aria-label=\"$backup_using\" name=\"updraft_service[]\" class=\"updraft_servicecheckbox $method $multi\" id=\"updraft_servicecheckbox_$method\" type=\"checkbox\" value=\"$method\"";
if ($active_service === $method || (is_array($active_service) && in_array($method, $active_service))) echo ' checked="checked"';
echo " data-labelauty=\"".esc_attr($description)."\">";
}
?>
<?php
if (false === apply_filters('updraftplus_storage_printoptions', false, $active_service)) {
echo '</div>';
echo '<p><a href="https://updraftplus.com/shop/morestorage/">'.htmlspecialchars(__('You can send a backup to more than one destination with an add-on.','updraftplus')).'</a></p>';
echo '</td></tr>';
}
?>
<tr class="updraftplusmethod none ud_nostorage" style="display:none;">
<td></td>
<td><em><?php echo htmlspecialchars(__('If you choose no remote storage, then the backups remain on the web-server. This is not recommended (unless you plan to manually copy them to your computer), as losing the web-server would mean losing both your website and the backups in one event.', 'updraftplus'));?></em></td>
</tr>
<?php
$method_objects = array();
foreach ($updraftplus->backup_methods as $method => $description) {
do_action('updraftplus_config_print_before_storage', $method);
require_once(UPDRAFTPLUS_DIR.'/methods/'.$method.'.php');
$call_method = 'UpdraftPlus_BackupModule_'.$method;
$method_objects[$method] = new $call_method;
$method_objects[$method]->config_print();
do_action('updraftplus_config_print_after_storage', $method);
}
?>
</table>
<hr style="width:900px; float:left;">
<h2 class="updraft_settings_sectionheading"><?php _e('File Options', 'updraftplus');?></h2>
<table class="form-table" >
<tr>
<th><?php _e('Include in files backup', 'updraftplus');?>:</th>
<td>
<?php echo $this->files_selector_widgetry(); ?>
<p><?php echo apply_filters('updraftplus_admin_directories_description', __('The above directories are everything, except for WordPress core itself which you can download afresh from WordPress.org.', 'updraftplus').' <a href="https://updraftplus.com/shop/">'.htmlspecialchars(__('See also the "More Files" add-on from our shop.', 'updraftplus')).'</a>'); ?></p>
</td>
</tr>
</table>
<h2 class="updraft_settings_sectionheading"><?php _e('Database Options','updraftplus');?></h2>
<table class="form-table width-900">
<tr>
<th><?php _e('Database encryption phrase', 'updraftplus');?>:</th>
<td>
<?php
echo apply_filters('updraft_database_encryption_config', '<a href="https://updraftplus.com/shop/updraftplus-premium/">'.__("Don't want to be spied on? UpdraftPlus Premium can encrypt your database backup.", 'updraftplus').'</a> '.__('It can also backup external databases.', 'updraftplus'));
?>
</td>
</tr>
<?php if (!empty($options['include_database_decrypter'])) { ?>
<tr class="backup-crypt-description">
<td></td>
<td>
<a href="#" class="updraft_show_decryption_widget"><?php _e('You can manually decrypt an encrypted database here.','updraftplus');?></a>
<div id="updraft-manualdecrypt-modal" class="updraft-hidden" style="display:none;">
<p><h3><?php _e("Manually decrypt a database backup file" ,'updraftplus');?></h3></p>
<?php
global $wp_version;
if (version_compare($wp_version, '3.3', '<')) {
echo '<em>'.sprintf(__('This feature requires %s version %s or later', 'updraftplus'), 'WordPress', '3.3').'</em>';
} else {
?>
<div id="plupload-upload-ui2">
<div id="drag-drop-area2">
<div class="drag-drop-inside">
<p class="drag-drop-info"><?php _e('Drop encrypted database files (db.gz.crypt files) here to upload them for decryption', 'updraftplus'); ?></p>
<p><?php _ex('or', 'Uploader: Drop db.gz.crypt files here to upload them for decryption - or - Select Files', 'updraftplus'); ?></p>
<p class="drag-drop-buttons"><input id="plupload-browse-button2" type="button" value="<?php esc_attr_e('Select Files', 'updraftplus'); ?>" class="button" /></p>
<p style="margin-top: 18px;"><?php _e('First, enter the decryption key','updraftplus')?>: <input id="updraftplus_db_decrypt" type="text" size="12"></input></p>
</div>
</div>
<div id="filelist2">
</div>
</div>
<?php } ?>
</div>
</td>
</tr>
<?php } ?>
<?php
#'<a href="https://updraftplus.com/shop/updraftplus-premium/">'.__("This feature is part of UpdraftPlus Premium.", 'updraftplus').'</a>'
$moredbs_config = apply_filters('updraft_database_moredbs_config', false);
if (!empty($moredbs_config)) {
?>
<tr>
<th><?php _e('Back up more databases', 'updraftplus');?>:</th>
<td><?php echo $moredbs_config; ?>
</td>
</tr>
<?php } ?>
</table>
<h2 class="updraft_settings_sectionheading"><?php _e('Reporting','updraftplus');?></h2>
<table class="form-table" style="width:900px;">
<?php
$report_rows = apply_filters('updraftplus_report_form', false);
if (is_string($report_rows)) {
echo $report_rows;
} else {
?>
<tr>
<th><?php _e('Email', 'updraftplus'); ?>:</th>
<td>
<?php
$updraft_email = UpdraftPlus_Options::get_updraft_option('updraft_email');
?>
<input type="checkbox" id="updraft_email" name="updraft_email" value="<?php esc_attr_e(get_bloginfo('admin_email')); ?>"<?php if (!empty($updraft_email)) echo ' checked="checked"';?> > <br><label for="updraft_email"><?php echo __("Check this box to have a basic report sent to", 'updraftplus').' <a href="'.admin_url('options-general.php').'">'.__("your site's admin address", 'updraftplus').'</a> ('.htmlspecialchars(get_bloginfo('admin_email')).")."; ?></label>
<?php
if (!class_exists('UpdraftPlus_Addon_Reporting')) echo '<a href="https://updraftplus.com/shop/reporting/">'.__('For more reporting features, use the Reporting add-on.', 'updraftplus').'</a>';
?>
</td>
</tr>
<?php } ?>
</table>
<script type="text/javascript">
/* <![CDATA[ */
<?php echo $this->get_settings_js($method_objects, $really_is_writable, $updraft_dir); ?>
/* ]]> */
</script>
<table class="form-table width-900">
<tr>
<td colspan="2"><h2 class="updraft_settings_sectionheading"><?php _e('Advanced / Debugging Settings','updraftplus'); ?></h2></td>
</tr>
<tr>
<th><?php _e('Expert settings','updraftplus');?>:</th>
<td><a class="enableexpertmode" href="#enableexpertmode"><?php _e('Show expert settings','updraftplus');?></a> - <?php _e("click this to show some further options; don't bother with this unless you have a problem or are curious.",'updraftplus');?> <?php do_action('updraftplus_expertsettingsdescription'); ?></td>
</tr>
<?php
$delete_local = UpdraftPlus_Options::get_updraft_option('updraft_delete_local', 1);
$split_every_mb = UpdraftPlus_Options::get_updraft_option('updraft_split_every', 400);
if (!is_numeric($split_every_mb)) $split_every_mb = 400;
if ($split_every_mb < UPDRAFTPLUS_SPLIT_MIN) $split_every_mb = UPDRAFTPLUS_SPLIT_MIN;
?>
<tr class="expertmode updraft-hidden" style="display:none;">
<th><?php _e('Debug mode','updraftplus');?>:</th>
<td><input type="checkbox" id="updraft_debug_mode" name="updraft_debug_mode" value="1" <?php echo $debug_mode; ?> /> <br><label for="updraft_debug_mode"><?php _e('Check this to receive more information and emails on the backup process - useful if something is going wrong.','updraftplus');?> <?php _e('This will also cause debugging output from all plugins to be shown upon this screen - please do not be surprised to see these.', 'updraftplus');?></label></td>
</tr>
<tr class="expertmode updraft-hidden" style="display:none;">
<th><?php _e('Split archives every:','updraftplus');?></th>
<td><input type="text" name="updraft_split_every" class="updraft_split_every" value="<?php echo $split_every_mb ?>" size="5" /> MB<br><?php echo sprintf(__('UpdraftPlus will split up backup archives when they exceed this file size. The default value is %s megabytes. Be careful to leave some margin if your web-server has a hard size limit (e.g. the 2 GB / 2048 MB limit on some 32-bit servers/file systems).','updraftplus'), 400); ?></td>
</tr>
<tr class="deletelocal expertmode updraft-hidden" style="display:none;">
<th><?php _e('Delete local backup','updraftplus');?>:</th>
<td><input type="checkbox" id="updraft_delete_local" name="updraft_delete_local" value="1" <?php if ($delete_local) echo 'checked="checked"'; ?>> <br><label for="updraft_delete_local"><?php _e('Check this to delete any superfluous backup files from your server after the backup run finishes (i.e. if you uncheck, then any files despatched remotely will also remain locally, and any files being kept locally will not be subject to the retention limits).','updraftplus');?></label></td>
</tr>
<tr class="expertmode backupdirrow updraft-hidden" style="display:none;">
<th><?php _e('Backup directory','updraftplus');?>:</th>
<td><input type="text" name="updraft_dir" id="updraft_dir" style="width:525px" value="<?php echo htmlspecialchars($this->prune_updraft_dir_prefix($updraft_dir)); ?>" /></td>
</tr>
<tr class="expertmode backupdirrow updraft-hidden" style="display:none;">
<td></td>
<td>
<span id="updraft_writable_mess">
<?php
$dir_info = $this->really_writable_message($really_is_writable, $updraft_dir);
echo $dir_info;
?>
</span>
<?php
echo __("This is where UpdraftPlus will write the zip files it creates initially. This directory must be writable by your web server. It is relative to your content directory (which by default is called wp-content).", 'updraftplus').' '.__("<b>Do not</b> place it inside your uploads or plugins directory, as that will cause recursion (backups of backups of backups of...).", 'updraftplus');
?>
</td>
</tr>
<tr class="expertmode updraft-hidden" style="display:none;">
<th><?php _e("Use the server's SSL certificates", 'updraftplus');?>:</th>
<td><input data-updraft_settings_test="useservercerts" type="checkbox" id="updraft_ssl_useservercerts" name="updraft_ssl_useservercerts" value="1" <?php if (UpdraftPlus_Options::get_updraft_option('updraft_ssl_useservercerts')) echo 'checked="checked"'; ?>> <br><label for="updraft_ssl_useservercerts"><?php _e('By default UpdraftPlus uses its own store of SSL certificates to verify the identity of remote sites (i.e. to make sure it is talking to the real Dropbox, Amazon S3, etc., and not an attacker). We keep these up to date. However, if you get an SSL error, then choosing this option (which causes UpdraftPlus to use your web server\'s collection instead) may help.','updraftplus');?></label></td>
</tr>
<tr class="expertmode updraft-hidden" style="display:none;">
<th><?php _e('Do not verify SSL certificates','updraftplus');?>:</th>
<td><input data-updraft_settings_test="disableverify" type="checkbox" id="updraft_ssl_disableverify" name="updraft_ssl_disableverify" value="1" <?php if (UpdraftPlus_Options::get_updraft_option('updraft_ssl_disableverify')) echo 'checked="checked"'; ?>> <br><label for="updraft_ssl_disableverify"><?php _e('Choosing this option lowers your security by stopping UpdraftPlus from verifying the identity of encrypted sites that it connects to (e.g. Dropbox, Google Drive). It means that UpdraftPlus will be using SSL only for encryption of traffic, and not for authentication.','updraftplus');?> <?php _e('Note that not all cloud backup methods are necessarily using SSL authentication.', 'updraftplus');?></label></td>
</tr>
<tr class="expertmode updraft-hidden" style="display:none;">
<th><?php _e('Disable SSL entirely where possible', 'updraftplus');?>:</th>
<td><input data-updraft_settings_test="nossl" type="checkbox" id="updraft_ssl_nossl" name="updraft_ssl_nossl" value="1" <?php if (UpdraftPlus_Options::get_updraft_option('updraft_ssl_nossl')) echo 'checked="checked"'; ?>> <br><label for="updraft_ssl_nossl"><?php _e('Choosing this option lowers your security by stopping UpdraftPlus from using SSL for authentication and encrypted transport at all, where possible. Note that some cloud storage providers do not allow this (e.g. Dropbox), so with those providers this setting will have no effect.','updraftplus');?> <a href="https://updraftplus.com/faqs/i-get-ssl-certificate-errors-when-backing-up-andor-restoring/"><?php _e('See this FAQ also.', 'updraftplus');?></a></label></td>
</tr>
<?php do_action('updraftplus_configprint_expertoptions'); ?>
<tr>
<td></td>
<td>
<?php
$ws_ad = empty($options['include_adverts']) ? false : $updraftplus->wordshell_random_advert(1);
if ($ws_ad) {
?>
<p class="wordshell-advert">
<?php echo $ws_ad; ?>
</p>
<?php } ?>
</td>
</tr>
<?php if (!empty($options['include_save_button'])) { ?>
<tr>
<td></td>
<td>
<input type="hidden" name="action" value="update" />
<input type="submit" class="button-primary" id="updraftplus-settings-save" value="<?php _e('Save Changes','updraftplus');?>" />
</td>
</tr>
<?php } ?>
</table>
<?php
}
private function get_settings_js($method_objects, $really_is_writable, $updraft_dir) {
global $updraftplus;
ob_start();
?>
jQuery(document).ready(function() {
<?php
if (!$really_is_writable) echo "jQuery('.backupdirrow').show();\n";
?>
<?php
if (!empty($active_service)) {
if (is_array($active_service)) {
foreach ($active_service as $serv) {
echo "jQuery('.${serv}').show();\n";
}
} else {
echo "jQuery('.${active_service}').show();\n";
}
} else {
echo "jQuery('.none').show();\n";
}
foreach ($updraftplus->backup_methods as $method => $description) {
// already done: require_once(UPDRAFTPLUS_DIR.'/methods/'.$method.'.php');
$call_method = "UpdraftPlus_BackupModule_$method";
if (method_exists($call_method, 'config_print_javascript_onready')) {
$method_objects[$method]->config_print_javascript_onready();
}
}
?>
});
<?php
$ret = ob_get_contents();
ob_end_clean();
return $ret;
}
// $include_more can be (bool) or (string)"sometimes"
public function files_selector_widgetry($prefix = '', $show_exclusion_options = true, $include_more = true) {
$ret = '';
global $updraftplus;
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
# The true (default value if non-existent) here has the effect of forcing a default of on.
$include_more_paths = UpdraftPlus_Options::get_updraft_option('updraft_include_more_path');
foreach ($backupable_entities as $key => $info) {
$included = (UpdraftPlus_Options::get_updraft_option("updraft_include_$key", apply_filters("updraftplus_defaultoption_include_".$key, true))) ? 'checked="checked"' : "";
if ('others' == $key || 'uploads' == $key) {
$data_toggle_exclude_field = $show_exclusion_options ? 'data-toggle_exclude_field="'.$key.'"' : '';
$ret .= '<input class="updraft_include_entity" id="'.$prefix.'updraft_include_'.$key.'" '.$data_toggle_exclude_field.' type="checkbox" name="updraft_include_'.$key.'" value="1" '.$included.'> <label '.(('others' == $key) ? 'title="'.sprintf(__('Your wp-content directory server path: %s', 'updraftplus'), WP_CONTENT_DIR).'" ' : '').' for="'.$prefix.'updraft_include_'.$key.'">'.(('others' == $key) ? __('Any other directories found inside wp-content', 'updraftplus') : htmlspecialchars($info['description'])).'</label><br>';
if ($show_exclusion_options) {
$include_exclude = UpdraftPlus_Options::get_updraft_option('updraft_include_'.$key.'_exclude', ('others' == $key) ? UPDRAFT_DEFAULT_OTHERS_EXCLUDE : UPDRAFT_DEFAULT_UPLOADS_EXCLUDE);
$display = ($included) ? '' : 'class="updraft-hidden" style="display:none;"';
$ret .= "<div id=\"".$prefix."updraft_include_".$key."_exclude\" $display>";
$ret .= '<label for="'.$prefix.'updraft_include_'.$key.'_exclude">'.__('Exclude these:', 'updraftplus').'</label>';
$ret .= '<input title="'.__('If entering multiple files/directories, then separate them with commas. For entities at the top level, you can use a * at the start or end of the entry as a wildcard.', 'updraftplus').'" type="text" id="'.$prefix.'updraft_include_'.$key.'_exclude" name="updraft_include_'.$key.'_exclude" size="54" value="'.htmlspecialchars($include_exclude).'" />';
$ret .= '<br></div>';
}
} else {
if ($key != 'more' || true === $include_more || ('sometimes' === $include_more && !empty($include_more_paths))) {
$data_toggle_exclude_field = $show_exclusion_options ? 'data-toggle_exclude_field="'.$key.'"' : '';
$ret .= "<input class=\"updraft_include_entity\" $data_toggle_exclude_field id=\"".$prefix."updraft_include_$key\" type=\"checkbox\" name=\"updraft_include_$key\" value=\"1\" $included /><label for=\"".$prefix."updraft_include_$key\"".((isset($info['htmltitle'])) ? ' title="'.htmlspecialchars($info['htmltitle']).'"' : '')."> ".htmlspecialchars($info['description']);
$ret .= "</label><br>";
$ret .= apply_filters("updraftplus_config_option_include_$key", '', $prefix);
}
}
}
return $ret;
}
public function show_double_warning($text, $extraclass = '', $echo = true) {
$ret = "<div class=\"error updraftplusmethod $extraclass\"><p>$text</p></div>";
$ret .= "<p class=\"double-warning\">$text</p>";
if ($echo) echo $ret;
return $ret;
}
public function optionfilter_split_every($value) {
$value = absint($value);
if ($value < UPDRAFTPLUS_SPLIT_MIN) $value = UPDRAFTPLUS_SPLIT_MIN;
return $value;
}
public function curl_check($service, $has_fallback = false, $extraclass = '', $echo = true) {
$ret = '';
// Check requirements
if (!function_exists("curl_init") || !function_exists('curl_exec')) {
$ret .= $this->show_double_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__("Your web server's PHP installation does not included a <strong>required</strong> (for %s) module (%s). Please contact your web hosting provider's support and ask for them to enable it.", 'updraftplus'), $service, 'Curl').' ', $extraclass, false);
} else {
$curl_version = curl_version();
$curl_ssl_supported= ($curl_version['features'] & CURL_VERSION_SSL);
if (!$curl_ssl_supported) {
if ($has_fallback) {
$ret .= '<p><strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__("Your web server's PHP/Curl installation does not support https access. Communications with %s will be unencrypted. ask your web host to install Curl/SSL in order to gain the ability for encryption (via an add-on).",'updraftplus'),$service).'</p>';
} else {
$ret .= $this->show_double_warning('<p><strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__("Your web server's PHP/Curl installation does not support https access. We cannot access %s without this support. Please contact your web hosting provider's support. %s <strong>requires</strong> Curl+https. Please do not file any support requests; there is no alternative.",'updraftplus'),$service).'</p>', $extraclass, false);
}
} else {
$ret .= '<p><em>'.sprintf(__("Good news: Your site's communications with %s can be encrypted. If you see any errors to do with encryption, then look in the 'Expert Settings' for more help.", 'updraftplus'),$service).'</em></p>';
}
}
if ($echo) {
echo $ret;
} else {
return $ret;
}
}
# If $basedirs is passed as an array, then $directorieses must be too
private function recursive_directory_size($directorieses, $exclude = array(), $basedirs = '', $format='text') {
$size = 0;
if (is_string($directorieses)) {
$basedirs = $directorieses;
$directorieses = array($directorieses);
}
if (is_string($basedirs)) $basedirs = array($basedirs);
foreach ($directorieses as $ind => $directories) {
if (!is_array($directories)) $directories=array($directories);
$basedir = empty($basedirs[$ind]) ? $basedirs[0] : $basedirs[$ind];
foreach ($directories as $dir) {
if (is_file($dir)) {
$size += @filesize($dir);
} else {
$suffix = ('' != $basedir) ? ((0 === strpos($dir, $basedir.'/')) ? substr($dir, 1+strlen($basedir)) : '') : '';
$size += $this->recursive_directory_size_raw($basedir, $exclude, $suffix);
}
}
}
if ('numeric' == $format) return $size;
global $updraftplus;
return $updraftplus->convert_numeric_size_to_text($size);
}
private function recursive_directory_size_raw($prefix_directory, &$exclude = array(), $suffix_directory = '') {
$directory = $prefix_directory.('' == $suffix_directory ? '' : '/'.$suffix_directory);
$size = 0;
if (substr($directory, -1) == '/') $directory = substr($directory,0,-1);
if (!file_exists($directory) || !is_dir($directory) || !is_readable($directory)) return -1;
if (file_exists($directory.'/.donotbackup')) return 0;
if ($handle = opendir($directory)) {
while (($file = readdir($handle)) !== false) {
if ($file != '.' && $file != '..') {
$spath = ('' == $suffix_directory) ? $file : $suffix_directory.'/'.$file;
if (false !== ($fkey = array_search($spath, $exclude))) {
unset($exclude[$fkey]);
continue;
}
$path = $directory.'/'.$file;
if (is_file($path)) {
$size += filesize($path);
} elseif (is_dir($path)) {
$handlesize = $this->recursive_directory_size_raw($prefix_directory, $exclude, $suffix_directory.('' == $suffix_directory ? '' : '/').$file);
if ($handlesize >= 0) { $size += $handlesize; }# else { return -1; }
}
}
}
closedir($handle);
}
return $size;
}
private function raw_backup_info($backup_history, $key, $nonce) {
global $updraftplus;
$backup = $backup_history[$key];
$pretty_date = get_date_from_gmt(gmdate('Y-m-d H:i:s', (int)$key), 'M d, Y G:i');
$rawbackup = "<h2 title=\"$key\">$pretty_date</h2>";
if (!empty($backup['label'])) $rawbackup .= '<span class="raw-backup-info">'.$backup['label'].'</span>';
$rawbackup .= '<hr><p>';
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
if (!empty($nonce)) {
$jd = $updraftplus->jobdata_getarray($nonce);
} else {
$jd = array();
}
foreach ($backupable_entities as $type => $info) {
if (!isset($backup[$type])) continue;
$rawbackup .= $updraftplus->printfile($info['description'], $backup, $type, array('sha1'), $jd, true);
// $rawbackup .= '<h3>'.$info['description'].'</h3>';
// $files = is_string($backup[$type]) ? array($backup[$type]) : $backup[$type];
// foreach ($files as $index => $file) {
// $rawbackup .= $file.'<br>';
// }
}
$total_size = 0;
foreach ($backup as $ekey => $files) {
if ('db' == strtolower(substr($ekey, 0, 2)) && '-size' != substr($ekey, -5, 5)) {
$rawbackup .= $updraftplus->printfile(__('Database', 'updraftplus'), $backup, $ekey, array('sha1'), $jd, true);
}
if (!isset($backupable_entities[$ekey]) && ('db' != substr($ekey, 0, 2) || '-size' == substr($ekey, -5, 5))) continue;
if (is_string($files)) $files = array($files);
foreach ($files as $findex => $file) {
$size_key = (0 == $findex) ? $ekey.'-size' : $ekey.$findex.'-size';
$total_size = (false === $total_size || !isset($backup[$size_key]) || !is_numeric($backup[$size_key])) ? false : $total_size + $backup[$size_key];
}
}
$services = empty($backup['service']) ? array('none') : $backup['service'];
if (!is_array($services)) $services = array('none');
$rawbackup .= '<strong>'.__('Uploaded to:', 'updraftplus').'</strong> ';
$show_services = '';
foreach ($services as $serv) {
if ('none' == $serv || '' == $serv) {
$add_none = true;
} elseif (isset($updraftplus->backup_methods[$serv])) {
$show_services .= ($show_services) ? ', '.$updraftplus->backup_methods[$serv] : $updraftplus->backup_methods[$serv];
} else {
$show_services .= ($show_services) ? ', '.$serv : $serv;
}
}
if ('' == $show_services && $add_none) $show_services .= __('None', 'updraftplus');
$rawbackup .= $show_services;
if ($total_size !== false) {
$rawbackup .= '</p><strong>'.__('Total backup size:', 'updraftplus').'</strong> '.$updraftplus->convert_numeric_size_to_text($total_size).'<p>';
}
$rawbackup .= '</p><hr><p><pre>'.print_r($backup, true).'</p></pre>';
if (!empty($jd) && is_array($jd)) {
$rawbackup .= '<p><pre>'.print_r($jd, true).'</pre></p>';
}
return esc_attr($rawbackup);
}
private function existing_backup_table($backup_history = false) {
global $updraftplus;
if (false === $backup_history) $backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
if (!is_array($backup_history)) $backup_history=array();
if (empty($backup_history)) return "<p><em>".__('You have not yet made any backups.', 'updraftplus')."</em></p>";
$updraft_dir = $updraftplus->backups_dir_location();
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
$accept = apply_filters('updraftplus_accept_archivename', array());
if (!is_array($accept)) $accept = array();
$ret = '<table class="existing-backups-table">';
//".__('Actions', 'updraftplus')."
$ret .= "<thead>
<tr style=\"margin-bottom: 4px;\">
<th class=\"backup-date\">".__('Backup date', 'updraftplus')."</th>
<th class=\"backup-data\">".__('Backup data (click to download)', 'updraftplus')."</th>
<th class=\"updraft_backup_actions\">".__('Actions', 'updraftplus')."</th>
</tr>
<tr style=\"height:2px; padding:1px; margin:0px;\">
<td colspan=\"4\" style=\"margin:0; padding:0\"><div style=\"height: 2px; background-color:#888888;\"> </div></td>
</tr>
</thead>
<tbody>";
// $ret .= "<thead>
// </thead>
// <tbody>";
krsort($backup_history);
foreach ($backup_history as $key => $backup) {
$remote_sent = (!empty($backup['service']) && ((is_array($backup['service']) && in_array('remotesend', $backup['service'])) || 'remotesend' === $backup['service'])) ? true : false;
# https://core.trac.wordpress.org/ticket/25331 explains why the following line is wrong
# $pretty_date = date_i18n('Y-m-d G:i',$key);
// Convert to blog time zone
// $pretty_date = get_date_from_gmt(gmdate('Y-m-d H:i:s', (int)$key), 'Y-m-d G:i');
$pretty_date = get_date_from_gmt(gmdate('Y-m-d H:i:s', (int)$key), 'M d, Y G:i');
$esc_pretty_date = esc_attr($pretty_date);
$entities = '';
$non = $backup['nonce'];
$rawbackup = $this->raw_backup_info($backup_history, $key, $non);
$jobdata = $updraftplus->jobdata_getarray($non);
$delete_button = $this->delete_button($key, $non, $backup);
$date_label = $this->date_label($pretty_date, $key, $backup, $jobdata, $non);
$log_button = $this->log_button($backup);
// Remote backups with no log result in useless empty rows
// However, not showing anything messes up the "Existing Backups (14)" display, until we tweak that code to count differently
// if ($remote_sent && !$log_button) continue;
$ret .= <<<ENDHERE
<tr class="updraft_existing_backups_row updraft_existing_backups_row_$key" data-key="$key" data-nonce="$non">
<td class="updraft_existingbackup_date " data-rawbackup="$rawbackup">
$date_label
</td>
ENDHERE;
$ret .= "<td>";
if ($remote_sent) {
$ret .= __('Backup sent to remote site - not available for download.', 'updraftplus');
if (!empty($backup['remotesend_url'])) $ret .= '<br>'.__('Site', 'updraftplus').': '.htmlspecialchars($backup['remotesend_url']);
} else {
if (empty($backup['meta_foreign']) || !empty($accept[$backup['meta_foreign']]['separatedb'])) {
if (isset($backup['db'])) {
$entities .= '/db=0/';
// Set a flag according to whether or not $backup['db'] ends in .crypt, then pick this up in the display of the decrypt field.
$db = is_array($backup['db']) ? $backup['db'][0] : $backup['db'];
if ($updraftplus->is_db_encrypted($db)) $entities .= '/dbcrypted=1/';
$ret .= $this->download_db_button('db', $key, $esc_pretty_date, $backup, $accept);
} else {
// $ret .= sprintf(_x('(No %s)','Message shown when no such object is available','updraftplus'), __('database', 'updraftplus'));
}
# External databases
foreach ($backup as $bkey => $binfo) {
if ('db' == $bkey || 'db' != substr($bkey, 0, 2) || '-size' == substr($bkey, -5, 5)) continue;
$ret .= $this->download_db_button($bkey, $key, $esc_pretty_date, $backup);
}
} else {
# Foreign without separate db
$entities = '/db=0/meta_foreign=1/';
}
if (!empty($backup['meta_foreign']) && !empty($accept[$backup['meta_foreign']]) && !empty($accept[$backup['meta_foreign']]['separatedb'])) {
$entities .= '/meta_foreign=2/';
}
$download_buttons = $this->download_buttons($backup, $key, $accept, $entities, $esc_pretty_date);
$ret .= $download_buttons;
// $ret .="</td>";
// No logs expected for foreign backups
if (empty($backup['meta_foreign'])) {
// $ret .= '<td>'.$this->log_button($backup)."</td>";
}
}
$ret .= "</td>";
$ret .= '<td class="before-restore-button">';
$ret .= $this->restore_button($backup, $key, $pretty_date, $entities);
$ret .= $delete_button;
if (empty($backup['meta_foreign'])) $ret .= $log_button;
$ret .= '</td>';
$ret .= '</tr>';
$ret .= "<tr style=\"height:2px; padding:1px; margin:0px;\"><td colspan=\"4\" style=\"margin:0; padding:0\"><div style=\"height: 2px; background-color:#aaaaaa;\"> </div></td></tr>";
}
$ret .= '</tbody></table>';
return $ret;
}
private function download_db_button($bkey, $key, $esc_pretty_date, $backup, $accept = array()) {
if (!empty($backup['meta_foreign']) && isset($accept[$backup['meta_foreign']])) {
$desc_source = $accept[$backup['meta_foreign']]['desc'];
} else {
$desc_source = __('unknown source', 'updraftplus');
}
$ret = '';
if ('db' == $bkey) {
$dbt = empty($backup['meta_foreign']) ? esc_attr(__('Database','updraftplus')) : esc_attr(sprintf(__('Database (created by %s)', 'updraftplus'), $desc_source));
} else {
$dbt = __('External database','updraftplus').' ('.substr($bkey, 2).')';
}
$ret .= $this->download_button($bkey, $key, 0, null, '', $dbt, $esc_pretty_date, '0');
return $ret;
}
// Go through each of the file entities
private function download_buttons($backup, $key, $accept, &$entities, $esc_pretty_date) {
global $updraftplus;
$ret = '';
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
// $colspan = 1;
// if (!empty($backup['meta_foreign'])) {
// $colspan = 2;
// if (empty($accept[$backup['meta_foreign']]['separatedb'])) $colspan++;
// }
// $ret .= (1 == $colspan) ? '<td>' : '<td colspan="'.$colspan.'">';
$first_entity = true;
foreach ($backupable_entities as $type => $info) {
if (!empty($backup['meta_foreign']) && 'wpcore' != $type) continue;
// $colspan = 1;
// if (!empty($backup['meta_foreign'])) {
// $colspan = (1+count($backupable_entities));
// if (empty($accept[$backup['meta_foreign']]['separatedb'])) $colspan++;
// }
// $ret .= (1 == $colspan) ? '<td>' : '<td colspan="'.$colspan.'">';
$ide = '';
if ('wpcore' == $type) $wpcore_restore_descrip = $info['description'];
if (empty($backup['meta_foreign'])) {
$sdescrip = preg_replace('/ \(.*\)$/', '', $info['description']);
if (strlen($sdescrip) > 20 && isset($info['shortdescription'])) $sdescrip = $info['shortdescription'];
} else {
$info['description'] = 'WordPress';
if (isset($accept[$backup['meta_foreign']])) {
$desc_source = $accept[$backup['meta_foreign']]['desc'];
$ide .= sprintf(__('Backup created by: %s.', 'updraftplus'), $accept[$backup['meta_foreign']]['desc']).' ';
} else {
$desc_source = __('unknown source', 'updraftplus');
$ide .= __('Backup created by unknown source (%s) - cannot be restored.', 'updraftplus').' ';
}
$sdescrip = (empty($accept[$backup['meta_foreign']]['separatedb'])) ? sprintf(__('Files and database WordPress backup (created by %s)', 'updraftplus'), $desc_source) : sprintf(__('Files backup (created by %s)', 'updraftplus'), $desc_source);
if ('wpcore' == $type) $wpcore_restore_descrip = $sdescrip;
}
if (isset($backup[$type])) {
if (!is_array($backup[$type])) $backup[$type]=array($backup[$type]);
$howmanyinset = count($backup[$type]);
$expected_index = 0;
$index_missing = false;
$set_contents = '';
$entities .= "/$type=";
$whatfiles = $backup[$type];
ksort($whatfiles);
foreach ($whatfiles as $findex => $bfile) {
$set_contents .= ($set_contents == '') ? $findex : ",$findex";
if ($findex != $expected_index) $index_missing = true;
$expected_index++;
}
$entities .= $set_contents.'/';
if (!empty($backup['meta_foreign'])) {
$entities .= '/plugins=0//themes=0//uploads=0//others=0/';
}
$printing_first = true;
foreach ($whatfiles as $findex => $bfile) {
$pdescrip = ($findex > 0) ? $sdescrip.' ('.($findex+1).')' : $sdescrip;
if ($printing_first) {
$ide .= __('Press here to download', 'updraftplus').' '.strtolower($info['description']);
} else {
$ret .= '<div class="updraft-hidden" style="display:none;">';
}
if (count($backup[$type]) >0) {
if ($printing_first) $ide .= ' '.sprintf(__('(%d archive(s) in set).', 'updraftplus'), $howmanyinset);
}
if ($index_missing) {
if ($printing_first) $ide .= ' '.__('You appear to be missing one or more archives from this multi-archive set.', 'updraftplus');
}
if (!$first_entity) {
// $ret .= ', ';
} else {
$first_entity = false;
}
$ret .= $this->download_button($type, $key, $findex, $info, $ide, $pdescrip, $esc_pretty_date, $set_contents);
if (!$printing_first) {
$ret .= '</div>';
} else {
$printing_first = false;
}
}
} else {
// $ret .= sprintf(_x('(No %s)','Message shown when no such object is available','updraftplus'), preg_replace('/\s\(.{12,}\)/', '', strtolower($sdescrip)));
}
// $ret .= '</td>';
}
// $ret .= '</td>';
return $ret;
}
public function date_label($pretty_date, $key, $backup, $jobdata, $nonce, $simple_format = false) {
// $ret = apply_filters('updraftplus_showbackup_date', '<strong>'.$pretty_date.'</strong>', $backup, $jobdata, (int)$key);
$ret = apply_filters('updraftplus_showbackup_date', $pretty_date, $backup, $jobdata, (int)$key, $simple_format);
if (is_array($jobdata) && !empty($jobdata['resume_interval']) && (empty($jobdata['jobstatus']) || 'finished' != $jobdata['jobstatus'])) {
if ($simple_format) {
$ret .= ' '.__('(Not finished)', 'updraftplus');
} else {
$ret .= apply_filters('updraftplus_msg_unfinishedbackup', "<br><span title=\"".esc_attr(__('If you are seeing more backups than you expect, then it is probably because the deletion of old backup sets does not happen until a fresh backup completes.', 'updraftplus'))."\">".__('(Not finished)', 'updraftplus').'</span>', $jobdata, $nonce);
}
}
return $ret;
}
private function download_button($type, $backup_timestamp, $findex, $info, $title, $pdescrip, $esc_pretty_date, $set_contents) {
$ret = '';
$wp_nonce = wp_create_nonce('updraftplus_download');
// updraft_downloader(base, backup_timestamp, what, whicharea, set_contents, prettydate, async)
$ret .= '<button data-wp_nonce="'.esc_attr($wp_nonce).'" data-backup_timestamp="'.esc_attr($backup_timestamp).'" data-what="'.esc_attr($type).'" data-set_contents="'.esc_attr($set_contents).'" data-prettydate="'.esc_attr($esc_pretty_date).'" type="button" class="updraft_download_button '."uddownloadform_${type}_${backup_timestamp}_${findex}".'" title="'.$title.'">'.$pdescrip.'</button>';
// onclick="'."return updraft_downloader('uddlstatus_', '$backup_timestamp', '$type', '.ud_downloadstatus', '$set_contents', '$esc_pretty_date', true)".'"
return $ret;
}
private function restore_button($backup, $key, $pretty_date, $entities = '') {
$ret = '<div class="restore-button">';
if ($entities) {
$show_data = $pretty_date;
if (isset($backup['native']) && false == $backup['native']) {
$show_data .= ' '.__('(backup set imported from remote location)', 'updraftplus');
}
$ret .= '<button data-showdata="'.esc_attr($show_data).'" data-backup_timestamp="'.$key.'" data-entities="'.esc_attr($entities).'" title="'.__('After pressing this button, you will be given the option to choose which components you wish to restore','updraftplus').'" type="button" style="float:left; clear:none;" class="button-primary choose-components-button">'.__('Restore', 'updraftplus').'</button>';
}
$ret .= "</div>\n";
return $ret;
}
private function delete_button($key, $nonce, $backup) {
$sval = ((isset($backup['service']) && $backup['service'] != 'email' && $backup['service'] != 'none')) ? '1' : '0';
return '<div class="updraftplus-remove" style="float: left; clear: none;" data-hasremote="'.$sval.'">
<a data-hasremote="'.$sval.'" data-nonce="'.$nonce.'" data-key="'.$key.'" class="no-decoration updraft-delete-link" href="#" title="'.esc_attr(__('Delete this backup set', 'updraftplus')).'">'.__('Delete', 'updraftplus').'</a>
</div>';
}
private function log_button($backup) {
global $updraftplus;
$updraft_dir = $updraftplus->backups_dir_location();
$ret = '';
if (isset($backup['nonce']) && preg_match("/^[0-9a-f]{12}$/",$backup['nonce']) && is_readable($updraft_dir.'/log.'.$backup['nonce'].'.txt')) {
$nval = $backup['nonce'];
// $lt = esc_attr(__('View Log','updraftplus'));
$lt = __('View Log', 'updraftplus');
$url = esc_attr(UpdraftPlus_Options::admin_page()."?page=updraftplus&action=downloadlog&updraftplus_backup_nonce=$nval");
$ret .= <<<ENDHERE
<div style="clear:none;" class="updraft-viewlogdiv">
<a class="no-decoration updraft-log-link" href="$url" data-jobid="$nval">
$lt
</a>
<!--
<form action="$url" method="get">
<input type="hidden" name="action" value="downloadlog" />
<input type="hidden" name="page" value="updraftplus" />
<input type="hidden" name="updraftplus_backup_nonce" value="$nval" />
<input type="submit" value="$lt" class="updraft-log-link" onclick="event.preventDefault(); updraft_popuplog('$nval');" />
</form>
-->
</div>
ENDHERE;
return $ret;
} else {
// return str_replace(' ', ' ', '('.__('No backup log)', 'updraftplus').')');
}
}
// Return values: false = 'not yet' (not necessarily terminal); WP_Error = terminal failure; true = success
private function restore_backup($timestamp, $continuation_data = null) {
@set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
global $wp_filesystem, $updraftplus;
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
if (!isset($backup_history[$timestamp]) || !is_array($backup_history[$timestamp])) {
echo '<p>'.__('This backup does not exist in the backup history - restoration aborted. Timestamp:','updraftplus')." $timestamp</p><br/>";
return new WP_Error('does_not_exist', __('Backup does not exist in the backup history', 'updraftplus'));
}
// request_filesystem_credentials passes on fields just via hidden name/value pairs.
// Build array of parameters to be passed via this
$extra_fields = array();
if (isset($_POST['updraft_restore']) && is_array($_POST['updraft_restore'])) {
foreach ($_POST['updraft_restore'] as $entity) {
$_POST['updraft_restore_'.$entity] = 1;
$extra_fields[] = 'updraft_restore_'.$entity;
}
}
if (is_array($continuation_data)) {
foreach ($continuation_data['second_loop_entities'] as $type => $files) {
$_POST['updraft_restore_'.$type] = 1;
if (!in_array('updraft_restore_'.$type, $extra_fields)) $extra_fields[] = 'updraft_restore_'.$type;
}
if (!empty($continuation_data['restore_options'])) $restore_options = $continuation_data['restore_options'];
}
// Now make sure that updraft_restorer_ option fields get passed along to request_filesystem_credentials
foreach ($_POST as $key => $value) {
if (0 === strpos($key, 'updraft_restorer_')) $extra_fields[] = $key;
}
$credentials = request_filesystem_credentials(UpdraftPlus_Options::admin_page()."?page=updraftplus&action=updraft_restore&backup_timestamp=$timestamp", '', false, false, $extra_fields);
WP_Filesystem($credentials);
if ( $wp_filesystem->errors->get_error_code() ) {
echo '<p><em><a href="https://updraftplus.com/faqs/asked-ftp-details-upon-restorationmigration-updates/">'.__('Why am I seeing this?', 'updraftplus').'</a></em></p>';
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) show_message($message);
exit;
}
// If we make it this far then WP_Filesystem has been instantiated and is functional
# Set up logging
$updraftplus->backup_time_nonce();
$updraftplus->jobdata_set('job_type', 'restore');
$updraftplus->jobdata_set('job_time_ms', $updraftplus->job_time_ms);
$updraftplus->logfile_open($updraftplus->nonce);
# Provide download link for the log file
# TODO: Automatic purging of old log files
# TODO: Provide option to auto-email the log file
echo '<h1>'.__('UpdraftPlus Restoration: Progress', 'updraftplus').'</h1><div id="updraft-restore-progress">';
$this->show_admin_warning('<a target="_blank" href="?action=downloadlog&page=updraftplus&updraftplus_backup_nonce='.htmlspecialchars($updraftplus->nonce).'">'.__('Follow this link to download the log file for this restoration (needed for any support requests).', 'updraftplus').'</a>');
$updraft_dir = trailingslashit($updraftplus->backups_dir_location());
$foreign_known = apply_filters('updraftplus_accept_archivename', array());
$service = (isset($backup_history[$timestamp]['service'])) ? $backup_history[$timestamp]['service'] : false;
if (!is_array($service)) $service = array($service);
// Now, need to turn any updraft_restore_<entity> fields (that came from a potential WP_Filesystem form) back into parts of the _POST array (which we want to use)
if (empty($_POST['updraft_restore']) || (!is_array($_POST['updraft_restore']))) $_POST['updraft_restore'] = array();
$backup_set = $backup_history[$timestamp];
$entities_to_restore = array();
foreach ($_POST['updraft_restore'] as $entity) {
if (empty($backup_set['meta_foreign'])) {
$entities_to_restore[$entity] = $entity;
} else {
if ('db' == $entity && !empty($foreign_known[$backup_set['meta_foreign']]) && !empty($foreign_known[$backup_set['meta_foreign']]['separatedb'])) {
$entities_to_restore[$entity] = 'db';
} else {
$entities_to_restore[$entity] = 'wpcore';
}
}
}
foreach ($_POST as $key => $value) {
if (0 === strpos($key, 'updraft_restore_')) {
$nkey = substr($key, 16);
if (!isset($entities_to_restore[$nkey])) {
$_POST['updraft_restore'][] = $nkey;
if (empty($backup_set['meta_foreign'])) {
$entities_to_restore[$nkey] = $nkey;
} else {
if ('db' == $entity && !empty($foreign_known[$backup_set['meta_foreign']]['separatedb'])) {
$entities_to_restore[$nkey] = 'db';
} else {
$entities_to_restore[$nkey] = 'wpcore';
}
}
}
}
}
if (0 == count($_POST['updraft_restore'])) {
echo '<p>'.__('ABORT: Could not find the information on which entities to restore.', 'updraftplus').'</p>';
echo '<p>'.__('If making a request for support, please include this information:','updraftplus').' '.count($_POST).' : '.htmlspecialchars(serialize($_POST)).'</p>';
return new WP_Error('missing_info', 'Backup information not found');
}
$this->entities_to_restore = $entities_to_restore;
set_error_handler(array($updraftplus, 'php_error'), E_ALL & ~E_STRICT);
/*
$_POST['updraft_restore'] is typically something like: array( 0=>'db', 1=>'plugins', 2=>'themes'), etc.
i.e. array ( 'db', 'plugins', themes')
*/
if (empty($restore_options)) {
// Gather the restore optons into one place - code after here should read the options, and not the HTTP layer
$restore_options = array();
if (!empty($_POST['updraft_restorer_restore_options'])) {
parse_str(stripslashes($_POST['updraft_restorer_restore_options']), $restore_options);
}
$restore_options['updraft_restorer_replacesiteurl'] = empty($_POST['updraft_restorer_replacesiteurl']) ? false : true;
$restore_options['updraft_encryptionphrase'] = empty($_POST['updraft_encryptionphrase']) ? '' : (string)stripslashes($_POST['updraft_encryptionphrase']);
$restore_options['updraft_restorer_wpcore_includewpconfig'] = empty($_POST['updraft_restorer_wpcore_includewpconfig']) ? false : true;
$updraftplus->jobdata_set('restore_options', $restore_options);
}
// Restore in the most helpful order
uksort($backup_set, array($this, 'sort_restoration_entities'));
// Now log
$copy_restore_options = $restore_options;
if (!empty($copy_restore_options['updraft_encryptionphrase'])) $copy_restore_options['updraft_encryptionphrase'] = '***';
$updraftplus->log("Restore job started. Entities to restore: ".implode(', ', array_flip($entities_to_restore)).'. Restore options: '.json_encode($copy_restore_options));
$backup_set['timestamp'] = $timestamp;
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
// Allow add-ons to adjust the restore directory (but only in the case of restore - otherwise, they could just use the filter built into UpdraftPlus::get_backupable_file_entities)
$backupable_entities = apply_filters('updraft_backupable_file_entities_on_restore', $backupable_entities, $restore_options, $backup_set);
// We use a single object for each entity, because we want to store information about the backup set
require_once(UPDRAFTPLUS_DIR.'/restorer.php');
global $updraftplus_restorer;
$updraftplus_restorer = new Updraft_Restorer(new Updraft_Restorer_Skin, $backup_set, false, $restore_options);
$second_loop = array();
echo "<h2>".__('Final checks', 'updraftplus').'</h2>';
if (empty($backup_set['meta_foreign'])) {
$entities_to_download = $entities_to_restore;
} else {
if (!empty($foreign_known[$backup_set['meta_foreign']]['separatedb'])) {
$entities_to_download = array();
if (in_array('db', $entities_to_restore)) {
$entities_to_download['db'] = 1;
}
if (count($entities_to_restore) > 1 || !in_array('db', $entities_to_restore)) {
$entities_to_download['wpcore'] = 1;
}
} else {
$entities_to_download = array('wpcore' => 1);
}
}
// First loop: make sure that files are present + readable; and populate array for second loop
foreach ($backup_set as $type => $files) {
// All restorable entities must be given explicitly, as we can store other arbitrary data in the history array
if (!isset($backupable_entities[$type]) && 'db' != $type) continue;
if (isset($backupable_entities[$type]['restorable']) && $backupable_entities[$type]['restorable'] == false) continue;
if (!isset($entities_to_download[$type])) continue;
if ('wpcore' == $type && is_multisite() && 0 === $updraftplus_restorer->ud_backup_is_multisite) {
echo "<p>$type: <strong>";
echo __('Skipping restoration of WordPress core when importing a single site into a multisite installation. If you had anything necessary in your WordPress directory then you will need to re-add it manually from the zip file.', 'updraftplus');
#TODO
#$updraftplus->log_e('Skipping restoration of WordPress core when importing a single site into a multisite installation. If you had anything necessary in your WordPress directory then you will need to re-add it manually from the zip file.');
echo "</strong></p>";
continue;
}
if (is_string($files)) $files=array($files);
foreach ($files as $ind => $file) {
$fullpath = $updraft_dir.$file;
echo sprintf(__("Looking for %s archive: file name: %s", 'updraftplus'), $type, htmlspecialchars($file))."<br>";
if (is_array($continuation_data) && isset($continuation_data['second_loop_entities'][$type]) && !in_array($file, $continuation_data['second_loop_entities'][$type])) {
echo __('Skipping: this archive was already restored.', 'updraftplus')."<br>";
// Set the marker so that the existing directory isn't moved out of the way
$updraftplus_restorer->been_restored[$type] = true;
continue;
}
add_action('http_request_args', array($updraftplus, 'modify_http_options'));
foreach ($service as $serv) {
if (!is_readable($fullpath)) {
$sd = (empty($updraftplus->backup_methods[$serv])) ? $serv : $updraftplus->backup_methods[$serv];
echo __("File is not locally present - needs retrieving from remote storage",'updraftplus')." ($sd)";
$this->download_file($file, $serv);
echo ": ";
if (!is_readable($fullpath)) {
echo __("Error", 'updraftplus');
} else {
echo __("OK", 'updraftplus');
}
echo '<br>';
}
}
remove_action('http_request_args', array($updraftplus, 'modify_http_options'));
$index = ($ind == 0) ? '' : $ind;
// If a file size is stored in the backup data, then verify correctness of the local file
if (isset($backup_history[$timestamp][$type.$index.'-size'])) {
$fs = $backup_history[$timestamp][$type.$index.'-size'];
echo __("Archive is expected to be size:",'updraftplus')." ".round($fs/1024, 1)." KB: ";
$as = @filesize($fullpath);
if ($as == $fs) {
echo __('OK','updraftplus').'<br>';
} else {
echo "<strong>".__('Error:','updraftplus')."</strong> ".__('file is size:', 'updraftplus')." ".round($as/1024)." ($fs, $as)<br>";
}
} else {
echo __("The backup records do not contain information about the proper size of this file.",'updraftplus')."<br>";
}
if (!is_readable($fullpath)) {
echo __('Could not find one of the files for restoration', 'updraftplus')." ($file)<br>";
$updraftplus->log("$file: ".__('Could not find one of the files for restoration', 'updraftplus'), 'error');
echo '</div>';
restore_error_handler();
return false;
}
}
if (empty($updraftplus_restorer->ud_foreign)) {
$types = array($type);
} else {
if ('db' != $type || empty($foreign_known[$updraftplus_restorer->ud_foreign]['separatedb'])) {
$types = array('wpcore');
} else {
$types = array('db');
}
}
foreach ($types as $check_type) {
$info = (isset($backupable_entities[$check_type])) ? $backupable_entities[$check_type] : array();
$val = $updraftplus_restorer->pre_restore_backup($files, $check_type, $info, $continuation_data);
if (is_wp_error($val)) {
$updraftplus->log_wp_error($val);
foreach ($val->get_error_messages() as $msg) {
echo '<strong>'.__('Error:', 'updraftplus').'</strong> '.htmlspecialchars($msg).'<br>';
}
foreach ($val->get_error_codes() as $code) {
if ('already_exists' == $code) $this->print_delete_old_dirs_form(false);
}
echo '</div>'; //close the updraft_restore_progress div even if we error
restore_error_handler();
return $val;
} elseif (false === $val) {
echo '</div>'; //close the updraft_restore_progress div even if we error
restore_error_handler();
return false;
}
}
foreach ($entities_to_restore as $entity => $via) {
if ($via == $type) {
if ('wpcore' == $via && 'db' == $entity && count($files) > 1) {
$second_loop[$entity] = apply_filters('updraftplus_select_wpcore_file_with_db', $files, $updraftplus_restorer->ud_foreign);
} else {
$second_loop[$entity] = $files;
}
}
}
}
$updraftplus_restorer->delete = (UpdraftPlus_Options::get_updraft_option('updraft_delete_local')) ? true : false;
if ('none' === $service || 'email' === $service || empty($service) || (is_array($service) && 1 == count($service) && (in_array('none', $service) || in_array('', $service) || in_array('email', $service))) || !empty($updraftplus_restorer->ud_foreign)) {
if ($updraftplus_restorer->delete) $updraftplus->log_e('Will not delete any archives after unpacking them, because there was no cloud storage for this backup');
$updraftplus_restorer->delete = false;
}
if (!empty($updraftplus_restorer->ud_foreign)) $updraftplus->log("Foreign backup; created by: ".$updraftplus_restorer->ud_foreign);
// Second loop: now actually do the restoration
uksort($second_loop, array($this, 'sort_restoration_entities'));
// If continuing, then prune those already done
if (is_array($continuation_data)) {
foreach ($second_loop as $type => $files) {
if (isset($continuation_data['second_loop_entities'][$type])) $second_loop[$type] = $continuation_data['second_loop_entities'][$type];
}
}
$updraftplus->jobdata_set('second_loop_entities', $second_loop);
$updraftplus->jobdata_set('backup_timestamp', $timestamp);
// use a site option, as otherwise on multisite when all the array of options is updated via UpdraftPlus_Options::update_site_option(), it will over-write any restored UD options from the backup
update_site_option('updraft_restore_in_progress', $updraftplus->nonce);
foreach ($second_loop as $type => $files) {
# Types: uploads, themes, plugins, others, db
$info = (isset($backupable_entities[$type])) ? $backupable_entities[$type] : array();
echo ('db' == $type) ? "<h2>".__('Database','updraftplus')."</h2>" : "<h2>".$info['description']."</h2>";
$updraftplus->log("Entity: ".$type);
if (is_string($files)) $files = array($files);
foreach ($files as $fkey => $file) {
$last_one = (1 == count($second_loop) && 1 == count($files));
$val = $updraftplus_restorer->restore_backup($file, $type, $info, $last_one);
if (is_wp_error($val)) {
$codes = $val->get_error_codes();
if (is_array($codes) && in_array('not_found', $codes) && !empty($updraftplus_restorer->ud_foreign) && apply_filters('updraftplus_foreign_allow_missing_entity', false, $type, $updraftplus_restorer->ud_foreign)) {
$updraftplus->log("Entity to move not found in this zip - but this is possible with this foreign backup type");
} else {
$updraftplus->log_e($val);
foreach ($val->get_error_messages() as $msg) {
echo '<strong>'.__('Error message', 'updraftplus').':</strong> '.htmlspecialchars($msg).'<br>';
}
$codes = $val->get_error_codes();
if (is_array($codes)) {
foreach ($codes as $code) {
$data = $val->get_error_data($code);
if (!empty($data)) {
$pdata = (is_string($data)) ? $data : serialize($data);
echo '<strong>'.__('Error data:', 'updraftplus').'</strong> '.htmlspecialchars($pdata).'<br>';
if (false !== strpos($pdata, 'PCLZIP_ERR_BAD_FORMAT (-10)')) {
echo '<a href="https://updraftplus.com/faqs/error-message-pclzip_err_bad_format-10-invalid-archive-structure-mean/"><strong>'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</strong></a><br>';
}
}
}
}
echo '</div>'; //close the updraft_restore_progress div even if we error
restore_error_handler();
return $val;
}
} elseif (false === $val) {
echo '</div>'; //close the updraft_restore_progress div even if we error
restore_error_handler();
return false;
}
unset($files[$fkey]);
$second_loop[$type] = $files;
$updraftplus->jobdata_set('second_loop_entities', $second_loop);
$updraftplus->jobdata_set('backup_timestamp', $timestamp);
do_action('updraft_restored_archive', $file, $type, $val, $fkey, $timestamp);
}
unset($second_loop[$type]);
update_site_option('updraft_restore_in_progress', $updraftplus->nonce);
$updraftplus->jobdata_set('second_loop_entities', $second_loop);
$updraftplus->jobdata_set('backup_timestamp', $timestamp);
}
// All done - remove
delete_site_option('updraft_restore_in_progress');
foreach (array('template', 'stylesheet', 'template_root', 'stylesheet_root') as $opt) {
add_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));
}
# Clear any cached pages after the restore
$updraftplus_restorer->clear_cache();
if (!function_exists('validate_current_theme')) require_once(ABSPATH.WPINC.'/themes');
# Have seen a case where the current theme in the DB began with a capital, but not on disk - and this breaks migrating from Windows to a case-sensitive system
$template = get_option('template');
if (!empty($template) && $template != WP_DEFAULT_THEME && $template != strtolower($template)) {
$theme_root = get_theme_root($template);
$theme_root2 = get_theme_root(strtolower($template));
if (!file_exists("$theme_root/$template/style.css") && file_exists("$theme_root/".strtolower($template)."/style.css")) {
$updraftplus->log_e("Theme directory (%s) not found, but lower-case version exists; updating database option accordingly", $template);
update_option('template', strtolower($template));
}
}
if (!validate_current_theme()) {
echo '<strong>';
$updraftplus->log_e("The current theme was not found; to prevent this stopping the site from loading, your theme has been reverted to the default theme");
echo '</strong>';
}
echo '</div>'; //close the updraft_restore_progress div
restore_error_handler();
return true;
}
public function option_filter_template($val) { global $updraftplus; return $updraftplus->option_filter_get('template'); }
public function option_filter_stylesheet($val) { global $updraftplus; return $updraftplus->option_filter_get('stylesheet'); }
public function option_filter_template_root($val) { global $updraftplus; return $updraftplus->option_filter_get('template_root'); }
public function option_filter_stylesheet_root($val) { global $updraftplus; return $updraftplus->option_filter_get('stylesheet_root'); }
public function sort_restoration_entities($a, $b) {
if ($a == $b) return 0;
// Put the database first
// Put wpcore after plugins/uploads/themes (needed for restores of foreign all-in-one formats)
if ('db' == $a || 'wpcore' == $b) return -1;
if ('db' == $b || 'wpcore' == $a) return 1;
// After wpcore, next last is others
if ('others' == $b) return -1;
if ('others' == $a) return 1;
// And then uploads - this is only because we want to make sure uploads is after plugins, so that we know before we get to the uploads whether the version of UD which might have to unpack them can do this new-style or not.
if ('uploads' == $b) return -1;
if ('uploads' == $a) return 1;
return strcmp($a, $b);
}
public function return_array($input) {
if (!is_array($input)) $input = array();
return $input;
}
public function updraft_ajax_savesettings() {
global $updraftplus;
if (empty($_POST) || empty($_POST['subaction']) || 'savesettings' != $_POST['subaction'] || !isset($_POST['nonce']) || !is_user_logged_in() || !UpdraftPlus_Options::user_can_manage() || !wp_verify_nonce($_POST['nonce'], 'updraftplus-settings-nonce')) die('Security check');
if (empty($_POST['settings']) || !is_string($_POST['settings'])) die('Invalid data');
parse_str(stripslashes($_POST['settings']), $posted_settings);
// We now have $posted_settings as an array
echo json_encode($this->save_settings($posted_settings));
die;
}
private function backup_now_remote_message() {
global $updraftplus;
$service = $updraftplus->just_one(UpdraftPlus_Options::get_updraft_option('updraft_service'));
if (is_string($service)) $service = array($service);
if (!is_array($service)) $service = array();
$no_remote_configured = (empty($service) || array('none') === $service || array('') === $service) ? true : false;
if ($no_remote_configured) {
return '<input type="checkbox" disabled="disabled" id="backupnow_includecloud"> <em>'.sprintf(__("Backup won't be sent to any remote storage - none has been saved in the %s", 'updraftplus'), '<a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&tab=settings" id="updraft_backupnow_gotosettings">'.__('settings', 'updraftplus')).'</a>. '.__('Not got any remote storage?', 'updraftplus').' <a href="https://updraftplus.com/landing/vault">'.__("Check out UpdraftPlus Vault.", 'updraftplus').'</a></em>';
} else {
return '<input type="checkbox" id="backupnow_includecloud" checked="checked"> <label for="backupnow_includecloud">'.__("Send this backup to remote storage", 'updraftplus').'</label>';
}
}
public function save_settings($settings) {
global $updraftplus;
// Make sure that settings filters are registered
UpdraftPlus_Options::admin_init();
$return_array = array('saved' => true);
$add_to_post_keys = array('updraft_interval', 'updraft_interval_database', 'updraft_starttime_files', 'updraft_starttime_db', 'updraft_startday_files', 'updraft_startday_db');
//If database and files are on same schedule, override the db day/time settings
if (isset($settings['updraft_interval_database']) && isset($settings['updraft_interval_database']) && $settings['updraft_interval_database'] == $settings['updraft_interval'] && isset($settings['updraft_starttime_files'])) {
$settings['updraft_starttime_db'] = $settings['updraft_starttime_files'];
$settings['updraft_startday_db'] = $settings['updraft_startday_files'];
}
foreach ($add_to_post_keys as $key) {
// For add-ons that look at $_POST to find saved settings, add the relevant keys to $_POST so that they find them there
if (isset($settings[$key])) {
$_POST[$key] = $settings[$key];
}
}
// Wipe the extra retention rules, as they are not saved correctly if the last one is deleted
UpdraftPlus_Options::update_updraft_option('updraft_retain_extrarules', array());
UpdraftPlus_Options::update_updraft_option('updraft_email', array());
UpdraftPlus_Options::update_updraft_option('updraft_report_warningsonly', array());
UpdraftPlus_Options::update_updraft_option('updraft_report_wholebackup', array());
UpdraftPlus_Options::update_updraft_option('updraft_extradbs', array());
UpdraftPlus_Options::update_updraft_option('updraft_include_more_path', array());
$relevant_keys = $updraftplus->get_settings_keys();
if (method_exists('UpdraftPlus_Options', 'mass_options_update')) {
$original_settings = $settings;
$settings = UpdraftPlus_Options::mass_options_update($settings);
$mass_updated = true;
}
foreach ($settings as $key => $value) {
// $exclude_keys = array('option_page', 'action', '_wpnonce', '_wp_http_referer');
// if (!in_array($key, $exclude_keys)) {
if (in_array($key, $relevant_keys)) {
if ($key == "updraft_service" && is_array($value)){
foreach ($value as $subkey => $subvalue){
if ($subvalue == '0') unset($value[$subkey]);
}
}
// This flag indicates that either the stored database option was changed, or that the supplied option was changed before being stored. It isn't comprehensive - it's only used to update some UI elements with invalid input.
$updated = empty($mass_updated) ? (is_string($value) && $value != UpdraftPlus_Options::get_updraft_option($key)) : (is_string($value) && (!isset($original_settings[$key]) || $original_settings[$key] != $value));
$db_updated = empty($mass_updated) ? UpdraftPlus_Options::update_updraft_option($key, $value) : true;
// Add information on what has changed to array to loop through to update links etc.
// Restricting to strings for now, to prevent any unintended leakage (since this is just used for UI updating)
if ($updated) {
$value = UpdraftPlus_Options::get_updraft_option($key);
if (is_string($value)) $return_array['changed'][$key] = $value;
}
} else {
// When last active, it was catching: option_page, action, _wpnonce, _wp_http_referer, updraft_s3_endpoint, updraft_dreamobjects_endpoint. The latter two are empty; probably don't need to be in the page at all.
//error_log("Non-UD key when saving from POSTed data: ".$key);
}
}
// Checking for various possible messages
$updraft_dir = $updraftplus->backups_dir_location(false);
$really_is_writable = $updraftplus->really_is_writable($updraft_dir);
$dir_info = $this->really_writable_message($really_is_writable, $updraft_dir);
$button_title = esc_attr(__('This button is disabled because your backup directory is not writable (see the settings).', 'updraftplus'));
$return_array['backup_now_message'] = $this->backup_now_remote_message();
$return_array['backup_dir'] = array('writable' => $really_is_writable, 'message' => $dir_info, 'button_title' => $button_title);
//Because of the single AJAX call, we need to remove the existing UD messages from the 'all_admin_notices' action
remove_all_actions('all_admin_notices');
//Moving from 2 to 1 ajax call
ob_start();
$service = UpdraftPlus_Options::get_updraft_option('updraft_service');
$this->setup_all_admin_notices_global($service);
$this->setup_all_admin_notices_udonly($service);
do_action('all_admin_notices');
if (!$really_is_writable){ //Check if writable
$this->show_admin_warning_unwritable();
}
if ($return_array['saved'] == true){ //
$this->show_admin_warning(__('Your settings have been saved.', 'updraftplus'), 'updated fade');
}
$messages_output = ob_get_contents();
ob_clean();
// Backup schedule output
$this->next_scheduled_backups_output();
$scheduled_output = ob_get_clean();
$return_array['messages'] = $messages_output;
$return_array['scheduled'] = $scheduled_output;
//*** Add the updated options to the return message, so we can update on screen ***\\
return $return_array;
}
}
|
kfitz/plannedobsolescence
|
wp-content/plugins/updraftplus/admin.php
|
PHP
|
gpl-2.0
| 255,747 |
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eu
cd "$MESON_SOURCE_ROOT"
if [ ! -f .git/hooks/pre-commit.sample -o -f .git/hooks/pre-commit ]; then
exit 2 # not needed
fi
cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo 'Activated pre-commit hook'
|
phomes/systemd
|
tools/add-git-hook.sh
|
Shell
|
gpl-2.0
| 313 |
cmd_fs/jbd/checkpoint.o := /opt/buildroot-gcc342/bin/mipsel-linux-uclibc-gcc -Wp,-MD,fs/jbd/.checkpoint.o.d -nostdinc -isystem /root/asuswrt-bender/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -Iinclude/asm-mips/rt2880 -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -gdwarf-2 -fno-stack-protector -membedded-data -muninit-const-in-rodata -funit-at-a-time -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -mlong-calls -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(checkpoint)" -D"KBUILD_MODNAME=KBUILD_STR(jbd)" -c -o fs/jbd/checkpoint.o fs/jbd/checkpoint.c
deps_fs/jbd/checkpoint.o := \
fs/jbd/checkpoint.c \
include/linux/time.h \
include/linux/types.h \
$(wildcard include/config/uid16.h) \
$(wildcard include/config/lbd.h) \
$(wildcard include/config/lsf.h) \
$(wildcard include/config/resources/64bit.h) \
include/linux/posix_types.h \
include/linux/stddef.h \
include/linux/compiler.h \
$(wildcard include/config/enable/must/check.h) \
include/linux/compiler-gcc4.h \
$(wildcard include/config/forced/inlining.h) \
include/linux/compiler-gcc.h \
include/asm/posix_types.h \
include/asm/sgidefs.h \
include/asm/types.h \
$(wildcard include/config/highmem.h) \
$(wildcard include/config/64bit/phys/addr.h) \
$(wildcard include/config/64bit.h) \
include/linux/seqlock.h \
include/linux/spinlock.h \
$(wildcard include/config/smp.h) \
$(wildcard include/config/debug/spinlock.h) \
$(wildcard include/config/preempt.h) \
$(wildcard include/config/debug/lock/alloc.h) \
include/linux/preempt.h \
$(wildcard include/config/debug/preempt.h) \
include/linux/thread_info.h \
include/linux/bitops.h \
include/asm/bitops.h \
$(wildcard include/config/cpu/mipsr2.h) \
$(wildcard include/config/cpu/mips32.h) \
$(wildcard include/config/cpu/mips64.h) \
include/linux/irqflags.h \
$(wildcard include/config/trace/irqflags.h) \
$(wildcard include/config/trace/irqflags/support.h) \
$(wildcard include/config/x86.h) \
include/asm/irqflags.h \
$(wildcard include/config/mips/mt/smtc.h) \
$(wildcard include/config/irq/cpu.h) \
$(wildcard include/config/mips/mt/smtc/instant/replay.h) \
include/asm/hazards.h \
$(wildcard include/config/cpu/r10000.h) \
$(wildcard include/config/cpu/rm9000.h) \
$(wildcard include/config/cpu/sb1.h) \
include/asm/barrier.h \
$(wildcard include/config/cpu/has/sync.h) \
$(wildcard include/config/cpu/has/wb.h) \
$(wildcard include/config/weak/ordering.h) \
include/asm/bug.h \
$(wildcard include/config/bug.h) \
include/asm/break.h \
include/asm-generic/bug.h \
$(wildcard include/config/generic/bug.h) \
$(wildcard include/config/debug/bugverbose.h) \
include/asm/byteorder.h \
$(wildcard include/config/cpu/mips64/r2.h) \
include/linux/byteorder/little_endian.h \
include/linux/byteorder/swab.h \
include/linux/byteorder/generic.h \
include/asm/cpu-features.h \
$(wildcard include/config/32bit.h) \
$(wildcard include/config/cpu/mipsr2/irq/vi.h) \
$(wildcard include/config/cpu/mipsr2/irq/ei.h) \
include/asm/cpu.h \
include/asm/cpu-info.h \
$(wildcard include/config/sgi/ip27.h) \
$(wildcard include/config/mips/mt.h) \
include/asm/cache.h \
$(wildcard include/config/mips/l1/cache/shift.h) \
include/asm-mips/mach-generic/kmalloc.h \
$(wildcard include/config/dma/coherent.h) \
include/asm-mips/mach-generic/cpu-feature-overrides.h \
include/asm/war.h \
$(wildcard include/config/sgi/ip22.h) \
$(wildcard include/config/sni/rm.h) \
$(wildcard include/config/cpu/r5432.h) \
$(wildcard include/config/sb1/pass/1/workarounds.h) \
$(wildcard include/config/sb1/pass/2/workarounds.h) \
$(wildcard include/config/mips/malta.h) \
$(wildcard include/config/mips/atlas.h) \
$(wildcard include/config/mips/sead.h) \
$(wildcard include/config/cpu/tx49xx.h) \
$(wildcard include/config/momenco/jaguar/atx.h) \
$(wildcard include/config/pmc/yosemite.h) \
$(wildcard include/config/basler/excite.h) \
$(wildcard include/config/momenco/ocelot/3.h) \
include/asm-generic/bitops/non-atomic.h \
include/asm-generic/bitops/fls64.h \
include/asm-generic/bitops/ffz.h \
include/asm-generic/bitops/find.h \
include/asm-generic/bitops/sched.h \
include/asm-generic/bitops/hweight.h \
include/asm-generic/bitops/ext2-non-atomic.h \
include/asm-generic/bitops/le.h \
include/asm-generic/bitops/ext2-atomic.h \
include/asm-generic/bitops/minix.h \
include/asm/thread_info.h \
$(wildcard include/config/page/size/4kb.h) \
$(wildcard include/config/page/size/8kb.h) \
$(wildcard include/config/page/size/16kb.h) \
$(wildcard include/config/page/size/64kb.h) \
$(wildcard include/config/debug/stack/usage.h) \
include/asm/processor.h \
$(wildcard include/config/mips/mt/fpaff.h) \
$(wildcard include/config/cpu/has/prefetch.h) \
include/linux/cpumask.h \
$(wildcard include/config/hotplug/cpu.h) \
include/linux/kernel.h \
$(wildcard include/config/preempt/voluntary.h) \
$(wildcard include/config/debug/spinlock/sleep.h) \
$(wildcard include/config/printk.h) \
$(wildcard include/config/numa.h) \
/root/asuswrt-bender/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/include/stdarg.h \
include/linux/linkage.h \
include/asm/linkage.h \
include/linux/log2.h \
$(wildcard include/config/arch/has/ilog2/u32.h) \
$(wildcard include/config/arch/has/ilog2/u64.h) \
include/linux/threads.h \
$(wildcard include/config/nr/cpus.h) \
$(wildcard include/config/base/small.h) \
include/linux/bitmap.h \
include/linux/string.h \
include/asm/string.h \
$(wildcard include/config/cpu/r3000.h) \
include/asm/cachectl.h \
include/asm/mipsregs.h \
$(wildcard include/config/cpu/vr41xx.h) \
include/asm/prefetch.h \
include/asm/system.h \
include/asm/addrspace.h \
$(wildcard include/config/cpu/r4300.h) \
$(wildcard include/config/cpu/r4x00.h) \
$(wildcard include/config/cpu/r5000.h) \
$(wildcard include/config/cpu/rm7000.h) \
$(wildcard include/config/cpu/nevada.h) \
$(wildcard include/config/cpu/r8000.h) \
$(wildcard include/config/cpu/sb1a.h) \
include/asm-mips/mach-generic/spaces.h \
$(wildcard include/config/dma/noncoherent.h) \
include/asm/dsp.h \
include/linux/stringify.h \
include/linux/bottom_half.h \
include/linux/spinlock_types.h \
include/linux/lockdep.h \
$(wildcard include/config/lockdep.h) \
$(wildcard include/config/generic/hardirqs.h) \
$(wildcard include/config/prove/locking.h) \
include/linux/spinlock_types_up.h \
include/linux/spinlock_up.h \
include/linux/spinlock_api_up.h \
include/asm/atomic.h \
include/asm-generic/atomic.h \
include/linux/fs.h \
$(wildcard include/config/dnotify.h) \
$(wildcard include/config/sysfs.h) \
$(wildcard include/config/quota.h) \
$(wildcard include/config/inotify.h) \
$(wildcard include/config/security.h) \
$(wildcard include/config/epoll.h) \
$(wildcard include/config/auditsyscall.h) \
$(wildcard include/config/block.h) \
$(wildcard include/config/fs/xip.h) \
$(wildcard include/config/migration.h) \
include/linux/limits.h \
include/linux/ioctl.h \
include/asm/ioctl.h \
include/linux/wait.h \
include/linux/list.h \
$(wildcard include/config/debug/list.h) \
include/linux/poison.h \
include/linux/prefetch.h \
include/asm/current.h \
include/linux/kdev_t.h \
include/linux/dcache.h \
$(wildcard include/config/profiling.h) \
include/linux/cache.h \
$(wildcard include/config/arch/has/cache/line/size.h) \
include/linux/rcupdate.h \
include/linux/percpu.h \
include/linux/slab.h \
$(wildcard include/config/slab/debug.h) \
$(wildcard include/config/slub.h) \
$(wildcard include/config/slob.h) \
$(wildcard include/config/debug/slab.h) \
include/linux/gfp.h \
$(wildcard include/config/zone/dma.h) \
$(wildcard include/config/zone/dma32.h) \
include/linux/mmzone.h \
$(wildcard include/config/force/max/zoneorder.h) \
$(wildcard include/config/memory/hotplug.h) \
$(wildcard include/config/arch/populates/node/map.h) \
$(wildcard include/config/discontigmem.h) \
$(wildcard include/config/flat/node/mem/map.h) \
$(wildcard include/config/have/memory/present.h) \
$(wildcard include/config/need/node/memmap/size.h) \
$(wildcard include/config/need/multiple/nodes.h) \
$(wildcard include/config/sparsemem.h) \
$(wildcard include/config/have/arch/early/pfn/to/nid.h) \
$(wildcard include/config/flatmem.h) \
$(wildcard include/config/sparsemem/extreme.h) \
$(wildcard include/config/nodes/span/other/nodes.h) \
$(wildcard include/config/holes/in/zone.h) \
include/linux/numa.h \
$(wildcard include/config/nodes/shift.h) \
include/linux/init.h \
$(wildcard include/config/modules.h) \
$(wildcard include/config/hotplug.h) \
$(wildcard include/config/acpi/hotplug/memory.h) \
include/linux/nodemask.h \
include/asm/page.h \
$(wildcard include/config/build/elf64.h) \
$(wildcard include/config/limited/dma.h) \
include/linux/pfn.h \
include/asm/io.h \
include/asm-generic/iomap.h \
include/asm/pgtable-bits.h \
$(wildcard include/config/cpu/mips32/r1.h) \
$(wildcard include/config/cpu/tx39xx.h) \
$(wildcard include/config/mips/uncached.h) \
include/asm-mips/mach-generic/ioremap.h \
include/asm-mips/mach-generic/mangle-port.h \
$(wildcard include/config/swap/io/space.h) \
include/asm-generic/memory_model.h \
$(wildcard include/config/out/of/line/pfn/to/page.h) \
include/asm-generic/page.h \
include/linux/memory_hotplug.h \
$(wildcard include/config/have/arch/nodedata/extension.h) \
include/linux/notifier.h \
include/linux/errno.h \
include/asm/errno.h \
include/asm-generic/errno-base.h \
include/linux/mutex.h \
$(wildcard include/config/debug/mutexes.h) \
include/linux/rwsem.h \
$(wildcard include/config/rwsem/generic/spinlock.h) \
include/linux/rwsem-spinlock.h \
include/linux/srcu.h \
include/linux/topology.h \
$(wildcard include/config/sched/smt.h) \
$(wildcard include/config/sched/mc.h) \
include/linux/smp.h \
include/asm/topology.h \
include/asm-mips/mach-generic/topology.h \
include/asm-generic/topology.h \
include/linux/slub_def.h \
include/linux/workqueue.h \
include/linux/timer.h \
$(wildcard include/config/timer/stats.h) \
include/linux/ktime.h \
$(wildcard include/config/ktime/scalar.h) \
include/linux/jiffies.h \
include/linux/calc64.h \
include/asm/div64.h \
include/asm-generic/div64.h \
include/linux/timex.h \
$(wildcard include/config/time/interpolation.h) \
$(wildcard include/config/no/hz.h) \
include/asm/param.h \
$(wildcard include/config/hz.h) \
include/asm/timex.h \
include/asm-mips/mach-generic/timex.h \
include/linux/kobject.h \
include/linux/sysfs.h \
include/linux/kref.h \
include/asm/percpu.h \
include/asm-generic/percpu.h \
include/linux/namei.h \
include/linux/stat.h \
include/asm/stat.h \
include/linux/radix-tree.h \
include/linux/prio_tree.h \
include/linux/pid.h \
include/asm/semaphore.h \
include/linux/quota.h \
include/linux/dqblk_xfs.h \
include/linux/dqblk_v1.h \
include/linux/dqblk_v2.h \
include/linux/nfs_fs_i.h \
include/linux/nfs.h \
include/linux/sunrpc/msg_prot.h \
include/linux/fcntl.h \
include/asm/fcntl.h \
include/asm-generic/fcntl.h \
include/linux/err.h \
include/linux/jbd.h \
$(wildcard include/config/jbd/debug.h) \
$(wildcard include/config/buffer/debug.h) \
include/linux/buffer_head.h \
include/linux/pagemap.h \
include/linux/mm.h \
$(wildcard include/config/sysctl.h) \
$(wildcard include/config/mmu.h) \
$(wildcard include/config/stack/growsup.h) \
$(wildcard include/config/debug/vm.h) \
$(wildcard include/config/shmem.h) \
$(wildcard include/config/split/ptlock/cpus.h) \
$(wildcard include/config/ia64.h) \
$(wildcard include/config/proc/fs.h) \
$(wildcard include/config/debug/pagealloc.h) \
include/linux/capability.h \
include/linux/rbtree.h \
include/linux/debug_locks.h \
$(wildcard include/config/debug/locking/api/selftests.h) \
include/linux/backing-dev.h \
include/linux/mm_types.h \
include/asm/pgtable.h \
include/asm/pgtable-32.h \
include/asm/fixmap.h \
include/asm-generic/pgtable-nopmd.h \
include/asm-generic/pgtable-nopud.h \
include/asm-generic/pgtable.h \
include/linux/page-flags.h \
$(wildcard include/config/s390.h) \
$(wildcard include/config/swap.h) \
include/linux/vmstat.h \
$(wildcard include/config/vm/event/counters.h) \
include/linux/highmem.h \
include/linux/uaccess.h \
include/asm/uaccess.h \
include/asm-generic/uaccess.h \
include/asm/cacheflush.h \
include/asm/kmap_types.h \
$(wildcard include/config/debug/highmem.h) \
include/linux/journal-head.h \
include/linux/bit_spinlock.h \
include/linux/sched.h \
$(wildcard include/config/detect/softlockup.h) \
$(wildcard include/config/keys.h) \
$(wildcard include/config/bsd/process/acct.h) \
$(wildcard include/config/taskstats.h) \
$(wildcard include/config/inotify/user.h) \
$(wildcard include/config/schedstats.h) \
$(wildcard include/config/task/delay/acct.h) \
$(wildcard include/config/blk/dev/io/trace.h) \
$(wildcard include/config/cc/stackprotector.h) \
$(wildcard include/config/sysvipc.h) \
$(wildcard include/config/rt/mutexes.h) \
$(wildcard include/config/task/xacct.h) \
$(wildcard include/config/cpusets.h) \
$(wildcard include/config/compat.h) \
$(wildcard include/config/fault/injection.h) \
include/linux/auxvec.h \
include/asm/auxvec.h \
include/asm/ptrace.h \
$(wildcard include/config/cpu/has/smartmips.h) \
include/asm/isadep.h \
include/asm/mmu.h \
include/asm/cputime.h \
include/asm-generic/cputime.h \
include/linux/sem.h \
include/linux/ipc.h \
$(wildcard include/config/ipc/ns.h) \
include/asm/ipcbuf.h \
include/asm/sembuf.h \
include/linux/signal.h \
include/asm/signal.h \
$(wildcard include/config/trad/signals.h) \
$(wildcard include/config/binfmt/irix.h) \
include/asm-generic/signal.h \
include/asm/sigcontext.h \
include/asm/siginfo.h \
include/asm-generic/siginfo.h \
include/linux/securebits.h \
include/linux/fs_struct.h \
include/linux/completion.h \
include/linux/seccomp.h \
$(wildcard include/config/seccomp.h) \
include/linux/futex.h \
$(wildcard include/config/futex.h) \
include/linux/rtmutex.h \
$(wildcard include/config/debug/rt/mutexes.h) \
include/linux/plist.h \
$(wildcard include/config/debug/pi/list.h) \
include/linux/param.h \
include/linux/resource.h \
include/asm/resource.h \
include/asm-generic/resource.h \
include/linux/hrtimer.h \
$(wildcard include/config/high/res/timers.h) \
include/linux/task_io_accounting.h \
$(wildcard include/config/task/io/accounting.h) \
include/linux/aio.h \
include/linux/aio_abi.h \
include/linux/uio.h \
fs/jbd/checkpoint.o: $(deps_fs/jbd/checkpoint.o)
$(deps_fs/jbd/checkpoint.o):
|
matteocrippa/dsl-n55u-bender
|
release/src-ra/linux/linux-2.6.21.x/fs/jbd/.checkpoint.o.cmd
|
Batchfile
|
gpl-2.0
| 15,700 |
/*
* Created on 5 Sep 2007
*
* Copyright (c) 2004-2007 Paul John Leonard
*
* http://www.frinika.com
*
* This file is part of Frinika.
*
* Frinika 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.
* Frinika 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 Frinika; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.frinika.tootX.midi;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.ShortMessage;
public class MidiHashUtil {
static public long hashValue(ShortMessage mess) {
byte data[] = mess.getMessage();
long cmd = mess.getCommand();
if (cmd == ShortMessage.PITCH_BEND) {
return ((long) data[0] << 8);
} else {
return (((long) data[0] << 8) + data[1]);
}
}
static public void hashDisp(long hash) {
long cntrl = hash & 0xFF;
long cmd = (hash >> 8) & 0xFF;
long chn = (hash >> 16) & 0xFF;
System.out.println(chn + " " + cmd + " " + cntrl);
}
static ShortMessage reconstructShortMessage(long hash, ShortMessage mess) {
if (mess == null) mess=new ShortMessage();
int status = (int) ((hash >> 8) & 0xFF);
int data1 = (int) (hash & 0xFF);
try {
mess.setMessage(status, data1, 0);
} catch (InvalidMidiDataException ex) {
Logger.getLogger(MidiHashUtil.class.getName()).log(Level.SEVERE, null, ex);
}
return mess;
}
}
|
petersalomonsen/frinika
|
src/com/frinika/tootX/midi/MidiHashUtil.java
|
Java
|
gpl-2.0
| 2,069 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2013 Richard Hughes <[email protected]>
*
* Licensed under the GNU General Public License Version 2
*
* 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.
*/
/**
* SECTION:huey-enum
* @short_description: Types used by huey and libhuey
*
* These helper functions provide a way to marshal enumerated values to
* text and back again.
*
* See also: #CdClient, #CdDevice
*/
#include "config.h"
#include <glib.h>
#include "huey-enum.h"
/**
* huey_rc_to_string:
*
* Since: 0.1.29
**/
const gchar *
huey_rc_to_string (guchar value)
{
if (value == HUEY_RC_SUCCESS)
return "success";
if (value == HUEY_RC_LOCKED)
return "locked";
if (value == HUEY_RC_ERROR)
return "error";
if (value == HUEY_RC_RETRY)
return "retry";
if (value == HUEY_RC_UNKNOWN_5A)
return "unknown5a";
if (value == HUEY_RC_UNKNOWN_81)
return "unknown81";
return NULL;
}
/**
* huey_cmd_code_to_string:
*
* Since: 0.1.29
**/
const gchar *
huey_cmd_code_to_string (guchar value)
{
if (value == HUEY_CMD_GET_STATUS)
return "get-status";
if (value == HUEY_CMD_READ_GREEN)
return "read-green";
if (value == HUEY_CMD_READ_BLUE)
return "read-blue";
if (value == HUEY_CMD_SET_INTEGRATION_TIME)
return "set-integration-time";
if (value == HUEY_CMD_GET_INTEGRATION_TIME)
return "get-integration-time";
if (value == HUEY_CMD_REGISTER_WRITE)
return "reg-write";
if (value == HUEY_CMD_REGISTER_READ)
return "reg-read";
if (value == HUEY_CMD_UNLOCK)
return "unlock";
if (value == HUEY_CMD_UNKNOWN_0F)
return "unknown0f";
if (value == HUEY_CMD_UNKNOWN_10)
return "unknown10";
if (value == HUEY_CMD_UNKNOWN_11)
return "unknown11";
if (value == HUEY_CMD_UNKNOWN_12)
return "unknown12";
if (value == HUEY_CMD_SENSOR_MEASURE_RGB_CRT)
return "measure-rgb-crt";
if (value == HUEY_CMD_UNKNOWN_15)
return "unknown15(status?)";
if (value == HUEY_CMD_SENSOR_MEASURE_RGB)
return "measure-rgb";
if (value == HUEY_CMD_UNKNOWN_21)
return "unknown21";
if (value == HUEY_CMD_GET_AMBIENT)
return "get-ambient";
if (value == HUEY_CMD_SET_LEDS)
return "set-leds";
if (value == HUEY_CMD_SENSOR_MEASURE_RGB_ALT)
return "measure-rgb-alt";
return NULL;
}
|
heysion/colord-clone
|
lib/huey/huey-enum.c
|
C
|
gpl-2.0
| 2,937 |
#include <iostream>
#include "common.h"
using namespace storage;
using namespace std;
StorageInterface* s = NULL;
void
test(const string& device)
{
ResizeInfo resize_info;
ContentInfo content_info;
if (s->getFreeInfo(device, true, resize_info, true, content_info, true))
{
cout << device << " true" << endl;
cout << " " << resize_info.resize_freeK << " " << resize_info.df_freeK << " "
<< resize_info.usedK << " " << resize_info.resize_ok << endl;
cout << " " << content_info.windows << " " << content_info.efi << " "
<< content_info.homes << endl;
}
else
{
cout << device << " false" << endl;
}
}
int
main()
{
cout.setf(std::ios::boolalpha);
setup_logger();
setup_system("thalassa");
s = createStorageInterface(TestEnvironment());
test("/dev/system/arvin");
test("/dev/system/root");
delete s;
}
|
gabi2/libstorage
|
testsuite/freeinfo1.cc
|
C++
|
gpl-2.0
| 895 |
#include <iostream>
using namespace std;
long long n, ans = 0;
long long dn[500][500];
long long rec(long long prlvl, long long sum)
{
if (sum < 0) return 0;
else if (sum == 0) return 1;
else
{
if (dn[prlvl][sum] != -1)
return dn[prlvl][sum];
else
{
long long res = 0;
for (int i = 1; i<prlvl; i++)
res += rec(i, sum - i);
return dn[prlvl][sum] = res;
}
}
}
void memorySet()
{
for (int i = 0; i<500; i++)
for (int j = 0; j<500; j++) dn[i][j] = -1;
}
int main()
{
memorySet();
cin >> n;
for (int i = 1; i<n; i++)
ans += rec(i, n - i);
cout << ans << endl;
}
|
Andriy963/e-olimp.com
|
acm.timus.1017.cpp
|
C++
|
gpl-2.0
| 640 |
# OpenStack ocata installation script on Ubuntu 16.04.2
# by kasidit chanchio
# vasabilab, dept of computer science,
# Thammasat University, Thailand
#
# Copyright 2017 Kasidit Chanchio
#
# Run this with sudo or as root
#!/bin/bash -x
cd $HOME/OPSInstaller/controller
pwd
echo "check chrony"
chronyc sources
sleep 1
#
#apt-get -y install debconf-utils
#debconf-set-selections <<< 'mariadb-server-5.5 mysql-server/root_password password mysqlpassword'
#debconf-set-selections <<< 'mariadb-server-5.5 mysql-server/root_password_again password mysqlpassword'
apt-get -y install mariadb-server
apt-get -y install python-pymysql
#
printf "* set openstack.cnf configuration... press any key\n"
sleep 2
#read varkey
#cp files/openstack.cnf /etc/mysql/conf.d/openstack.cnf
cp files/99-openstack.cnf /etc/mysql/mariadb.conf.d/99-openstack.cnf
#printf "* restart mysql & delete anonymous acct... press\n"
#read varkey
service mysql restart
printf "\n *** First, enter blank for mysql password. Then set new password to\n mysqlpassword \n*** \n"
sleep 2
mysql_secure_installation
#mysql -u root -pmysqlpassword -e "UPDATE mysql.user SET Password=PASSWORD('mysqlpassword') WHERE User='root';"
#mysql -u root -pmysqlpassword -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
#mysql -u root -pmysqlpassword -e "DELETE FROM mysql.user WHERE User='';"
#mysql -u root -pmysqlpassword -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%';"
#mysql -u root -pmysqlpassword -e "FLUSH PRIVILEGES;"
#
#exit 0
#printf "* install nosql... press any key\n"
#read varkey
#apt-get -y install mongodb-server mongodb-clients python-pymongo
#cp files/mongodb.conf /etc/mongodb.conf
#service mongodb stop
#rm /var/lib/mongodb/journal/prealloc.*
#service mongodb start
|
kasidit/openstack-ocata-installer
|
documents/Example.OPSInstaller/controller/exe-stage04-SUDO-mysql.sh
|
Shell
|
gpl-2.0
| 1,810 |
#!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
test_description='Binary diff and apply
'
. ./test-lib.sh
test_expect_success 'prepare repository' \
'echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d &&
git update-index --add a b c d &&
echo git >a &&
cat "$TEST_DIRECTORY"/test4012.png >b &&
echo git >c &&
cat b b >d'
cat > expected <<\EOF
a | 2 +-
b | Bin
c | 2 +-
d | Bin
4 files changed, 2 insertions(+), 2 deletions(-)
EOF
test_expect_success 'diff without --binary' \
'git diff | git apply --stat --summary >current &&
test_cmp expected current'
test_expect_success 'diff with --binary' \
'git diff --binary | git apply --stat --summary >current &&
test_cmp expected current'
# apply needs to be able to skip the binary material correctly
# in order to report the line number of a corrupt patch.
test_expect_success 'apply detecting corrupt patch correctly' \
'git diff | sed -e 's/-CIT/xCIT/' >broken &&
if git apply --stat --summary broken 2>detected
then
echo unhappy - should have detected an error
(exit 1)
else
echo happy
fi &&
detected=`cat detected` &&
detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` &&
detected=`sed -ne "${detected}p" broken` &&
test "$detected" = xCIT'
test_expect_success 'apply detecting corrupt patch correctly' \
'git diff --binary | sed -e 's/-CIT/xCIT/' >broken &&
if git apply --stat --summary broken 2>detected
then
echo unhappy - should have detected an error
(exit 1)
else
echo happy
fi &&
detected=`cat detected` &&
detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` &&
detected=`sed -ne "${detected}p" broken` &&
test "$detected" = xCIT'
test_expect_success 'initial commit' 'git commit -a -m initial'
# Try removal (b), modification (d), and creation (e).
test_expect_success 'diff-index with --binary' \
'echo AIT >a && mv b e && echo CIT >c && cat e >d &&
git update-index --add --remove a b c d e &&
tree0=`git write-tree` &&
git diff --cached --binary >current &&
git apply --stat --summary current'
test_expect_success 'apply binary patch' \
'git reset --hard &&
git apply --binary --index <current &&
tree1=`git write-tree` &&
test "$tree1" = "$tree0"'
q_to_nul() {
perl -pe 'y/Q/\000/'
}
nul_to_q() {
perl -pe 'y/\000/Q/'
}
test_expect_success 'diff --no-index with binary creation' '
echo Q | q_to_nul >binary &&
(:# hide error code from diff, which just indicates differences
git diff --binary --no-index /dev/null binary >current ||
true
) &&
rm binary &&
git apply --binary <current &&
echo Q >expected &&
nul_to_q <binary >actual &&
test_cmp expected actual
'
test_done
|
zhaoz/gidit
|
t/t4012-diff-binary.sh
|
Shell
|
gpl-2.0
| 2,684 |
/*
* Copyright (C) 2001-2004 by David Brownell
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* this file is part of ehci-hcd.c */
/*-------------------------------------------------------------------------*/
/*
* EHCI Root Hub ... the nonsharable stuff
*
* Registers don't need cpu_to_le32, that happens transparently
*/
#ifdef CONFIG_ARCH_MXS
#define MXS_USB_HOST_HACK
#include <linux/fsl_devices.h>
#endif
/*-------------------------------------------------------------------------*/
#define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
#ifdef CONFIG_PM
static int ehci_hub_control(
struct usb_hcd *hcd,
u16 typeReq,
u16 wValue,
u16 wIndex,
char *buf,
u16 wLength
);
/* After a power loss, ports that were owned by the companion must be
* reset so that the companion can still own them.
*/
static void ehci_handover_companion_ports(struct ehci_hcd *ehci)
{
u32 __iomem *reg;
u32 status;
int port;
__le32 buf;
struct usb_hcd *hcd = ehci_to_hcd(ehci);
if (!ehci->owned_ports)
return;
/* Give the connections some time to appear */
msleep(20);
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
if (test_bit(port, &ehci->owned_ports)) {
reg = &ehci->regs->port_status[port];
status = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;
/* Port already owned by companion? */
if (status & PORT_OWNER)
clear_bit(port, &ehci->owned_ports);
else if (test_bit(port, &ehci->companion_ports))
ehci_writel(ehci, status & ~PORT_PE, reg);
else
ehci_hub_control(hcd, SetPortFeature,
USB_PORT_FEAT_RESET, port + 1,
NULL, 0);
}
}
if (!ehci->owned_ports)
return;
msleep(90); /* Wait for resets to complete */
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
if (test_bit(port, &ehci->owned_ports)) {
ehci_hub_control(hcd, GetPortStatus,
0, port + 1,
(char *) &buf, sizeof(buf));
/* The companion should now own the port,
* but if something went wrong the port must not
* remain enabled.
*/
reg = &ehci->regs->port_status[port];
status = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;
if (status & PORT_OWNER)
ehci_writel(ehci, status | PORT_CSC, reg);
else {
ehci_dbg(ehci, "failed handover port %d: %x\n",
port + 1, status);
ehci_writel(ehci, status & ~PORT_PE, reg);
}
}
}
ehci->owned_ports = 0;
}
static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
bool suspending)
{
int port;
u32 temp;
/* If remote wakeup is enabled for the root hub but disabled
* for the controller, we must adjust all the port wakeup flags
* when the controller is suspended or resumed. In all other
* cases they don't need to be changed.
*/
if (!ehci_to_hcd(ehci)->self.root_hub->do_remote_wakeup ||
device_may_wakeup(ehci_to_hcd(ehci)->self.controller))
return;
/* clear phy low-power mode before changing wakeup flags */
if (ehci->has_hostpc) {
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
u32 __iomem *hostpc_reg;
hostpc_reg = (u32 __iomem *)((u8 *) ehci->regs
+ HOSTPC0 + 4 * port);
temp = ehci_readl(ehci, hostpc_reg);
ehci_writel(ehci, temp & ~HOSTPC_PHCD, hostpc_reg);
}
msleep(5);
}
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
u32 __iomem *reg = &ehci->regs->port_status[port];
u32 t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;
u32 t2 = t1 & ~PORT_WAKE_BITS;
/* If we are suspending the controller, clear the flags.
* If we are resuming the controller, set the wakeup flags.
*/
if (!suspending) {
if (t1 & PORT_CONNECT)
t2 |= PORT_WKOC_E | PORT_WKDISC_E;
else
t2 |= PORT_WKOC_E | PORT_WKCONN_E;
}
ehci_vdbg(ehci, "port %d, %08x -> %08x\n",
port + 1, t1, t2);
ehci_writel(ehci, t2, reg);
}
/* enter phy low-power mode again */
if (ehci->has_hostpc) {
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
u32 __iomem *hostpc_reg;
hostpc_reg = (u32 __iomem *)((u8 *) ehci->regs
+ HOSTPC0 + 4 * port);
temp = ehci_readl(ehci, hostpc_reg);
ehci_writel(ehci, temp | HOSTPC_PHCD, hostpc_reg);
}
}
}
static int ehci_bus_suspend (struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
int port;
int mask;
int changed;
ehci_dbg(ehci, "suspend root hub\n");
if (time_before (jiffies, ehci->next_statechange))
msleep(5);
del_timer_sync(&ehci->watchdog);
del_timer_sync(&ehci->iaa_watchdog);
spin_lock_irq (&ehci->lock);
/* Once the controller is stopped, port resumes that are already
* in progress won't complete. Hence if remote wakeup is enabled
* for the root hub and any ports are in the middle of a resume or
* remote wakeup, we must fail the suspend.
*/
if (hcd->self.root_hub->do_remote_wakeup) {
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
if (ehci->reset_done[port] != 0) {
spin_unlock_irq(&ehci->lock);
ehci_dbg(ehci, "suspend failed because "
"port %d is resuming\n",
port + 1);
return -EBUSY;
}
}
}
/* stop schedules, clean any completed work */
if (HC_IS_RUNNING(hcd->state)) {
ehci_quiesce (ehci);
hcd->state = HC_STATE_QUIESCING;
}
ehci->command = ehci_readl(ehci, &ehci->regs->command);
ehci_work(ehci);
/* Unlike other USB host controller types, EHCI doesn't have
* any notion of "global" or bus-wide suspend. The driver has
* to manually suspend all the active unsuspended ports, and
* then manually resume them in the bus_resume() routine.
*/
ehci->bus_suspended = 0;
ehci->owned_ports = 0;
changed = 0;
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
u32 __iomem *reg = &ehci->regs->port_status [port];
u32 t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;
u32 t2 = t1 & ~PORT_WAKE_BITS;
/* keep track of which ports we suspend */
if (t1 & PORT_OWNER)
set_bit(port, &ehci->owned_ports);
else if ((t1 & PORT_PE) && !(t1 & PORT_SUSPEND)) {
t2 |= PORT_SUSPEND;
set_bit(port, &ehci->bus_suspended);
}
/* enable remote wakeup on all ports, if told to do so */
if (hcd->self.root_hub->do_remote_wakeup) {
/* only enable appropriate wake bits, otherwise the
* hardware can not go phy low power mode. If a race
* condition happens here(connection change during bits
* set), the port change detection will finally fix it.
*/
if (t1 & PORT_CONNECT)
t2 |= PORT_WKOC_E | PORT_WKDISC_E;
else
t2 |= PORT_WKOC_E | PORT_WKCONN_E;
}
if (t1 != t2) {
ehci_vdbg (ehci, "port %d, %08x -> %08x\n",
port + 1, t1, t2);
ehci_writel(ehci, t2, reg);
changed = 1;
}
}
if (changed && ehci->has_hostpc) {
spin_unlock_irq(&ehci->lock);
msleep(5); /* 5 ms for HCD to enter low-power mode */
spin_lock_irq(&ehci->lock);
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
u32 __iomem *hostpc_reg;
u32 t3;
hostpc_reg = (u32 __iomem *)((u8 *) ehci->regs
+ HOSTPC0 + 4 * port);
t3 = ehci_readl(ehci, hostpc_reg);
ehci_writel(ehci, t3 | HOSTPC_PHCD, hostpc_reg);
t3 = ehci_readl(ehci, hostpc_reg);
ehci_dbg(ehci, "Port %d phy low-power mode %s\n",
port, (t3 & HOSTPC_PHCD) ?
"succeeded" : "failed");
}
}
/* Apparently some devices need a >= 1-uframe delay here */
if (ehci->bus_suspended)
udelay(150);
/* turn off now-idle HC */
ehci_halt (ehci);
hcd->state = HC_STATE_SUSPENDED;
if (ehci->reclaim)
end_unlink_async(ehci);
/* allow remote wakeup */
mask = INTR_MASK;
if (!hcd->self.root_hub->do_remote_wakeup)
mask &= ~STS_PCD;
ehci_writel(ehci, mask, &ehci->regs->intr_enable);
ehci_readl(ehci, &ehci->regs->intr_enable);
ehci->next_statechange = jiffies + msecs_to_jiffies(10);
spin_unlock_irq (&ehci->lock);
/* ehci_work() may have re-enabled the watchdog timer, which we do not
* want, and so we must delete any pending watchdog timer events.
*/
del_timer_sync(&ehci->watchdog);
return 0;
}
/* caller has locked the root hub, and should reset/reinit on error */
static int ehci_bus_resume (struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
u32 temp;
u32 power_okay;
int i;
u8 resume_needed = 0;
if (time_before (jiffies, ehci->next_statechange))
msleep(5);
spin_lock_irq (&ehci->lock);
if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
spin_unlock_irq(&ehci->lock);
return -ESHUTDOWN;
}
if (unlikely(ehci->debug)) {
if (!dbgp_reset_prep())
ehci->debug = NULL;
else
dbgp_external_startup();
}
/* Ideally and we've got a real resume here, and no port's power
* was lost. (For PCI, that means Vaux was maintained.) But we
* could instead be restoring a swsusp snapshot -- so that BIOS was
* the last user of the controller, not reset/pm hardware keeping
* state we gave to it.
*/
power_okay = ehci_readl(ehci, &ehci->regs->intr_enable);
ehci_dbg(ehci, "resume root hub%s\n",
power_okay ? "" : " after power loss");
/* at least some APM implementations will try to deliver
* IRQs right away, so delay them until we're ready.
*/
ehci_writel(ehci, 0, &ehci->regs->intr_enable);
/* re-init operational registers */
ehci_writel(ehci, 0, &ehci->regs->segment);
ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list);
ehci_writel(ehci, (u32) ehci->async->qh_dma, &ehci->regs->async_next);
/* restore CMD_RUN, framelist size, and irq threshold */
ehci_writel(ehci, ehci->command, &ehci->regs->command);
/* Some controller/firmware combinations need a delay during which
* they set up the port statuses. See Bugzilla #8190. */
spin_unlock_irq(&ehci->lock);
msleep(8);
spin_lock_irq(&ehci->lock);
/* clear phy low-power mode before resume */
if (ehci->bus_suspended && ehci->has_hostpc) {
i = HCS_N_PORTS(ehci->hcs_params);
while (i--) {
if (test_bit(i, &ehci->bus_suspended)) {
u32 __iomem *hostpc_reg;
hostpc_reg = (u32 __iomem *)((u8 *) ehci->regs
+ HOSTPC0 + 4 * i);
temp = ehci_readl(ehci, hostpc_reg);
ehci_writel(ehci, temp & ~HOSTPC_PHCD,
hostpc_reg);
}
}
spin_unlock_irq(&ehci->lock);
msleep(5);
spin_lock_irq(&ehci->lock);
}
/* manually resume the ports we suspended during bus_suspend() */
i = HCS_N_PORTS (ehci->hcs_params);
while (i--) {
temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
if (test_bit(i, &ehci->bus_suspended) &&
(temp & PORT_SUSPEND)) {
temp |= PORT_RESUME;
resume_needed = 1;
}
ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
}
/* msleep for 20ms only if code is trying to resume port */
if (resume_needed) {
spin_unlock_irq(&ehci->lock);
msleep(20);
#ifdef MXS_USB_HOST_HACK
{
struct fsl_usb2_platform_data *pdata;
pdata = hcd->self.controller->platform_data;
if (pdata && pdata->platform_resume)
pdata->platform_resume(pdata);
}
#endif
spin_lock_irq(&ehci->lock);
}
i = HCS_N_PORTS (ehci->hcs_params);
while (i--) {
temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
if (test_bit(i, &ehci->bus_suspended) &&
(temp & PORT_SUSPEND)) {
temp &= ~(PORT_RWC_BITS | PORT_RESUME);
ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
ehci_vdbg (ehci, "resumed port %d\n", i + 1);
}
}
(void) ehci_readl(ehci, &ehci->regs->command);
/* maybe re-activate the schedule(s) */
temp = 0;
if (ehci->async->qh_next.qh)
temp |= CMD_ASE;
if (ehci->periodic_sched)
temp |= CMD_PSE;
if (temp) {
ehci->command |= temp;
ehci_writel(ehci, ehci->command, &ehci->regs->command);
}
ehci->next_statechange = jiffies + msecs_to_jiffies(5);
hcd->state = HC_STATE_RUNNING;
/* Now we can safely re-enable irqs */
ehci_writel(ehci, INTR_MASK, &ehci->regs->intr_enable);
spin_unlock_irq (&ehci->lock);
ehci_handover_companion_ports(ehci);
return 0;
}
#else
#define ehci_bus_suspend NULL
#define ehci_bus_resume NULL
#endif /* CONFIG_PM */
/*-------------------------------------------------------------------------*/
/* Display the ports dedicated to the companion controller */
static ssize_t show_companion(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct ehci_hcd *ehci;
int nports, index, n;
int count = PAGE_SIZE;
char *ptr = buf;
ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
nports = HCS_N_PORTS(ehci->hcs_params);
for (index = 0; index < nports; ++index) {
if (test_bit(index, &ehci->companion_ports)) {
n = scnprintf(ptr, count, "%d\n", index + 1);
ptr += n;
count -= n;
}
}
return ptr - buf;
}
/*
* Sets the owner of a port
*/
static void set_owner(struct ehci_hcd *ehci, int portnum, int new_owner)
{
u32 __iomem *status_reg;
u32 port_status;
int try;
status_reg = &ehci->regs->port_status[portnum];
/*
* The controller won't set the OWNER bit if the port is
* enabled, so this loop will sometimes require at least two
* iterations: one to disable the port and one to set OWNER.
*/
for (try = 4; try > 0; --try) {
spin_lock_irq(&ehci->lock);
port_status = ehci_readl(ehci, status_reg);
if ((port_status & PORT_OWNER) == new_owner
|| (port_status & (PORT_OWNER | PORT_CONNECT))
== 0)
try = 0;
else {
port_status ^= PORT_OWNER;
port_status &= ~(PORT_PE | PORT_RWC_BITS);
ehci_writel(ehci, port_status, status_reg);
}
spin_unlock_irq(&ehci->lock);
if (try > 1)
msleep(5);
}
}
/*
* Dedicate or undedicate a port to the companion controller.
* Syntax is "[-]portnum", where a leading '-' sign means
* return control of the port to the EHCI controller.
*/
static ssize_t store_companion(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct ehci_hcd *ehci;
int portnum, new_owner;
ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
new_owner = PORT_OWNER; /* Owned by companion */
if (sscanf(buf, "%d", &portnum) != 1)
return -EINVAL;
if (portnum < 0) {
portnum = - portnum;
new_owner = 0; /* Owned by EHCI */
}
if (portnum <= 0 || portnum > HCS_N_PORTS(ehci->hcs_params))
return -ENOENT;
portnum--;
if (new_owner)
set_bit(portnum, &ehci->companion_ports);
else
clear_bit(portnum, &ehci->companion_ports);
set_owner(ehci, portnum, new_owner);
return count;
}
static DEVICE_ATTR(companion, 0644, show_companion, store_companion);
static inline void create_companion_file(struct ehci_hcd *ehci)
{
int i;
/* with integrated TT there is no companion! */
if (!ehci_is_TDI(ehci))
i = device_create_file(ehci_to_hcd(ehci)->self.controller,
&dev_attr_companion);
}
static inline void remove_companion_file(struct ehci_hcd *ehci)
{
/* with integrated TT there is no companion! */
if (!ehci_is_TDI(ehci))
device_remove_file(ehci_to_hcd(ehci)->self.controller,
&dev_attr_companion);
}
/*-------------------------------------------------------------------------*/
static int check_reset_complete (
struct ehci_hcd *ehci,
int index,
u32 __iomem *status_reg,
int port_status
) {
if (!(port_status & PORT_CONNECT))
return port_status;
/* if reset finished and it's still not enabled -- handoff */
if (!(port_status & PORT_PE)) {
/* with integrated TT, there's nobody to hand it to! */
if (ehci_is_TDI(ehci)) {
ehci_dbg (ehci,
"Failed to enable port %d on root hub TT\n",
index+1);
return port_status;
}
ehci_dbg (ehci, "port %d full speed --> companion\n",
index + 1);
// what happens if HCS_N_CC(params) == 0 ?
port_status |= PORT_OWNER;
port_status &= ~PORT_RWC_BITS;
ehci_writel(ehci, port_status, status_reg);
/* ensure 440EPX ohci controller state is operational */
if (ehci->has_amcc_usb23)
set_ohci_hcfs(ehci, 1);
} else {
ehci_dbg (ehci, "port %d high speed\n", index + 1);
/* ensure 440EPx ohci controller state is suspended */
if (ehci->has_amcc_usb23)
set_ohci_hcfs(ehci, 0);
}
return port_status;
}
/*-------------------------------------------------------------------------*/
/* build "status change" packet (one or two bytes) from HC registers */
static int
ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
{
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
u32 temp, status = 0;
u32 mask;
int ports, i, retval = 1;
unsigned long flags;
/* if !USB_SUSPEND, root hub timers won't get shut down ... */
if (!HC_IS_RUNNING(hcd->state))
return 0;
/* init status to no-changes */
buf [0] = 0;
ports = HCS_N_PORTS (ehci->hcs_params);
if (ports > 7) {
buf [1] = 0;
retval++;
}
/* Some boards (mostly VIA?) report bogus overcurrent indications,
* causing massive log spam unless we completely ignore them. It
* may be relevant that VIA VT8235 controllers, where PORT_POWER is
* always set, seem to clear PORT_OCC and PORT_CSC when writing to
* PORT_POWER; that's surprising, but maybe within-spec.
*/
if (!ignore_oc)
mask = PORT_CSC | PORT_PEC | PORT_OCC;
else
mask = PORT_CSC | PORT_PEC;
// PORT_RESUME from hardware ~= PORT_STAT_C_SUSPEND
/* no hub change reports (bit 0) for now (power, ...) */
/* port N changes (bit N)? */
spin_lock_irqsave (&ehci->lock, flags);
for (i = 0; i < ports; i++) {
temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
/*
* Return status information even for ports with OWNER set.
* Otherwise khubd wouldn't see the disconnect event when a
* high-speed device is switched over to the companion
* controller by the user.
*/
if ((temp & mask) != 0 || test_bit(i, &ehci->port_c_suspend)
|| (ehci->reset_done[i] && time_after_eq(
jiffies, ehci->reset_done[i]))) {
if (i < 7)
buf [0] |= 1 << (i + 1);
else
buf [1] |= 1 << (i - 7);
status = STS_PCD;
}
}
/* FIXME autosuspend idle root hubs */
spin_unlock_irqrestore (&ehci->lock, flags);
return status ? retval : 0;
}
/*-------------------------------------------------------------------------*/
static void
ehci_hub_descriptor (
struct ehci_hcd *ehci,
struct usb_hub_descriptor *desc
) {
int ports = HCS_N_PORTS (ehci->hcs_params);
u16 temp;
desc->bDescriptorType = 0x29;
desc->bPwrOn2PwrGood = 10; /* ehci 1.0, 2.3.9 says 20ms max */
desc->bHubContrCurrent = 0;
desc->bNbrPorts = ports;
temp = 1 + (ports / 8);
desc->bDescLength = 7 + 2 * temp;
/* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */
memset (&desc->bitmap [0], 0, temp);
memset (&desc->bitmap [temp], 0xff, temp);
temp = 0x0008; /* per-port overcurrent reporting */
if (HCS_PPC (ehci->hcs_params))
temp |= 0x0001; /* per-port power control */
else
temp |= 0x0002; /* no power switching */
#if 0
// re-enable when we support USB_PORT_FEAT_INDICATOR below.
if (HCS_INDICATOR (ehci->hcs_params))
temp |= 0x0080; /* per-port indicators (LEDs) */
#endif
desc->wHubCharacteristics = cpu_to_le16(temp);
}
/*-------------------------------------------------------------------------*/
static int ehci_hub_control (
struct usb_hcd *hcd,
u16 typeReq,
u16 wValue,
u16 wIndex,
char *buf,
u16 wLength
) {
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
int ports = HCS_N_PORTS (ehci->hcs_params);
u32 __iomem *status_reg = &ehci->regs->port_status[
(wIndex & 0xff) - 1];
u32 __iomem *hostpc_reg = NULL;
u32 temp, temp1, status;
unsigned long flags;
int retval = 0;
unsigned selector;
/*
* FIXME: support SetPortFeatures USB_PORT_FEAT_INDICATOR.
* HCS_INDICATOR may say we can change LEDs to off/amber/green.
* (track current state ourselves) ... blink for diagnostics,
* power, "this is the one", etc. EHCI spec supports this.
*/
if (ehci->has_hostpc)
hostpc_reg = (u32 __iomem *)((u8 *)ehci->regs
+ HOSTPC0 + 4 * ((wIndex & 0xff) - 1));
spin_lock_irqsave (&ehci->lock, flags);
switch (typeReq) {
case ClearHubFeature:
switch (wValue) {
case C_HUB_LOCAL_POWER:
case C_HUB_OVER_CURRENT:
/* no hub-wide feature/status flags */
break;
default:
goto error;
}
break;
case ClearPortFeature:
if (!wIndex || wIndex > ports)
goto error;
wIndex--;
temp = ehci_readl(ehci, status_reg);
/*
* Even if OWNER is set, so the port is owned by the
* companion controller, khubd needs to be able to clear
* the port-change status bits (especially
* USB_PORT_STAT_C_CONNECTION).
*/
switch (wValue) {
case USB_PORT_FEAT_ENABLE:
ehci_writel(ehci, temp & ~PORT_PE, status_reg);
break;
case USB_PORT_FEAT_C_ENABLE:
ehci_writel(ehci, (temp & ~PORT_RWC_BITS) | PORT_PEC,
status_reg);
break;
case USB_PORT_FEAT_SUSPEND:
if (temp & PORT_RESET)
goto error;
if (ehci->no_selective_suspend)
break;
if (!(temp & PORT_SUSPEND))
break;
if ((temp & PORT_PE) == 0)
goto error;
/* clear phy low-power mode before resume */
if (hostpc_reg) {
temp1 = ehci_readl(ehci, hostpc_reg);
ehci_writel(ehci, temp1 & ~HOSTPC_PHCD,
hostpc_reg);
spin_unlock_irqrestore(&ehci->lock, flags);
msleep(5);/* wait to leave low-power mode */
spin_lock_irqsave(&ehci->lock, flags);
}
/* resume signaling for 20 msec */
temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
ehci_writel(ehci, temp | PORT_RESUME, status_reg);
ehci->reset_done[wIndex] = jiffies
+ msecs_to_jiffies(20);
break;
case USB_PORT_FEAT_C_SUSPEND:
clear_bit(wIndex, &ehci->port_c_suspend);
break;
case USB_PORT_FEAT_POWER:
if (HCS_PPC (ehci->hcs_params))
ehci_writel(ehci,
temp & ~(PORT_RWC_BITS | PORT_POWER),
status_reg);
break;
case USB_PORT_FEAT_C_CONNECTION:
ehci_writel(ehci, (temp & ~PORT_RWC_BITS) | PORT_CSC,
status_reg);
break;
case USB_PORT_FEAT_C_OVER_CURRENT:
ehci_writel(ehci, (temp & ~PORT_RWC_BITS) | PORT_OCC,
status_reg);
break;
case USB_PORT_FEAT_C_RESET:
/* GetPortStatus clears reset */
break;
default:
goto error;
}
ehci_readl(ehci, &ehci->regs->command); /* unblock posted write */
break;
case GetHubDescriptor:
ehci_hub_descriptor (ehci, (struct usb_hub_descriptor *)
buf);
break;
case GetHubStatus:
/* no hub-wide feature/status flags */
memset (buf, 0, 4);
//cpu_to_le32s ((u32 *) buf);
break;
case GetPortStatus:
if (!wIndex || wIndex > ports)
goto error;
wIndex--;
status = 0;
temp = ehci_readl(ehci, status_reg);
// wPortChange bits
if (temp & PORT_CSC)
status |= USB_PORT_STAT_C_CONNECTION << 16;
if (temp & PORT_PEC)
status |= USB_PORT_STAT_C_ENABLE << 16;
if ((temp & PORT_OCC) && !ignore_oc){
status |= USB_PORT_STAT_C_OVERCURRENT << 16;
/*
* Hubs should disable port power on over-current.
* However, not all EHCI implementations do this
* automatically, even if they _do_ support per-port
* power switching; they're allowed to just limit the
* current. khubd will turn the power back on.
*/
if (HCS_PPC (ehci->hcs_params)){
ehci_writel(ehci,
temp & ~(PORT_RWC_BITS | PORT_POWER),
status_reg);
}
}
/* whoever resumes must GetPortStatus to complete it!! */
if (temp & PORT_RESUME) {
/* Remote Wakeup received? */
if (!ehci->reset_done[wIndex]) {
/* resume signaling for 20 msec */
ehci->reset_done[wIndex] = jiffies
+ msecs_to_jiffies(20);
/* check the port again */
mod_timer(&ehci_to_hcd(ehci)->rh_timer,
ehci->reset_done[wIndex]);
}
/* resume completed? */
else if (time_after_eq(jiffies,
ehci->reset_done[wIndex])) {
clear_bit(wIndex, &ehci->suspended_ports);
set_bit(wIndex, &ehci->port_c_suspend);
ehci->reset_done[wIndex] = 0;
/* stop resume signaling */
temp = ehci_readl(ehci, status_reg);
ehci_writel(ehci,
temp & ~(PORT_RWC_BITS | PORT_RESUME),
status_reg);
retval = handshake(ehci, status_reg,
PORT_RESUME, 0, 2000 /* 2msec */);
if (retval != 0) {
ehci_err(ehci,
"port %d resume error %d\n",
wIndex + 1, retval);
goto error;
}
temp &= ~(PORT_SUSPEND|PORT_RESUME|(3<<10));
}
}
/* whoever resets must GetPortStatus to complete it!! */
if ((temp & PORT_RESET)
&& time_after_eq(jiffies,
ehci->reset_done[wIndex])) {
status |= USB_PORT_STAT_C_RESET << 16;
ehci->reset_done [wIndex] = 0;
/* force reset to complete */
ehci_writel(ehci, temp & ~(PORT_RWC_BITS | PORT_RESET),
status_reg);
/* REVISIT: some hardware needs 550+ usec to clear
* this bit; seems too long to spin routinely...
*/
retval = handshake(ehci, status_reg,
PORT_RESET, 0, 1000);
if (retval != 0) {
ehci_err (ehci, "port %d reset error %d\n",
wIndex + 1, retval);
goto error;
}
/* see what we found out */
temp = check_reset_complete (ehci, wIndex, status_reg,
ehci_readl(ehci, status_reg));
}
if (!(temp & (PORT_RESUME|PORT_RESET)))
ehci->reset_done[wIndex] = 0;
/* transfer dedicated ports to the companion hc */
if ((temp & PORT_CONNECT) &&
test_bit(wIndex, &ehci->companion_ports)) {
temp &= ~PORT_RWC_BITS;
temp |= PORT_OWNER;
ehci_writel(ehci, temp, status_reg);
ehci_dbg(ehci, "port %d --> companion\n", wIndex + 1);
temp = ehci_readl(ehci, status_reg);
}
/*
* Even if OWNER is set, there's no harm letting khubd
* see the wPortStatus values (they should all be 0 except
* for PORT_POWER anyway).
*/
if (temp & PORT_CONNECT) {
status |= USB_PORT_STAT_CONNECTION;
// status may be from integrated TT
if (ehci->has_hostpc) {
temp1 = ehci_readl(ehci, hostpc_reg);
status |= ehci_port_speed(ehci, temp1);
} else
status |= ehci_port_speed(ehci, temp);
}
if (temp & PORT_PE)
status |= USB_PORT_STAT_ENABLE;
/* maybe the port was unsuspended without our knowledge */
if (temp & (PORT_SUSPEND|PORT_RESUME)) {
status |= USB_PORT_STAT_SUSPEND;
} else if (test_bit(wIndex, &ehci->suspended_ports)) {
clear_bit(wIndex, &ehci->suspended_ports);
ehci->reset_done[wIndex] = 0;
if (temp & PORT_PE)
set_bit(wIndex, &ehci->port_c_suspend);
}
if (temp & PORT_OC)
status |= USB_PORT_STAT_OVERCURRENT;
if (temp & PORT_RESET)
status |= USB_PORT_STAT_RESET;
if (temp & PORT_POWER)
status |= USB_PORT_STAT_POWER;
if (test_bit(wIndex, &ehci->port_c_suspend))
status |= USB_PORT_STAT_C_SUSPEND << 16;
#ifndef VERBOSE_DEBUG
if (status & ~0xffff) /* only if wPortChange is interesting */
#endif
dbg_port (ehci, "GetStatus", wIndex + 1, temp);
put_unaligned_le32(status, buf);
break;
case SetHubFeature:
switch (wValue) {
case C_HUB_LOCAL_POWER:
case C_HUB_OVER_CURRENT:
/* no hub-wide feature/status flags */
break;
default:
goto error;
}
break;
case SetPortFeature:
selector = wIndex >> 8;
wIndex &= 0xff;
if (unlikely(ehci->debug)) {
/* If the debug port is active any port
* feature requests should get denied */
if (wIndex == HCS_DEBUG_PORT(ehci->hcs_params) &&
(readl(&ehci->debug->control) & DBGP_ENABLED)) {
retval = -ENODEV;
goto error_exit;
}
}
if (!wIndex || wIndex > ports)
goto error;
wIndex--;
temp = ehci_readl(ehci, status_reg);
if (temp & PORT_OWNER)
break;
temp &= ~PORT_RWC_BITS;
switch (wValue) {
case USB_PORT_FEAT_SUSPEND:
if (ehci->no_selective_suspend)
break;
if ((temp & PORT_PE) == 0
|| (temp & PORT_RESET) != 0)
goto error;
/* After above check the port must be connected.
* Set appropriate bit thus could put phy into low power
* mode if we have hostpc feature
*/
temp &= ~PORT_WKCONN_E;
temp |= PORT_WKDISC_E | PORT_WKOC_E;
ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
#ifdef MXS_USB_HOST_HACK
spin_unlock_irqrestore(&ehci->lock, flags);
{
struct fsl_usb2_platform_data *pdata;
pdata = hcd->self.controller->platform_data;
if (pdata && pdata->platform_suspend)
pdata->platform_suspend(pdata);
}
spin_lock_irqsave(&ehci->lock, flags);
#endif
if (hostpc_reg) {
spin_unlock_irqrestore(&ehci->lock, flags);
msleep(5);/* 5ms for HCD enter low pwr mode */
spin_lock_irqsave(&ehci->lock, flags);
temp1 = ehci_readl(ehci, hostpc_reg);
ehci_writel(ehci, temp1 | HOSTPC_PHCD,
hostpc_reg);
temp1 = ehci_readl(ehci, hostpc_reg);
ehci_dbg(ehci, "Port%d phy low pwr mode %s\n",
wIndex, (temp1 & HOSTPC_PHCD) ?
"succeeded" : "failed");
}
set_bit(wIndex, &ehci->suspended_ports);
break;
case USB_PORT_FEAT_POWER:
if (HCS_PPC (ehci->hcs_params))
ehci_writel(ehci, temp | PORT_POWER,
status_reg);
break;
case USB_PORT_FEAT_RESET:
if (temp & PORT_RESUME)
goto error;
/* line status bits may report this as low speed,
* which can be fine if this root hub has a
* transaction translator built in.
*/
if ((temp & (PORT_PE|PORT_CONNECT)) == PORT_CONNECT
&& !ehci_is_TDI(ehci)
&& PORT_USB11 (temp)) {
ehci_dbg (ehci,
"port %d low speed --> companion\n",
wIndex + 1);
temp |= PORT_OWNER;
} else {
ehci_vdbg (ehci, "port %d reset\n", wIndex + 1);
temp |= PORT_RESET;
temp &= ~PORT_PE;
/*
* caller must wait, then call GetPortStatus
* usb 2.0 spec says 50 ms resets on root
*/
ehci->reset_done [wIndex] = jiffies
+ msecs_to_jiffies (50);
}
ehci_writel(ehci, temp, status_reg);
break;
/* For downstream facing ports (these): one hub port is put
* into test mode according to USB2 11.24.2.13, then the hub
* must be reset (which for root hub now means rmmod+modprobe,
* or else system reboot). See EHCI 2.3.9 and 4.14 for info
* about the EHCI-specific stuff.
*/
case USB_PORT_FEAT_TEST:
if (!selector || selector > 5)
goto error;
ehci_quiesce(ehci);
ehci_halt(ehci);
temp |= selector << 16;
ehci_writel(ehci, temp, status_reg);
break;
default:
goto error;
}
ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
break;
default:
error:
/* "stall" on error */
retval = -EPIPE;
}
error_exit:
spin_unlock_irqrestore (&ehci->lock, flags);
return retval;
}
static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
if (ehci_is_TDI(ehci))
return;
set_owner(ehci, --portnum, PORT_OWNER);
}
static int ehci_port_handed_over(struct usb_hcd *hcd, int portnum)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
u32 __iomem *reg;
if (ehci_is_TDI(ehci))
return 0;
reg = &ehci->regs->port_status[portnum - 1];
return ehci_readl(ehci, reg) & PORT_OWNER;
}
|
btolfa/kernel_tion_pro28
|
drivers/usb/host/ehci-hub.c
|
C
|
gpl-2.0
| 31,050 |
/**
* @file error.c Error functions
*
* purple
*
* Purple 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "nateon.h"
#include "error.h"
const char *
nateon_error_get_text(unsigned int type, gboolean *debug)
{
static char msg[NATEON_BUF_LEN];
*debug = FALSE;
switch (type) {
// case 0:
// g_snprintf(msg, sizeof(msg),
// _("Unable to parse message"));
// *debug = TRUE;
// break;
// case 200:
// g_snprintf(msg, sizeof(msg),
// _("Syntax Error (probably a client bug)"));
// *debug = TRUE;
// break;
// case 201:
// g_snprintf(msg, sizeof(msg),
// _("Invalid e-mail address"));
// break;
// case 205:
// g_snprintf(msg, sizeof(msg), _("User does not exist"));
// break;
// case 206:
// g_snprintf(msg, sizeof(msg),
// _("Fully qualified domain name missing"));
// break;
// case 207:
// g_snprintf(msg, sizeof(msg), _("Already logged in"));
// break;
// case 208:
// g_snprintf(msg, sizeof(msg), _("Invalid screen name"));
// break;
// case 209:
// g_snprintf(msg, sizeof(msg), _("Invalid friendly name"));
// break;
// case 210:
// g_snprintf(msg, sizeof(msg), _("List full"));
// break;
// case 215:
// g_snprintf(msg, sizeof(msg), _("Already there"));
// *debug = TRUE;
// break;
// case 216:
// g_snprintf(msg, sizeof(msg), _("Not on list"));
// break;
// case 217:
// g_snprintf(msg, sizeof(msg), _("User is offline"));
// break;
// case 218:
// g_snprintf(msg, sizeof(msg), _("Already in the mode"));
// *debug = TRUE;
// break;
// case 219:
// g_snprintf(msg, sizeof(msg), _("Already in opposite list"));
// *debug = TRUE;
// break;
// case 223:
// g_snprintf(msg, sizeof(msg), _("Too many groups"));
// break;
// case 224:
// g_snprintf(msg, sizeof(msg), _("Invalid group"));
// break;
// case 225:
// g_snprintf(msg, sizeof(msg), _("User not in group"));
// break;
// case 229:
// g_snprintf(msg, sizeof(msg), _("Group name too long"));
// break;
// case 230:
// g_snprintf(msg, sizeof(msg), _("Cannot remove group zero"));
// *debug = TRUE;
// break;
// case 231:
// g_snprintf(msg, sizeof(msg),
// _("Tried to add a user to a group "
// "that doesn't exist"));
// break;
// case 280:
// g_snprintf(msg, sizeof(msg), _("Switchboard failed"));
// *debug = TRUE;
// break;
// case 281:
// g_snprintf(msg, sizeof(msg), _("Notify transfer failed"));
// *debug = TRUE;
// break;
//
// case 300:
// g_snprintf(msg, sizeof(msg), _("Required fields missing"));
// *debug = TRUE;
// break;
// case 301:
// g_snprintf(msg, sizeof(msg), _("Too many hits to a FND"));
// *debug = TRUE;
// break;
// case 302:
// g_snprintf(msg, sizeof(msg), _("Not logged in"));
// break;
//
// case 500:
// g_snprintf(msg, sizeof(msg), _("Service temporarily unavailable"));
// break;
// case 501:
// g_snprintf(msg, sizeof(msg), _("Database server error"));
// *debug = TRUE;
// break;
// case 502:
// g_snprintf(msg, sizeof(msg), _("Command disabled"));
// *debug = TRUE;
// break;
// case 510:
// g_snprintf(msg, sizeof(msg), _("File operation error"));
// *debug = TRUE;
// break;
// case 520:
// g_snprintf(msg, sizeof(msg), _("Memory allocation error"));
// *debug = TRUE;
// break;
// case 540:
// g_snprintf(msg, sizeof(msg), _("Wrong CHL value sent to server"));
// *debug = TRUE;
// break;
//
// case 600:
// g_snprintf(msg, sizeof(msg), _("Server busy"));
// break;
// case 601:
// g_snprintf(msg, sizeof(msg), _("Server unavailable"));
// break;
// case 602:
// g_snprintf(msg, sizeof(msg), _("Peer notification server down"));
// *debug = TRUE;
// break;
// case 603:
// g_snprintf(msg, sizeof(msg), _("Database connect error"));
// *debug = TRUE;
// break;
// case 604:
// g_snprintf(msg, sizeof(msg),
// _("Server is going down (abandon ship)"));
// break;
// case 605:
// g_snprintf(msg, sizeof(msg), _("Server unavailable"));
// break;
//
// case 707:
// g_snprintf(msg, sizeof(msg), _("Error creating connection"));
// *debug = TRUE;
// break;
// case 710:
// g_snprintf(msg, sizeof(msg),
// _("CVR parameters are either unknown or not allowed"));
// *debug = TRUE;
// break;
// case 711:
// g_snprintf(msg, sizeof(msg), _("Unable to write"));
// break;
// case 712:
// g_snprintf(msg, sizeof(msg), _("Session overload"));
// *debug = TRUE;
// break;
// case 713:
// g_snprintf(msg, sizeof(msg), _("User is too active"));
// break;
// case 714:
// g_snprintf(msg, sizeof(msg), _("Too many sessions"));
// break;
// case 715:
// g_snprintf(msg, sizeof(msg), _("Passport not verified"));
// break;
// case 717:
// g_snprintf(msg, sizeof(msg), _("Bad friend file"));
// *debug = TRUE;
// break;
// case 731:
// g_snprintf(msg, sizeof(msg), _("Not expected"));
// *debug = TRUE;
// break;
//
// case 800:
// g_snprintf(msg, sizeof(msg),
// _("Friendly name changes too rapidly"));
// break;
//
// case 910:
// case 912:
// case 918:
// case 919:
// case 921:
// case 922:
// g_snprintf(msg, sizeof(msg), _("Server too busy"));
// break;
// case 911:
// case 917:
// g_snprintf(msg, sizeof(msg), _("Authentication failed"));
// break;
// case 913:
// g_snprintf(msg, sizeof(msg), _("Not allowed when offline"));
// break;
// case 914:
// case 915:
// case 916:
// g_snprintf(msg, sizeof(msg), _("Server unavailable"));
// break;
// case 920:
// g_snprintf(msg, sizeof(msg), _("Not accepting new users"));
// break;
// case 923:
// g_snprintf(msg, sizeof(msg),
// _("Kids Passport without parental consent"));
// break;
// case 924:
// g_snprintf(msg, sizeof(msg),
// _("Passport account not yet verified"));
// break;
// case 928:
// g_snprintf(msg, sizeof(msg), _("Bad ticket"));
// *debug = TRUE;
// break;
default:
g_snprintf(msg, sizeof(msg), _("Unknown Error Code %d"), type);
*debug = TRUE;
break;
}
return msg;
}
void
nateon_error_handle(NateonSession *session, unsigned int type)
{
char buf[NATEON_BUF_LEN];
gboolean debug;
g_snprintf(buf, sizeof(buf), _("NATEON Error: %s\n"),
nateon_error_get_text(type, &debug));
if (debug)
purple_debug_warning("nateon", "error %d: %s\n", type, buf);
else
purple_notify_error(session->account->gc, NULL, buf, NULL);
}
|
difro/pidgin-nateon
|
src/error.c
|
C
|
gpl-2.0
| 7,255 |
<?php
class Zend_View_Helper_WebSectionTemplate extends Zend_View_Helper_Abstract
{
public function webSectionTemplate($area)
{
$html = '';
$html.= '<div class="row-fluid">';
$html.= '<div class="span12">';
$html.= '<div class="page-header">';
$html.= '<h1>Header Layout Default</h1>';
$html.= '</div>';
$html.= '</div>';
$html.= '</div>';
$html.= '<div class="row-fluid">';
$html.= '<div class="span12">';
$html.= '<div class="page-header">';
$html.= '<h1>Menu <a href="/">'.$lang->translate('Home').'</a></h1>';
$html.= '</div>';
$html.= '</div>';
$html.= '</div>';
$html.= '<div class="row-fluid">';
$html.= '<div class="span6">';
$html.= '<div class="row-fluid">';
$html.= '<div class="page-header">';
$html.= '<h2>area 1</h2>';
$html.= $area[1];
$html.= '</div>';
$html.= '</div>';
$html.= '</div>';
$html.= '<div class="span6">';
$html.= '<div class="row-fluid">';
$html.= '<div class="page-header">';
$html.= '<h2>area 2</h2>';
$html.= $area[2];
$html.= '</div>';
$html.= '</div>';
$html.= '<div class="row-fluid">';
$html.= '<div class="page-header">';
$html.= '<h2>area 3</h2>';
$html.= $area[3];
$html.= '</div>';
$html.= '</div>';
$html.= '</div>';
$html.= '</div>';
//$html.= $area_1.' '.$area_2.' '.$area_3;
return $html;
}
}
|
AlexandrosV/beta-thesis
|
application/modules/default/views/helpers/WebSectionTemplate.php
|
PHP
|
gpl-2.0
| 1,478 |
var EFA = {
log: [],
/*
Prevent backspace being used as back button in infopath form in modal.
Source: http://johnliu.net/blog/2012/3/27/infopath-disabling-backspace-key-in-browser-form.html
grab a reference to the modal window object in SharePoint
*/
OpenPopUpPage: function( url ){
var options = SP.UI.$create_DialogOptions();
options.url = url;
var w = SP.UI.ModalDialog.showModalDialog(options);
/* Attempt to prevent backspace acting as navigation key on read only input - Doesn't currently work.
if (w) {
// get the modal window's iFrame element
var f = w.get_frameElement();
EFA.f = f;
// watch frame's readyState change - when page load is complete, re-attach keydown event
// on the new document
$(f).ready(function(){
var fwin = this.contentWindow || this.contentDocument;
$(fwin.document).on('focus',"input[readonly]",function(){ $(this).blur(); });
});
}*/
},
// get current user
checkCurrentUser: function (callback){
ExecuteOrDelayUntilScriptLoaded(checkCurrentUserLoaded, "sp.js");
function checkCurrentUserLoaded() {
var context = SP.ClientContext.get_current();
var siteColl = context.get_site();
var web = siteColl.get_rootWeb();
this._currentUser = web.get_currentUser();
context.load(this._currentUser);
context.executeQueryAsync(Function.createDelegate(this, callback),Function.createDelegate(this, callback));
}
},
CheckUserSucceeded: function(){
EFA['User'] = this._currentUser;
},
CheckUserfailed: function(){
//console.log('Failed to get user');
},
DoesUserHaveCreatePermissions: function(url, callback) {
var Xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\
<soap:Body>\
<DoesCurrentUserHavePermissionsToList xmlns=\"http://tempuri.org/\">\
<url>"+ url +"</url>\
</DoesCurrentUserHavePermissionsToList>\
</soap:Body>\
</soap:Envelope>";
$.ajax({
url: "/_layouts/EFA/EFAWebServices.asmx",
type: "POST",
dataType: "xml",
data: Xml,
complete: function(xData, Status){
if(Status != 'success')
throw "Failed to determine user permissions for " + url;
callback(xData);
},
contentType: "text/xml; charset=\"utf-8\""
});
}
};
/*
To access the mapping need to uses keys, therefore need to check if its available for browser and add it if not.
Then we can loop through the mapping like so:
$.each(keys(config.mapping), function(){ console.log(config.mapping[this.toString()]) });
using this to build the query and create the resultant html
*/
// SOURCE: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
if (!Object.keys) {
Object.keys = (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
],
dontEnumsLength = dontEnums.length;
return function (obj) {
if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object');
var result = [];
for (var prop in obj) {
if (hasOwnProperty.call(obj, prop)) result.push(prop);
}
if (hasDontEnumBug) {
for (var i=0; i < dontEnumsLength; i++) {
if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i]);
}
}
return result;
};
})();
}
/*
Array.indexOf for IE
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
*/
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
'use strict';
if (this == null) {
throw new TypeError();
}
var n, k, t = Object(this),
len = t.length >>> 0;
if (len === 0) {
return -1;
}
n = 0;
if (arguments.length > 1) {
n = Number(arguments[1]);
if (n != n) { // shortcut for verifying if it's NaN
n = 0;
} else if (n != 0 && n != Infinity && n != -Infinity) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
}
if (n >= len) {
return -1;
}
for (k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); k < len; k++) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
};
}
/*
Test for Canvas Suppport
Source: http://stackoverflow.com/questions/2745432/best-way-to-detect-that-html5-canvas-is-not-supported/2746983#2746983
*/
function isCanvasSupported(){
var elem = document.createElement('canvas');
return !!(elem.getContext && elem.getContext('2d'));
}
/*
Console.log() for IE 8
*/
(function() {
if (!window.console) {
window.console = {};
}
// union of Chrome, FF, IE, and Safari console methods
var m = [
"log", "info", "warn", "error", "debug", "trace", "dir", "group",
"groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd",
"dirxml", "assert", "count", "markTimeline", "timeStamp", "clear"
];
// define undefined methods as noops to prevent errors
for (var i = 0; i < m.length; i++) {
if (!window.console[m[i]]) {
window.console[m[i]] = function() {};
}
}
})();
|
jwykeham/SharePoint-Bootstrap3-Master
|
TwitterBootstrapMasterPage/pkg/Debug/TwitterBootstrapMasterPage/Layouts/TB/js/helper.js
|
JavaScript
|
gpl-2.0
| 5,718 |
/*
* arch/arm/include/asm/pgtable.h
*
* Copyright (C) 1995-2002 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _ASMARM_PGTABLE_H
#define _ASMARM_PGTABLE_H
#include <linux/const.h>
#include <asm/proc-fns.h>
#ifndef CONFIG_MMU
#include <asm-generic/4level-fixup.h>
#include "pgtable-nommu.h"
#else
#include <asm-generic/pgtable-nopud.h>
#include <asm/memory.h>
#include <asm/pgtable-hwdef.h>
#ifdef CONFIG_ARM_LPAE
#include <asm/pgtable-3level.h>
#else
#include <asm/pgtable-2level.h>
#endif
/*
* Just any arbitrary offset to the start of the vmalloc VM area: the
* current 8MB value just means that there will be a 8MB "hole" after the
* physical memory until the kernel virtual memory starts. That means that
* any out-of-bounds memory accesses will hopefully be caught.
* The vmalloc() routines leaves a hole of 4kB between each vmalloced
* area for the same reason. ;)
*/
#define VMALLOC_OFFSET (8*1024*1024)
#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
#define VMALLOC_END 0xff000000UL
#define LIBRARY_TEXT_START 0x0c000000
#ifndef __ASSEMBLY__
extern void __pte_error(const char *file, int line, pte_t);
extern void __pmd_error(const char *file, int line, pmd_t);
extern void __pgd_error(const char *file, int line, pgd_t);
#define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte)
#define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd)
#define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd)
/*
* This is the lowest virtual address we can permit any user space
* mapping to be mapped at. This is particularly important for
* non-high vector CPUs.
*/
#define FIRST_USER_ADDRESS PAGE_SIZE
/*
* The pgprot_* and protection_map entries will be fixed up in runtime
* to include the cachable and bufferable bits based on memory policy,
* as well as any architecture dependent bits like global/ASID and SMP
* shared mapping bits.
*/
#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG
extern pgprot_t pgprot_user;
extern pgprot_t pgprot_kernel;
#define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b))
#define PAGE_NONE _MOD_PROT(pgprot_user, L_PTE_XN | L_PTE_RDONLY)
#define PAGE_SHARED _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_XN)
#define PAGE_SHARED_EXEC _MOD_PROT(pgprot_user, L_PTE_USER)
#define PAGE_COPY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY | L_PTE_XN)
#define PAGE_COPY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY)
#define PAGE_READONLY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY | L_PTE_XN)
#define PAGE_READONLY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY)
#define PAGE_KERNEL _MOD_PROT(pgprot_kernel, L_PTE_XN)
#define PAGE_KERNEL_EXEC pgprot_kernel
#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN)
#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)
#define __PAGE_SHARED_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER)
#define __PAGE_COPY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY | L_PTE_XN)
#define __PAGE_COPY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY)
#define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY | L_PTE_XN)
#define __PAGE_READONLY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY)
#define __pgprot_modify(prot,mask,bits) \
__pgprot((pgprot_val(prot) & ~(mask)) | (bits))
#define pgprot_noncached(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)
#define pgprot_writecombine(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
#define pgprot_stronglyordered(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)
#define pgprot_device(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_DEV_NONSHARED)
#define pgprot_writethroughcache(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_WRITETHROUGH)
#define pgprot_writebackcache(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_WRITEBACK)
#define pgprot_writebackwacache(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_WRITEALLOC)
#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
#define pgprot_dmacoherent(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE | L_PTE_XN)
#define __HAVE_PHYS_MEM_ACCESS_PROT
#define COHERENT_IS_NORMAL 1
struct file;
extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot);
#else
#define pgprot_dmacoherent(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED | L_PTE_XN)
#define COHERENT_IS_NORMAL 0
#endif
#endif /* __ASSEMBLY__ */
/*
* The table below defines the page protection levels that we insert into our
* Linux page table version. These get translated into the best that the
* architecture can perform. Note that on most ARM hardware:
* 1) We cannot do execute protection
* 2) If we could do execute protection, then read is implied
* 3) write implies read permissions
*/
#define __P000 __PAGE_NONE
#define __P001 __PAGE_READONLY
#define __P010 __PAGE_COPY
#define __P011 __PAGE_COPY
#define __P100 __PAGE_READONLY_EXEC
#define __P101 __PAGE_READONLY_EXEC
#define __P110 __PAGE_COPY_EXEC
#define __P111 __PAGE_COPY_EXEC
#define __S000 __PAGE_NONE
#define __S001 __PAGE_READONLY
#define __S010 __PAGE_SHARED
#define __S011 __PAGE_SHARED
#define __S100 __PAGE_READONLY_EXEC
#define __S101 __PAGE_READONLY_EXEC
#define __S110 __PAGE_SHARED_EXEC
#define __S111 __PAGE_SHARED_EXEC
#ifndef __ASSEMBLY__
/*
* ZERO_PAGE is a global shared page that is always zero: used
* for zero-mapped memory areas etc..
*/
extern struct page *empty_zero_page;
#define ZERO_PAGE(vaddr) (empty_zero_page)
extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
/* to find an entry in a page-table-directory */
#define pgd_index(addr) ((addr) >> PGDIR_SHIFT)
#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
/* to find an entry in a kernel page-table-directory */
#define pgd_offset_k(addr) pgd_offset(&init_mm, addr)
#define pmd_none(pmd) (!pmd_val(pmd))
#define pmd_present(pmd) (pmd_val(pmd))
static inline pte_t *pmd_page_vaddr(pmd_t pmd)
{
return __va(pmd_val(pmd) & PHYS_MASK & (s32)PAGE_MASK);
}
#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
#ifndef CONFIG_HIGHPTE
#define __pte_map(pmd) pmd_page_vaddr(*(pmd))
#define __pte_unmap(pte) do { } while (0)
#else
#define __pte_map(pmd) (pte_t *)kmap_atomic(pmd_page(*(pmd)))
#define __pte_unmap(pte) kunmap_atomic(pte)
#endif
#define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(pmd,addr) (pmd_page_vaddr(*(pmd)) + pte_index(addr))
#define pte_offset_map(pmd,addr) (__pte_map(pmd) + pte_index(addr))
#define pte_unmap(pte) __pte_unmap(pte)
#define pte_pfn(pte) ((pte_val(pte) & PHYS_MASK) >> PAGE_SHIFT)
#define pfn_pte(pfn,prot) __pte(__pfn_to_phys(pfn) | pgprot_val(prot))
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot)
#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0)
#define pte_none(pte) (!pte_val(pte))
#define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT)
#define pte_write(pte) (!(pte_val(pte) & L_PTE_RDONLY))
#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY)
#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
#define pte_exec(pte) (!(pte_val(pte) & L_PTE_XN))
#define pte_special(pte) (0)
#define pte_present_user(pte) \
((pte_val(pte) & (L_PTE_PRESENT | L_PTE_USER)) == \
(L_PTE_PRESENT | L_PTE_USER))
#if __LINUX_ARM_ARCH__ < 6
static inline void __sync_icache_dcache(pte_t pteval)
{
}
#else
extern void __sync_icache_dcache(pte_t pteval);
#endif
static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pteval)
{
unsigned long ext = 0;
if (addr < TASK_SIZE && pte_present_user(pteval)) {
__sync_icache_dcache(pteval);
ext |= PTE_EXT_NG;
}
set_pte_ext(ptep, pteval, ext);
}
#define PTE_BIT_FUNC(fn,op) \
static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
PTE_BIT_FUNC(wrprotect, |= L_PTE_RDONLY);
PTE_BIT_FUNC(mkwrite, &= ~L_PTE_RDONLY);
PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY);
PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY);
PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG);
PTE_BIT_FUNC(mkyoung, |= L_PTE_YOUNG);
static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{
const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER;
pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
return pte;
}
/*
* Encode and decode a swap entry. Swap entries are stored in the Linux
* page tables as follows:
*
* 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* <--------------- offset ----------------------> < type -> 0 0 0
*
* This gives us up to 31 swap files and 64GB per swap file. Note that
* the offset field is always non-zero.
*/
#define __SWP_TYPE_SHIFT 3
#define __SWP_TYPE_BITS 5
#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1)
#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
#define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK)
#define __swp_offset(x) ((x).val >> __SWP_OFFSET_SHIFT)
#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) })
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
/*
* It is an error for the kernel to have more swap files than we can
* encode in the PTEs. This ensures that we know when MAX_SWAPFILES
* is increased beyond what we presently support.
*/
#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > __SWP_TYPE_BITS)
/*
* Encode and decode a file entry. File entries are stored in the Linux
* page tables as follows:
*
* 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* <----------------------- offset ------------------------> 1 0 0
*/
#define pte_file(pte) (pte_val(pte) & L_PTE_FILE)
#define pte_to_pgoff(x) (pte_val(x) >> 3)
#define pgoff_to_pte(x) __pte(((x) << 3) | L_PTE_FILE)
#define PTE_FILE_MAX_BITS 29
/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
/* FIXME: this is not correct */
#define kern_addr_valid(addr) (1)
#include <asm-generic/pgtable.h>
/*
* We provide our own arch_get_unmapped_area to cope with VIPT caches.
*/
#define HAVE_ARCH_UNMAPPED_AREA
#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
/*
* remap a physical page `pfn' of size `size' with page protection `prot'
* into virtual address `from'
*/
#define io_remap_pfn_range(vma,from,pfn,size,prot) \
remap_pfn_range(vma,from,pfn,size,prot)
#define pgtable_cache_init() do { } while (0)
#endif /* !__ASSEMBLY__ */
#endif /* CONFIG_MMU */
#endif /* _ASMARM_PGTABLE_H */
|
Nicklas373/Hana-CoreUX-Kernel_MSM8627-AOSP_7.0
|
arch/arm/include/asm/pgtable.h
|
C
|
gpl-2.0
| 11,085 |
"""
Small event module
=======================
"""
import numpy as np
import logging
logger = logging.getLogger(__name__)
from ...utils.decorators import face_lookup
from ...geometry.sheet_geometry import SheetGeometry
from ...topology.sheet_topology import cell_division
from .actions import (
exchange,
remove,
merge_vertices,
detach_vertices,
increase,
decrease,
increase_linear_tension,
)
def reconnect(sheet, manager, **kwargs):
"""Performs reconnections (vertex merging / splitting) following Finegan et al. 2019
kwargs overwrite their corresponding `sheet.settings` entries
Keyword Arguments
-----------------
threshold_length : the threshold length at which vertex merging is performed
p_4 : the probability per unit time to perform a detachement from a rank 4 vertex
p_5p : the probability per unit time to perform a detachement from a rank 5 or more vertex
See Also
--------
**The tricellular vertex-specific adhesion molecule Sidekick
facilitates polarised cell intercalation during Drosophila axis
extension** _Tara M Finegan, Nathan Hervieux, Alexander
Nestor-Bergmann, Alexander G. Fletcher, Guy B Blanchard, Benedicte
Sanson_ bioRxiv 704932; doi: https://doi.org/10.1101/704932
"""
sheet.settings.update(kwargs)
nv = sheet.Nv
merge_vertices(sheet)
if nv != sheet.Nv:
logger.info(f"Merged {nv - sheet.Nv+1} vertices")
nv = sheet.Nv
retval = detach_vertices(sheet)
if retval:
logger.info("Failed to detach, skipping")
if nv != sheet.Nv:
logger.info(f"Detached {sheet.Nv - nv} vertices")
manager.append(reconnect, **kwargs)
default_division_spec = {
"face_id": -1,
"face": -1,
"growth_rate": 0.1,
"critical_vol": 2.0,
"geom": SheetGeometry,
}
@face_lookup
def division(sheet, manager, **kwargs):
"""Cell division happens through cell growth up to a critical volume,
followed by actual division of the face.
Parameters
----------
sheet : a `Sheet` object
manager : an `EventManager` instance
face_id : int,
index of the mother face
growth_rate : float, default 0.1
rate of increase of the prefered volume
critical_vol : float, default 2.
volume at which the cells stops to grow and devides
"""
division_spec = default_division_spec
division_spec.update(**kwargs)
face = division_spec["face"]
division_spec["critical_vol"] *= sheet.specs["face"]["prefered_vol"]
print(sheet.face_df.loc[face, "vol"], division_spec["critical_vol"])
if sheet.face_df.loc[face, "vol"] < division_spec["critical_vol"]:
increase(
sheet, "face", face, division_spec["growth_rate"], "prefered_vol", True
)
manager.append(division, **division_spec)
else:
daughter = cell_division(sheet, face, division_spec["geom"])
sheet.face_df.loc[daughter, "id"] = sheet.face_df.id.max() + 1
default_contraction_spec = {
"face_id": -1,
"face": -1,
"contractile_increase": 1.0,
"critical_area": 1e-2,
"max_contractility": 10,
"multiply": False,
"contraction_column": "contractility",
"unique": True,
}
@face_lookup
def contraction(sheet, manager, **kwargs):
"""Single step contraction event."""
contraction_spec = default_contraction_spec
contraction_spec.update(**kwargs)
face = contraction_spec["face"]
if (sheet.face_df.loc[face, "area"] < contraction_spec["critical_area"]) or (
sheet.face_df.loc[face, contraction_spec["contraction_column"]]
> contraction_spec["max_contractility"]
):
return
increase(
sheet,
"face",
face,
contraction_spec["contractile_increase"],
contraction_spec["contraction_column"],
contraction_spec["multiply"],
)
default_type1_transition_spec = {
"face_id": -1,
"face": -1,
"critical_length": 0.1,
"geom": SheetGeometry,
}
@face_lookup
def type1_transition(sheet, manager, **kwargs):
"""Custom type 1 transition event that tests if
the the shorter edge of the face is smaller than
the critical length.
"""
type1_transition_spec = default_type1_transition_spec
type1_transition_spec.update(**kwargs)
face = type1_transition_spec["face"]
edges = sheet.edge_df[sheet.edge_df["face"] == face]
if min(edges["length"]) < type1_transition_spec["critical_length"]:
exchange(sheet, face, type1_transition_spec["geom"])
default_face_elimination_spec = {"face_id": -1, "face": -1, "geom": SheetGeometry}
@face_lookup
def face_elimination(sheet, manager, **kwargs):
"""Removes the face with if face_id from the sheet."""
face_elimination_spec = default_face_elimination_spec
face_elimination_spec.update(**kwargs)
remove(sheet, face_elimination_spec["face"], face_elimination_spec["geom"])
default_check_tri_face_spec = {"geom": SheetGeometry}
def check_tri_faces(sheet, manager, **kwargs):
"""Three neighbourghs cell elimination
Add all cells with three neighbourghs in the manager
to be eliminated at the next time step.
Parameters
----------
sheet : a :class:`tyssue.sheet` object
manager : a :class:`tyssue.events.EventManager` object
"""
check_tri_faces_spec = default_check_tri_face_spec
check_tri_faces_spec.update(**kwargs)
tri_faces = sheet.face_df[(sheet.face_df["num_sides"] < 4)].id
manager.extend(
[
(face_elimination, {"face_id": f, "geom": check_tri_faces_spec["geom"]})
for f in tri_faces
]
)
default_contraction_line_tension_spec = {
"face_id": -1,
"face": -1,
"shrink_rate": 1.05,
"contractile_increase": 1.0,
"critical_area": 1e-2,
"max_contractility": 10,
"multiply": True,
"contraction_column": "line_tension",
"unique": True,
}
@face_lookup
def contraction_line_tension(sheet, manager, **kwargs):
"""
Single step contraction event
"""
contraction_spec = default_contraction_line_tension_spec
contraction_spec.update(**kwargs)
face = contraction_spec["face"]
if sheet.face_df.loc[face, "area"] < contraction_spec["critical_area"]:
return
# reduce prefered_area
decrease(
sheet,
"face",
face,
contraction_spec["shrink_rate"],
col="prefered_area",
divide=True,
bound=contraction_spec["critical_area"] / 2,
)
increase_linear_tension(
sheet,
face,
contraction_spec["contractile_increase"],
multiply=contraction_spec["multiply"],
isotropic=True,
limit=100,
)
|
CellModels/tyssue
|
tyssue/behaviors/sheet/basic_events.py
|
Python
|
gpl-2.0
| 6,721 |
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Qt 4.3: mainwindow.cpp Example File (sql/masterdetail/mainwindow.cpp)</title>
<link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 class="title">mainwindow.cpp Example File<br /><span class="small-subtitle">sql/masterdetail/mainwindow.cpp</span>
</h1>
<pre><span class="comment"> /****************************************************************************
**
** Copyright (C) 2006-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the example classes of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at [email protected].
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/</span>
#include "mainwindow.h"
#include "dialog.h"
#include <QtGui>
#include <QtSql>
#include <QtXml>
extern int uniqueAlbumId;
extern int uniqueArtistId;
MainWindow::MainWindow(const QString &artistTable, const QString &albumTable,
QFile *albumDetails, QWidget *parent)
: QMainWindow(parent)
{
file = albumDetails;
readAlbumData();
model = new QSqlRelationalTableModel(this);
model->setTable(albumTable);
model->setRelation(2, QSqlRelation(artistTable, "id", "artist"));
model->select();
QGroupBox *artists = createArtistGroupBox();
QGroupBox *albums = createAlbumGroupBox();
QGroupBox *details = createDetailsGroupBox();
artistView->setCurrentIndex(0);
uniqueAlbumId = model->rowCount();
uniqueArtistId = artistView->count();
connect(model, SIGNAL(rowsInserted(QModelIndex, int, int)),
this, SLOT(updateHeader(QModelIndex, int, int)));
connect(model, SIGNAL(rowsRemoved(QModelIndex, int, int)),
this, SLOT(updateHeader(QModelIndex, int, int)));
QGridLayout *layout = new QGridLayout;
layout->addWidget(artists, 0, 0);
layout->addWidget(albums, 1, 0);
layout->addWidget(details, 0, 1, 2, 1);
layout->setColumnStretch(1, 1);
layout->setColumnMinimumWidth(0, 500);
QWidget *widget = new QWidget;
widget->setLayout(layout);
setCentralWidget(widget);
createMenuBar();
showImageLabel();
resize(850, 400);
setWindowTitle(tr("Music Archive"));
}
void MainWindow::changeArtist(int row)
{
if (row > 0) {
QModelIndex index = model->relationModel(2)->index(row, 1);
model->setFilter("artist = '" + index.data().toString() + "'") ;
showArtistProfile(index);
} else if (row == 0) {
model->setFilter("");
showImageLabel();
} else {
return;
}
}
void MainWindow::showArtistProfile(QModelIndex index)
{
QSqlRecord record = model->relationModel(2)->record(index.row());
QString name = record.value("artist").toString();
QString count = record.value("albumcount").toString();
profileLabel->setText(tr("Artist : %1 \n" \
"Number of Albums: %2").arg(name).arg(count));
profileLabel->show();
iconLabel->show();
titleLabel->hide();
trackList->hide();
imageLabel->hide();
}
void MainWindow::showAlbumDetails(QModelIndex index)
{
QSqlRecord record = model->record(index.row());
QString artist = record.value("artist").toString();
QString title = record.value("title").toString();
QString year = record.value("year").toString();
QString albumId = record.value("albumid").toString();
showArtistProfile(indexOfArtist(artist));
titleLabel->setText(tr("Title: %1 (%2)").arg(title).arg(year));
titleLabel->show();
QDomNodeList albums = albumData.elementsByTagName("album");
for (int i = 0; i < albums.count(); i++) {
QDomNode album = albums.item(i);
if (album.toElement().attribute("id") == albumId) {
getTrackList(album.toElement());
break;
}
}
if (!trackList->count() == 0)
trackList->show();
}
void MainWindow::getTrackList(QDomNode album)
{
trackList->clear();
QDomNodeList tracks = album.childNodes();
QDomNode track;
QString trackNumber;
for (int j = 0; j < tracks.count(); j++) {
track = tracks.item(j);
trackNumber = track.toElement().attribute("number");
QListWidgetItem *item = new QListWidgetItem(trackList);
item->setText(trackNumber + ": " + track.toElement().text());
}
}
void MainWindow::addAlbum()
{
Dialog *dialog = new Dialog(model, albumData, file, this);
int accepted = dialog->exec();
if (accepted == 1) {
int lastRow = model->rowCount() - 1;
albumView->selectRow(lastRow);
albumView->scrollToBottom();
showAlbumDetails(model->index(lastRow, 0));
}
}
void MainWindow::deleteAlbum()
{
QModelIndexList selection = albumView->selectionModel()->selectedRows(0);
if (!selection.empty()) {
QModelIndex idIndex = selection.at(0);
int id = idIndex.data().toInt();
QString title = idIndex.sibling(idIndex.row(), 1).data().toString();
QString artist = idIndex.sibling(idIndex.row(), 2).data().toString();
QMessageBox::StandardButton button;
button = QMessageBox::question(this, tr("Delete Album"),
QString(tr("Are you sure you want to " \
"delete '%1' by '%2'?"))
.arg(title).arg(artist),
QMessageBox::Yes | QMessageBox::No);
if (button == QMessageBox::Yes) {
removeAlbumFromFile(id);
removeAlbumFromDatabase(idIndex);
decreaseAlbumCount(indexOfArtist(artist));
showImageLabel();
}
} else {
QMessageBox::information(this, tr("Delete Album"),
tr("Select the album you want to delete."));
}
}
void MainWindow::removeAlbumFromFile(int id)
{
QDomNodeList albums = albumData.elementsByTagName("album");
for (int i = 0; i < albums.count(); i++) {
QDomNode node = albums.item(i);
if (node.toElement().attribute("id").toInt() == id) {
albumData.elementsByTagName("archive").item(0).removeChild(node);
break;
}
}
<span class="comment"> /*
The following code is commented out since the example uses an in
memory database, i.e., altering the XML file will bring the data
out of sync.
if (!file->open(QIODevice::WriteOnly)) {
return;
} else {
QTextStream stream(file);
albumData.elementsByTagName("archive").item(0).save(stream, 4);
file->close();
}
*/</span>
}
void MainWindow::removeAlbumFromDatabase(QModelIndex index)
{
model->removeRow(index.row());
}
void MainWindow::decreaseAlbumCount(QModelIndex artistIndex)
{
int row = artistIndex.row();
QModelIndex albumCountIndex = artistIndex.sibling(row, 2);
int albumCount = albumCountIndex.data().toInt();
QSqlTableModel *artists = model->relationModel(2);
if (albumCount == 1) {
artists->removeRow(row);
showImageLabel();
} else {
artists->setData(albumCountIndex, QVariant(albumCount - 1));
}
}
void MainWindow::readAlbumData()
{
if (!file->open(QIODevice::ReadOnly))
return;
if (!albumData.setContent(file)) {
file->close();
return;
}
file->close();
}
QGroupBox* MainWindow::createArtistGroupBox()
{
artistView = new QComboBox;
artistView->setModel(model->relationModel(2));
artistView->setModelColumn(1);
connect(artistView, SIGNAL(currentIndexChanged(int)),
this, SLOT(changeArtist(int)));
QGroupBox *box = new QGroupBox(tr("Artist"));
QGridLayout *layout = new QGridLayout;
layout->addWidget(artistView, 0, 0);
box->setLayout(layout);
return box;
}
QGroupBox* MainWindow::createAlbumGroupBox()
{
QGroupBox *box = new QGroupBox(tr("Album"));
albumView = new QTableView;
albumView->setEditTriggers(QAbstractItemView::NoEditTriggers);
albumView->setSortingEnabled(true);
albumView->setSelectionBehavior(QAbstractItemView::SelectRows);
albumView->setSelectionMode(QAbstractItemView::SingleSelection);
albumView->setShowGrid(false);
albumView->verticalHeader()->hide();
albumView->setAlternatingRowColors(true);
albumView->setModel(model);
adjustHeader();
QLocale locale = albumView->locale();
locale.setNumberOptions(QLocale::OmitGroupSeparator);
albumView->setLocale(locale);
connect(albumView, SIGNAL(clicked(QModelIndex)),
this, SLOT(showAlbumDetails(QModelIndex)));
connect(albumView, SIGNAL(activated(QModelIndex)),
this, SLOT(showAlbumDetails(QModelIndex)));
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(albumView, 0, 0);
box->setLayout(layout);
return box;
}
QGroupBox* MainWindow::createDetailsGroupBox()
{
QGroupBox *box = new QGroupBox(tr("Details"));
profileLabel = new QLabel;
profileLabel->setWordWrap(true);
profileLabel->setAlignment(Qt::AlignBottom);
titleLabel = new QLabel;
titleLabel->setWordWrap(true);
titleLabel->setAlignment(Qt::AlignBottom);
iconLabel = new QLabel();
iconLabel->setAlignment(Qt::AlignBottom | Qt::AlignRight);
iconLabel->setPixmap(QPixmap(":/images/icon.png"));
imageLabel = new QLabel;
imageLabel->setWordWrap(true);
imageLabel->setAlignment(Qt::AlignCenter);
imageLabel->setPixmap(QPixmap(":/images/image.png"));
trackList = new QListWidget;
QGridLayout *layout = new QGridLayout;
layout->addWidget(imageLabel, 0, 0, 3, 2);
layout->addWidget(profileLabel, 0, 0);
layout->addWidget(iconLabel, 0, 1);
layout->addWidget(titleLabel, 1, 0, 1, 2);
layout->addWidget(trackList, 2, 0, 1, 2);
layout->setRowStretch(2, 1);
box->setLayout(layout);
return box;
}
void MainWindow::createMenuBar()
{
QAction *addAction = new QAction(tr("&Add album..."), this);
QAction *deleteAction = new QAction(tr("&Delete album..."), this);
QAction *quitAction = new QAction(tr("&Quit"), this);
QAction *aboutAction = new QAction(tr("&About"), this);
QAction *aboutQtAction = new QAction(tr("About &Qt"), this);
addAction->setShortcut(tr("Ctrl+A"));
deleteAction->setShortcut(tr("Ctrl+D"));
quitAction->setShortcut(tr("Ctrl+Q"));
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(addAction);
fileMenu->addAction(deleteAction);
fileMenu->addSeparator();
fileMenu->addAction(quitAction);
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(aboutAction);
helpMenu->addAction(aboutQtAction);
connect(addAction, SIGNAL(triggered(bool)), this, SLOT(addAlbum()));
connect(deleteAction, SIGNAL(triggered(bool)), this, SLOT(deleteAlbum()));
connect(quitAction, SIGNAL(triggered(bool)), this, SLOT(close()));
connect(aboutAction, SIGNAL(triggered(bool)), this, SLOT(about()));
connect(aboutQtAction, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt()));
}
void MainWindow::showImageLabel()
{
profileLabel->hide();
titleLabel->hide();
iconLabel->hide();
trackList->hide();
imageLabel->show();
}
QModelIndex MainWindow::indexOfArtist(const QString &artist)
{
QSqlTableModel *artistModel = model->relationModel(2);
for (int i = 0; i < artistModel->rowCount(); i++) {
QSqlRecord record = artistModel->record(i);
if (record.value("artist") == artist)
return artistModel->index(i, 1);
}
return QModelIndex();
}
void MainWindow::updateHeader(QModelIndex, int, int)
{
adjustHeader();
}
void MainWindow::adjustHeader()
{
albumView->hideColumn(0);
albumView->horizontalHeader()->setResizeMode(1, QHeaderView::Stretch);
albumView->resizeColumnToContents(2);
albumView->resizeColumnToContents(3);
}
void MainWindow::about()
{
QMessageBox::about(this, tr("About Music Archive"),
tr("<p>The <b>Music Archive</b> example shows how to present "
"data from different data sources in the same application. "
"The album titles, and the corresponding artists and release dates, "
"are kept in a database, while each album's tracks are stored "
"in an XML file. </p><p>The example also shows how to add as "
"well as remove data from both the database and the "
"associated XML file using the API provided by the QtSql and "
"QtXml modules, respectively.</p>"));
}</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright © 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.6</div></td>
</tr></table></div></address></body>
</html>
|
muromec/qtopia-ezx
|
qtopiacore/qt/doc/html/sql-masterdetail-mainwindow-cpp.html
|
HTML
|
gpl-2.0
| 17,275 |
/*
* rtl_tcp_andro is a library that uses libusb and librtlsdr to
* turn your Realtek RTL2832 based DVB dongle into a SDR receiver.
* It independently implements the rtl-tcp API protocol for native Android usage.
* Copyright (C) 2016 by Martin Marinov <[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, see <http://www.gnu.org/licenses/>.
*/
#include "queue.h"
#include <string.h>
#include <stdio.h>
typedef struct queue_element queue_element_t;
struct queue_element {
queue_element_t * next;
queue_element_t * prev;
queue_element_t * last;
void * payload;
};
void queue_add(queue_t * queue, void * ptr) {
if (*queue == NULL) {
queue_element_t * new_el = (queue_element_t *) malloc(sizeof(queue_element_t));
new_el->last = new_el;
new_el->next = NULL;
new_el->prev = NULL;
new_el->payload = ptr;
*queue = (void *) new_el;
} else {
queue_element_t * qe = (queue_element_t *) *queue;
queue_element_t * new_el = (queue_element_t *) malloc(sizeof(queue_element_t));
new_el->last = NULL;
new_el->next = NULL;
new_el->prev = qe->last;
new_el->payload = ptr;
qe->last->next = new_el;
qe->last = new_el;
}
}
void * queue_pop(queue_t * queue) {
if (*queue == NULL) return NULL;
queue_element_t * qe = (queue_element_t *) *queue;
if (qe->next != NULL) {
qe->next->prev = NULL;
qe->next->last = qe->last;
}
void * result = qe->payload;
*queue = (void *) qe->next;
free(qe);
return result;
}
/* Usage:
void queue_unit_test(void) {
queue_t queue = NULL;
int a = 1; int b = 3; int c = 5; int d = 18;
queue_add(&queue, (void *) &a);
queue_add(&queue, (void *) &b);
queue_add(&queue, (void *) &c);
queue_add(&queue, (void *) &d);
c = 12;
int * ans;
while ((ans = (int *) queue_pop(&queue)))
printf("%d ", *ans);
// prints out 1 3 12 18
}
*/
|
AnthonyQuan/AndroidRTLPower
|
app/src/main/jni/queue.c
|
C
|
gpl-2.0
| 2,396 |
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
* Copyright 2002-2004 Wilmer van der Gaast and others *
\********************************************************************/
/* Some stuff to fetch, save and handle nicknames for your buddies */
/*
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 with
the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
*/
void nick_set( account_t *acc, const char *handle, const char *nick );
char *nick_get( account_t *acc, const char *handle );
void nick_dedupe( account_t *acc, const char *handle, char nick[MAX_NICK_LENGTH+1] );
int nick_saved( account_t *acc, const char *handle );
void nick_del( account_t *acc, const char *handle );
void nick_strip( char *nick );
int nick_ok( const char *nick );
int nick_lc( char *nick );
int nick_uc( char *nick );
int nick_cmp( const char *a, const char *b );
char *nick_dup( const char *nick );
|
jianingy/bitlbee-clone
|
nick.h
|
C
|
gpl-2.0
| 1,717 |
#include "BitArray.h"
namespace Rapid {
void BitArrayT::append(char const * Bytes, std::size_t Size)
{
mBytes.append(Bytes, Size);
}
std::size_t BitArrayT::size() const
{
return mBytes.size() * 8;
}
bool BitArrayT::operator[](std::size_t Index) const
{
auto ByteIndex = Index / 8;
auto BitIndex = Index % 8;
return static_cast<std::uint8_t>(mBytes[ByteIndex]) >> BitIndex & 0x1;
}
}
|
abma/pr-downloader
|
src/rapid/BitArray.cpp
|
C++
|
gpl-2.0
| 393 |
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
This file is part of Quake III Arena source code.
Quake III Arena source code 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.
Quake III Arena source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
/*****************************************************************************
* name: be_aas_file.c
*
* desc: AAS file loading/writing
*
* $Archive: /MissionPack/code/botlib/be_aas_file.c $
*
*****************************************************************************/
#include "../game/q_shared.h"
#include "l_memory.h"
#include "l_script.h"
#include "l_precomp.h"
#include "l_struct.h"
#include "l_libvar.h"
#include "l_utils.h"
#include "aasfile.h"
#include "../game/botlib.h"
#include "../game/be_aas.h"
#include "be_aas_funcs.h"
#include "be_interface.h"
#include "be_aas_def.h"
//#define AASFILEDEBUG
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_SwapAASData(void)
{
int i, j;
//bounding boxes
for (i = 0; i < aasworld.numbboxes; i++)
{
aasworld.bboxes[i].presencetype = LittleLong(aasworld.bboxes[i].presencetype);
aasworld.bboxes[i].flags = LittleLong(aasworld.bboxes[i].flags);
for (j = 0; j < 3; j++)
{
aasworld.bboxes[i].mins[j] = LittleLong(aasworld.bboxes[i].mins[j]);
aasworld.bboxes[i].maxs[j] = LittleLong(aasworld.bboxes[i].maxs[j]);
} //end for
} //end for
//vertexes
for (i = 0; i < aasworld.numvertexes; i++)
{
for (j = 0; j < 3; j++)
aasworld.vertexes[i][j] = LittleFloat(aasworld.vertexes[i][j]);
} //end for
//planes
for (i = 0; i < aasworld.numplanes; i++)
{
for (j = 0; j < 3; j++)
aasworld.planes[i].normal[j] = LittleFloat(aasworld.planes[i].normal[j]);
aasworld.planes[i].dist = LittleFloat(aasworld.planes[i].dist);
aasworld.planes[i].type = LittleLong(aasworld.planes[i].type);
} //end for
//edges
for (i = 0; i < aasworld.numedges; i++)
{
aasworld.edges[i].v[0] = LittleLong(aasworld.edges[i].v[0]);
aasworld.edges[i].v[1] = LittleLong(aasworld.edges[i].v[1]);
} //end for
//edgeindex
for (i = 0; i < aasworld.edgeindexsize; i++)
{
aasworld.edgeindex[i] = LittleLong(aasworld.edgeindex[i]);
} //end for
//faces
for (i = 0; i < aasworld.numfaces; i++)
{
aasworld.faces[i].planenum = LittleLong(aasworld.faces[i].planenum);
aasworld.faces[i].faceflags = LittleLong(aasworld.faces[i].faceflags);
aasworld.faces[i].numedges = LittleLong(aasworld.faces[i].numedges);
aasworld.faces[i].firstedge = LittleLong(aasworld.faces[i].firstedge);
aasworld.faces[i].frontarea = LittleLong(aasworld.faces[i].frontarea);
aasworld.faces[i].backarea = LittleLong(aasworld.faces[i].backarea);
} //end for
//face index
for (i = 0; i < aasworld.faceindexsize; i++)
{
aasworld.faceindex[i] = LittleLong(aasworld.faceindex[i]);
} //end for
//convex areas
for (i = 0; i < aasworld.numareas; i++)
{
aasworld.areas[i].areanum = LittleLong(aasworld.areas[i].areanum);
aasworld.areas[i].numfaces = LittleLong(aasworld.areas[i].numfaces);
aasworld.areas[i].firstface = LittleLong(aasworld.areas[i].firstface);
for (j = 0; j < 3; j++)
{
aasworld.areas[i].mins[j] = LittleFloat(aasworld.areas[i].mins[j]);
aasworld.areas[i].maxs[j] = LittleFloat(aasworld.areas[i].maxs[j]);
aasworld.areas[i].center[j] = LittleFloat(aasworld.areas[i].center[j]);
} //end for
} //end for
//area settings
for (i = 0; i < aasworld.numareasettings; i++)
{
aasworld.areasettings[i].contents = LittleLong(aasworld.areasettings[i].contents);
aasworld.areasettings[i].areaflags = LittleLong(aasworld.areasettings[i].areaflags);
aasworld.areasettings[i].presencetype = LittleLong(aasworld.areasettings[i].presencetype);
aasworld.areasettings[i].cluster = LittleLong(aasworld.areasettings[i].cluster);
aasworld.areasettings[i].clusterareanum = LittleLong(aasworld.areasettings[i].clusterareanum);
aasworld.areasettings[i].numreachableareas = LittleLong(aasworld.areasettings[i].numreachableareas);
aasworld.areasettings[i].firstreachablearea = LittleLong(aasworld.areasettings[i].firstreachablearea);
} //end for
//area reachability
for (i = 0; i < aasworld.reachabilitysize; i++)
{
aasworld.reachability[i].areanum = LittleLong(aasworld.reachability[i].areanum);
aasworld.reachability[i].facenum = LittleLong(aasworld.reachability[i].facenum);
aasworld.reachability[i].edgenum = LittleLong(aasworld.reachability[i].edgenum);
for (j = 0; j < 3; j++)
{
aasworld.reachability[i].start[j] = LittleFloat(aasworld.reachability[i].start[j]);
aasworld.reachability[i].end[j] = LittleFloat(aasworld.reachability[i].end[j]);
} //end for
aasworld.reachability[i].traveltype = LittleLong(aasworld.reachability[i].traveltype);
aasworld.reachability[i].traveltime = LittleShort(aasworld.reachability[i].traveltime);
} //end for
//nodes
for (i = 0; i < aasworld.numnodes; i++)
{
aasworld.nodes[i].planenum = LittleLong(aasworld.nodes[i].planenum);
aasworld.nodes[i].children[0] = LittleLong(aasworld.nodes[i].children[0]);
aasworld.nodes[i].children[1] = LittleLong(aasworld.nodes[i].children[1]);
} //end for
//cluster portals
for (i = 0; i < aasworld.numportals; i++)
{
aasworld.portals[i].areanum = LittleLong(aasworld.portals[i].areanum);
aasworld.portals[i].frontcluster = LittleLong(aasworld.portals[i].frontcluster);
aasworld.portals[i].backcluster = LittleLong(aasworld.portals[i].backcluster);
aasworld.portals[i].clusterareanum[0] = LittleLong(aasworld.portals[i].clusterareanum[0]);
aasworld.portals[i].clusterareanum[1] = LittleLong(aasworld.portals[i].clusterareanum[1]);
} //end for
//cluster portal index
for (i = 0; i < aasworld.portalindexsize; i++)
{
aasworld.portalindex[i] = LittleLong(aasworld.portalindex[i]);
} //end for
//cluster
for (i = 0; i < aasworld.numclusters; i++)
{
aasworld.clusters[i].numareas = LittleLong(aasworld.clusters[i].numareas);
aasworld.clusters[i].numreachabilityareas = LittleLong(aasworld.clusters[i].numreachabilityareas);
aasworld.clusters[i].numportals = LittleLong(aasworld.clusters[i].numportals);
aasworld.clusters[i].firstportal = LittleLong(aasworld.clusters[i].firstportal);
} //end for
} //end of the function AAS_SwapAASData
//===========================================================================
// dump the current loaded aas file
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_DumpAASData(void)
{
aasworld.numbboxes = 0;
if (aasworld.bboxes) FreeMemory(aasworld.bboxes);
aasworld.bboxes = NULL;
aasworld.numvertexes = 0;
if (aasworld.vertexes) FreeMemory(aasworld.vertexes);
aasworld.vertexes = NULL;
aasworld.numplanes = 0;
if (aasworld.planes) FreeMemory(aasworld.planes);
aasworld.planes = NULL;
aasworld.numedges = 0;
if (aasworld.edges) FreeMemory(aasworld.edges);
aasworld.edges = NULL;
aasworld.edgeindexsize = 0;
if (aasworld.edgeindex) FreeMemory(aasworld.edgeindex);
aasworld.edgeindex = NULL;
aasworld.numfaces = 0;
if (aasworld.faces) FreeMemory(aasworld.faces);
aasworld.faces = NULL;
aasworld.faceindexsize = 0;
if (aasworld.faceindex) FreeMemory(aasworld.faceindex);
aasworld.faceindex = NULL;
aasworld.numareas = 0;
if (aasworld.areas) FreeMemory(aasworld.areas);
aasworld.areas = NULL;
aasworld.numareasettings = 0;
if (aasworld.areasettings) FreeMemory(aasworld.areasettings);
aasworld.areasettings = NULL;
aasworld.reachabilitysize = 0;
if (aasworld.reachability) FreeMemory(aasworld.reachability);
aasworld.reachability = NULL;
aasworld.numnodes = 0;
if (aasworld.nodes) FreeMemory(aasworld.nodes);
aasworld.nodes = NULL;
aasworld.numportals = 0;
if (aasworld.portals) FreeMemory(aasworld.portals);
aasworld.portals = NULL;
aasworld.numportals = 0;
if (aasworld.portalindex) FreeMemory(aasworld.portalindex);
aasworld.portalindex = NULL;
aasworld.portalindexsize = 0;
if (aasworld.clusters) FreeMemory(aasworld.clusters);
aasworld.clusters = NULL;
aasworld.numclusters = 0;
//
aasworld.loaded = qfalse;
aasworld.initialized = qfalse;
aasworld.savefile = qfalse;
} //end of the function AAS_DumpAASData
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
#ifdef AASFILEDEBUG
void AAS_FileInfo(void)
{
int i, n, optimized;
botimport.Print(PRT_MESSAGE, "version = %d\n", AASVERSION);
botimport.Print(PRT_MESSAGE, "numvertexes = %d\n", aasworld.numvertexes);
botimport.Print(PRT_MESSAGE, "numplanes = %d\n", aasworld.numplanes);
botimport.Print(PRT_MESSAGE, "numedges = %d\n", aasworld.numedges);
botimport.Print(PRT_MESSAGE, "edgeindexsize = %d\n", aasworld.edgeindexsize);
botimport.Print(PRT_MESSAGE, "numfaces = %d\n", aasworld.numfaces);
botimport.Print(PRT_MESSAGE, "faceindexsize = %d\n", aasworld.faceindexsize);
botimport.Print(PRT_MESSAGE, "numareas = %d\n", aasworld.numareas);
botimport.Print(PRT_MESSAGE, "numareasettings = %d\n", aasworld.numareasettings);
botimport.Print(PRT_MESSAGE, "reachabilitysize = %d\n", aasworld.reachabilitysize);
botimport.Print(PRT_MESSAGE, "numnodes = %d\n", aasworld.numnodes);
botimport.Print(PRT_MESSAGE, "numportals = %d\n", aasworld.numportals);
botimport.Print(PRT_MESSAGE, "portalindexsize = %d\n", aasworld.portalindexsize);
botimport.Print(PRT_MESSAGE, "numclusters = %d\n", aasworld.numclusters);
//
for (n = 0, i = 0; i < aasworld.numareasettings; i++)
{
if (aasworld.areasettings[i].areaflags & AREA_GROUNDED) n++;
} //end for
botimport.Print(PRT_MESSAGE, "num grounded areas = %d\n", n);
//
botimport.Print(PRT_MESSAGE, "planes size %d bytes\n", aasworld.numplanes * sizeof(aas_plane_t));
botimport.Print(PRT_MESSAGE, "areas size %d bytes\n", aasworld.numareas * sizeof(aas_area_t));
botimport.Print(PRT_MESSAGE, "areasettings size %d bytes\n", aasworld.numareasettings * sizeof(aas_areasettings_t));
botimport.Print(PRT_MESSAGE, "nodes size %d bytes\n", aasworld.numnodes * sizeof(aas_node_t));
botimport.Print(PRT_MESSAGE, "reachability size %d bytes\n", aasworld.reachabilitysize * sizeof(aas_reachability_t));
botimport.Print(PRT_MESSAGE, "portals size %d bytes\n", aasworld.numportals * sizeof(aas_portal_t));
botimport.Print(PRT_MESSAGE, "clusters size %d bytes\n", aasworld.numclusters * sizeof(aas_cluster_t));
optimized = aasworld.numplanes * sizeof(aas_plane_t) +
aasworld.numareas * sizeof(aas_area_t) +
aasworld.numareasettings * sizeof(aas_areasettings_t) +
aasworld.numnodes * sizeof(aas_node_t) +
aasworld.reachabilitysize * sizeof(aas_reachability_t) +
aasworld.numportals * sizeof(aas_portal_t) +
aasworld.numclusters * sizeof(aas_cluster_t);
botimport.Print(PRT_MESSAGE, "optimzed size %d KB\n", optimized >> 10);
} //end of the function AAS_FileInfo
#endif //AASFILEDEBUG
//===========================================================================
// allocate memory and read a lump of a AAS file
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
char *AAS_LoadAASLump(fileHandle_t fp, int offset, int length, int *lastoffset, int size)
{
char *buf;
//
if (!length)
{
//just alloc a dummy
return (char *) GetClearedHunkMemory(size+1);
} //end if
//seek to the data
if (offset != *lastoffset)
{
botimport.Print(PRT_WARNING, "AAS file not sequentially read\n");
if (botimport.FS_Seek(fp, offset, FS_SEEK_SET))
{
AAS_Error("can't seek to aas lump\n");
AAS_DumpAASData();
botimport.FS_FCloseFile(fp);
return NULL;
} //end if
} //end if
//allocate memory
buf = (char *) GetClearedHunkMemory(length+1);
//read the data
if (length)
{
botimport.FS_Read(buf, length, fp );
*lastoffset += length;
} //end if
return buf;
} //end of the function AAS_LoadAASLump
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_DData(unsigned char *data, int size)
{
int i;
for (i = 0; i < size; i++)
{
data[i] ^= (unsigned char) i * 119;
} //end for
} //end of the function AAS_DData
//===========================================================================
// load an aas file
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
int AAS_LoadAASFile(char *filename)
{
fileHandle_t fp;
aas_header_t header;
int offset, length, lastoffset;
botimport.Print(PRT_MESSAGE, "trying to load %s\n", filename);
//dump current loaded aas file
AAS_DumpAASData();
//open the file
botimport.FS_FOpenFile( filename, &fp, FS_READ );
if (!fp)
{
AAS_Error("can't open %s\n", filename);
return BLERR_CANNOTOPENAASFILE;
} //end if
//read the header
botimport.FS_Read(&header, sizeof(aas_header_t), fp );
lastoffset = sizeof(aas_header_t);
//check header identification
header.ident = LittleLong(header.ident);
if (header.ident != AASID)
{
AAS_Error("%s is not an AAS file\n", filename);
botimport.FS_FCloseFile(fp);
return BLERR_WRONGAASFILEID;
} //end if
//check the version
header.version = LittleLong(header.version);
//
if (header.version != AASVERSION_OLD && header.version != AASVERSION)
{
AAS_Error("aas file %s is version %i, not %i\n", filename, header.version, AASVERSION);
botimport.FS_FCloseFile(fp);
return BLERR_WRONGAASFILEVERSION;
} //end if
//
if (header.version == AASVERSION)
{
AAS_DData((unsigned char *) &header + 8, sizeof(aas_header_t) - 8);
} //end if
//
aasworld.bspchecksum = atoi(LibVarGetString( "sv_mapChecksum"));
if (LittleLong(header.bspchecksum) != aasworld.bspchecksum)
{
AAS_Error("aas file %s is out of date\n", filename);
botimport.FS_FCloseFile(fp);
return BLERR_WRONGAASFILEVERSION;
} //end if
//load the lumps:
//bounding boxes
offset = LittleLong(header.lumps[AASLUMP_BBOXES].fileofs);
length = LittleLong(header.lumps[AASLUMP_BBOXES].filelen);
aasworld.bboxes = (aas_bbox_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_bbox_t));
aasworld.numbboxes = length / sizeof(aas_bbox_t);
if (aasworld.numbboxes && !aasworld.bboxes) return BLERR_CANNOTREADAASLUMP;
//vertexes
offset = LittleLong(header.lumps[AASLUMP_VERTEXES].fileofs);
length = LittleLong(header.lumps[AASLUMP_VERTEXES].filelen);
aasworld.vertexes = (aas_vertex_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_vertex_t));
aasworld.numvertexes = length / sizeof(aas_vertex_t);
if (aasworld.numvertexes && !aasworld.vertexes) return BLERR_CANNOTREADAASLUMP;
//planes
offset = LittleLong(header.lumps[AASLUMP_PLANES].fileofs);
length = LittleLong(header.lumps[AASLUMP_PLANES].filelen);
aasworld.planes = (aas_plane_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_plane_t));
aasworld.numplanes = length / sizeof(aas_plane_t);
if (aasworld.numplanes && !aasworld.planes) return BLERR_CANNOTREADAASLUMP;
//edges
offset = LittleLong(header.lumps[AASLUMP_EDGES].fileofs);
length = LittleLong(header.lumps[AASLUMP_EDGES].filelen);
aasworld.edges = (aas_edge_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_edge_t));
aasworld.numedges = length / sizeof(aas_edge_t);
if (aasworld.numedges && !aasworld.edges) return BLERR_CANNOTREADAASLUMP;
//edgeindex
offset = LittleLong(header.lumps[AASLUMP_EDGEINDEX].fileofs);
length = LittleLong(header.lumps[AASLUMP_EDGEINDEX].filelen);
aasworld.edgeindex = (aas_edgeindex_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_edgeindex_t));
aasworld.edgeindexsize = length / sizeof(aas_edgeindex_t);
if (aasworld.edgeindexsize && !aasworld.edgeindex) return BLERR_CANNOTREADAASLUMP;
//faces
offset = LittleLong(header.lumps[AASLUMP_FACES].fileofs);
length = LittleLong(header.lumps[AASLUMP_FACES].filelen);
aasworld.faces = (aas_face_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_face_t));
aasworld.numfaces = length / sizeof(aas_face_t);
if (aasworld.numfaces && !aasworld.faces) return BLERR_CANNOTREADAASLUMP;
//faceindex
offset = LittleLong(header.lumps[AASLUMP_FACEINDEX].fileofs);
length = LittleLong(header.lumps[AASLUMP_FACEINDEX].filelen);
aasworld.faceindex = (aas_faceindex_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_faceindex_t));
aasworld.faceindexsize = length / sizeof(aas_faceindex_t);
if (aasworld.faceindexsize && !aasworld.faceindex) return BLERR_CANNOTREADAASLUMP;
//convex areas
offset = LittleLong(header.lumps[AASLUMP_AREAS].fileofs);
length = LittleLong(header.lumps[AASLUMP_AREAS].filelen);
aasworld.areas = (aas_area_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_area_t));
aasworld.numareas = length / sizeof(aas_area_t);
if (aasworld.numareas && !aasworld.areas) return BLERR_CANNOTREADAASLUMP;
//area settings
offset = LittleLong(header.lumps[AASLUMP_AREASETTINGS].fileofs);
length = LittleLong(header.lumps[AASLUMP_AREASETTINGS].filelen);
aasworld.areasettings = (aas_areasettings_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_areasettings_t));
aasworld.numareasettings = length / sizeof(aas_areasettings_t);
if (aasworld.numareasettings && !aasworld.areasettings) return BLERR_CANNOTREADAASLUMP;
//reachability list
offset = LittleLong(header.lumps[AASLUMP_REACHABILITY].fileofs);
length = LittleLong(header.lumps[AASLUMP_REACHABILITY].filelen);
aasworld.reachability = (aas_reachability_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_reachability_t));
aasworld.reachabilitysize = length / sizeof(aas_reachability_t);
if (aasworld.reachabilitysize && !aasworld.reachability) return BLERR_CANNOTREADAASLUMP;
//nodes
offset = LittleLong(header.lumps[AASLUMP_NODES].fileofs);
length = LittleLong(header.lumps[AASLUMP_NODES].filelen);
aasworld.nodes = (aas_node_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_node_t));
aasworld.numnodes = length / sizeof(aas_node_t);
if (aasworld.numnodes && !aasworld.nodes) return BLERR_CANNOTREADAASLUMP;
//cluster portals
offset = LittleLong(header.lumps[AASLUMP_PORTALS].fileofs);
length = LittleLong(header.lumps[AASLUMP_PORTALS].filelen);
aasworld.portals = (aas_portal_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_portal_t));
aasworld.numportals = length / sizeof(aas_portal_t);
if (aasworld.numportals && !aasworld.portals) return BLERR_CANNOTREADAASLUMP;
//cluster portal index
offset = LittleLong(header.lumps[AASLUMP_PORTALINDEX].fileofs);
length = LittleLong(header.lumps[AASLUMP_PORTALINDEX].filelen);
aasworld.portalindex = (aas_portalindex_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_portalindex_t));
aasworld.portalindexsize = length / sizeof(aas_portalindex_t);
if (aasworld.portalindexsize && !aasworld.portalindex) return BLERR_CANNOTREADAASLUMP;
//clusters
offset = LittleLong(header.lumps[AASLUMP_CLUSTERS].fileofs);
length = LittleLong(header.lumps[AASLUMP_CLUSTERS].filelen);
aasworld.clusters = (aas_cluster_t *) AAS_LoadAASLump(fp, offset, length, &lastoffset, sizeof(aas_cluster_t));
aasworld.numclusters = length / sizeof(aas_cluster_t);
if (aasworld.numclusters && !aasworld.clusters) return BLERR_CANNOTREADAASLUMP;
//swap everything
AAS_SwapAASData();
//aas file is loaded
aasworld.loaded = qtrue;
//close the file
botimport.FS_FCloseFile(fp);
//
#ifdef AASFILEDEBUG
AAS_FileInfo();
#endif //AASFILEDEBUG
//
return BLERR_NOERROR;
} //end of the function AAS_LoadAASFile
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
static int AAS_WriteAASLump_offset;
int AAS_WriteAASLump(fileHandle_t fp, aas_header_t *h, int lumpnum, void *data, int length)
{
aas_lump_t *lump;
lump = &h->lumps[lumpnum];
lump->fileofs = LittleLong(AAS_WriteAASLump_offset); //LittleLong(ftell(fp));
lump->filelen = LittleLong(length);
if (length > 0)
{
botimport.FS_Write(data, length, fp );
} //end if
AAS_WriteAASLump_offset += length;
return qtrue;
} //end of the function AAS_WriteAASLump
//===========================================================================
// aas data is useless after writing to file because it is byte swapped
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
qboolean AAS_WriteAASFile(char *filename)
{
aas_header_t header;
fileHandle_t fp;
botimport.Print(PRT_MESSAGE, "writing %s\n", filename);
//swap the aas data
AAS_SwapAASData();
//initialize the file header
Com_Memset(&header, 0, sizeof(aas_header_t));
header.ident = LittleLong(AASID);
header.version = LittleLong(AASVERSION);
header.bspchecksum = LittleLong(aasworld.bspchecksum);
//open a new file
botimport.FS_FOpenFile( filename, &fp, FS_WRITE );
if (!fp)
{
botimport.Print(PRT_ERROR, "error opening %s\n", filename);
return qfalse;
} //end if
//write the header
botimport.FS_Write(&header, sizeof(aas_header_t), fp);
AAS_WriteAASLump_offset = sizeof(aas_header_t);
//add the data lumps to the file
if (!AAS_WriteAASLump(fp, &header, AASLUMP_BBOXES, aasworld.bboxes,
aasworld.numbboxes * sizeof(aas_bbox_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_VERTEXES, aasworld.vertexes,
aasworld.numvertexes * sizeof(aas_vertex_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_PLANES, aasworld.planes,
aasworld.numplanes * sizeof(aas_plane_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_EDGES, aasworld.edges,
aasworld.numedges * sizeof(aas_edge_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_EDGEINDEX, aasworld.edgeindex,
aasworld.edgeindexsize * sizeof(aas_edgeindex_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_FACES, aasworld.faces,
aasworld.numfaces * sizeof(aas_face_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_FACEINDEX, aasworld.faceindex,
aasworld.faceindexsize * sizeof(aas_faceindex_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_AREAS, aasworld.areas,
aasworld.numareas * sizeof(aas_area_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_AREASETTINGS, aasworld.areasettings,
aasworld.numareasettings * sizeof(aas_areasettings_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_REACHABILITY, aasworld.reachability,
aasworld.reachabilitysize * sizeof(aas_reachability_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_NODES, aasworld.nodes,
aasworld.numnodes * sizeof(aas_node_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_PORTALS, aasworld.portals,
aasworld.numportals * sizeof(aas_portal_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_PORTALINDEX, aasworld.portalindex,
aasworld.portalindexsize * sizeof(aas_portalindex_t))) return qfalse;
if (!AAS_WriteAASLump(fp, &header, AASLUMP_CLUSTERS, aasworld.clusters,
aasworld.numclusters * sizeof(aas_cluster_t))) return qfalse;
//rewrite the header with the added lumps
botimport.FS_Seek(fp, 0, FS_SEEK_SET);
AAS_DData((unsigned char *) &header + 8, sizeof(aas_header_t) - 8);
botimport.FS_Write(&header, sizeof(aas_header_t), fp);
//close the file
botimport.FS_FCloseFile(fp);
return qtrue;
} //end of the function AAS_WriteAASFile
|
entdark/q3mme
|
trunk/code/botlib/be_aas_file.c
|
C
|
gpl-2.0
| 24,509 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>skip (EstraierPure::Condition)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
<pre><span class="ruby-comment cmt"># File estraierpure.rb, line 370</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skip</span>()
<span class="ruby-ivar">@skip</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
|
oracc/oracc
|
oracc-hyperestraier/doc/rubypureapi/classes/EstraierPure/Condition.src/M000028.html
|
HTML
|
gpl-2.0
| 713 |
Дополнительно для удобства добавлены некоторые настройки компонента
| Параметр | По умолчанию | Описание |
| -------------------------------------- | ----------------------- | ---------------------------------- |
| **msgallerysearch_available_buttons** | download,google,gallery | Кнопки на панели |
| **msgallerysearch_copy_meta** | Да | Копировать мета данные изображений |
| **msgallerysearch_custom_search** | Пусто | Ссылка на свой поиск |
| **msgallerysearch_disable_auto_query** | Да | Отключить загрузку результатов |
| **msgallerysearch_disable_minishop2** | Нет | Отключить для miniShop2 |
| **msgallerysearch_disable_ms2gallery** | Нет | Отключить для ms2Gallery |
Название кнопок для регистрации
* download - ссылка на скачивание
* google - найти в google
* gallery - найти в изображениях
|
Alroniks/Docs
|
ru/01_Компоненты/59_msGallerySearch/04_Системные_настройки.md
|
Markdown
|
gpl-2.0
| 1,332 |
/*
Copyright (C) 2012 - 2015 Evan Teran
[email protected]
Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ELF_VERDAUX_20121007_H_
#define ELF_VERDAUX_20121007_H_
#include "elf/elf_types.h"
/* Auxialiary version information. */
struct elf32_verdaux {
elf32_word vda_name; /* Version or dependency names */
elf32_word vda_next; /* Offset in bytes to next verdaux entry */
};
struct elf64_verdaux {
elf64_word vda_name; /* Version or dependency names */
elf64_word vda_next; /* Offset in bytes to next verdaux entry */
};
#endif
|
Northern-Lights/edb-debugger
|
plugins/BinaryInfo/elf/elf_verdaux.h
|
C
|
gpl-2.0
| 1,257 |
/*
* linux/drivers/usb/gadget/s3c2410_udc.h
* Samsung on-chip full speed USB device controllers
*
* Copyright (C) 2004-2007 Herbert Pötzl - Arnaud Patard
* Additional cleanups by Ben Dooks <[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
*
*/
#ifndef _S3C2410_UDC_H
#define _S3C2410_UDC_H
struct s3c2410_ep {
struct list_head queue;
unsigned long last_io; /* jiffies timestamp */
struct usb_gadget *gadget;
struct s3c2410_udc *dev;
const struct usb_endpoint_descriptor *desc;
struct usb_ep ep;
u8 num;
unsigned short fifo_size;
u8 bEndpointAddress;
u8 bmAttributes;
unsigned halted : 1;
unsigned already_seen : 1;
unsigned setup_stage : 1;
};
/* Warning : ep0 has a fifo of 16 bytes */
/* Don't try to set 32 or 64 */
/* also testusb 14 fails wit 16 but is */
/* fine with 8 */
#define EP0_FIFO_SIZE 8
#define EP_FIFO_SIZE 64
#define DEFAULT_POWER_STATE 0x00
#define S3C2440_EP_FIFO_SIZE 128
static const char ep0name [] = "ep0";
static const char *const ep_name[] = {
ep0name, /* everyone has ep0 */
/* s3c2410 four bidirectional bulk endpoints */
"ep1-bulk", "ep2-bulk", "ep3-bulk", "ep4-bulk",
};
#define S3C2410_ENDPOINTS ARRAY_SIZE(ep_name)
struct s3c2410_request {
struct list_head queue; /* ep's requests */
struct usb_request req;
};
enum ep0_state {
EP0_IDLE,
EP0_IN_DATA_PHASE,
EP0_OUT_DATA_PHASE,
EP0_END_XFER,
EP0_STALL,
};
static const char *ep0states[]= {
"EP0_IDLE",
"EP0_IN_DATA_PHASE",
"EP0_OUT_DATA_PHASE",
"EP0_END_XFER",
"EP0_STALL",
};
struct s3c2410_udc {
spinlock_t lock;
struct s3c2410_ep ep[S3C2410_ENDPOINTS];
int address;
struct usb_gadget gadget;
struct usb_gadget_driver *driver;
struct s3c2410_request fifo_req;
u8 fifo_buf[EP_FIFO_SIZE];
u16 devstatus;
u32 port_status;
int ep0state;
unsigned got_irq : 1;
unsigned req_std : 1;
unsigned req_config : 1;
unsigned req_pending : 1;
u8 vbus;
struct dentry *regs_info;
};
#endif
|
janrinze/loox7xxport.loox2-6-22
|
drivers/usb/gadget/s3c2410_udc.h
|
C
|
gpl-2.0
| 2,841 |
package org.compiere.dbPort;
import java.util.Collections;
import java.util.List;
/**
* Native PostgreSQL (pass-through) implementation of {@link Convert}
*
* @author tsa
*
*/
public final class Convert_PostgreSQL_Native extends Convert
{
@Override
protected final List<String> convertStatement(final String sqlStatement)
{
return Collections.singletonList(sqlStatement);
}
}
|
klst-com/metasfresh
|
de.metas.adempiere.adempiere/base/src/main/java-legacy/org/compiere/dbPort/Convert_PostgreSQL_Native.java
|
Java
|
gpl-2.0
| 393 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="es">
<head>
<!-- Generated by javadoc (1.8.0_25) on Wed Feb 25 01:10:23 CET 2015 -->
<title>Constant Field Values</title>
<meta name="date" content="2015-02-25">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#com.darkorbit">com.darkorbit.*</a></li>
</ul>
</div>
<div class="constantValuesContainer"><a name="com.darkorbit">
<!-- -->
</a>
<h2 title="com.darkorbit">com.darkorbit.*</h2>
<ul class="blockList">
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.darkorbit.packets.<a href="com/darkorbit/packets/Packet.html" title="class in com.darkorbit.packets">Packet</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.darkorbit.packets.Packet.LOGIN">
<!-- -->
</a><code>public static final java.lang.String</code></td>
<td><code><a href="com/darkorbit/packets/Packet.html#LOGIN">LOGIN</a></code></td>
<td class="colLast"><code>"LOGIN"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="com.darkorbit.packets.Packet.POLICY">
<!-- -->
</a><code>public static final java.lang.String</code></td>
<td><code><a href="com/darkorbit/packets/Packet.html#POLICY">POLICY</a></code></td>
<td class="colLast"><code>"<policy-file-request/>"</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
krypticdestro/DarkOrbitProject
|
doc/constant-values.html
|
HTML
|
gpl-2.0
| 4,992 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Api.Reports
{
public class ReportRow
{
/// <summary>
/// Initializes a new instance of the ReportRow class.
/// </summary>
public ReportRow()
{
Columns = new List<ReportItem>();
}
/// <summary> Gets or sets the identifier. </summary>
/// <value> The identifier. </value>
public string Id { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this object has backdrop image. </summary>
/// <value> true if this object has backdrop image, false if not. </value>
public bool HasImageTagsBackdrop { get; set; }
/// <summary> Gets or sets a value indicating whether this object has image tags. </summary>
/// <value> true if this object has image tags, false if not. </value>
public bool HasImageTagsPrimary { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this object has image tags logo. </summary>
/// <value> true if this object has image tags logo, false if not. </value>
public bool HasImageTagsLogo { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this object has local trailer. </summary>
/// <value> true if this object has local trailer, false if not. </value>
public bool HasLocalTrailer { get; set; }
/// <summary> Gets or sets a value indicating whether this object has lock data. </summary>
/// <value> true if this object has lock data, false if not. </value>
public bool HasLockData { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this object has embedded image. </summary>
/// <value> true if this object has embedded image, false if not. </value>
public bool HasEmbeddedImage { get; set; }
/// <summary> Gets or sets a value indicating whether this object has subtitles. </summary>
/// <value> true if this object has subtitles, false if not. </value>
public bool HasSubtitles { get; set; }
/// <summary> Gets or sets a value indicating whether this object has specials. </summary>
/// <value> true if this object has specials, false if not. </value>
public bool HasSpecials { get; set; }
/// <summary> Gets or sets a value indicating whether this object is unidentified. </summary>
/// <value> true if this object is unidentified, false if not. </value>
public bool IsUnidentified { get; set; }
/// <summary> Gets or sets the columns. </summary>
/// <value> The columns. </value>
public List<ReportItem> Columns { get; set; }
/// <summary> Gets or sets the type. </summary>
/// <value> The type. </value>
public ReportIncludeItemTypes RowType { get; set; }
/// <summary> Gets or sets the identifier of the user. </summary>
/// <value> The identifier of the user. </value>
public string UserId { get; set; }
}
}
|
mtlott/Emby
|
MediaBrowser.Api/Reports/Model/ReportRow.cs
|
C#
|
gpl-2.0
| 2,891 |
/*
* Copyright (C) 2000 Ulrich Czekalla
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _WINE_WININET_H_
#define _WINE_WININET_H_
#ifdef __cplusplus
extern "C" {
#endif
#define INTERNETAPI
#define BOOLAPI INTERNETAPI BOOL WINAPI
typedef LPVOID HINTERNET;
typedef HINTERNET * LPHINTERNET;
typedef WORD INTERNET_PORT;
typedef INTERNET_PORT * LPINTERNET_PORT;
#define INTERNET_INVALID_PORT_NUMBER 0
#define INTERNET_DEFAULT_FTP_PORT 21
#define INTERNET_DEFAULT_GOPHER_PORT 70
#define INTERNET_DEFAULT_HTTP_PORT 80
#define INTERNET_DEFAULT_HTTPS_PORT 443
#define INTERNET_DEFAULT_SOCKS_PORT 1080
#define INTERNET_MAX_HOST_NAME_LENGTH 256
#define INTERNET_MAX_USER_NAME_LENGTH 128
#define INTERNET_MAX_PASSWORD_LENGTH 128
#define INTERNET_MAX_PORT_NUMBER_LENGTH 5
#define INTERNET_MAX_PORT_NUMBER_VALUE 65535
#define INTERNET_MAX_PATH_LENGTH 2048
#define INTERNET_MAX_SCHEME_LENGTH 32
#define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH + sizeof("://")+ INTERNET_MAX_PATH_LENGTH)
#define INTERNET_KEEP_ALIVE_UNKNOWN ((DWORD)-1)
#define INTERNET_KEEP_ALIVE_ENABLED 1
#define INTERNET_KEEP_ALIVE_DISABLED 0
#define INTERNET_REQFLAG_FROM_CACHE 0x00000001
#define INTERNET_REQFLAG_ASYNC 0x00000002
#define INTERNET_REQFLAG_VIA_PROXY 0x00000004
#define INTERNET_REQFLAG_NO_HEADERS 0x00000008
#define INTERNET_REQFLAG_PASSIVE 0x00000010
#define INTERNET_REQFLAG_CACHE_WRITE_DISABLED 0x00000040
#define INTERNET_FLAG_RELOAD 0x80000000
#define INTERNET_FLAG_RAW_DATA 0x40000000
#define INTERNET_FLAG_EXISTING_CONNECT 0x20000000
#define INTERNET_FLAG_ASYNC 0x10000000
#define INTERNET_FLAG_PASSIVE 0x08000000
#define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000
#define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE
#define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000
#define INTERNET_FLAG_FROM_CACHE 0x01000000
#define INTERNET_FLAG_OFFLINE INTERNET_FLAG_FROM_CACHE
#define INTERNET_FLAG_SECURE 0x00800000
#define INTERNET_FLAG_KEEP_CONNECTION 0x00400000
#define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000
#define INTERNET_FLAG_READ_PREFETCH 0x00100000
#define INTERNET_FLAG_NO_COOKIES 0x00080000
#define INTERNET_FLAG_NO_AUTH 0x00040000
#define INTERNET_FLAG_CACHE_IF_NET_FAIL 0x00010000
#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000
#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000
#define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000
#define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000
#define INTERNET_FLAG_RESYNCHRONIZE 0x00000800
#define INTERNET_FLAG_HYPERLINK 0x00000400
#define INTERNET_FLAG_NO_UI 0x00000200
#define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100
#define INTERNET_FLAG_CACHE_ASYNC 0x00000080
#define INTERNET_FLAG_FORMS_SUBMIT 0x00000040
#define INTERNET_FLAG_NEED_FILE 0x00000010
#define INTERNET_FLAG_MUST_CACHE_REQUEST INTERNET_FLAG_NEED_FILE
#define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII
#define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY
#define SECURITY_INTERNET_MASK (INTERNET_FLAG_IGNORE_CERT_CN_INVALID|\
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|\
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS|\
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP)
#define INTERNET_FLAGS_MASK (INTERNET_FLAG_RELOAD \
| INTERNET_FLAG_RAW_DATA \
| INTERNET_FLAG_EXISTING_CONNECT \
| INTERNET_FLAG_ASYNC \
| INTERNET_FLAG_PASSIVE \
| INTERNET_FLAG_NO_CACHE_WRITE \
| INTERNET_FLAG_MAKE_PERSISTENT \
| INTERNET_FLAG_FROM_CACHE \
| INTERNET_FLAG_SECURE \
| INTERNET_FLAG_KEEP_CONNECTION \
| INTERNET_FLAG_NO_AUTO_REDIRECT \
| INTERNET_FLAG_READ_PREFETCH \
| INTERNET_FLAG_NO_COOKIES \
| INTERNET_FLAG_NO_AUTH \
| INTERNET_FLAG_CACHE_IF_NET_FAIL \
| SECURITY_INTERNET_MASK \
| INTERNET_FLAG_RESYNCHRONIZE \
| INTERNET_FLAG_HYPERLINK \
| INTERNET_FLAG_NO_UI \
| INTERNET_FLAG_PRAGMA_NOCACHE \
| INTERNET_FLAG_CACHE_ASYNC \
| INTERNET_FLAG_FORMS_SUBMIT \
| INTERNET_FLAG_NEED_FILE \
| INTERNET_FLAG_TRANSFER_BINARY \
| INTERNET_FLAG_TRANSFER_ASCII \
)
#define INTERNET_ERROR_MASK_INSERT_CDROM 0x1
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT 0x2
#define INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG 0x4
#define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY 0x8
#define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK)
#define WININET_API_FLAG_ASYNC 0x00000001
#define WININET_API_FLAG_SYNC 0x00000004
#define WININET_API_FLAG_USE_CONTEXT 0x00000008
#define INTERNET_NO_CALLBACK 0
typedef enum {
INTERNET_SCHEME_PARTIAL = -2,
INTERNET_SCHEME_UNKNOWN = -1,
INTERNET_SCHEME_DEFAULT = 0,
INTERNET_SCHEME_FTP,
INTERNET_SCHEME_GOPHER,
INTERNET_SCHEME_HTTP,
INTERNET_SCHEME_HTTPS,
INTERNET_SCHEME_FILE,
INTERNET_SCHEME_NEWS,
INTERNET_SCHEME_MAILTO,
INTERNET_SCHEME_SOCKS,
INTERNET_SCHEME_JAVASCRIPT,
INTERNET_SCHEME_VBSCRIPT,
INTERNET_SCHEME_RES,
INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP,
INTERNET_SCHEME_LAST = INTERNET_SCHEME_RES
} INTERNET_SCHEME,* LPINTERNET_SCHEME;
typedef struct {
DWORD_PTR dwResult;
DWORD dwError;
} INTERNET_ASYNC_RESULT,* LPINTERNET_ASYNC_RESULT;
typedef struct {
DWORD dwAccessType;
LPCSTR lpszProxy;
LPCSTR lpszProxyBypass;
} INTERNET_PROXY_INFOA,* LPINTERNET_PROXY_INFOA;
typedef struct {
DWORD dwAccessType;
LPCWSTR lpszProxy;
LPCWSTR lpszProxyBypass;
} INTERNET_PROXY_INFOW,* LPINTERNET_PROXY_INFOW;
DECL_WINELIB_TYPE_AW(INTERNET_PROXY_INFO)
DECL_WINELIB_TYPE_AW(LPINTERNET_PROXY_INFO)
typedef struct {
DWORD dwMajorVersion;
DWORD dwMinorVersion;
} INTERNET_VERSION_INFO,* LPINTERNET_VERSION_INFO;
typedef struct {
DWORD dwMajorVersion;
DWORD dwMinorVersion;
} HTTP_VERSION_INFO,* LPHTTP_VERSION_INFO;
typedef struct {
DWORD dwConnectedState;
DWORD dwFlags;
} INTERNET_CONNECTED_INFO,* LPINTERNET_CONNECTED_INFO;
#define ISO_FORCE_DISCONNECTED 0x00000001
typedef struct {
DWORD dwStructSize;
LPSTR lpszScheme;
DWORD dwSchemeLength;
INTERNET_SCHEME nScheme;
LPSTR lpszHostName;
DWORD dwHostNameLength;
INTERNET_PORT nPort;
LPSTR lpszUserName;
DWORD dwUserNameLength;
LPSTR lpszPassword;
DWORD dwPasswordLength;
LPSTR lpszUrlPath;
DWORD dwUrlPathLength;
LPSTR lpszExtraInfo;
DWORD dwExtraInfoLength;
} URL_COMPONENTSA,* LPURL_COMPONENTSA;
typedef struct {
DWORD dwStructSize;
LPWSTR lpszScheme;
DWORD dwSchemeLength;
INTERNET_SCHEME nScheme;
LPWSTR lpszHostName;
DWORD dwHostNameLength;
INTERNET_PORT nPort;
LPWSTR lpszUserName;
DWORD dwUserNameLength;
LPWSTR lpszPassword;
DWORD dwPasswordLength;
LPWSTR lpszUrlPath;
DWORD dwUrlPathLength;
LPWSTR lpszExtraInfo;
DWORD dwExtraInfoLength;
} URL_COMPONENTSW,* LPURL_COMPONENTSW;
DECL_WINELIB_TYPE_AW(URL_COMPONENTS)
DECL_WINELIB_TYPE_AW(LPURL_COMPONENTS)
typedef struct {
FILETIME ftExpiry;
FILETIME ftStart;
LPSTR lpszSubjectInfo;
LPSTR lpszIssuerInfo;
LPSTR lpszProtocolName;
LPSTR lpszSignatureAlgName;
LPSTR lpszEncryptionAlgName;
DWORD dwKeySize;
} INTERNET_CERTIFICATE_INFOA,* LPINTERNET_CERTIFICATE_INFOA;
typedef struct {
FILETIME ftExpiry;
FILETIME ftStart;
LPWSTR lpszSubjectInfo;
LPWSTR lpszIssuerInfo;
LPWSTR lpszProtocolName;
LPWSTR lpszSignatureAlgName;
LPWSTR lpszEncryptionAlgName;
DWORD dwKeySize;
} INTERNET_CERTIFICATE_INFOW,* LPINTERNET_CERTIFICATE_INFOW;
DECL_WINELIB_TYPE_AW(INTERNET_CERTIFICATE_INFO)
DECL_WINELIB_TYPE_AW(LPINTERNET_CERTIFICATE_INFO)
typedef struct _INTERNET_BUFFERSA {
DWORD dwStructSize;
struct _INTERNET_BUFFERSA * Next;
LPCSTR lpcszHeader;
DWORD dwHeadersLength;
DWORD dwHeadersTotal;
LPVOID lpvBuffer;
DWORD dwBufferLength;
DWORD dwBufferTotal;
DWORD dwOffsetLow;
DWORD dwOffsetHigh;
} INTERNET_BUFFERSA,* LPINTERNET_BUFFERSA;
typedef struct _INTERNET_BUFFERSW {
DWORD dwStructSize;
struct _INTERNET_BUFFERSW * Next;
LPCWSTR lpcszHeader;
DWORD dwHeadersLength;
DWORD dwHeadersTotal;
LPVOID lpvBuffer;
DWORD dwBufferLength;
DWORD dwBufferTotal;
DWORD dwOffsetLow;
DWORD dwOffsetHigh;
} INTERNET_BUFFERSW,* LPINTERNET_BUFFERSW;
DECL_WINELIB_TYPE_AW(INTERNET_BUFFERS)
DECL_WINELIB_TYPE_AW(LPINTERNET_BUFFERS)
#define GROUP_OWNER_STORAGE_SIZE 4
#define GROUPNAME_MAX_LENGTH 120
typedef struct _INTERNET_CACHE_GROUP_INFOA {
DWORD dwGroupSize;
DWORD dwGroupFlags;
DWORD dwGroupType;
DWORD dwDiskUsage;
DWORD dwDiskQuota;
DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
CHAR szGroupName[GROUPNAME_MAX_LENGTH];
} INTERNET_CACHE_GROUP_INFOA, * LPINTERNET_CACHE_GROUP_INFOA;
typedef struct _INTERNET_CACHE_GROUP_INFOW {
DWORD dwGroupSize;
DWORD dwGroupFlags;
DWORD dwGroupType;
DWORD dwDiskUsage;
DWORD dwDiskQuota;
DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
WCHAR szGroupName[GROUPNAME_MAX_LENGTH];
} INTERNET_CACHE_GROUP_INFOW, *LPINTERNET_CACHE_GROUP_INFOW;
DECL_WINELIB_TYPE_AW(INTERNET_CACHE_GROUP_INFO)
DECL_WINELIB_TYPE_AW(LPINTERNET_CACHE_GROUP_INFO)
typedef struct _INTERNET_PER_CONN_OPTIONA {
DWORD dwOption;
union {
DWORD dwValue;
LPSTR pszValue;
FILETIME ftValue;
} Value;
} INTERNET_PER_CONN_OPTIONA, *LPINTERNET_PER_CONN_OPTIONA;
typedef struct _INTERNET_PER_CONN_OPTIONW {
DWORD dwOption;
union {
DWORD dwValue;
LPWSTR pszValue;
FILETIME ftValue;
} Value;
} INTERNET_PER_CONN_OPTIONW, *LPINTERNET_PER_CONN_OPTIONW;
DECL_WINELIB_TYPE_AW(INTERNET_PER_CONN_OPTION)
DECL_WINELIB_TYPE_AW(LPINTERNET_PER_CONN_OPTION)
#define INTERNET_PER_CONN_FLAGS 1
#define INTERNET_PER_CONN_PROXY_SERVER 2
#define INTERNET_PER_CONN_PROXY_BYPASS 3
#define INTERNET_PER_CONN_AUTOCONFIG_URL 4
#define INTERNET_PER_CONN_AUTODISCOVERY_FLAGS 5
#define INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL 6
#define INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS 7
#define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME 8
#define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL 9
/* Values for INTERNET_PER_CONN_FLAGS */
#define PROXY_TYPE_DIRECT 0x00000001
#define PROXY_TYPE_PROXY 0x00000002
#define PROXY_TYPE_AUTO_PROXY_URL 0x00000004
#define PROXY_TYPE_AUTO_DETECT 0x00000008
/* Values for INTERNET_PER_CONN_AUTODISCOVERY_FLAGS */
#define AUTO_PROXY_FLAG_USER_SET 0x00000001
#define AUTO_PROXY_FLAG_ALWAYS_DETECT 0x00000002
#define AUTO_PROXY_FLAG_DETECTION_RUN 0x00000004
#define AUTO_PROXY_FLAG_MIGRATED 0x00000008
#define AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT 0x00000010
#define AUTO_PROXY_FLAG_CACHE_INIT_RUN 0x00000020
#define AUTO_PROXY_FLAG_DETECTION_SUSPECT 0x00000040
typedef struct _INTERNET_PER_CONN_OPTION_LISTA {
DWORD dwSize;
LPSTR pszConnection;
DWORD dwOptionCount;
DWORD dwOptionError;
LPINTERNET_PER_CONN_OPTIONA pOptions;
} INTERNET_PER_CONN_OPTION_LISTA, *LPINTERNET_PER_CONN_OPTION_LISTA;
typedef struct _INTERNET_PER_CONN_OPTION_LISTW {
DWORD dwSize;
LPWSTR pszConnection;
DWORD dwOptionCount;
DWORD dwOptionError;
LPINTERNET_PER_CONN_OPTIONW pOptions;
} INTERNET_PER_CONN_OPTION_LISTW, *LPINTERNET_PER_CONN_OPTION_LISTW;
DECL_WINELIB_TYPE_AW(INTERNET_PER_CONN_OPTION_LIST)
DECL_WINELIB_TYPE_AW(LPINTERNET_PER_CONN_OPTION_LIST)
typedef struct _INTERNET_DIAGNOSTIC_SOCKET_INFO
{
DWORD_PTR Socket;
DWORD SourcePort;
DWORD DestPort;
DWORD Flags;
} INTERNET_DIAGNOSTIC_SOCKET_INFO, *LPINTERNET_DIAGNOSTIC_SOCKET_INFO;
#define IDSI_FLAG_KEEP_ALIVE 0x00000001
#define IDSI_FLAG_SECURE 0x00000002
#define IDSI_FLAG_PROXY 0x00000004
#define IDSI_FLAG_TUNNEL 0x00000008
BOOLAPI InternetTimeFromSystemTimeA(CONST SYSTEMTIME *,DWORD ,LPSTR ,DWORD);
BOOLAPI InternetTimeFromSystemTimeW(CONST SYSTEMTIME *,DWORD ,LPWSTR ,DWORD);
#define InternetTimeFromSystemTime WINELIB_NAME_AW(InternetTimeFromSystemTime)
#define INTERNET_RFC1123_FORMAT 0
#define INTERNET_RFC1123_BUFSIZE 30
BOOLAPI InternetTimeToSystemTimeA(LPCSTR ,SYSTEMTIME *,DWORD);
BOOLAPI InternetTimeToSystemTimeW(LPCWSTR ,SYSTEMTIME *,DWORD);
#define InternetTimeToSystemTime WINELIB_NAME_AW(InternetTimeToSystemTime)
BOOLAPI InternetCrackUrlA(LPCSTR ,DWORD ,DWORD ,LPURL_COMPONENTSA);
BOOLAPI InternetCrackUrlW(LPCWSTR ,DWORD ,DWORD ,LPURL_COMPONENTSW);
#define InternetCrackUrl WINELIB_NAME_AW(InternetCrackUrl)
BOOLAPI InternetCreateUrlA(LPURL_COMPONENTSA ,DWORD ,LPSTR ,LPDWORD);
BOOLAPI InternetCreateUrlW(LPURL_COMPONENTSW ,DWORD ,LPWSTR ,LPDWORD);
#define InternetCreateUrl WINELIB_NAME_AW(InternetCreateUrl)
BOOLAPI InternetCanonicalizeUrlA(LPCSTR ,LPSTR ,LPDWORD ,DWORD);
BOOLAPI InternetCanonicalizeUrlW(LPCWSTR ,LPWSTR ,LPDWORD ,DWORD);
#define InternetCanonicalizeUrl WINELIB_NAME_AW(InternetCanonicalizeUrl)
BOOLAPI InternetCombineUrlA(LPCSTR ,LPCSTR ,LPSTR ,LPDWORD ,DWORD);
BOOLAPI InternetCombineUrlW(LPCWSTR ,LPCWSTR ,LPWSTR ,LPDWORD ,DWORD);
#define InternetCombineUrl WINELIB_NAME_AW(InternetCombineUrl)
#define ICU_ESCAPE 0x80000000
#define ICU_USERNAME 0x40000000
#define ICU_NO_ENCODE 0x20000000
#define ICU_DECODE 0x10000000
#define ICU_NO_META 0x08000000
#define ICU_ENCODE_SPACES_ONLY 0x04000000
#define ICU_BROWSER_MODE 0x02000000
INTERNETAPI HINTERNET WINAPI InternetOpenA(LPCSTR ,DWORD ,LPCSTR ,LPCSTR ,DWORD);
INTERNETAPI HINTERNET WINAPI InternetOpenW(LPCWSTR ,DWORD ,LPCWSTR ,LPCWSTR ,DWORD);
#define InternetOpen WINELIB_NAME_AW(InternetOpen)
#define INTERNET_OPEN_TYPE_PRECONFIG 0
#define INTERNET_OPEN_TYPE_DIRECT 1
#define INTERNET_OPEN_TYPE_PROXY 3
#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4
#define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG
#define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT
#define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY
BOOLAPI InternetCloseHandle(HINTERNET);
INTERNETAPI HINTERNET WINAPI InternetConnectA(HINTERNET ,LPCSTR ,INTERNET_PORT ,
LPCSTR ,LPCSTR ,DWORD ,DWORD ,DWORD_PTR );
INTERNETAPI HINTERNET WINAPI InternetConnectW(HINTERNET ,LPCWSTR ,INTERNET_PORT ,
LPCWSTR ,LPCWSTR ,DWORD ,DWORD ,DWORD_PTR );
#define InternetConnect WINELIB_NAME_AW(InternetConnect)
#define INTERNET_SERVICE_URL 0
#define INTERNET_SERVICE_FTP 1
#define INTERNET_SERVICE_GOPHER 2
#define INTERNET_SERVICE_HTTP 3
#define InternetConnectUrl(hInternet,lpszUrl,dwFlags,dwContext) \
InternetConnect(hInternet,\
lpszUrl,\
INTERNET_INVALID_PORT_NUMBER,\
NULL,\
NULL,\
INTERNET_SERVICE_URL,\
dwFlags,\
dwContext \
)
INTERNETAPI HINTERNET WINAPI InternetOpenUrlA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI InternetOpenUrlW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD ,DWORD_PTR);
#define InternetOpenUrl WINELIB_NAME_AW(InternetOpenUrl)
BOOLAPI InternetReadFile( HINTERNET ,LPVOID ,DWORD ,LPDWORD );
INTERNETAPI BOOL WINAPI InternetReadFileExA( HINTERNET ,LPINTERNET_BUFFERSA ,DWORD ,DWORD_PTR );
INTERNETAPI BOOL WINAPI InternetReadFileExW( HINTERNET ,LPINTERNET_BUFFERSW ,DWORD ,DWORD_PTR );
#define InternetReadFileEx WINELIB_NAME_AW(InternetReadFileEx)
#define IRF_ASYNC WININET_API_FLAG_ASYNC
#define IRF_SYNC WININET_API_FLAG_SYNC
#define IRF_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT
#define IRF_NO_WAIT 0x00000008
INTERNETAPI DWORD WINAPI InternetSetFilePointer(HINTERNET ,LONG ,PVOID ,DWORD ,DWORD_PTR);
BOOLAPI InternetWriteFile(HINTERNET ,LPCVOID ,DWORD ,LPDWORD);
BOOLAPI InternetQueryDataAvailable(HINTERNET ,LPDWORD ,DWORD ,DWORD_PTR);
BOOLAPI InternetFindNextFileA(HINTERNET ,LPVOID);
BOOLAPI InternetFindNextFileW(HINTERNET ,LPVOID);
#define InternetFindNextFile WINELIB_NAME_AW(InternetFindNextFile)
BOOLAPI InternetQueryOptionA(HINTERNET ,DWORD ,LPVOID ,LPDWORD);
BOOLAPI InternetQueryOptionW(HINTERNET ,DWORD ,LPVOID ,LPDWORD);
#define InternetQueryOption WINELIB_NAME_AW(InternetQueryOption)
BOOLAPI InternetSetOptionA(HINTERNET ,DWORD ,LPVOID ,DWORD);
BOOLAPI InternetSetOptionW(HINTERNET ,DWORD ,LPVOID ,DWORD);
#define InternetSetOption WINELIB_NAME_AW(InternetSetOption)
BOOLAPI InternetSetOptionExA(HINTERNET ,DWORD ,LPVOID ,DWORD ,DWORD);
BOOLAPI InternetSetOptionExW(HINTERNET ,DWORD ,LPVOID ,DWORD ,DWORD);
#define InternetSetOptionEx WINELIB_NAME_AW(InternetSetOptionEx)
BOOLAPI InternetLockRequestFile(HINTERNET ,HANDLE *);
BOOLAPI InternetUnlockRequestFile(HANDLE);
#define ISO_GLOBAL 0x00000001
#define ISO_REGISTRY 0x00000002
#define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY)
#define INTERNET_OPTION_CALLBACK 1
#define INTERNET_OPTION_CONNECT_TIMEOUT 2
#define INTERNET_OPTION_CONNECT_RETRIES 3
#define INTERNET_OPTION_CONNECT_BACKOFF 4
#define INTERNET_OPTION_SEND_TIMEOUT 5
#define INTERNET_OPTION_CONTROL_SEND_TIMEOUT INTERNET_OPTION_SEND_TIMEOUT
#define INTERNET_OPTION_RECEIVE_TIMEOUT 6
#define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT INTERNET_OPTION_RECEIVE_TIMEOUT
#define INTERNET_OPTION_DATA_SEND_TIMEOUT 7
#define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT 8
#define INTERNET_OPTION_HANDLE_TYPE 9
#define INTERNET_OPTION_LISTEN_TIMEOUT 11
#define INTERNET_OPTION_READ_BUFFER_SIZE 12
#define INTERNET_OPTION_WRITE_BUFFER_SIZE 13
#define INTERNET_OPTION_ASYNC_ID 15
#define INTERNET_OPTION_ASYNC_PRIORITY 16
#define INTERNET_OPTION_PARENT_HANDLE 21
#define INTERNET_OPTION_KEEP_CONNECTION 22
#define INTERNET_OPTION_REQUEST_FLAGS 23
#define INTERNET_OPTION_EXTENDED_ERROR 24
#define INTERNET_OPTION_OFFLINE_MODE 26
#define INTERNET_OPTION_CACHE_STREAM_HANDLE 27
#define INTERNET_OPTION_USERNAME 28
#define INTERNET_OPTION_PASSWORD 29
#define INTERNET_OPTION_ASYNC 30
#define INTERNET_OPTION_SECURITY_FLAGS 31
#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT 32
#define INTERNET_OPTION_DATAFILE_NAME 33
#define INTERNET_OPTION_URL 34
#define INTERNET_OPTION_SECURITY_CERTIFICATE 35
#define INTERNET_OPTION_SECURITY_KEY_BITNESS 36
#define INTERNET_OPTION_REFRESH 37
#define INTERNET_OPTION_PROXY 38
#define INTERNET_OPTION_SETTINGS_CHANGED 39
#define INTERNET_OPTION_VERSION 40
#define INTERNET_OPTION_USER_AGENT 41
#define INTERNET_OPTION_END_BROWSER_SESSION 42
#define INTERNET_OPTION_PROXY_USERNAME 43
#define INTERNET_OPTION_PROXY_PASSWORD 44
#define INTERNET_OPTION_CONTEXT_VALUE 45
#define INTERNET_OPTION_CONNECT_LIMIT 46
#define INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT 47
#define INTERNET_OPTION_POLICY 48
#define INTERNET_OPTION_DISCONNECTED_TIMEOUT 49
#define INTERNET_OPTION_CONNECTED_STATE 50
#define INTERNET_OPTION_IDLE_STATE 51
#define INTERNET_OPTION_OFFLINE_SEMANTICS 52
#define INTERNET_OPTION_SECONDARY_CACHE_KEY 53
#define INTERNET_OPTION_CALLBACK_FILTER 54
#define INTERNET_OPTION_CONNECT_TIME 55
#define INTERNET_OPTION_SEND_THROUGHPUT 56
#define INTERNET_OPTION_RECEIVE_THROUGHPUT 57
#define INTERNET_OPTION_REQUEST_PRIORITY 58
#define INTERNET_OPTION_HTTP_VERSION 59
#define INTERNET_OPTION_RESET_URLCACHE_SESSION 60
#define INTERNET_OPTION_ERROR_MASK 62
#define INTERNET_OPTION_FROM_CACHE_TIMEOUT 63
#define INTERNET_OPTION_BYPASS_EDITED_ENTRY 64
#define INTERNET_OPTION_HTTP_DECODING 65
#define INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO 67
#define INTERNET_OPTION_CODEPAGE 68
#define INTERNET_OPTION_CACHE_TIMESTAMPS 69
#define INTERNET_OPTION_DISABLE_AUTODIAL 70
#define INTERNET_OPTION_MAX_CONNS_PER_SERVER 73
#define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER 74
#define INTERNET_OPTION_PER_CONNECTION_OPTION 75
#define INTERNET_OPTION_DIGEST_AUTH_UNLOAD 76
#define INTERNET_OPTION_IGNORE_OFFLINE 77
#define INTERNET_OPTION_IDENTITY 78
#define INTERNET_OPTION_REMOVE_IDENTITY 79
#define INTERNET_OPTION_ALTER_IDENTITY 80
#define INTERNET_OPTION_SUPPRESS_BEHAVIOR 81
#define INTERNET_OPTION_AUTODIAL_MODE 82
#define INTERNET_OPTION_AUTODIAL_CONNECTION 83
#define INTERNET_OPTION_CLIENT_CERT_CONTEXT 84
#define INTERNET_OPTION_AUTH_FLAGS 85
#define INTERNET_OPTION_COOKIES_3RD_PARTY 86
#define INTERNET_OPTION_DISABLE_PASSPORT_AUTH 87
#define INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY 88
#define INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT 89
#define INTERNET_OPTION_ENABLE_PASSPORT_AUTH 90
#define INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS 91
#define INTERNET_OPTION_ACTIVATE_WORKER_THREADS 92
#define INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS 93
#define INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH 94
#define INTERNET_OPTION_PROXY_SETTINGS_CHANGED 95
#define INTERNET_OPTION_DATAFILE_EXT 96
#define INTERNET_OPTION_CODEPAGE_PATH 100
#define INTERNET_OPTION_CODEPAGE_EXTRA 101
#define INTERNET_OPTION_IDN 102
#define INTERNET_OPTION_MAX_CONNS_PER_PROXY 103
#define INTERNET_OPTION_SUPPRESS_SERVER_AUTH 104
#define INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT 105
#define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK
#define INTERNET_LAST_OPTION INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT
#define INTERNET_PRIORITY_FOREGROUND 1000
#define INTERNET_HANDLE_TYPE_INTERNET 1
#define INTERNET_HANDLE_TYPE_CONNECT_FTP 2
#define INTERNET_HANDLE_TYPE_CONNECT_GOPHER 3
#define INTERNET_HANDLE_TYPE_CONNECT_HTTP 4
#define INTERNET_HANDLE_TYPE_FTP_FIND 5
#define INTERNET_HANDLE_TYPE_FTP_FIND_HTML 6
#define INTERNET_HANDLE_TYPE_FTP_FILE 7
#define INTERNET_HANDLE_TYPE_FTP_FILE_HTML 8
#define INTERNET_HANDLE_TYPE_GOPHER_FIND 9
#define INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML 10
#define INTERNET_HANDLE_TYPE_GOPHER_FILE 11
#define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12
#define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13
#define SECURITY_FLAG_SECURE 0x00000001
#define SECURITY_FLAG_STRENGTH_WEAK 0x10000000
#define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000
#define SECURITY_FLAG_STRENGTH_STRONG 0x20000000
#define SECURITY_FLAG_UNKNOWNBIT 0x80000000
#define SECURITY_FLAG_NORMALBITNESS SECURITY_FLAG_STRENGTH_WEAK
#define SECURITY_FLAG_SSL 0x00000002
#define SECURITY_FLAG_SSL3 0x00000004
#define SECURITY_FLAG_PCT 0x00000008
#define SECURITY_FLAG_PCT4 0x00000010
#define SECURITY_FLAG_IETFSSL4 0x00000020
#define SECURITY_FLAG_40BIT SECURITY_FLAG_STRENGTH_WEAK
#define SECURITY_FLAG_128BIT SECURITY_FLAG_STRENGTH_STRONG
#define SECURITY_FLAG_56BIT SECURITY_FLAG_STRENGTH_MEDIUM
#define SECURITY_FLAG_IGNORE_REVOCATION 0x00000080
#define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100
#define SECURITY_FLAG_IGNORE_WRONG_USAGE 0x00000200
#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID INTERNET_FLAG_IGNORE_CERT_CN_INVALID
#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
#define SECURITY_SET_MASK (SECURITY_FLAG_IGNORE_REVOCATION |\
SECURITY_FLAG_IGNORE_UNKNOWN_CA |\
SECURITY_FLAG_IGNORE_CERT_CN_INVALID |\
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |\
SECURITY_FLAG_IGNORE_WRONG_USAGE)
BOOLAPI InternetGetLastResponseInfoA(LPDWORD ,LPSTR ,LPDWORD);
BOOLAPI InternetGetLastResponseInfoW(LPDWORD ,LPWSTR ,LPDWORD);
#define InternetGetLastResponseInfo WINELIB_NAME_AW(InternetGetLastResponseInfo)
typedef VOID (CALLBACK *INTERNET_STATUS_CALLBACK)(HINTERNET ,DWORD_PTR ,DWORD ,
LPVOID ,DWORD);
typedef INTERNET_STATUS_CALLBACK * LPINTERNET_STATUS_CALLBACK;
INTERNETAPI INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA(HINTERNET ,INTERNET_STATUS_CALLBACK);
INTERNETAPI INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW(HINTERNET ,INTERNET_STATUS_CALLBACK);
#define InternetSetStatusCallback WINELIB_NAME_AW(InternetSetStatusCallback)
#define INTERNET_STATUS_RESOLVING_NAME 10
#define INTERNET_STATUS_NAME_RESOLVED 11
#define INTERNET_STATUS_CONNECTING_TO_SERVER 20
#define INTERNET_STATUS_CONNECTED_TO_SERVER 21
#define INTERNET_STATUS_SENDING_REQUEST 30
#define INTERNET_STATUS_REQUEST_SENT 31
#define INTERNET_STATUS_RECEIVING_RESPONSE 40
#define INTERNET_STATUS_RESPONSE_RECEIVED 41
#define INTERNET_STATUS_CTL_RESPONSE_RECEIVED 42
#define INTERNET_STATUS_PREFETCH 43
#define INTERNET_STATUS_CLOSING_CONNECTION 50
#define INTERNET_STATUS_CONNECTION_CLOSED 51
#define INTERNET_STATUS_HANDLE_CREATED 60
#define INTERNET_STATUS_HANDLE_CLOSING 70
#define INTERNET_STATUS_DETECTING_PROXY 80
#define INTERNET_STATUS_REQUEST_COMPLETE 100
#define INTERNET_STATUS_REDIRECT 110
#define INTERNET_STATUS_INTERMEDIATE_RESPONSE 120
#define INTERNET_STATUS_USER_INPUT_REQUIRED 140
#define INTERNET_STATUS_STATE_CHANGE 200
#define INTERNET_STATUS_COOKIE_SENT 320
#define INTERNET_STATUS_COOKIE_RECEIVED 321
#define INTERNET_STATUS_PRIVACY_IMPACTED 324
#define INTERNET_STATUS_P3P_HEADER 325
#define INTERNET_STATUS_P3P_POLICYREF 326
#define INTERNET_STATUS_COOKIE_HISTORY 327
#define INTERNET_STATE_CONNECTED 0x00000001
#define INTERNET_STATE_DISCONNECTED 0x00000002
#define INTERNET_STATE_DISCONNECTED_BY_USER 0x00000010
#define INTERNET_STATE_IDLE 0x00000100
#define INTERNET_STATE_BUSY 0x00000200
#define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L))
#define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000
#define FTP_TRANSFER_TYPE_ASCII 0x00000001
#define FTP_TRANSFER_TYPE_BINARY 0x00000002
#define FTP_TRANSFER_TYPE_MASK (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY)
BOOLAPI FtpCommandA(HINTERNET, BOOL, DWORD, LPCSTR, DWORD_PTR, HINTERNET *);
BOOLAPI FtpCommandW(HINTERNET, BOOL, DWORD, LPCWSTR, DWORD_PTR, HINTERNET *);
#define FtpCommand WINELIB_NAME_AW(FtpCommand)
INTERNETAPI HINTERNET WINAPI FtpFindFirstFileA(HINTERNET ,LPCSTR ,
LPWIN32_FIND_DATAA ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI FtpFindFirstFileW(HINTERNET ,LPCWSTR ,
LPWIN32_FIND_DATAW ,DWORD ,DWORD_PTR);
#define FtpFindFirstFile WINELIB_NAME_AW(FtpFindFirstFile)
BOOLAPI FtpGetFileA(HINTERNET ,LPCSTR ,LPCSTR ,BOOL ,DWORD ,DWORD ,DWORD_PTR);
BOOLAPI FtpGetFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,BOOL ,DWORD ,DWORD ,DWORD_PTR);
#define FtpGetFile WINELIB_NAME_AW(FtpGetFile)
DWORD WINAPI FtpGetFileSize(HINTERNET, LPDWORD);
BOOLAPI FtpPutFileA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD_PTR);
BOOLAPI FtpPutFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD_PTR);
#define FtpPutFile WINELIB_NAME_AW(FtpPutFile)
BOOLAPI FtpDeleteFileA(HINTERNET ,LPCSTR);
BOOLAPI FtpDeleteFileW(HINTERNET ,LPCWSTR);
#define FtpDeleteFile WINELIB_NAME_AW(FtpDeleteFile)
BOOLAPI FtpRenameFileA(HINTERNET ,LPCSTR ,LPCSTR);
BOOLAPI FtpRenameFileW(HINTERNET ,LPCWSTR ,LPCWSTR);
#define FtpRenameFile WINELIB_NAME_AW(FtpRenameFile)
INTERNETAPI HINTERNET WINAPI FtpOpenFileA(HINTERNET ,LPCSTR ,DWORD ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI FtpOpenFileW(HINTERNET ,LPCWSTR ,DWORD ,DWORD ,DWORD_PTR);
#define FtpOpenFile WINELIB_NAME_AW(FtpOpenFile)
BOOLAPI FtpCreateDirectoryA(HINTERNET ,LPCSTR);
BOOLAPI FtpCreateDirectoryW(HINTERNET ,LPCWSTR);
#define FtpCreateDirectory WINELIB_NAME_AW(FtpCreateDirectory)
BOOLAPI FtpRemoveDirectoryA(HINTERNET ,LPCSTR);
BOOLAPI FtpRemoveDirectoryW(HINTERNET ,LPCWSTR);
#define FtpRemoveDirectory WINELIB_NAME_AW(FtpRemoveDirectory)
BOOLAPI FtpSetCurrentDirectoryA(HINTERNET ,LPCSTR);
BOOLAPI FtpSetCurrentDirectoryW(HINTERNET ,LPCWSTR);
#define FtpSetCurrentDirectory WINELIB_NAME_AW(FtpSetCurrentDirectory)
BOOLAPI FtpGetCurrentDirectoryA(HINTERNET ,LPSTR ,LPDWORD);
BOOLAPI FtpGetCurrentDirectoryW(HINTERNET ,LPWSTR ,LPDWORD);
#define FtpGetCurrentDirectory WINELIB_NAME_AW(FtpGetCurrentDirectory)
#define MAX_GOPHER_DISPLAY_TEXT 128
#define MAX_GOPHER_SELECTOR_TEXT 256
#define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH
#define MAX_GOPHER_LOCATOR_LENGTH (1 \
+ MAX_GOPHER_DISPLAY_TEXT \
+ 1 \
+ MAX_GOPHER_SELECTOR_TEXT \
+ 1 \
+ MAX_GOPHER_HOST_NAME \
+ 1 \
+ INTERNET_MAX_PORT_NUMBER_LENGTH \
+ 1 \
+ 1 \
+ 2 \
)
typedef struct {
CHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
DWORD GopherType;
DWORD SizeLow;
DWORD SizeHigh;
FILETIME LastModificationTime;
CHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
} GOPHER_FIND_DATAA,* LPGOPHER_FIND_DATAA;
typedef struct {
WCHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
DWORD GopherType;
DWORD SizeLow;
DWORD SizeHigh;
FILETIME LastModificationTime;
WCHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
} GOPHER_FIND_DATAW,* LPGOPHER_FIND_DATAW;
DECL_WINELIB_TYPE_AW(GOPHER_FIND_DATA)
DECL_WINELIB_TYPE_AW(LPGOPHER_FIND_DATA)
#define GOPHER_TYPE_TEXT_FILE 0x00000001
#define GOPHER_TYPE_DIRECTORY 0x00000002
#define GOPHER_TYPE_CSO 0x00000004
#define GOPHER_TYPE_ERROR 0x00000008
#define GOPHER_TYPE_MAC_BINHEX 0x00000010
#define GOPHER_TYPE_DOS_ARCHIVE 0x00000020
#define GOPHER_TYPE_UNIX_UUENCODED 0x00000040
#define GOPHER_TYPE_INDEX_SERVER 0x00000080
#define GOPHER_TYPE_TELNET 0x00000100
#define GOPHER_TYPE_BINARY 0x00000200
#define GOPHER_TYPE_REDUNDANT 0x00000400
#define GOPHER_TYPE_TN3270 0x00000800
#define GOPHER_TYPE_GIF 0x00001000
#define GOPHER_TYPE_IMAGE 0x00002000
#define GOPHER_TYPE_BITMAP 0x00004000
#define GOPHER_TYPE_MOVIE 0x00008000
#define GOPHER_TYPE_SOUND 0x00010000
#define GOPHER_TYPE_HTML 0x00020000
#define GOPHER_TYPE_PDF 0x00040000
#define GOPHER_TYPE_CALENDAR 0x00080000
#define GOPHER_TYPE_INLINE 0x00100000
#define GOPHER_TYPE_UNKNOWN 0x20000000
#define GOPHER_TYPE_ASK 0x40000000
#define GOPHER_TYPE_GOPHER_PLUS 0x80000000
#define IS_GOPHER_FILE(type) (BOOL)(((type) & GOPHER_TYPE_FILE_MASK) ? TRUE : FALSE)
#define IS_GOPHER_DIRECTORY(type) (BOOL)(((type) & GOPHER_TYPE_DIRECTORY) ? TRUE : FALSE)
#define IS_GOPHER_PHONE_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_CSO) ? TRUE : FALSE)
#define IS_GOPHER_ERROR(type) (BOOL)(((type) & GOPHER_TYPE_ERROR) ? TRUE : FALSE)
#define IS_GOPHER_INDEX_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_INDEX_SERVER) ? TRUE : FALSE)
#define IS_GOPHER_TELNET_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TELNET) ? TRUE : FALSE)
#define IS_GOPHER_BACKUP_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_REDUNDANT) ? TRUE : FALSE)
#define IS_GOPHER_TN3270_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TN3270) ? TRUE : FALSE)
#define IS_GOPHER_ASK(type) (BOOL)(((type) & GOPHER_TYPE_ASK) ? TRUE : FALSE)
#define IS_GOPHER_PLUS(type) (BOOL)(((type) & GOPHER_TYPE_GOPHER_PLUS) ? TRUE : FALSE)
#define IS_GOPHER_TYPE_KNOWN(type) (BOOL)(((type) & GOPHER_TYPE_UNKNOWN) ? FALSE : TRUE)
#define GOPHER_TYPE_FILE_MASK (GOPHER_TYPE_TEXT_FILE \
| GOPHER_TYPE_MAC_BINHEX \
| GOPHER_TYPE_DOS_ARCHIVE \
| GOPHER_TYPE_UNIX_UUENCODED \
| GOPHER_TYPE_BINARY \
| GOPHER_TYPE_GIF \
| GOPHER_TYPE_IMAGE \
| GOPHER_TYPE_BITMAP \
| GOPHER_TYPE_MOVIE \
| GOPHER_TYPE_SOUND \
| GOPHER_TYPE_HTML \
| GOPHER_TYPE_PDF \
| GOPHER_TYPE_CALENDAR \
| GOPHER_TYPE_INLINE \
)
typedef struct {
LPCSTR Comment;
LPCSTR EmailAddress;
} GOPHER_ADMIN_ATTRIBUTE_TYPEA,* LPGOPHER_ADMIN_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR Comment;
LPCWSTR EmailAddress;
} GOPHER_ADMIN_ATTRIBUTE_TYPEW,* LPGOPHER_ADMIN_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_ADMIN_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_ADMIN_ATTRIBUTE_TYPE)
typedef struct {
FILETIME DateAndTime;
} GOPHER_MOD_DATE_ATTRIBUTE_TYPE,* LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE;
typedef struct {
DWORD Ttl;
} GOPHER_TTL_ATTRIBUTE_TYPE,* LPGOPHER_TTL_ATTRIBUTE_TYPE;
typedef struct {
INT Score;
} GOPHER_SCORE_ATTRIBUTE_TYPE,* LPGOPHER_SCORE_ATTRIBUTE_TYPE;
typedef struct {
INT LowerBound;
INT UpperBound;
} GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE,* LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
typedef struct {
LPCSTR Site;
} GOPHER_SITE_ATTRIBUTE_TYPEA,* LPGOPHER_SITE_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR Site;
} GOPHER_SITE_ATTRIBUTE_TYPEW,* LPGOPHER_SITE_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_SITE_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_SITE_ATTRIBUTE_TYPE)
typedef struct {
LPCSTR Organization;
} GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA,* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR Organization;
} GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW,* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_ORGANIZATION_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE)
typedef struct {
LPCSTR Location;
} GOPHER_LOCATION_ATTRIBUTE_TYPEA,* LPGOPHER_LOCATION_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR Location;
} GOPHER_LOCATION_ATTRIBUTE_TYPEW,* LPGOPHER_LOCATION_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_LOCATION_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_LOCATION_ATTRIBUTE_TYPE)
typedef struct {
INT DegreesNorth;
INT MinutesNorth;
INT SecondsNorth;
INT DegreesEast;
INT MinutesEast;
INT SecondsEast;
} GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE,* LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
typedef struct {
INT Zone;
} GOPHER_TIMEZONE_ATTRIBUTE_TYPE,* LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE;
typedef struct {
LPCSTR Provider;
} GOPHER_PROVIDER_ATTRIBUTE_TYPEA,* LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR Provider;
} GOPHER_PROVIDER_ATTRIBUTE_TYPEW,* LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_PROVIDER_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_PROVIDER_ATTRIBUTE_TYPE)
typedef struct {
LPCSTR Version;
} GOPHER_VERSION_ATTRIBUTE_TYPEA,* LPGOPHER_VERSION_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR Version;
} GOPHER_VERSION_ATTRIBUTE_TYPEW,* LPGOPHER_VERSION_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_VERSION_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_VERSION_ATTRIBUTE_TYPE)
typedef struct {
LPCSTR ShortAbstract;
LPCSTR AbstractFile;
} GOPHER_ABSTRACT_ATTRIBUTE_TYPEA,* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR ShortAbstract;
LPCWSTR AbstractFile;
} GOPHER_ABSTRACT_ATTRIBUTE_TYPEW,* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_ABSTRACT_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE)
typedef struct {
LPCSTR ContentType;
LPCSTR Language;
DWORD Size;
} GOPHER_VIEW_ATTRIBUTE_TYPEA,* LPGOPHER_VIEW_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR ContentType;
LPCWSTR Language;
DWORD Size;
} GOPHER_VIEW_ATTRIBUTE_TYPEW,* LPGOPHER_VIEW_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_VIEW_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_VIEW_ATTRIBUTE_TYPE)
typedef struct {
BOOL TreeWalk;
} GOPHER_VERONICA_ATTRIBUTE_TYPE,* LPGOPHER_VERONICA_ATTRIBUTE_TYPE;
typedef struct {
LPCSTR QuestionType;
LPCSTR QuestionText;
} GOPHER_ASK_ATTRIBUTE_TYPEA,* LPGOPHER_ASK_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR QuestionType;
LPCWSTR QuestionText;
} GOPHER_ASK_ATTRIBUTE_TYPEW,* LPGOPHER_ASK_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_ASK_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_ASK_ATTRIBUTE_TYPE)
typedef struct {
LPCSTR Text;
} GOPHER_UNKNOWN_ATTRIBUTE_TYPEA,* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA;
typedef struct {
LPCWSTR Text;
} GOPHER_UNKNOWN_ATTRIBUTE_TYPEW,* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_UNKNOWN_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE)
typedef struct {
DWORD CategoryId;
DWORD AttributeId;
union {
GOPHER_ADMIN_ATTRIBUTE_TYPEA Admin;
GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate;
GOPHER_TTL_ATTRIBUTE_TYPE Ttl;
GOPHER_SCORE_ATTRIBUTE_TYPE Score;
GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange;
GOPHER_SITE_ATTRIBUTE_TYPEA Site;
GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA Organization;
GOPHER_LOCATION_ATTRIBUTE_TYPEA Location;
GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation;
GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone;
GOPHER_PROVIDER_ATTRIBUTE_TYPEA Provider;
GOPHER_VERSION_ATTRIBUTE_TYPEA Version;
GOPHER_ABSTRACT_ATTRIBUTE_TYPEA Abstract;
GOPHER_VIEW_ATTRIBUTE_TYPEA View;
GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica;
GOPHER_ASK_ATTRIBUTE_TYPEA Ask;
GOPHER_UNKNOWN_ATTRIBUTE_TYPEA Unknown;
} AttributeType;
} GOPHER_ATTRIBUTE_TYPEA, *LPGOPHER_ATTRIBUTE_TYPEA;
typedef struct {
DWORD CategoryId;
DWORD AttributeId;
union {
GOPHER_ADMIN_ATTRIBUTE_TYPEW Admin;
GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate;
GOPHER_TTL_ATTRIBUTE_TYPE Ttl;
GOPHER_SCORE_ATTRIBUTE_TYPE Score;
GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange;
GOPHER_SITE_ATTRIBUTE_TYPEW Site;
GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW Organization;
GOPHER_LOCATION_ATTRIBUTE_TYPEW Location;
GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation;
GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone;
GOPHER_PROVIDER_ATTRIBUTE_TYPEW Provider;
GOPHER_VERSION_ATTRIBUTE_TYPEW Version;
GOPHER_ABSTRACT_ATTRIBUTE_TYPEW Abstract;
GOPHER_VIEW_ATTRIBUTE_TYPEW View;
GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica;
GOPHER_ASK_ATTRIBUTE_TYPEW Ask;
GOPHER_UNKNOWN_ATTRIBUTE_TYPEW Unknown;
} AttributeType;
} GOPHER_ATTRIBUTE_TYPEW, *LPGOPHER_ATTRIBUTE_TYPEW;
DECL_WINELIB_TYPE_AW(GOPHER_ATTRIBUTE_TYPE)
DECL_WINELIB_TYPE_AW(LPGOPHER_ATTRIBUTE_TYPE)
#define MAX_GOPHER_CATEGORY_NAME 128
#define MAX_GOPHER_ATTRIBUTE_NAME 128
#define MIN_GOPHER_ATTRIBUTE_LENGTH 256
#define GOPHER_INFO_CATEGORY TEXT("+INFO")
#define GOPHER_ADMIN_CATEGORY TEXT("+ADMIN")
#define GOPHER_VIEWS_CATEGORY TEXT("+VIEWS")
#define GOPHER_ABSTRACT_CATEGORY TEXT("+ABSTRACT")
#define GOPHER_VERONICA_CATEGORY TEXT("+VERONICA")
#define GOPHER_ADMIN_ATTRIBUTE TEXT("Admin")
#define GOPHER_MOD_DATE_ATTRIBUTE TEXT("Mod-Date")
#define GOPHER_TTL_ATTRIBUTE TEXT("TTL")
#define GOPHER_SCORE_ATTRIBUTE TEXT("Score")
#define GOPHER_RANGE_ATTRIBUTE TEXT("Score-range")
#define GOPHER_SITE_ATTRIBUTE TEXT("Site")
#define GOPHER_ORG_ATTRIBUTE TEXT("Org")
#define GOPHER_LOCATION_ATTRIBUTE TEXT("Loc")
#define GOPHER_GEOG_ATTRIBUTE TEXT("Geog")
#define GOPHER_TIMEZONE_ATTRIBUTE TEXT("TZ")
#define GOPHER_PROVIDER_ATTRIBUTE TEXT("Provider")
#define GOPHER_VERSION_ATTRIBUTE TEXT("Version")
#define GOPHER_ABSTRACT_ATTRIBUTE TEXT("Abstract")
#define GOPHER_VIEW_ATTRIBUTE TEXT("View")
#define GOPHER_TREEWALK_ATTRIBUTE TEXT("treewalk")
#define GOPHER_ATTRIBUTE_ID_BASE 0xabcccc00
#define GOPHER_CATEGORY_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 1)
#define GOPHER_CATEGORY_ID_INFO (GOPHER_ATTRIBUTE_ID_BASE + 2)
#define GOPHER_CATEGORY_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 3)
#define GOPHER_CATEGORY_ID_VIEWS (GOPHER_ATTRIBUTE_ID_BASE + 4)
#define GOPHER_CATEGORY_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 5)
#define GOPHER_CATEGORY_ID_VERONICA (GOPHER_ATTRIBUTE_ID_BASE + 6)
#define GOPHER_CATEGORY_ID_ASK (GOPHER_ATTRIBUTE_ID_BASE + 7)
#define GOPHER_CATEGORY_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 8)
#define GOPHER_ATTRIBUTE_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 9)
#define GOPHER_ATTRIBUTE_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 10)
#define GOPHER_ATTRIBUTE_ID_MOD_DATE (GOPHER_ATTRIBUTE_ID_BASE + 11)
#define GOPHER_ATTRIBUTE_ID_TTL (GOPHER_ATTRIBUTE_ID_BASE + 12)
#define GOPHER_ATTRIBUTE_ID_SCORE (GOPHER_ATTRIBUTE_ID_BASE + 13)
#define GOPHER_ATTRIBUTE_ID_RANGE (GOPHER_ATTRIBUTE_ID_BASE + 14)
#define GOPHER_ATTRIBUTE_ID_SITE (GOPHER_ATTRIBUTE_ID_BASE + 15)
#define GOPHER_ATTRIBUTE_ID_ORG (GOPHER_ATTRIBUTE_ID_BASE + 16)
#define GOPHER_ATTRIBUTE_ID_LOCATION (GOPHER_ATTRIBUTE_ID_BASE + 17)
#define GOPHER_ATTRIBUTE_ID_GEOG (GOPHER_ATTRIBUTE_ID_BASE + 18)
#define GOPHER_ATTRIBUTE_ID_TIMEZONE (GOPHER_ATTRIBUTE_ID_BASE + 19)
#define GOPHER_ATTRIBUTE_ID_PROVIDER (GOPHER_ATTRIBUTE_ID_BASE + 20)
#define GOPHER_ATTRIBUTE_ID_VERSION (GOPHER_ATTRIBUTE_ID_BASE + 21)
#define GOPHER_ATTRIBUTE_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 22)
#define GOPHER_ATTRIBUTE_ID_VIEW (GOPHER_ATTRIBUTE_ID_BASE + 23)
#define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE + 24)
#define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 25)
BOOLAPI GopherCreateLocatorA(LPCSTR ,INTERNET_PORT ,LPCSTR ,
LPCSTR ,DWORD ,LPSTR ,LPDWORD);
BOOLAPI GopherCreateLocatorW(LPCWSTR ,INTERNET_PORT ,LPCWSTR ,
LPCWSTR ,DWORD ,LPWSTR ,LPDWORD);
#define GopherCreateLocator WINELIB_NAME_AW(GopherCreateLocator)
BOOLAPI GopherGetLocatorTypeA(LPCSTR ,LPDWORD);
BOOLAPI GopherGetLocatorTypeW(LPCWSTR ,LPDWORD);
#define GopherGetLocatorType WINELIB_NAME_AW(GopherGetLocatorType)
INTERNETAPI HINTERNET WINAPI GopherFindFirstFileA(HINTERNET ,LPCSTR ,
LPCSTR ,LPGOPHER_FIND_DATAA ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI GopherFindFirstFileW(HINTERNET ,LPCWSTR ,
LPCWSTR ,LPGOPHER_FIND_DATAW ,DWORD ,DWORD_PTR);
#define GopherFindFirstFile WINELIB_NAME_AW(GopherFindFirstFile)
INTERNETAPI HINTERNET WINAPI GopherOpenFileA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI GopherOpenFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD_PTR);
#define GopherOpenFile WINELIB_NAME_AW(GopherOpenFile)
typedef BOOL (CALLBACK *GOPHER_ATTRIBUTE_ENUMERATORA)(LPGOPHER_ATTRIBUTE_TYPEA ,DWORD);
typedef BOOL (CALLBACK *GOPHER_ATTRIBUTE_ENUMERATORW)(LPGOPHER_ATTRIBUTE_TYPEW ,DWORD);
DECL_WINELIB_TYPE_AW(GOPHER_ATTRIBUTE_ENUMERATOR)
BOOLAPI GopherGetAttributeA(HINTERNET ,LPCSTR ,LPCSTR ,LPBYTE ,
DWORD ,LPDWORD ,GOPHER_ATTRIBUTE_ENUMERATORA ,DWORD_PTR);
BOOLAPI GopherGetAttributeW(HINTERNET ,LPCWSTR ,LPCWSTR ,LPBYTE ,
DWORD ,LPDWORD ,GOPHER_ATTRIBUTE_ENUMERATORW ,DWORD_PTR);
#define GopherGetAttribute WINELIB_NAME_AW(GopherGetAttribute)
#define HTTP_MAJOR_VERSION 1
#define HTTP_MINOR_VERSION 0
#define HTTP_VERSION TEXT("HTTP/1.0")
#define HTTP_QUERY_MIME_VERSION 0
#define HTTP_QUERY_CONTENT_TYPE 1
#define HTTP_QUERY_CONTENT_TRANSFER_ENCODING 2
#define HTTP_QUERY_CONTENT_ID 3
#define HTTP_QUERY_CONTENT_DESCRIPTION 4
#define HTTP_QUERY_CONTENT_LENGTH 5
#define HTTP_QUERY_CONTENT_LANGUAGE 6
#define HTTP_QUERY_ALLOW 7
#define HTTP_QUERY_PUBLIC 8
#define HTTP_QUERY_DATE 9
#define HTTP_QUERY_EXPIRES 10
#define HTTP_QUERY_LAST_MODIFIED 11
#define HTTP_QUERY_MESSAGE_ID 12
#define HTTP_QUERY_URI 13
#define HTTP_QUERY_DERIVED_FROM 14
#define HTTP_QUERY_COST 15
#define HTTP_QUERY_LINK 16
#define HTTP_QUERY_PRAGMA 17
#define HTTP_QUERY_VERSION 18
#define HTTP_QUERY_STATUS_CODE 19
#define HTTP_QUERY_STATUS_TEXT 20
#define HTTP_QUERY_RAW_HEADERS 21
#define HTTP_QUERY_RAW_HEADERS_CRLF 22
#define HTTP_QUERY_CONNECTION 23
#define HTTP_QUERY_ACCEPT 24
#define HTTP_QUERY_ACCEPT_CHARSET 25
#define HTTP_QUERY_ACCEPT_ENCODING 26
#define HTTP_QUERY_ACCEPT_LANGUAGE 27
#define HTTP_QUERY_AUTHORIZATION 28
#define HTTP_QUERY_CONTENT_ENCODING 29
#define HTTP_QUERY_FORWARDED 30
#define HTTP_QUERY_FROM 31
#define HTTP_QUERY_IF_MODIFIED_SINCE 32
#define HTTP_QUERY_LOCATION 33
#define HTTP_QUERY_ORIG_URI 34
#define HTTP_QUERY_REFERER 35
#define HTTP_QUERY_RETRY_AFTER 36
#define HTTP_QUERY_SERVER 37
#define HTTP_QUERY_TITLE 38
#define HTTP_QUERY_USER_AGENT 39
#define HTTP_QUERY_WWW_AUTHENTICATE 40
#define HTTP_QUERY_PROXY_AUTHENTICATE 41
#define HTTP_QUERY_ACCEPT_RANGES 42
#define HTTP_QUERY_SET_COOKIE 43
#define HTTP_QUERY_COOKIE 44
#define HTTP_QUERY_REQUEST_METHOD 45
#define HTTP_QUERY_REFRESH 46
#define HTTP_QUERY_CONTENT_DISPOSITION 47
#define HTTP_QUERY_AGE 48
#define HTTP_QUERY_CACHE_CONTROL 49
#define HTTP_QUERY_CONTENT_BASE 50
#define HTTP_QUERY_CONTENT_LOCATION 51
#define HTTP_QUERY_CONTENT_MD5 52
#define HTTP_QUERY_CONTENT_RANGE 53
#define HTTP_QUERY_ETAG 54
#define HTTP_QUERY_HOST 55
#define HTTP_QUERY_IF_MATCH 56
#define HTTP_QUERY_IF_NONE_MATCH 57
#define HTTP_QUERY_IF_RANGE 58
#define HTTP_QUERY_IF_UNMODIFIED_SINCE 59
#define HTTP_QUERY_MAX_FORWARDS 60
#define HTTP_QUERY_PROXY_AUTHORIZATION 61
#define HTTP_QUERY_RANGE 62
#define HTTP_QUERY_TRANSFER_ENCODING 63
#define HTTP_QUERY_UPGRADE 64
#define HTTP_QUERY_VARY 65
#define HTTP_QUERY_VIA 66
#define HTTP_QUERY_WARNING 67
#define HTTP_QUERY_EXPECT 68
#define HTTP_QUERY_PROXY_CONNECTION 69
#define HTTP_QUERY_UNLESS_MODIFIED_SINCE 70
#define HTTP_QUERY_ECHO_REQUEST 71
#define HTTP_QUERY_ECHO_REPLY 72
#define HTTP_QUERY_ECHO_HEADERS 73
#define HTTP_QUERY_ECHO_HEADERS_CRLF 74
#define HTTP_QUERY_PROXY_SUPPORT 75
#define HTTP_QUERY_AUTHENTICATION_INFO 76
#define HTTP_QUERY_PASSPORT_URLS 77
#define HTTP_QUERY_PASSPORT_CONFIG 78
#define HTTP_QUERY_MAX 78
#define HTTP_QUERY_CUSTOM 65535
#define HTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000
#define HTTP_QUERY_FLAG_SYSTEMTIME 0x40000000
#define HTTP_QUERY_FLAG_NUMBER 0x20000000
#define HTTP_QUERY_FLAG_COALESCE 0x10000000
#define HTTP_QUERY_MODIFIER_FLAGS_MASK (HTTP_QUERY_FLAG_REQUEST_HEADERS \
| HTTP_QUERY_FLAG_SYSTEMTIME \
| HTTP_QUERY_FLAG_NUMBER \
| HTTP_QUERY_FLAG_COALESCE \
)
#define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK)
#define HTTP_STATUS_CONTINUE 100
#define HTTP_STATUS_SWITCH_PROTOCOLS 101
#define HTTP_STATUS_OK 200
#define HTTP_STATUS_CREATED 201
#define HTTP_STATUS_ACCEPTED 202
#define HTTP_STATUS_PARTIAL 203
#define HTTP_STATUS_NO_CONTENT 204
#define HTTP_STATUS_RESET_CONTENT 205
#define HTTP_STATUS_PARTIAL_CONTENT 206
#define HTTP_STATUS_AMBIGUOUS 300
#define HTTP_STATUS_MOVED 301
#define HTTP_STATUS_REDIRECT 302
#define HTTP_STATUS_REDIRECT_METHOD 303
#define HTTP_STATUS_NOT_MODIFIED 304
#define HTTP_STATUS_USE_PROXY 305
#define HTTP_STATUS_REDIRECT_KEEP_VERB 307
#define HTTP_STATUS_BAD_REQUEST 400
#define HTTP_STATUS_DENIED 401
#define HTTP_STATUS_PAYMENT_REQ 402
#define HTTP_STATUS_FORBIDDEN 403
#define HTTP_STATUS_NOT_FOUND 404
#define HTTP_STATUS_BAD_METHOD 405
#define HTTP_STATUS_NONE_ACCEPTABLE 406
#define HTTP_STATUS_PROXY_AUTH_REQ 407
#define HTTP_STATUS_REQUEST_TIMEOUT 408
#define HTTP_STATUS_CONFLICT 409
#define HTTP_STATUS_GONE 410
#define HTTP_STATUS_LENGTH_REQUIRED 411
#define HTTP_STATUS_PRECOND_FAILED 412
#define HTTP_STATUS_REQUEST_TOO_LARGE 413
#define HTTP_STATUS_URI_TOO_LONG 414
#define HTTP_STATUS_UNSUPPORTED_MEDIA 415
#define HTTP_STATUS_SERVER_ERROR 500
#define HTTP_STATUS_NOT_SUPPORTED 501
#define HTTP_STATUS_BAD_GATEWAY 502
#define HTTP_STATUS_SERVICE_UNAVAIL 503
#define HTTP_STATUS_GATEWAY_TIMEOUT 504
#define HTTP_STATUS_VERSION_NOT_SUP 505
#define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE
#define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP
INTERNETAPI HINTERNET WINAPI HttpOpenRequestA(HINTERNET ,LPCSTR ,LPCSTR ,LPCSTR ,
LPCSTR ,LPCSTR * ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI HttpOpenRequestW(HINTERNET ,LPCWSTR ,LPCWSTR ,LPCWSTR ,
LPCWSTR ,LPCWSTR * ,DWORD ,DWORD_PTR);
#define HttpOpenRequest WINELIB_NAME_AW(HttpOpenRequest)
BOOLAPI HttpAddRequestHeadersA(HINTERNET ,LPCSTR ,DWORD ,DWORD);
BOOLAPI HttpAddRequestHeadersW(HINTERNET ,LPCWSTR ,DWORD ,DWORD);
#define HttpAddRequestHeaders WINELIB_NAME_AW(HttpAddRequestHeaders)
#define HTTP_ADDREQ_INDEX_MASK 0x0000FFFF
#define HTTP_ADDREQ_FLAGS_MASK 0xFFFF0000
#define HTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000
#define HTTP_ADDREQ_FLAG_ADD 0x20000000
#define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000
#define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000
#define HTTP_ADDREQ_FLAG_COALESCE HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
#define HTTP_ADDREQ_FLAG_REPLACE 0x80000000
BOOLAPI HttpSendRequestA(HINTERNET ,LPCSTR ,DWORD ,LPVOID ,DWORD);
BOOLAPI HttpSendRequestW(HINTERNET ,LPCWSTR ,DWORD ,LPVOID ,DWORD);
#define HttpSendRequest WINELIB_NAME_AW(HttpSendRequest)
INTERNETAPI BOOL WINAPI HttpSendRequestExA(HINTERNET ,LPINTERNET_BUFFERSA ,
LPINTERNET_BUFFERSA ,DWORD ,DWORD_PTR);
INTERNETAPI BOOL WINAPI HttpSendRequestExW(HINTERNET ,LPINTERNET_BUFFERSW ,
LPINTERNET_BUFFERSW ,DWORD ,DWORD_PTR);
#define HttpSendRequestEx WINELIB_NAME_AW(HttpSendRequestEx)
#define HSR_ASYNC WININET_API_FLAG_ASYNC
#define HSR_SYNC WININET_API_FLAG_SYNC
#define HSR_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT
#define HSR_INITIATE 0x00000008
#define HSR_DOWNLOAD 0x00000010
#define HSR_CHUNKED 0x00000020
INTERNETAPI BOOL WINAPI HttpEndRequestA(HINTERNET ,LPINTERNET_BUFFERSA ,DWORD ,DWORD_PTR);
INTERNETAPI BOOL WINAPI HttpEndRequestW(HINTERNET ,LPINTERNET_BUFFERSW ,DWORD ,DWORD_PTR);
#define HttpEndRequest WINELIB_NAME_AW(HttpEndRequest)
BOOLAPI HttpQueryInfoA(HINTERNET ,DWORD ,LPVOID ,LPDWORD ,LPDWORD);
BOOLAPI HttpQueryInfoW(HINTERNET ,DWORD ,LPVOID ,LPDWORD ,LPDWORD);
#define HttpQueryInfo WINELIB_NAME_AW(HttpQueryInfo)
BOOLAPI InternetClearAllPerSiteCookieDecisions(VOID);
BOOLAPI InternetEnumPerSiteCookieDecisionA(LPSTR,ULONG *,ULONG *,ULONG);
BOOLAPI InternetEnumPerSiteCookieDecisionW(LPWSTR,ULONG *,ULONG *,ULONG);
#define InternetEnumPerSiteCookieDecision WINELIB_NAME_AW(InternetEnumPerSiteCookieDecision)
#define INTERNET_COOKIE_IS_SECURE 0x00000001
#define INTERNET_COOKIE_IS_SESSION 0x00000002
#define INTERNET_COOKIE_THIRD_PARTY 0x00000010
#define INTERNET_COOKIE_PROMPT_REQUIRED 0x00000020
#define INTERNET_COOKIE_EVALUATE_P3P 0x00000040
#define INTERNET_COOKIE_APPLY_P3P 0x00000080
#define INTERNET_COOKIE_P3P_ENABLED 0x00000100
#define INTERNET_COOKIE_IS_RESTRICTED 0x00000200
#define INTERNET_COOKIE_IE6 0x00000400
#define INTERNET_COOKIE_IS_LEGACY 0x00000800
BOOLAPI InternetGetCookieExA(LPCSTR,LPCSTR,LPSTR,LPDWORD,DWORD,LPVOID);
BOOLAPI InternetGetCookieExW(LPCWSTR,LPCWSTR,LPWSTR,LPDWORD,DWORD,LPVOID);
#define InternetGetCookieEx WINELIB_NAME_AW(InternetGetCookieEx)
DWORD WINAPI InternetSetCookieExA(LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD_PTR);
DWORD WINAPI InternetSetCookieExW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,DWORD_PTR);
#define InternetSetCookieEx WINELIB_NAME_AW(InternetSetCookieEx)
BOOLAPI InternetGetPerSiteCookieDecisionA(LPCSTR,ULONG *);
BOOLAPI InternetGetPerSiteCookieDecisionW(LPCWSTR,ULONG *);
#define InternetGetPerSiteCookieDecision WINELIB_NAME_AW(InternetGetPerSiteCookieDecision)
BOOLAPI InternetSetPerSiteCookieDecisionA(LPCSTR,DWORD);
BOOLAPI InternetSetPerSiteCookieDecisionW(LPCWSTR,DWORD);
#define InternetSetPerSiteCookieDecision WINELIB_NAME_AW(InternetSetPerSiteCookieDecision)
BOOLAPI InternetSetCookieA(LPCSTR ,LPCSTR ,LPCSTR);
BOOLAPI InternetSetCookieW(LPCWSTR ,LPCWSTR ,LPCWSTR);
#define InternetSetCookie WINELIB_NAME_AW(InternetSetCookie)
BOOLAPI InternetGetCookieA(LPCSTR ,LPCSTR ,LPSTR ,LPDWORD);
BOOLAPI InternetGetCookieW(LPCWSTR ,LPCWSTR ,LPWSTR ,LPDWORD);
#define InternetGetCookie WINELIB_NAME_AW(InternetGetCookie)
INTERNETAPI DWORD WINAPI InternetAttemptConnect(DWORD);
BOOLAPI InternetCheckConnectionA(LPCSTR ,DWORD ,DWORD);
BOOLAPI InternetCheckConnectionW(LPCWSTR ,DWORD ,DWORD);
#define InternetCheckConnection WINELIB_NAME_AW(InternetCheckConnection)
#define FLAG_ICC_FORCE_CONNECTION 0x00000001
#define FLAGS_ERROR_UI_FILTER_FOR_ERRORS 0x01
#define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS 0x02
#define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA 0x04
#define FLAGS_ERROR_UI_FLAGS_NO_UI 0x08
#define FLAGS_ERROR_UI_SERIALIZE_DIALOGS 0x10
DWORD InternetAuthNotifyCallback ( DWORD_PTR ,DWORD ,LPVOID );
typedef DWORD (CALLBACK *PFN_AUTH_NOTIFY) (DWORD_PTR,DWORD,LPVOID);
typedef struct
{
DWORD cbStruct;
DWORD dwOptions;
PFN_AUTH_NOTIFY pfnNotify;
DWORD_PTR dwContext;
}
INTERNET_AUTH_NOTIFY_DATA;
INTERNETAPI DWORD WINAPI InternetErrorDlg(HWND ,HINTERNET ,DWORD ,DWORD ,LPVOID *);
INTERNETAPI DWORD WINAPI InternetConfirmZoneCrossingA(HWND ,LPSTR ,LPSTR ,BOOL);
INTERNETAPI DWORD WINAPI InternetConfirmZoneCrossingW(HWND ,LPWSTR ,LPWSTR ,BOOL);
#define InternetConfirmZoneCrossing WINELIB_NAME_AW(InternetConfirmZoneCrossing)
#define PRIVACY_TEMPLATE_NO_COOKIES 0
#define PRIVACY_TEMPLATE_HIGH 1
#define PRIVACY_TEMPLATE_MEDIUM_HIGH 2
#define PRIVACY_TEMPLATE_MEDIUM 3
#define PRIVACY_TEMPLATE_MEDIUM_LOW 4
#define PRIVACY_TEMPLATE_LOW 5
#define PRIVACY_TEMPLATE_CUSTOM 100
#define PRIVACY_TEMPLATE_ADVANCED 101
#define PRIVACY_TEMPLATE_MAX PRIVACY_TEMPLATE_LOW
#define PRIVACY_TYPE_FIRST_PARTY 0
#define PRIVACY_TYPE_THIRD_PARTY 1
INTERNETAPI DWORD WINAPI PrivacySetZonePreferenceW(DWORD,DWORD,DWORD,LPCWSTR);
INTERNETAPI DWORD WINAPI PrivacyGetZonePreferenceW(DWORD,DWORD,LPDWORD,LPWSTR,LPDWORD);
#define INTERNET_ERROR_BASE 12000
#define ERROR_INTERNET_OUT_OF_HANDLES (INTERNET_ERROR_BASE + 1)
#define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE + 2)
#define ERROR_INTERNET_EXTENDED_ERROR (INTERNET_ERROR_BASE + 3)
#define ERROR_INTERNET_INTERNAL_ERROR (INTERNET_ERROR_BASE + 4)
#define ERROR_INTERNET_INVALID_URL (INTERNET_ERROR_BASE + 5)
#define ERROR_INTERNET_UNRECOGNIZED_SCHEME (INTERNET_ERROR_BASE + 6)
#define ERROR_INTERNET_NAME_NOT_RESOLVED (INTERNET_ERROR_BASE + 7)
#define ERROR_INTERNET_PROTOCOL_NOT_FOUND (INTERNET_ERROR_BASE + 8)
#define ERROR_INTERNET_INVALID_OPTION (INTERNET_ERROR_BASE + 9)
#define ERROR_INTERNET_BAD_OPTION_LENGTH (INTERNET_ERROR_BASE + 10)
#define ERROR_INTERNET_OPTION_NOT_SETTABLE (INTERNET_ERROR_BASE + 11)
#define ERROR_INTERNET_SHUTDOWN (INTERNET_ERROR_BASE + 12)
#define ERROR_INTERNET_INCORRECT_USER_NAME (INTERNET_ERROR_BASE + 13)
#define ERROR_INTERNET_INCORRECT_PASSWORD (INTERNET_ERROR_BASE + 14)
#define ERROR_INTERNET_LOGIN_FAILURE (INTERNET_ERROR_BASE + 15)
#define ERROR_INTERNET_INVALID_OPERATION (INTERNET_ERROR_BASE + 16)
#define ERROR_INTERNET_OPERATION_CANCELLED (INTERNET_ERROR_BASE + 17)
#define ERROR_INTERNET_INCORRECT_HANDLE_TYPE (INTERNET_ERROR_BASE + 18)
#define ERROR_INTERNET_INCORRECT_HANDLE_STATE (INTERNET_ERROR_BASE + 19)
#define ERROR_INTERNET_NOT_PROXY_REQUEST (INTERNET_ERROR_BASE + 20)
#define ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND (INTERNET_ERROR_BASE + 21)
#define ERROR_INTERNET_BAD_REGISTRY_PARAMETER (INTERNET_ERROR_BASE + 22)
#define ERROR_INTERNET_NO_DIRECT_ACCESS (INTERNET_ERROR_BASE + 23)
#define ERROR_INTERNET_NO_CONTEXT (INTERNET_ERROR_BASE + 24)
#define ERROR_INTERNET_NO_CALLBACK (INTERNET_ERROR_BASE + 25)
#define ERROR_INTERNET_REQUEST_PENDING (INTERNET_ERROR_BASE + 26)
#define ERROR_INTERNET_INCORRECT_FORMAT (INTERNET_ERROR_BASE + 27)
#define ERROR_INTERNET_ITEM_NOT_FOUND (INTERNET_ERROR_BASE + 28)
#define ERROR_INTERNET_CANNOT_CONNECT (INTERNET_ERROR_BASE + 29)
#define ERROR_INTERNET_CONNECTION_ABORTED (INTERNET_ERROR_BASE + 30)
#define ERROR_INTERNET_CONNECTION_RESET (INTERNET_ERROR_BASE + 31)
#define ERROR_INTERNET_FORCE_RETRY (INTERNET_ERROR_BASE + 32)
#define ERROR_INTERNET_INVALID_PROXY_REQUEST (INTERNET_ERROR_BASE + 33)
#define ERROR_INTERNET_NEED_UI (INTERNET_ERROR_BASE + 34)
#define ERROR_INTERNET_HANDLE_EXISTS (INTERNET_ERROR_BASE + 36)
#define ERROR_INTERNET_SEC_CERT_DATE_INVALID (INTERNET_ERROR_BASE + 37)
#define ERROR_INTERNET_SEC_CERT_CN_INVALID (INTERNET_ERROR_BASE + 38)
#define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR (INTERNET_ERROR_BASE + 39)
#define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR (INTERNET_ERROR_BASE + 40)
#define ERROR_INTERNET_MIXED_SECURITY (INTERNET_ERROR_BASE + 41)
#define ERROR_INTERNET_CHG_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 42)
#define ERROR_INTERNET_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 43)
#define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED (INTERNET_ERROR_BASE + 44)
#define ERROR_INTERNET_INVALID_CA (INTERNET_ERROR_BASE + 45)
#define ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP (INTERNET_ERROR_BASE + 46)
#define ERROR_INTERNET_ASYNC_THREAD_FAILED (INTERNET_ERROR_BASE + 47)
#define ERROR_INTERNET_REDIRECT_SCHEME_CHANGE (INTERNET_ERROR_BASE + 48)
#define ERROR_INTERNET_DIALOG_PENDING (INTERNET_ERROR_BASE + 49)
#define ERROR_INTERNET_RETRY_DIALOG (INTERNET_ERROR_BASE + 50)
#define ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR (INTERNET_ERROR_BASE + 52)
#define ERROR_INTERNET_INSERT_CDROM (INTERNET_ERROR_BASE + 53)
#define ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED (INTERNET_ERROR_BASE + 54)
#define ERROR_INTERNET_SEC_CERT_ERRORS (INTERNET_ERROR_BASE + 55)
#define ERROR_INTERNET_SEC_CERT_NO_REV (INTERNET_ERROR_BASE + 56)
#define ERROR_INTERNET_SEC_CERT_REV_FAILED (INTERNET_ERROR_BASE + 57)
#define ERROR_FTP_TRANSFER_IN_PROGRESS (INTERNET_ERROR_BASE + 110)
#define ERROR_FTP_DROPPED (INTERNET_ERROR_BASE + 111)
#define ERROR_FTP_NO_PASSIVE_MODE (INTERNET_ERROR_BASE + 112)
#define ERROR_GOPHER_PROTOCOL_ERROR (INTERNET_ERROR_BASE + 130)
#define ERROR_GOPHER_NOT_FILE (INTERNET_ERROR_BASE + 131)
#define ERROR_GOPHER_DATA_ERROR (INTERNET_ERROR_BASE + 132)
#define ERROR_GOPHER_END_OF_DATA (INTERNET_ERROR_BASE + 133)
#define ERROR_GOPHER_INVALID_LOCATOR (INTERNET_ERROR_BASE + 134)
#define ERROR_GOPHER_INCORRECT_LOCATOR_TYPE (INTERNET_ERROR_BASE + 135)
#define ERROR_GOPHER_NOT_GOPHER_PLUS (INTERNET_ERROR_BASE + 136)
#define ERROR_GOPHER_ATTRIBUTE_NOT_FOUND (INTERNET_ERROR_BASE + 137)
#define ERROR_GOPHER_UNKNOWN_LOCATOR (INTERNET_ERROR_BASE + 138)
#define ERROR_HTTP_HEADER_NOT_FOUND (INTERNET_ERROR_BASE + 150)
#define ERROR_HTTP_DOWNLEVEL_SERVER (INTERNET_ERROR_BASE + 151)
#define ERROR_HTTP_INVALID_SERVER_RESPONSE (INTERNET_ERROR_BASE + 152)
#define ERROR_HTTP_INVALID_HEADER (INTERNET_ERROR_BASE + 153)
#define ERROR_HTTP_INVALID_QUERY_REQUEST (INTERNET_ERROR_BASE + 154)
#define ERROR_HTTP_HEADER_ALREADY_EXISTS (INTERNET_ERROR_BASE + 155)
#define ERROR_HTTP_REDIRECT_FAILED (INTERNET_ERROR_BASE + 156)
#define ERROR_HTTP_NOT_REDIRECTED (INTERNET_ERROR_BASE + 160)
#define ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 161)
#define ERROR_HTTP_COOKIE_DECLINED (INTERNET_ERROR_BASE + 162)
#define ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 168)
#define ERROR_INTERNET_SECURITY_CHANNEL_ERROR (INTERNET_ERROR_BASE + 157)
#define ERROR_INTERNET_UNABLE_TO_CACHE_FILE (INTERNET_ERROR_BASE + 158)
#define ERROR_INTERNET_TCPIP_NOT_INSTALLED (INTERNET_ERROR_BASE + 159)
#define ERROR_INTERNET_DISCONNECTED (INTERNET_ERROR_BASE + 163)
#define ERROR_INTERNET_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 164)
#define ERROR_INTERNET_PROXY_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 165)
#define ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT (INTERNET_ERROR_BASE + 166)
#define ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT (INTERNET_ERROR_BASE + 167)
#define ERROR_INTERNET_SEC_INVALID_CERT (INTERNET_ERROR_BASE + 169)
#define ERROR_INTERNET_SEC_CERT_REVOKED (INTERNET_ERROR_BASE + 170)
#define ERROR_INTERNET_FAILED_DUETOSECURITYCHECK (INTERNET_ERROR_BASE + 171)
#define ERROR_INTERNET_NOT_INITIALIZED (INTERNET_ERROR_BASE + 172)
#define ERROR_INTERNET_NEED_MSN_SSPI_PKG (INTERNET_ERROR_BASE + 173)
#define ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY (INTERNET_ERROR_BASE + 174)
#define ERROR_INTERNET_DECODING_FAILED (INTERNET_ERROR_BASE + 175)
#define INTERNET_ERROR_LAST ERROR_INTERNET_DECODING_FAILED
#define NORMAL_CACHE_ENTRY 0x00000001
#define STICKY_CACHE_ENTRY 0x00000004
#define EDITED_CACHE_ENTRY 0x00000008
#define COOKIE_CACHE_ENTRY 0x00100000
#define URLHISTORY_CACHE_ENTRY 0x00200000
#define TRACK_OFFLINE_CACHE_ENTRY 0x00000010
#define TRACK_ONLINE_CACHE_ENTRY 0x00000020
#define SPARSE_CACHE_ENTRY 0x00010000
#define URLCACHE_FIND_DEFAULT_FILTER NORMAL_CACHE_ENTRY \
| COOKIE_CACHE_ENTRY \
| URLHISTORY_CACHE_ENTRY \
| TRACK_OFFLINE_CACHE_ENTRY \
| TRACK_ONLINE_CACHE_ENTRY \
| STICKY_CACHE_ENTRY
typedef struct _INTERNET_CACHE_ENTRY_INFOA {
DWORD dwStructSize;
LPSTR lpszSourceUrlName;
LPSTR lpszLocalFileName;
DWORD CacheEntryType;
DWORD dwUseCount;
DWORD dwHitRate;
DWORD dwSizeLow;
DWORD dwSizeHigh;
FILETIME LastModifiedTime;
FILETIME ExpireTime;
FILETIME LastAccessTime;
FILETIME LastSyncTime;
LPBYTE lpHeaderInfo;
DWORD dwHeaderInfoSize;
LPSTR lpszFileExtension;
union {
DWORD dwReserved;
DWORD dwExemptDelta;
} DUMMYUNIONNAME;
} INTERNET_CACHE_ENTRY_INFOA,* LPINTERNET_CACHE_ENTRY_INFOA;
typedef struct _INTERNET_CACHE_ENTRY_INFOW {
DWORD dwStructSize;
LPWSTR lpszSourceUrlName;
LPWSTR lpszLocalFileName;
DWORD CacheEntryType;
DWORD dwUseCount;
DWORD dwHitRate;
DWORD dwSizeLow;
DWORD dwSizeHigh;
FILETIME LastModifiedTime;
FILETIME ExpireTime;
FILETIME LastAccessTime;
FILETIME LastSyncTime;
LPBYTE lpHeaderInfo;
DWORD dwHeaderInfoSize;
LPWSTR lpszFileExtension;
union {
DWORD dwReserved;
DWORD dwExemptDelta;
} DUMMYUNIONNAME;
} INTERNET_CACHE_ENTRY_INFOW,* LPINTERNET_CACHE_ENTRY_INFOW;
DECL_WINELIB_TYPE_AW(INTERNET_CACHE_ENTRY_INFO)
DECL_WINELIB_TYPE_AW(LPINTERNET_CACHE_ENTRY_INFO)
typedef struct _INTERNET_CACHE_TIMESTAMPS
{
FILETIME ftExpires;
FILETIME ftLastModified;
} INTERNET_CACHE_TIMESTAMPS, *LPINTERNET_CACHE_TIMESTAMPS;
BOOLAPI CreateUrlCacheEntryA(LPCSTR ,DWORD ,LPCSTR ,LPSTR ,DWORD);
BOOLAPI CreateUrlCacheEntryW(LPCWSTR ,DWORD ,LPCWSTR ,LPWSTR ,DWORD);
#define CreateUrlCacheEntry WINELIB_NAME_AW(CreateUrlCacheEntry)
BOOLAPI CommitUrlCacheEntryA(LPCSTR,LPCSTR,FILETIME,FILETIME,DWORD,LPBYTE,DWORD,LPCSTR,LPCSTR);
BOOLAPI CommitUrlCacheEntryW(LPCWSTR,LPCWSTR,FILETIME,FILETIME,DWORD,LPWSTR,DWORD,LPCWSTR,LPCWSTR);
#define CommitUrlCacheEntry WINELIB_NAME_AW(CommitUrlCacheEntry)
BOOLAPI ResumeSuspendedDownload(HINTERNET, DWORD);
BOOLAPI RetrieveUrlCacheEntryFileA(LPCSTR ,LPINTERNET_CACHE_ENTRY_INFOA ,LPDWORD ,DWORD);
BOOLAPI RetrieveUrlCacheEntryFileW(LPCWSTR ,LPINTERNET_CACHE_ENTRY_INFOW ,LPDWORD ,DWORD);
#define RetrieveUrlCacheEntryFile WINELIB_NAME_AW(RetrieveUrlCacheEntryFile)
BOOLAPI UnlockUrlCacheEntryFileA(LPCSTR ,DWORD);
BOOLAPI UnlockUrlCacheEntryFileW(LPCWSTR ,DWORD);
#define UnlockUrlCacheEntryFile WINELIB_NAME_AW(UnlockUrlCacheEntryFile)
INTERNETAPI HANDLE WINAPI RetrieveUrlCacheEntryStreamA(LPCSTR ,
LPINTERNET_CACHE_ENTRY_INFOA , LPDWORD ,BOOL ,DWORD);
INTERNETAPI HANDLE WINAPI RetrieveUrlCacheEntryStreamW(LPCWSTR ,LPINTERNET_CACHE_ENTRY_INFOW ,
LPDWORD ,BOOL ,DWORD);
#define RetrieveUrlCacheEntryStream WINELIB_NAME_AW(RetrieveUrlCacheEntryStream)
BOOLAPI ReadUrlCacheEntryStream( HANDLE ,DWORD ,LPVOID ,LPDWORD ,DWORD );
BOOLAPI UnlockUrlCacheEntryStream( HANDLE ,DWORD );
BOOLAPI GetUrlCacheEntryInfoA(LPCSTR ,LPINTERNET_CACHE_ENTRY_INFOA ,LPDWORD);
BOOLAPI GetUrlCacheEntryInfoW(LPCWSTR ,LPINTERNET_CACHE_ENTRY_INFOW ,LPDWORD);
#define GetUrlCacheEntryInfo WINELIB_NAME_AW(GetUrlCacheEntryInfo)
BOOLAPI GetUrlCacheEntryInfoExA(
LPCSTR ,LPINTERNET_CACHE_ENTRY_INFOA ,LPDWORD ,LPSTR ,LPDWORD ,LPVOID ,DWORD);
BOOLAPI GetUrlCacheEntryInfoExW(
LPCWSTR ,LPINTERNET_CACHE_ENTRY_INFOW ,LPDWORD ,LPWSTR ,LPDWORD ,LPVOID ,DWORD);
#define GetUrlCacheEntryInfoEx WINELIB_NAME_AW(GetUrlCacheEntryInfoEx)
#define CACHE_ENTRY_ATTRIBUTE_FC 0x00000004
#define CACHE_ENTRY_HITRATE_FC 0x00000010
#define CACHE_ENTRY_MODTIME_FC 0x00000040
#define CACHE_ENTRY_EXPTIME_FC 0x00000080
#define CACHE_ENTRY_ACCTIME_FC 0x00000100
#define CACHE_ENTRY_SYNCTIME_FC 0x00000200
#define CACHE_ENTRY_HEADERINFO_FC 0x00000400
#define CACHE_ENTRY_EXEMPT_DELTA_FC 0x00000800
BOOLAPI SetUrlCacheEntryInfoA(LPCSTR ,LPINTERNET_CACHE_ENTRY_INFOA ,DWORD);
BOOLAPI SetUrlCacheEntryInfoW(LPCWSTR ,LPINTERNET_CACHE_ENTRY_INFOW ,DWORD);
#define SetUrlCacheEntryInfo WINELIB_NAME_AW(SetUrlCacheEntryInfo)
typedef LONGLONG GROUPID;
INTERNETAPI GROUPID WINAPI CreateUrlCacheGroup(DWORD,LPVOID);
BOOLAPI DeleteUrlCacheGroup(GROUPID ,DWORD ,LPVOID);
INTERNETAPI HANDLE WINAPI FindFirstUrlCacheGroup(DWORD,DWORD,LPVOID,DWORD,GROUPID*,LPVOID);
BOOLAPI FindNextUrlCacheGroup(HANDLE,GROUPID*,LPVOID);
BOOLAPI GetUrlCacheGroupAttributeA(GROUPID,DWORD,DWORD,LPINTERNET_CACHE_GROUP_INFOA,LPDWORD,LPVOID);
BOOLAPI GetUrlCacheGroupAttributeW(GROUPID,DWORD,DWORD,LPINTERNET_CACHE_GROUP_INFOW,LPDWORD,LPVOID);
#define GetUrlCacheGroupAttribute WINELIB_NAME_AW(GetUrlCacheGroupAttribute)
#define INTERNET_CACHE_GROUP_ADD 0
#define INTERNET_CACHE_GROUP_REMOVE 1
BOOLAPI SetUrlCacheEntryGroupA(LPCSTR,DWORD,GROUPID,LPBYTE,DWORD,LPVOID);
BOOLAPI SetUrlCacheEntryGroupW(LPCWSTR,DWORD,GROUPID,LPBYTE,DWORD,LPVOID);
#define SetUrlCacheEntryGroup WINELIB_NAME_AW(SetUrlCacheEntryGroup)
BOOLAPI SetUrlCacheGroupAttributeA(GROUPID,DWORD,DWORD,LPINTERNET_CACHE_GROUP_INFOA,LPVOID);
BOOLAPI SetUrlCacheGroupAttributeW(GROUPID,DWORD,DWORD,LPINTERNET_CACHE_GROUP_INFOW,LPVOID);
#define SetUrlCacheGroupAttribute WINELIB_NAME_AW(SetUrlCacheGroupAttribute)
INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryExA(
LPCSTR ,DWORD ,DWORD ,GROUPID ,LPINTERNET_CACHE_ENTRY_INFOA ,LPDWORD ,LPVOID ,LPDWORD ,LPVOID );
INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryExW(
LPCWSTR ,DWORD ,DWORD ,GROUPID ,LPINTERNET_CACHE_ENTRY_INFOW ,LPDWORD ,LPVOID ,LPDWORD ,LPVOID );
#define FindFirstUrlCacheEntryEx WINELIB_NAME_AW(FindFirstUrlCacheEntryEx)
BOOLAPI FindNextUrlCacheEntryExA(HANDLE ,LPINTERNET_CACHE_ENTRY_INFOA ,LPDWORD ,LPVOID ,LPDWORD ,LPVOID);
BOOLAPI FindNextUrlCacheEntryExW(HANDLE ,LPINTERNET_CACHE_ENTRY_INFOW ,LPDWORD ,LPVOID ,LPDWORD ,LPVOID);
#define FindNextUrlCacheEntryEx WINELIB_NAME_AW(FindNextUrlCacheEntryEx)
INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryA(LPCSTR ,LPINTERNET_CACHE_ENTRY_INFOA ,LPDWORD);
INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryW(LPCWSTR ,LPINTERNET_CACHE_ENTRY_INFOW ,LPDWORD);
#define FindFirstUrlCacheEntry WINELIB_NAME_AW(FindFirstUrlCacheEntry)
BOOLAPI FindNextUrlCacheEntryA(HANDLE ,LPINTERNET_CACHE_ENTRY_INFOA ,LPDWORD);
BOOLAPI FindNextUrlCacheEntryW(HANDLE ,LPINTERNET_CACHE_ENTRY_INFOW ,LPDWORD);
#define FindNextUrlCacheEntry WINELIB_NAME_AW(FindNextUrlCacheEntry)
BOOLAPI FindCloseUrlCache(HANDLE);
BOOLAPI DeleteUrlCacheEntryA(LPCSTR);
BOOLAPI DeleteUrlCacheEntryW(LPCWSTR);
#define DeleteUrlCacheEntry WINELIB_NAME_AW(DeleteUrlCacheEntry)
/* FCS_ flags and FreeUrlCacheSpace are no longer documented */
#define FCS_PERCENT_CACHE_SPACE 0 /* guessed value */
#define FCS_PERCENT_DISK_SPACE 1 /* guessed value */
#define FCS_ABSOLUTE_SIZE 2 /* guessed value */
BOOLAPI FreeUrlCacheSpaceA(LPCSTR ,DWORD ,DWORD);
BOOLAPI FreeUrlCacheSpaceW(LPCWSTR ,DWORD ,DWORD);
#define FreeUrlCacheSpace WINELIB_NAME_AW(FreeUrlCacheSpace)
INTERNETAPI DWORD WINAPI InternetDialA(HWND ,LPSTR ,DWORD ,DWORD_PTR* ,DWORD);
INTERNETAPI DWORD WINAPI InternetDialW(HWND ,LPWSTR ,DWORD ,DWORD_PTR* ,DWORD);
#define InternetDial WINELIB_NAME_AW(InternetDial)
#define INTERNET_DIAL_UNATTENDED 0x8000
INTERNETAPI DWORD WINAPI InternetHangUp(DWORD_PTR ,DWORD);
BOOLAPI CreateMD5SSOHash(PWSTR,PWSTR,PWSTR,PBYTE);
#define INTERENT_GOONLINE_REFRESH 0x00000001
#define INTERENT_GOONLINE_MASK 0x00000001
INTERNETAPI BOOL WINAPI InternetGoOnlineA(LPSTR ,HWND ,DWORD);
INTERNETAPI BOOL WINAPI InternetGoOnlineW(LPWSTR ,HWND ,DWORD);
#define InternetGoOnline WINELIB_NAME_AW(InternetGoOnline)
INTERNETAPI BOOL WINAPI InternetAutodial(DWORD,HWND);
#define INTERNET_AUTODIAL_FORCE_ONLINE 1
#define INTERNET_AUTODIAL_FORCE_UNATTENDED 2
#define INTERNET_AUTODIAL_FAILIFSECURITYCHECK 4
#define INTERNET_AUTODIAL_FLAGS_MASK (INTERNET_AUTODIAL_FORCE_ONLINE | INTERNET_AUTODIAL_FORCE_UNATTENDED | INTERNET_AUTODIAL_FAILIFSECURITYCHECK)
INTERNETAPI BOOL WINAPI InternetAutodialHangup(DWORD);
INTERNETAPI BOOL WINAPI InternetGetConnectedState(LPDWORD ,DWORD);
#define INTERNET_CONNECTION_MODEM 1
#define INTERNET_CONNECTION_LAN 2
#define INTERNET_CONNECTION_PROXY 4
#define INTERNET_CONNECTION_MODEM_BUSY 8
typedef DWORD (CALLBACK *PFN_DIAL_HANDLER) (HWND,LPCSTR,DWORD,LPDWORD);
#define INTERNET_CUSTOMDIAL_CONNECT 0
#define INTERNET_CUSTOMDIAL_UNATTENDED 1
#define INTERNET_CUSTOMDIAL_DISCONNECT 2
#define INTERNET_CUSTOMDIAL_SHOWOFFLINE 4
#define INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED 1
#define INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE 2
#define INTERNET_CUSTOMDIAL_CAN_HANGUP 4
INTERNETAPI BOOL WINAPI InternetSetDialStateA(LPCSTR ,DWORD ,DWORD);
INTERNETAPI BOOL WINAPI InternetSetDialStateW(LPCWSTR ,DWORD ,DWORD);
#define InternetSetDialState WINELIB_NAME_AW(InternetSetDialState)
#define INTERNET_DIALSTATE_DISCONNECTED 1
BOOL WINAPI InternetGetConnectedStateExA(LPDWORD, LPSTR, DWORD, DWORD);
BOOL WINAPI InternetGetConnectedStateExW(LPDWORD, LPWSTR, DWORD, DWORD);
#define InternetGetConnectedStateEx WINELIB_NAME_AW(InternetGetConnectedStateEx)
BOOL WINAPI InternetInitializeAutoProxyDll(DWORD);
BOOL WINAPI DetectAutoProxyUrl(LPSTR, DWORD, DWORD);
#ifdef __cplusplus
}
#endif
#endif
|
jfoote/verysleepy
|
src/dbghelpw/include/wininet.h
|
C
|
gpl-2.0
| 76,854 |
/* Core Hardware driver for Hx4700 (ASIC3, EGPIOs)
*
* Copyright (c) 2005 SDG Systems, LLC
*
* 2005-03-29 Todd Blumer Converted basic structure to support hx4700
* 2005-04-30 Todd Blumer Add IRDA code from H2200
*/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/dpm.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa-pm_ll.h>
#include <asm/arch/hx4700-gpio.h>
#include <asm/arch/hx4700-asic.h>
#include <asm/arch/hx4700-core.h>
#include <linux/mfd/asic3_base.h>
#include <asm/hardware/ipaq-asic3.h>
#define EGPIO_OFFSET 0
#define EGPIO_BASE (PXA_CS5_PHYS+EGPIO_OFFSET)
volatile u_int16_t *egpios;
u_int16_t egpio_reg;
static int htc_bootloader = 0; /* Is the stock HTC bootloader installed? */
static u32 save[4];
static u32 save2[13];
/*
* may make sense to put egpios elsewhere, but they're here now
* since they share some of the same address space with the TI WLAN
*
* EGPIO register is write-only
*/
void
hx4700_egpio_enable( u_int16_t bits )
{
unsigned long flags;
local_irq_save(flags);
egpio_reg |= bits;
*egpios = egpio_reg;
local_irq_restore(flags);
}
EXPORT_SYMBOL(hx4700_egpio_enable);
void
hx4700_egpio_disable( u_int16_t bits )
{
unsigned long flags;
local_irq_save(flags);
egpio_reg &= ~bits;
*egpios = egpio_reg;
local_irq_restore(flags);
}
EXPORT_SYMBOL(hx4700_egpio_disable);
#ifdef CONFIG_PM
static int hx4700_suspend(struct platform_device *pdev, pm_message_t state)
{
/* Turn off external clocks here, because hx4700_power and asic3_mmc
* scared to do so to not hurt each other. (-5 mA) */
#if 0
asic3_set_clock_cdex(&hx4700_asic3.dev,
CLOCK_CDEX_EX0 | CLOCK_CDEX_EX1, 0 | 0);
#endif
/* 0x20c2 is HTC clock value
* CLOCK_CDEX_SOURCE 2
* CLOCK_CDEX_SPI 0
* CLOCK_CDEX_OWM 0
*
* CLOCK_CDEX_PWM0 0
* CLOCK_CDEX_PWM1 0
* CLOCK_CDEX_LED0 1
* CLOCK_CDEX_LED1 1
*
* CLOCK_CDEX_LED2 0
* CLOCK_CDEX_SD_HOST 0
* CLOCK_CDEX_SD_BUS 0
* CLOCK_CDEX_SMBUS 0
*
* CLOCK_CDEX_CONTROL_CX 0
* CLOCK_CDEX_EX0 1
* CLOCK_CDEX_EX1 0
* */
asic3_set_clock_cdex(&hx4700_asic3.dev, 0xffff, 0x21c2);
*egpios = 0; /* turn off all egpio power */
/*
* Note that WEP1 wake up event is used by bootldr to set the
* LEDS when power is applied/removed for charging.
*/
PWER = PWER_RTC | PWER_GPIO0 | PWER_GPIO1 | PWER_GPIO12 | PWER_WEP1; // rtc + power + reset + asic3 + wep1
PFER = PWER_GPIO1; // Falling Edge Detect
PRER = PWER_GPIO0 | PWER_GPIO12; // Rising Edge Detect
PGSR0 = 0x080DC01C;
PGSR1 = 0x34CF0002;
PGSR2 = 0x0123C18C;
/* PGSR3 = 0x00104202; */
PGSR3 = 0x00100202;
/* These next checks are specifically for charging. We want to enable
* it if it is already enabled */
/* Check for charge enable, GPIO 72 */
if(GPLR2 & (1 << 8)) {
/* Set it */
PGSR2 |= (1U << 8);
} else {
/* Clear it */
PGSR2 &= ~(1U << 8);
}
/* Check for USB_CHARGE_RATE, GPIO 96 */
if(GPLR3 & (1 << 0)) {
/* Set it */
PGSR3 |= (1U << 0);
} else {
/* Clear it */
PGSR3 &= ~(1U << 0);
}
PCFR = PCFR_GPROD|PCFR_DC_EN|PCFR_GPR_EN|PCFR_OPDE
|PCFR_FP|PCFR_PI2CEN; /* was 0x1091; */
/* The 2<<2 below turns on the Power Island state preservation
* and counters. This allows us to wake up bootldr after a
* period of time, and it can set the LEDs correctly based on
* the power state. The bootldr turns it off when it's
* charged.
*/
PSLR=0xc8000000 | (2 << 2);
/*
* If we're using bootldr and not the stock HTC bootloader,
* we want to wake up periodically to see if the charge is full while
* it is suspended. We do this with the OS timer 4 in the pxa270.
*/
if (!htc_bootloader) {
OMCR4 = 0x4b; /* Periodic, self-resetting, 1-second timer */
OSMR4 = 5; /* Wake up bootldr after x seconds so it can
figure out what to do with the LEDs. */
OIER |= 0x10; /* Enable interrupt source for Timer 4 */
OSCR4 = 0; /* This starts the timer */
}
asic3_set_extcf_select(&hx4700_asic3.dev, ASIC3_EXTCF_OWM_EN, 0);
return 0;
}
static int hx4700_resume(struct platform_device *pdev)
{
hx4700_egpio_enable(0);
return 0;
}
#else
# define hx4700_suspend NULL
# define hx4700_resume NULL
#endif
static void
hx4700_pxa_ll_pm_suspend(unsigned long resume_addr)
{
int i;
u32 csum, tmp, *p;
/* Save the 13 words at 0xa0038000. */
for (p = phys_to_virt(0xa0038000), i = 0; i < 13; i++)
save2[i] = p[i];
/* Save the first four words at 0xa0000000. */
for (p = phys_to_virt(0xa0000000), i = 0; i < 4; i++)
save[i] = p[i];
/* Set the first four words at 0xa0000000 to:
* resume address; MMU control; TLB base addr; domain id */
p[0] = resume_addr;
asm( "mrc\tp15, 0, %0, c1, c0, 0" : "=r" (tmp) );
p[1] = tmp & ~(0x3987); /* mmu off */
asm( "mrc\tp15, 0, %0, c2, c0, 0" : "=r" (tmp) );
p[2] = tmp; /* Shouldn't matter, since MMU will be off. */
asm( "mrc\tp15, 0, %0, c3, c0, 0" : "=r" (tmp) );
p[3] = tmp; /* Shouldn't matter, since MMU will be off. */
/* Set PSPR to the checksum the HTC bootloader wants to see. */
for (csum = 0, i = 0; i < 52; i++) {
tmp = p[i] & 0x1;
tmp = tmp << 31;
tmp |= tmp >> 1;
csum += tmp;
}
PSPR = csum;
}
static void
hx4700_pxa_ll_pm_resume(void)
{
int i;
u32 *p;
/* Restore the first four words at 0xa0000000. */
for (p = phys_to_virt(0xa0000000), i = 0; i < 4; i++)
p[i] = save[i];
/* Restore the 13 words at 0xa0038000. */
for (p = phys_to_virt(0xa0038000), i = 0; i < 13; i++)
p[i] = save2[i];
/* XXX Do we need to flush the cache? */
}
struct pxa_ll_pm_ops hx4700_ll_pm_ops = {
.suspend = hx4700_pxa_ll_pm_suspend,
.resume = hx4700_pxa_ll_pm_resume,
};
/* automatic backlight brightness control */
static ssize_t auto_brightness_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", GET_HX4700_GPIO(AUTO_SENSE) ? 1 : 0);
}
static ssize_t auto_brightness_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
int auto_brightness = simple_strtoul(buf, NULL, 10) ? 1 : 0;
SET_HX4700_GPIO(AUTO_SENSE, auto_brightness);
return count;
}
static DEVICE_ATTR(auto_brightness, 0644, auto_brightness_show,
auto_brightness_store);
static int
hx4700_core_probe( struct platform_device *pdev )
{
u32 *bootldr;
int i;
int ret = 0;
printk( KERN_NOTICE "hx4700 Core Hardware Driver\n" );
egpios = (volatile u_int16_t *)ioremap_nocache( EGPIO_BASE, sizeof *egpios );
if (!egpios)
return -ENODEV;
/* Is the stock HTC bootloader installed? */
bootldr = (u32 *) ioremap(PXA_CS0_PHYS, 1024 * 1024);
/* Windows Mobile 2003 Second Edition v. 4.21.1088 Build 15045.2.6.0
* ROM date 4/13/05, rev 1.10.08 ENG, bootloader 1.01,
* XIP v4.21.15045.0 */
i = 0x000414dc / 4;
if (bootldr[i] == 0xe59f1360 && /* ldr r1, [pc, #864] ; power base */
bootldr[i+1] == 0xe5914008 && /* ldr r4, [r1, #8] ; PSPR */
bootldr[i+2] == 0xe1320004) { /* teq r2, r4 */
printk("Stock HTC WM2003 bootloader detected\n");
htc_bootloader = 1;
pxa_pm_set_ll_ops(&hx4700_ll_pm_ops);
}
/* XXX Which version of WM2005 is this? */
i = 0x00041d68 / 4;
if (bootldr[i] == 0xe59f1354 && /* ldr r1, [pc, #852] ; power base */
bootldr[i+1] == 0xe5914008 && /* ldr r4, [r1, #8] ; PSPR */
bootldr[i+2] == 0xe1320004) { /* teq r2, r4 */
printk("Stock HTC WM2005 bootloader detected\n");
htc_bootloader = 1;
pxa_pm_set_ll_ops(&hx4700_ll_pm_ops);
}
/* WM 5.0 OS 5.1.70 Build 14406.1.1.1 */
i = 0x00041340 / 4;
if (bootldr[i] == 0xe59f1354 && /* ldr r1, [pc, #852] ; power base */
bootldr[i+1] == 0xe5914008 && /* ldr r4, [r1, #8] ; PSPR */
bootldr[i+2] == 0xe1320004) { /* teq r2, r4 */
printk("Stock HTC WM2005 bootloader detected\n");
htc_bootloader = 1;
pxa_pm_set_ll_ops(&hx4700_ll_pm_ops);
}
iounmap(bootldr);
ret = device_create_file(&pdev->dev, &dev_attr_auto_brightness);
if (ret)
iounmap(egpios);
return ret;
}
static int
hx4700_core_remove( struct platform_device *pdev )
{
struct hx4700_core_funcs *funcs = pdev->dev.platform_data;
device_remove_file(&pdev->dev, &dev_attr_auto_brightness);
if (egpios != NULL)
iounmap( (void *)egpios );
funcs->udc_detect = NULL;
return 0;
}
static struct platform_driver hx4700_core_driver = {
.driver = {
.name = "hx4700-core",
},
.probe = hx4700_core_probe,
.remove = hx4700_core_remove,
.suspend = hx4700_suspend,
.resume = hx4700_resume,
};
static int __init
hx4700_core_init( void )
{
return platform_driver_register( &hx4700_core_driver );
}
static void __exit
hx4700_core_exit( void )
{
platform_driver_unregister( &hx4700_core_driver );
}
module_init( hx4700_core_init );
module_exit( hx4700_core_exit );
MODULE_AUTHOR("Todd Blumer, SDG Systems, LLC");
MODULE_DESCRIPTION("hx4700 Core Hardware Driver");
MODULE_LICENSE("GPL");
/* vim600: set noexpandtab sw=8 ts=8 :*/
|
janrinze/loox7xxport.loox2-6-22
|
arch/arm/mach-pxa/hx4700/hx4700_core.c
|
C
|
gpl-2.0
| 9,113 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CoreGTKGen: CGTKRevealer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">CoreGTKGen
 <span id="projectnumber">3.22.0</span>
</div>
<div id="projectbrief">CoreGTKGen is a utility that generates Objective-C language bindings for CoreGTK using GObject Introspection</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Instance Methods</a> |
<a href="interfaceCGTKRevealer-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">CGTKRevealer Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for CGTKRevealer:</div>
<div class="dyncontent">
<div class="center">
<img src="interfaceCGTKRevealer.png" usemap="#CGTKRevealer_map" alt=""/>
<map id="CGTKRevealer_map" name="CGTKRevealer_map">
<area href="interfaceCGTKBin.html" alt="CGTKBin" shape="rect" coords="55,224,155,248"/>
<area href="interfaceCGTKContainer.html" alt="CGTKContainer" shape="rect" coords="55,168,155,192"/>
<area href="interfaceCGTKWidget.html" alt="CGTKWidget" shape="rect" coords="55,112,155,136"/>
<area href="interfaceCGTKBase.html" alt="CGTKBase" shape="rect" coords="55,56,155,80"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Instance Methods</h2></td></tr>
<tr class="memitem:a53d34850b0873611933656a93238a872"><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#a53d34850b0873611933656a93238a872">init</a></td></tr>
<tr class="separator:a53d34850b0873611933656a93238a872"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a493772f0d7580e575fb6c4d40fbefd98"><td class="memItemLeft" align="right" valign="top">(GtkRevealer *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#a493772f0d7580e575fb6c4d40fbefd98">REVEALER</a></td></tr>
<tr class="separator:a493772f0d7580e575fb6c4d40fbefd98"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac2faf6efc0b4e086eff9e31759ce73b7"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#ac2faf6efc0b4e086eff9e31759ce73b7">getChildRevealed</a></td></tr>
<tr class="separator:ac2faf6efc0b4e086eff9e31759ce73b7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae8727fa7f9007c48228da543cb52386c"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#ae8727fa7f9007c48228da543cb52386c">getRevealChild</a></td></tr>
<tr class="separator:ae8727fa7f9007c48228da543cb52386c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae97d87143cb987f0f01d7161fc274a8"><td class="memItemLeft" align="right" valign="top">(guint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#aae97d87143cb987f0f01d7161fc274a8">getTransitionDuration</a></td></tr>
<tr class="separator:aae97d87143cb987f0f01d7161fc274a8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a505c7081e5524dcab1fcbf023566c83a"><td class="memItemLeft" align="right" valign="top">(GtkRevealerTransitionType) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#a505c7081e5524dcab1fcbf023566c83a">getTransitionType</a></td></tr>
<tr class="separator:a505c7081e5524dcab1fcbf023566c83a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a025227948311c65d5e514304295e6008"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#a025227948311c65d5e514304295e6008">setRevealChild:</a></td></tr>
<tr class="separator:a025227948311c65d5e514304295e6008"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab493ca7b7c28cc610a5be0a91bab74aa"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#ab493ca7b7c28cc610a5be0a91bab74aa">setTransitionDuration:</a></td></tr>
<tr class="separator:ab493ca7b7c28cc610a5be0a91bab74aa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aea4f2ff04ef2a003304abf3a39b740c4"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKRevealer.html#aea4f2ff04ef2a003304abf3a39b740c4">setTransitionType:</a></td></tr>
<tr class="separator:aea4f2ff04ef2a003304abf3a39b740c4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_interfaceCGTKBin"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interfaceCGTKBin')"><img src="closed.png" alt="-"/> Instance Methods inherited from <a class="el" href="interfaceCGTKBin.html">CGTKBin</a></td></tr>
<tr class="memitem:a139c8efb261a93c81aff2d0a6bb9da8b inherit pub_methods_interfaceCGTKBin"><td class="memItemLeft" align="right" valign="top">(GtkBin *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBin.html#a139c8efb261a93c81aff2d0a6bb9da8b">BIN</a></td></tr>
<tr class="separator:a139c8efb261a93c81aff2d0a6bb9da8b inherit pub_methods_interfaceCGTKBin"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae93993d5d24e9f74db4e37928582cae6 inherit pub_methods_interfaceCGTKBin"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interfaceCGTKWidget.html">CGTKWidget</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBin.html#ae93993d5d24e9f74db4e37928582cae6">getChild</a></td></tr>
<tr class="separator:ae93993d5d24e9f74db4e37928582cae6 inherit pub_methods_interfaceCGTKBin"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_interfaceCGTKContainer"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interfaceCGTKContainer')"><img src="closed.png" alt="-"/> Instance Methods inherited from <a class="el" href="interfaceCGTKContainer.html">CGTKContainer</a></td></tr>
<tr class="memitem:a98e333e97df13e34afbc8b908ed6e775 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(GtkContainer *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a98e333e97df13e34afbc8b908ed6e775">CONTAINER</a></td></tr>
<tr class="separator:a98e333e97df13e34afbc8b908ed6e775 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a29dcd7dc80c80a401a4e5e6fb9b8cd53 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top"><a id="a29dcd7dc80c80a401a4e5e6fb9b8cd53"></a>
(void) </td><td class="memItemRight" valign="bottom">- <b>addWidget:withProperties:</b></td></tr>
<tr class="separator:a29dcd7dc80c80a401a4e5e6fb9b8cd53 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae5772097dbf633d6f732ffd596a49b80 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#ae5772097dbf633d6f732ffd596a49b80">add:</a></td></tr>
<tr class="separator:ae5772097dbf633d6f732ffd596a49b80 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7a5896cf03751c4bb21d32716d30e721 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a7a5896cf03751c4bb21d32716d30e721">checkResize</a></td></tr>
<tr class="separator:a7a5896cf03751c4bb21d32716d30e721 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa1d50711ed5a4bb450fd5f787c159cda inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#aa1d50711ed5a4bb450fd5f787c159cda">childGetPropertyWithChild:andPropertyName:andValue:</a></td></tr>
<tr class="separator:aa1d50711ed5a4bb450fd5f787c159cda inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a600fae87d9fde4f8c12874ee4d732b88 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a600fae87d9fde4f8c12874ee4d732b88">childGetValistWithChild:andFirstPropertyName:andVarArgs:</a></td></tr>
<tr class="separator:a600fae87d9fde4f8c12874ee4d732b88 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a259aab1cd0628e5d93525652fd9937a6 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a259aab1cd0628e5d93525652fd9937a6">childNotifyWithChild:andChildProperty:</a></td></tr>
<tr class="separator:a259aab1cd0628e5d93525652fd9937a6 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acc046a53ae9b9ef345e2f3641333d5e0 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#acc046a53ae9b9ef345e2f3641333d5e0">childNotifyByPspecWithChild:andPspec:</a></td></tr>
<tr class="separator:acc046a53ae9b9ef345e2f3641333d5e0 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8506bb339e164d2591b2a1898931638c inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a8506bb339e164d2591b2a1898931638c">childSetPropertyWithChild:andPropertyName:andValue:</a></td></tr>
<tr class="separator:a8506bb339e164d2591b2a1898931638c inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af078de1afd1d0e37520c2fe713480149 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#af078de1afd1d0e37520c2fe713480149">childSetValistWithChild:andFirstPropertyName:andVarArgs:</a></td></tr>
<tr class="separator:af078de1afd1d0e37520c2fe713480149 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1f88579a752aadb34893fa10ca2e5964 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(GType) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a1f88579a752aadb34893fa10ca2e5964">childType</a></td></tr>
<tr class="separator:a1f88579a752aadb34893fa10ca2e5964 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac161ea26099366ab1d490f901e3a4d4e inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#ac161ea26099366ab1d490f901e3a4d4e">forallWithCallback:andCallbackData:</a></td></tr>
<tr class="separator:ac161ea26099366ab1d490f901e3a4d4e inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d6991785cf42b2c2db4f8b3120b8208 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a2d6991785cf42b2c2db4f8b3120b8208">foreachWithCallback:andCallbackData:</a></td></tr>
<tr class="separator:a2d6991785cf42b2c2db4f8b3120b8208 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaca6da18a53faa4969ee686acb167f9a inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(guint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#aaca6da18a53faa4969ee686acb167f9a">getBorderWidth</a></td></tr>
<tr class="separator:aaca6da18a53faa4969ee686acb167f9a inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae0fcd6a6284b53d62338cdb3b96ba441 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(GList *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#ae0fcd6a6284b53d62338cdb3b96ba441">getChildren</a></td></tr>
<tr class="separator:ae0fcd6a6284b53d62338cdb3b96ba441 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a75882742352f84775e73de737d50bdb1 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a75882742352f84775e73de737d50bdb1">getFocusChain:</a></td></tr>
<tr class="separator:a75882742352f84775e73de737d50bdb1 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a15a01ee3b65868c4be3a63ddec589e6b inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interfaceCGTKWidget.html">CGTKWidget</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a15a01ee3b65868c4be3a63ddec589e6b">getFocusChild</a></td></tr>
<tr class="separator:a15a01ee3b65868c4be3a63ddec589e6b inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa5095439c14fdecd8fd4c203393d73ec inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(GtkAdjustment *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#aa5095439c14fdecd8fd4c203393d73ec">getFocusHadjustment</a></td></tr>
<tr class="separator:aa5095439c14fdecd8fd4c203393d73ec inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3c23d2260713442526e7a07b7a49868b inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(GtkAdjustment *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a3c23d2260713442526e7a07b7a49868b">getFocusVadjustment</a></td></tr>
<tr class="separator:a3c23d2260713442526e7a07b7a49868b inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad917cf5d20756601d1302e8a83f2a92b inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(GtkWidgetPath *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#ad917cf5d20756601d1302e8a83f2a92b">getPathForChild:</a></td></tr>
<tr class="separator:ad917cf5d20756601d1302e8a83f2a92b inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a13a5cc4f8e0342162c383c163a36daab inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(GtkResizeMode) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a13a5cc4f8e0342162c383c163a36daab">getResizeMode</a></td></tr>
<tr class="separator:a13a5cc4f8e0342162c383c163a36daab inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9f0130ba08482ce712c5d4b62dde92d4 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a9f0130ba08482ce712c5d4b62dde92d4">propagateDrawWithChild:andCr:</a></td></tr>
<tr class="separator:a9f0130ba08482ce712c5d4b62dde92d4 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a538934d688fa4e3f5231b1a1e0886286 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a538934d688fa4e3f5231b1a1e0886286">remove:</a></td></tr>
<tr class="separator:a538934d688fa4e3f5231b1a1e0886286 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9a15a9b064392ebc86e9db253065b27f inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a9a15a9b064392ebc86e9db253065b27f">resizeChildren</a></td></tr>
<tr class="separator:a9a15a9b064392ebc86e9db253065b27f inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af0a135c2d6db989603d35320d077f704 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#af0a135c2d6db989603d35320d077f704">setBorderWidth:</a></td></tr>
<tr class="separator:af0a135c2d6db989603d35320d077f704 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a181efda342f41d2dc9b08e443fabf886 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a181efda342f41d2dc9b08e443fabf886">setFocusChain:</a></td></tr>
<tr class="separator:a181efda342f41d2dc9b08e443fabf886 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d9ad233faf0179668cb3225c22120fc inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a2d9ad233faf0179668cb3225c22120fc">setFocusChild:</a></td></tr>
<tr class="separator:a2d9ad233faf0179668cb3225c22120fc inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa60aa530e405eb768f86733741448e34 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#aa60aa530e405eb768f86733741448e34">setFocusHadjustment:</a></td></tr>
<tr class="separator:aa60aa530e405eb768f86733741448e34 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab553d0a635fcd9ab733ff9370213ca9d inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#ab553d0a635fcd9ab733ff9370213ca9d">setFocusVadjustment:</a></td></tr>
<tr class="separator:ab553d0a635fcd9ab733ff9370213ca9d inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac1bdcd3e23d2b5d528133ede78b8483a inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#ac1bdcd3e23d2b5d528133ede78b8483a">setReallocateRedraws:</a></td></tr>
<tr class="separator:ac1bdcd3e23d2b5d528133ede78b8483a inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6b2a1de63f347b7d7d5c8cd3008d15d5 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#a6b2a1de63f347b7d7d5c8cd3008d15d5">setResizeMode:</a></td></tr>
<tr class="separator:a6b2a1de63f347b7d7d5c8cd3008d15d5 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acd66f3ec6b282e887e80179096ba1d67 inherit pub_methods_interfaceCGTKContainer"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKContainer.html#acd66f3ec6b282e887e80179096ba1d67">unsetFocusChain</a></td></tr>
<tr class="separator:acd66f3ec6b282e887e80179096ba1d67 inherit pub_methods_interfaceCGTKContainer"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_interfaceCGTKWidget"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interfaceCGTKWidget')"><img src="closed.png" alt="-"/> Instance Methods inherited from <a class="el" href="interfaceCGTKWidget.html">CGTKWidget</a></td></tr>
<tr class="memitem:a899a518b9a942b9e1ef8f101067a1797 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkWidget *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a899a518b9a942b9e1ef8f101067a1797">WIDGET</a></td></tr>
<tr class="separator:a899a518b9a942b9e1ef8f101067a1797 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4fd98a02fc5038a70b7b231588855753 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4fd98a02fc5038a70b7b231588855753">activate</a></td></tr>
<tr class="separator:a4fd98a02fc5038a70b7b231588855753 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2c55e8488ef0a80f9b3ebcccb7a127bb inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a2c55e8488ef0a80f9b3ebcccb7a127bb">addAcceleratorWithAccelSignal:andAccelGroup:andAccelKey:andAccelMods:andAccelFlags:</a></td></tr>
<tr class="separator:a2c55e8488ef0a80f9b3ebcccb7a127bb inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a598b3c4a826b0f5ffd272d9c9dbf1449 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a598b3c4a826b0f5ffd272d9c9dbf1449">addDeviceEventsWithDevice:andEvents:</a></td></tr>
<tr class="separator:a598b3c4a826b0f5ffd272d9c9dbf1449 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6e4136aa2c462751566aaefc338c203d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6e4136aa2c462751566aaefc338c203d">addEvents:</a></td></tr>
<tr class="separator:a6e4136aa2c462751566aaefc338c203d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8a98957f7086a47326b6f87165d1076c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8a98957f7086a47326b6f87165d1076c">addMnemonicLabel:</a></td></tr>
<tr class="separator:a8a98957f7086a47326b6f87165d1076c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abd73849da3a9a5f0218a604d6f1692cc inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(guint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abd73849da3a9a5f0218a604d6f1692cc">addTickCallbackWithCallback:andUserData:andNotify:</a></td></tr>
<tr class="separator:abd73849da3a9a5f0218a604d6f1692cc inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a14de6dd293c096ff29e30d59b873fb85 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a14de6dd293c096ff29e30d59b873fb85">canActivateAccel:</a></td></tr>
<tr class="separator:a14de6dd293c096ff29e30d59b873fb85 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1bf2f9f41c60a287308a7f4058bbfcf5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1bf2f9f41c60a287308a7f4058bbfcf5">childFocus:</a></td></tr>
<tr class="separator:a1bf2f9f41c60a287308a7f4058bbfcf5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a22c17c2ae602da5fb17587bd947fb77f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a22c17c2ae602da5fb17587bd947fb77f">childNotify:</a></td></tr>
<tr class="separator:a22c17c2ae602da5fb17587bd947fb77f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7e04ba2a57897a511429a6e76011d381 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7e04ba2a57897a511429a6e76011d381">classPathWithPathLength:andPath:andPathReversed:</a></td></tr>
<tr class="separator:a7e04ba2a57897a511429a6e76011d381 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ace88057ed514e62acb6c2e9ef89a1820 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ace88057ed514e62acb6c2e9ef89a1820">computeExpand:</a></td></tr>
<tr class="separator:ace88057ed514e62acb6c2e9ef89a1820 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aed7a0ddf38e1144905974a78b2853e64 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(PangoContext *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aed7a0ddf38e1144905974a78b2853e64">createPangoContext</a></td></tr>
<tr class="separator:aed7a0ddf38e1144905974a78b2853e64 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a65aab48d716c479f90ecb990b9d34218 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(PangoLayout *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a65aab48d716c479f90ecb990b9d34218">createPangoLayout:</a></td></tr>
<tr class="separator:a65aab48d716c479f90ecb990b9d34218 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a49abc58113965b5df9d5ac9262ea7a66 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a49abc58113965b5df9d5ac9262ea7a66">destroy</a></td></tr>
<tr class="separator:a49abc58113965b5df9d5ac9262ea7a66 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a44ea770795efa1fbfdfd1b70c7d50898 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a44ea770795efa1fbfdfd1b70c7d50898">destroyed:</a></td></tr>
<tr class="separator:a44ea770795efa1fbfdfd1b70c7d50898 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae3096b5e9f8bfee5ef4638ea1ece57e6 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae3096b5e9f8bfee5ef4638ea1ece57e6">deviceIsShadowed:</a></td></tr>
<tr class="separator:ae3096b5e9f8bfee5ef4638ea1ece57e6 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acff583914ec9e84a9e47fa629be693c9 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkDragContext *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#acff583914ec9e84a9e47fa629be693c9">gtkDragBeginWithTargets:andActions:andButton:andEvent:</a></td></tr>
<tr class="separator:acff583914ec9e84a9e47fa629be693c9 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a28659f0dda6d0800d6f62efce5c7650c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkDragContext *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a28659f0dda6d0800d6f62efce5c7650c">gtkDragBeginWithCoordinatesWithTargets:andActions:andButton:andEvent:andX:andY:</a></td></tr>
<tr class="separator:a28659f0dda6d0800d6f62efce5c7650c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af1e61de2c3b0dfb54c1496b0c3f6d54d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af1e61de2c3b0dfb54c1496b0c3f6d54d">gtkDragCheckThresholdWithStartX:andStartY:andCurrentX:andCurrentY:</a></td></tr>
<tr class="separator:af1e61de2c3b0dfb54c1496b0c3f6d54d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a99a555320ff8917b74662a3eec265d68 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a99a555320ff8917b74662a3eec265d68">gtkDragDestAddImageTargets</a></td></tr>
<tr class="separator:a99a555320ff8917b74662a3eec265d68 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4251606c07625e0aa42df01371483aac inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4251606c07625e0aa42df01371483aac">gtkDragDestAddTextTargets</a></td></tr>
<tr class="separator:a4251606c07625e0aa42df01371483aac inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a48d4a65675d22144d5af82785d125571 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a48d4a65675d22144d5af82785d125571">gtkDragDestAddUriTargets</a></td></tr>
<tr class="separator:a48d4a65675d22144d5af82785d125571 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6e48f41eb6368df75fdd94c1c83f39a7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkAtom) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6e48f41eb6368df75fdd94c1c83f39a7">gtkDragDestFindTargetWithContext:andTargetList:</a></td></tr>
<tr class="separator:a6e48f41eb6368df75fdd94c1c83f39a7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a664f7bd6a18963c96b3e36c959f788b6 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkTargetList *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a664f7bd6a18963c96b3e36c959f788b6">gtkDragDestGetTargetList</a></td></tr>
<tr class="separator:a664f7bd6a18963c96b3e36c959f788b6 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab336da4298ffe5279e097ea7e567ff1d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab336da4298ffe5279e097ea7e567ff1d">gtkDragDestGetTrackMotion</a></td></tr>
<tr class="separator:ab336da4298ffe5279e097ea7e567ff1d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5611b3d9fc3fbc57d152b20f579b2831 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a5611b3d9fc3fbc57d152b20f579b2831">gtkDragDestSetWithFlags:andTargets:andNtargets:andActions:</a></td></tr>
<tr class="separator:a5611b3d9fc3fbc57d152b20f579b2831 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a56fe349f2649a880654b079568f57f04 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a56fe349f2649a880654b079568f57f04">gtkDragDestSetProxyWithProxyWindow:andProtocol:andUseCoordinates:</a></td></tr>
<tr class="separator:a56fe349f2649a880654b079568f57f04 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa4a516012bd12167e72ff09f50976dfe inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa4a516012bd12167e72ff09f50976dfe">gtkDragDestSetTargetList:</a></td></tr>
<tr class="separator:aa4a516012bd12167e72ff09f50976dfe inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aadb9048643d8538c19b6a5372682d3a6 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aadb9048643d8538c19b6a5372682d3a6">gtkDragDestSetTrackMotion:</a></td></tr>
<tr class="separator:aadb9048643d8538c19b6a5372682d3a6 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1fd99e7021e007b2b5981f472f408d95 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1fd99e7021e007b2b5981f472f408d95">gtkDragDestUnset</a></td></tr>
<tr class="separator:a1fd99e7021e007b2b5981f472f408d95 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a83031eff8e872125b6d25172282269a0 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a83031eff8e872125b6d25172282269a0">gtkDragGetDataWithContext:andTarget:andTime:</a></td></tr>
<tr class="separator:a83031eff8e872125b6d25172282269a0 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a408aebae1bd4d32d4d298773e0c722 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4a408aebae1bd4d32d4d298773e0c722">gtkDragHighlight</a></td></tr>
<tr class="separator:a4a408aebae1bd4d32d4d298773e0c722 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6b62c2ba2c9fc0698e9a81372cd65f18 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6b62c2ba2c9fc0698e9a81372cd65f18">gtkDragSourceAddImageTargets</a></td></tr>
<tr class="separator:a6b62c2ba2c9fc0698e9a81372cd65f18 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa84fa411fbfa01698e0d46076c521d41 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa84fa411fbfa01698e0d46076c521d41">gtkDragSourceAddTextTargets</a></td></tr>
<tr class="separator:aa84fa411fbfa01698e0d46076c521d41 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad39ec50ff4b5c6d4bf8118d1fc6538c5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ad39ec50ff4b5c6d4bf8118d1fc6538c5">gtkDragSourceAddUriTargets</a></td></tr>
<tr class="separator:ad39ec50ff4b5c6d4bf8118d1fc6538c5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acbb0a8df7ffcef0e5d6f4730c0f4d7e7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkTargetList *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#acbb0a8df7ffcef0e5d6f4730c0f4d7e7">gtkDragSourceGetTargetList</a></td></tr>
<tr class="separator:acbb0a8df7ffcef0e5d6f4730c0f4d7e7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aafd48e8eb58ace1682a353bdb9ce9e2a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aafd48e8eb58ace1682a353bdb9ce9e2a">gtkDragSourceSetWithStartButtonMask:andTargets:andNtargets:andActions:</a></td></tr>
<tr class="separator:aafd48e8eb58ace1682a353bdb9ce9e2a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a68f6b1274423e4b24d50a1a012a489b1 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a68f6b1274423e4b24d50a1a012a489b1">gtkDragSourceSetIconGicon:</a></td></tr>
<tr class="separator:a68f6b1274423e4b24d50a1a012a489b1 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8aedf329170784cf45f38a0648923f53 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8aedf329170784cf45f38a0648923f53">gtkDragSourceSetIconName:</a></td></tr>
<tr class="separator:a8aedf329170784cf45f38a0648923f53 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6cef284bfc1e736c4bfb55a0b1a83b29 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6cef284bfc1e736c4bfb55a0b1a83b29">gtkDragSourceSetIconPixbuf:</a></td></tr>
<tr class="separator:a6cef284bfc1e736c4bfb55a0b1a83b29 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaaff676ee3e74fb966523b089b9bc960 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aaaff676ee3e74fb966523b089b9bc960">gtkDragSourceSetIconStock:</a></td></tr>
<tr class="separator:aaaff676ee3e74fb966523b089b9bc960 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a52e5751ec81f60558718659f033774c0 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a52e5751ec81f60558718659f033774c0">gtkDragSourceSetTargetList:</a></td></tr>
<tr class="separator:a52e5751ec81f60558718659f033774c0 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab338bbfa4c11d07a6aed977b35ad4301 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab338bbfa4c11d07a6aed977b35ad4301">gtkDragSourceUnset</a></td></tr>
<tr class="separator:ab338bbfa4c11d07a6aed977b35ad4301 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2c670c0971ceffa3f5d6d3a504a610d2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a2c670c0971ceffa3f5d6d3a504a610d2">gtkDragUnhighlight</a></td></tr>
<tr class="separator:a2c670c0971ceffa3f5d6d3a504a610d2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d810e3e873ba9c627c5a4cd7f494dd0 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1d810e3e873ba9c627c5a4cd7f494dd0">draw:</a></td></tr>
<tr class="separator:a1d810e3e873ba9c627c5a4cd7f494dd0 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8b2ec87d85e38b93f9967b2bc6c97654 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8b2ec87d85e38b93f9967b2bc6c97654">ensureStyle</a></td></tr>
<tr class="separator:a8b2ec87d85e38b93f9967b2bc6c97654 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acc695bd0aa1492eaa06e7578e9856a47 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#acc695bd0aa1492eaa06e7578e9856a47">errorBell</a></td></tr>
<tr class="separator:acc695bd0aa1492eaa06e7578e9856a47 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a82a32d0f60474b95112dfdbbd5524d76 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a82a32d0f60474b95112dfdbbd5524d76">event:</a></td></tr>
<tr class="separator:a82a32d0f60474b95112dfdbbd5524d76 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7d5123c49edd866aa41658e58d81f082 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7d5123c49edd866aa41658e58d81f082">freezeChildNotify</a></td></tr>
<tr class="separator:a7d5123c49edd866aa41658e58d81f082 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a52354f6322f9663100bb96372fe34afa inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(AtkObject *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a52354f6322f9663100bb96372fe34afa">getAccessible</a></td></tr>
<tr class="separator:a52354f6322f9663100bb96372fe34afa inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af26ce0fb7c8fd2a890319b6ab1df0062 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GActionGroup *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af26ce0fb7c8fd2a890319b6ab1df0062">getActionGroup:</a></td></tr>
<tr class="separator:af26ce0fb7c8fd2a890319b6ab1df0062 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae4f7a57d8de1aae648836acd06b2937 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(int) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aae4f7a57d8de1aae648836acd06b2937">getAllocatedBaseline</a></td></tr>
<tr class="separator:aae4f7a57d8de1aae648836acd06b2937 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af0e7cf2d2801f021ca0dce21c5b2a510 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(int) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af0e7cf2d2801f021ca0dce21c5b2a510">getAllocatedHeight</a></td></tr>
<tr class="separator:af0e7cf2d2801f021ca0dce21c5b2a510 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a159d298840809f92c028869ced9ce7e6 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a159d298840809f92c028869ced9ce7e6">getAllocatedSizeWithAllocation:andBaseline:</a></td></tr>
<tr class="separator:a159d298840809f92c028869ced9ce7e6 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa298e567e1b87e03f87ee636c4beef23 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(int) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa298e567e1b87e03f87ee636c4beef23">getAllocatedWidth</a></td></tr>
<tr class="separator:aa298e567e1b87e03f87ee636c4beef23 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abfadef17f7d5ba42125ea8704b91fb98 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abfadef17f7d5ba42125ea8704b91fb98">getAllocation:</a></td></tr>
<tr class="separator:abfadef17f7d5ba42125ea8704b91fb98 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aff8b651aa05ec8637a0417b0ce3683b3 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interfaceCGTKWidget.html">CGTKWidget</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aff8b651aa05ec8637a0417b0ce3683b3">getAncestor:</a></td></tr>
<tr class="separator:aff8b651aa05ec8637a0417b0ce3683b3 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1b09f7fde5bf8295d44aea416fd803dc inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1b09f7fde5bf8295d44aea416fd803dc">getAppPaintable</a></td></tr>
<tr class="separator:a1b09f7fde5bf8295d44aea416fd803dc inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9f7567616a279ece11f53627410995fc inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a9f7567616a279ece11f53627410995fc">getCanDefault</a></td></tr>
<tr class="separator:a9f7567616a279ece11f53627410995fc inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abc938d6b05410e4d21afe5891c8fa95c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abc938d6b05410e4d21afe5891c8fa95c">getCanFocus</a></td></tr>
<tr class="separator:abc938d6b05410e4d21afe5891c8fa95c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab830e3b398e1500263f2fea81b5e33d9 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab830e3b398e1500263f2fea81b5e33d9">getChildRequisition:</a></td></tr>
<tr class="separator:ab830e3b398e1500263f2fea81b5e33d9 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a96eb60aa6f7f00ebae204a7fe8c503f2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a96eb60aa6f7f00ebae204a7fe8c503f2">getChildVisible</a></td></tr>
<tr class="separator:a96eb60aa6f7f00ebae204a7fe8c503f2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d8eb45a4b3ecbb353077619d543c792 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1d8eb45a4b3ecbb353077619d543c792">getClip:</a></td></tr>
<tr class="separator:a1d8eb45a4b3ecbb353077619d543c792 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1db13d54b2773fe6e1394b04e3733237 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkClipboard *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1db13d54b2773fe6e1394b04e3733237">getClipboard:</a></td></tr>
<tr class="separator:a1db13d54b2773fe6e1394b04e3733237 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae3d91521899552010b600fa6bb6d52bb inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae3d91521899552010b600fa6bb6d52bb">getCompositeName</a></td></tr>
<tr class="separator:ae3d91521899552010b600fa6bb6d52bb inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a45cc868226236d52182b6f35660f2301 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a45cc868226236d52182b6f35660f2301">getDeviceEnabled:</a></td></tr>
<tr class="separator:a45cc868226236d52182b6f35660f2301 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab962098179bacaab44b76ec586f316a4 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkEventMask) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab962098179bacaab44b76ec586f316a4">getDeviceEvents:</a></td></tr>
<tr class="separator:ab962098179bacaab44b76ec586f316a4 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3e7856b1725cedc96564fe5b6a89b65b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkTextDirection) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3e7856b1725cedc96564fe5b6a89b65b">getDirection</a></td></tr>
<tr class="separator:a3e7856b1725cedc96564fe5b6a89b65b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a116891db25462cf45df26295c6c751e5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkDisplay *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a116891db25462cf45df26295c6c751e5">getDisplay</a></td></tr>
<tr class="separator:a116891db25462cf45df26295c6c751e5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae52c231a3686dd25c5d2b414229dbc3 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aae52c231a3686dd25c5d2b414229dbc3">getDoubleBuffered</a></td></tr>
<tr class="separator:aae52c231a3686dd25c5d2b414229dbc3 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6886aeff62230c00ba766b30b7aadbd2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6886aeff62230c00ba766b30b7aadbd2">getEvents</a></td></tr>
<tr class="separator:a6886aeff62230c00ba766b30b7aadbd2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a473946e844002a5759d11c6ae57efd04 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a473946e844002a5759d11c6ae57efd04">getFocusOnClick</a></td></tr>
<tr class="separator:a473946e844002a5759d11c6ae57efd04 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4f3399c75640fb07599e8ac08e5cad67 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(PangoFontMap *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4f3399c75640fb07599e8ac08e5cad67">getFontMap</a></td></tr>
<tr class="separator:a4f3399c75640fb07599e8ac08e5cad67 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a05d07791de6a3d04881fe6b4dc84c157 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(const cairo_font_options_t *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a05d07791de6a3d04881fe6b4dc84c157">getFontOptions</a></td></tr>
<tr class="separator:a05d07791de6a3d04881fe6b4dc84c157 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4873b3bec01da1f55a00c60514d051a9 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkFrameClock *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4873b3bec01da1f55a00c60514d051a9">getFrameClock</a></td></tr>
<tr class="separator:a4873b3bec01da1f55a00c60514d051a9 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad0483caf2c147e429f1ebdc321fb314a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkAlign) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ad0483caf2c147e429f1ebdc321fb314a">getHalign</a></td></tr>
<tr class="separator:ad0483caf2c147e429f1ebdc321fb314a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a488b757ea2bc1d49e55845ac1d732c73 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a488b757ea2bc1d49e55845ac1d732c73">getHasTooltip</a></td></tr>
<tr class="separator:a488b757ea2bc1d49e55845ac1d732c73 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0164b500267217201fcb2df4d3650053 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a0164b500267217201fcb2df4d3650053">getHasWindow</a></td></tr>
<tr class="separator:a0164b500267217201fcb2df4d3650053 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab63adc91866c8cf2a949c5692d2ce043 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab63adc91866c8cf2a949c5692d2ce043">getHexpand</a></td></tr>
<tr class="separator:ab63adc91866c8cf2a949c5692d2ce043 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa4b3342a0c09e4bfd73ae9582b5e31d4 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa4b3342a0c09e4bfd73ae9582b5e31d4">getHexpandSet</a></td></tr>
<tr class="separator:aa4b3342a0c09e4bfd73ae9582b5e31d4 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad7425bfc70235c5b52b246ae28c8540b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ad7425bfc70235c5b52b246ae28c8540b">getMapped</a></td></tr>
<tr class="separator:ad7425bfc70235c5b52b246ae28c8540b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2876c83a33b041ee22f9dc6a32efd523 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a2876c83a33b041ee22f9dc6a32efd523">getMarginBottom</a></td></tr>
<tr class="separator:a2876c83a33b041ee22f9dc6a32efd523 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7504dc7f4f580aea7ce94f38f49e97ec inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7504dc7f4f580aea7ce94f38f49e97ec">getMarginEnd</a></td></tr>
<tr class="separator:a7504dc7f4f580aea7ce94f38f49e97ec inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae256e596256df7f072a365a5914a630b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae256e596256df7f072a365a5914a630b">getMarginLeft</a></td></tr>
<tr class="separator:ae256e596256df7f072a365a5914a630b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a64152aee63ca9236c44fa7e576e1aed9 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a64152aee63ca9236c44fa7e576e1aed9">getMarginRight</a></td></tr>
<tr class="separator:a64152aee63ca9236c44fa7e576e1aed9 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac5fbb05224639d4017c80e0b6ce079b5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac5fbb05224639d4017c80e0b6ce079b5">getMarginStart</a></td></tr>
<tr class="separator:ac5fbb05224639d4017c80e0b6ce079b5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5f90aefff6f4825c428a3a1f69ec511d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a5f90aefff6f4825c428a3a1f69ec511d">getMarginTop</a></td></tr>
<tr class="separator:a5f90aefff6f4825c428a3a1f69ec511d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa6f3e5de5e21168894a92802aa4c841d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkModifierType) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa6f3e5de5e21168894a92802aa4c841d">getModifierMask:</a></td></tr>
<tr class="separator:aa6f3e5de5e21168894a92802aa4c841d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a622a12a9f180259131cf7ad4a5ee1a54 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkRcStyle *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a622a12a9f180259131cf7ad4a5ee1a54">getModifierStyle</a></td></tr>
<tr class="separator:a622a12a9f180259131cf7ad4a5ee1a54 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2f4e7f6e2b1e09c4101906972ddaea90 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a2f4e7f6e2b1e09c4101906972ddaea90">getName</a></td></tr>
<tr class="separator:a2f4e7f6e2b1e09c4101906972ddaea90 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad2a8b67da114cb4683ebcb1ad3a3eb5a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ad2a8b67da114cb4683ebcb1ad3a3eb5a">getNoShowAll</a></td></tr>
<tr class="separator:ad2a8b67da114cb4683ebcb1ad3a3eb5a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae329f13d4777f94d6458fe68694c919e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(double) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae329f13d4777f94d6458fe68694c919e">getOpacity</a></td></tr>
<tr class="separator:ae329f13d4777f94d6458fe68694c919e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adcc8e9dda992afef92ff780166b4a0e0 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(PangoContext *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#adcc8e9dda992afef92ff780166b4a0e0">getPangoContext</a></td></tr>
<tr class="separator:adcc8e9dda992afef92ff780166b4a0e0 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae0c40b0136e5beff824537a9ddd9e00d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interfaceCGTKWidget.html">CGTKWidget</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae0c40b0136e5beff824537a9ddd9e00d">getParent</a></td></tr>
<tr class="separator:ae0c40b0136e5beff824537a9ddd9e00d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a06042b17f8a6e421688d6227fd4d212a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkWindow *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a06042b17f8a6e421688d6227fd4d212a">getParentWindow</a></td></tr>
<tr class="separator:a06042b17f8a6e421688d6227fd4d212a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0e337f5193da0cc8512f546fc4f1af60 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkWidgetPath *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a0e337f5193da0cc8512f546fc4f1af60">getPath</a></td></tr>
<tr class="separator:a0e337f5193da0cc8512f546fc4f1af60 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a78aa2a4af9cf27e5adecf64e50f5184d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a78aa2a4af9cf27e5adecf64e50f5184d">getPointerWithX:andY:</a></td></tr>
<tr class="separator:a78aa2a4af9cf27e5adecf64e50f5184d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1c1770da319872afa46a776c0af66018 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1c1770da319872afa46a776c0af66018">getPreferredHeightWithMinimumHeight:andNaturalHeight:</a></td></tr>
<tr class="separator:a1c1770da319872afa46a776c0af66018 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab9d4ed8eb854e17ea6eed352dbf011a8 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab9d4ed8eb854e17ea6eed352dbf011a8">getPreferredHeightAndBaselineForWidthWithWidth:andMinimumHeight:andNaturalHeight:andMinimumBaseline:andNaturalBaseline:</a></td></tr>
<tr class="separator:ab9d4ed8eb854e17ea6eed352dbf011a8 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a272cb4efdd5f09231e70a1bed9ceb8e8 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a272cb4efdd5f09231e70a1bed9ceb8e8">getPreferredHeightForWidthWithWidth:andMinimumHeight:andNaturalHeight:</a></td></tr>
<tr class="separator:a272cb4efdd5f09231e70a1bed9ceb8e8 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9be055ca4e996fc54ad65859a38d78f3 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a9be055ca4e996fc54ad65859a38d78f3">getPreferredSizeWithMinimumSize:andNaturalSize:</a></td></tr>
<tr class="separator:a9be055ca4e996fc54ad65859a38d78f3 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7389bdb69ebac9ea01ced704eda50e2c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7389bdb69ebac9ea01ced704eda50e2c">getPreferredWidthWithMinimumWidth:andNaturalWidth:</a></td></tr>
<tr class="separator:a7389bdb69ebac9ea01ced704eda50e2c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a89cf36ebbffca23180b1f70bb35da4ab inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a89cf36ebbffca23180b1f70bb35da4ab">getPreferredWidthForHeightWithHeight:andMinimumWidth:andNaturalWidth:</a></td></tr>
<tr class="separator:a89cf36ebbffca23180b1f70bb35da4ab inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7a5237f1ca1b96a8e7776b99a0f2c061 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7a5237f1ca1b96a8e7776b99a0f2c061">getRealized</a></td></tr>
<tr class="separator:a7a5237f1ca1b96a8e7776b99a0f2c061 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa75738b143ef4f0520b5f257fcd16069 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa75738b143ef4f0520b5f257fcd16069">getReceivesDefault</a></td></tr>
<tr class="separator:aa75738b143ef4f0520b5f257fcd16069 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa234f86d75f1ed90e4a97e3dc0d380b5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkSizeRequestMode) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa234f86d75f1ed90e4a97e3dc0d380b5">getRequestMode</a></td></tr>
<tr class="separator:aa234f86d75f1ed90e4a97e3dc0d380b5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a569c9d224cbd076dfaae5a2a28e9fca6 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a569c9d224cbd076dfaae5a2a28e9fca6">getRequisition:</a></td></tr>
<tr class="separator:a569c9d224cbd076dfaae5a2a28e9fca6 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abd14878333cc13c68c6356a90b6709c7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkWindow *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abd14878333cc13c68c6356a90b6709c7">getRootWindow</a></td></tr>
<tr class="separator:abd14878333cc13c68c6356a90b6709c7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a713ff7767f7ca2627eaac4de9f998281 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a713ff7767f7ca2627eaac4de9f998281">getScaleFactor</a></td></tr>
<tr class="separator:a713ff7767f7ca2627eaac4de9f998281 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa06a6ab82b79956f7fb6833207d65fd4 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkScreen *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa06a6ab82b79956f7fb6833207d65fd4">getScreen</a></td></tr>
<tr class="separator:aa06a6ab82b79956f7fb6833207d65fd4 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adb1e1d5f08229eb5dd2ce2d1af60880f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#adb1e1d5f08229eb5dd2ce2d1af60880f">getSensitive</a></td></tr>
<tr class="separator:adb1e1d5f08229eb5dd2ce2d1af60880f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a30f96536013cb1a940aa355ebe70846f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkSettings *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a30f96536013cb1a940aa355ebe70846f">getSettings</a></td></tr>
<tr class="separator:a30f96536013cb1a940aa355ebe70846f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a33ceee8ef4190d2931a08c3b21ce167d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a33ceee8ef4190d2931a08c3b21ce167d">getSizeRequestWithWidth:andHeight:</a></td></tr>
<tr class="separator:a33ceee8ef4190d2931a08c3b21ce167d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae6e1b530c246c205d69c59c32903a0ff inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkStateType) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae6e1b530c246c205d69c59c32903a0ff">getState</a></td></tr>
<tr class="separator:ae6e1b530c246c205d69c59c32903a0ff inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a60ce210de5e514893aee5abbf8e6b642 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkStateFlags) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a60ce210de5e514893aee5abbf8e6b642">getStateFlags</a></td></tr>
<tr class="separator:a60ce210de5e514893aee5abbf8e6b642 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aceba43a6b1874c29c7b54e7f1ef9c46a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkStyle *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aceba43a6b1874c29c7b54e7f1ef9c46a">getStyle</a></td></tr>
<tr class="separator:aceba43a6b1874c29c7b54e7f1ef9c46a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8e508612d9471bd30fb57405880e96f5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkStyleContext *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8e508612d9471bd30fb57405880e96f5">getStyleContext</a></td></tr>
<tr class="separator:a8e508612d9471bd30fb57405880e96f5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a71db754c15fab2afa5924eebac6c265d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a71db754c15fab2afa5924eebac6c265d">getSupportMultidevice</a></td></tr>
<tr class="separator:a71db754c15fab2afa5924eebac6c265d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac1febdea582d988b33e72dc9944b3a06 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GObject *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac1febdea582d988b33e72dc9944b3a06">getTemplateChildWithWidgetType:andName:</a></td></tr>
<tr class="separator:ac1febdea582d988b33e72dc9944b3a06 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4c6136e5dee840b37fcd974ab9e1d182 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4c6136e5dee840b37fcd974ab9e1d182">getTooltipMarkup</a></td></tr>
<tr class="separator:a4c6136e5dee840b37fcd974ab9e1d182 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af479c66684284371267aa469b8f4f143 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af479c66684284371267aa469b8f4f143">getTooltipText</a></td></tr>
<tr class="separator:af479c66684284371267aa469b8f4f143 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6e1ad0fa95e6af179ee2bc1d9c5e0e35 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkWindow *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6e1ad0fa95e6af179ee2bc1d9c5e0e35">getTooltipWindow</a></td></tr>
<tr class="separator:a6e1ad0fa95e6af179ee2bc1d9c5e0e35 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a03657df87902931a6eb974623ab234c5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interfaceCGTKWidget.html">CGTKWidget</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a03657df87902931a6eb974623ab234c5">getToplevel</a></td></tr>
<tr class="separator:a03657df87902931a6eb974623ab234c5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a832fcd94fcfab50c3e3f7986ae249c6b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkAlign) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a832fcd94fcfab50c3e3f7986ae249c6b">getValign</a></td></tr>
<tr class="separator:a832fcd94fcfab50c3e3f7986ae249c6b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8323417f59b832c91b7c5cc9dc4e37c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkAlign) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af8323417f59b832c91b7c5cc9dc4e37c">getValignWithBaseline</a></td></tr>
<tr class="separator:af8323417f59b832c91b7c5cc9dc4e37c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3767a58021ac0af09c75f46d7dadfd7a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3767a58021ac0af09c75f46d7dadfd7a">getVexpand</a></td></tr>
<tr class="separator:a3767a58021ac0af09c75f46d7dadfd7a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a799204ff773b0b41660b7d1d86d2bd2e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a799204ff773b0b41660b7d1d86d2bd2e">getVexpandSet</a></td></tr>
<tr class="separator:a799204ff773b0b41660b7d1d86d2bd2e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a19f43e4c58ba1757381a7087a08930be inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a19f43e4c58ba1757381a7087a08930be">getVisible</a></td></tr>
<tr class="separator:a19f43e4c58ba1757381a7087a08930be inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac60148bed892b20f8dc4c049ec6f4c4f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkVisual *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac60148bed892b20f8dc4c049ec6f4c4f">getVisual</a></td></tr>
<tr class="separator:ac60148bed892b20f8dc4c049ec6f4c4f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a161cce50b4a4ff2bf356d3f6da29c44d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkWindow *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a161cce50b4a4ff2bf356d3f6da29c44d">getWindow</a></td></tr>
<tr class="separator:a161cce50b4a4ff2bf356d3f6da29c44d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af1fc22fb43c4efcb0f3000827470771f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af1fc22fb43c4efcb0f3000827470771f">gtkGrabAdd</a></td></tr>
<tr class="separator:af1fc22fb43c4efcb0f3000827470771f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a58c4c989df3bfc0f0986967acc113ba3 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a58c4c989df3bfc0f0986967acc113ba3">grabDefault</a></td></tr>
<tr class="separator:a58c4c989df3bfc0f0986967acc113ba3 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a20524b669db15669e890c5a00b523e70 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a20524b669db15669e890c5a00b523e70">grabFocus</a></td></tr>
<tr class="separator:a20524b669db15669e890c5a00b523e70 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a510b5607cf4e5ba97028a236a5f709e5 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a510b5607cf4e5ba97028a236a5f709e5">gtkGrabRemove</a></td></tr>
<tr class="separator:a510b5607cf4e5ba97028a236a5f709e5 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aee2c646e2d1ca917baecc5e99b9d8802 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aee2c646e2d1ca917baecc5e99b9d8802">hasDefault</a></td></tr>
<tr class="separator:aee2c646e2d1ca917baecc5e99b9d8802 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad37d527b774ae4a9f9d2fc14172e17f9 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ad37d527b774ae4a9f9d2fc14172e17f9">hasFocus</a></td></tr>
<tr class="separator:ad37d527b774ae4a9f9d2fc14172e17f9 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a172a54d258cd3049559adb92253a0575 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a172a54d258cd3049559adb92253a0575">hasGrab</a></td></tr>
<tr class="separator:a172a54d258cd3049559adb92253a0575 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af4ce642168176463da445320793e3297 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af4ce642168176463da445320793e3297">hasRcStyle</a></td></tr>
<tr class="separator:af4ce642168176463da445320793e3297 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab4022b5a7b59630684c9d4a8d488bd29 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab4022b5a7b59630684c9d4a8d488bd29">hasScreen</a></td></tr>
<tr class="separator:ab4022b5a7b59630684c9d4a8d488bd29 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af5064931b4855095bc788c7f574d2520 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af5064931b4855095bc788c7f574d2520">hasVisibleFocus</a></td></tr>
<tr class="separator:af5064931b4855095bc788c7f574d2520 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a18eb1d2ff44967a37b0ccdc07533b93a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a18eb1d2ff44967a37b0ccdc07533b93a">hide</a></td></tr>
<tr class="separator:a18eb1d2ff44967a37b0ccdc07533b93a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0c610842d7f05c4cf6f80ca731301075 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a0c610842d7f05c4cf6f80ca731301075">hideOnDelete</a></td></tr>
<tr class="separator:a0c610842d7f05c4cf6f80ca731301075 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1e29829a0e7c81c99163c3edf0024410 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1e29829a0e7c81c99163c3edf0024410">inDestruction</a></td></tr>
<tr class="separator:a1e29829a0e7c81c99163c3edf0024410 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d6d01ddaca5c83f1e0574823d17f206 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a2d6d01ddaca5c83f1e0574823d17f206">initTemplate</a></td></tr>
<tr class="separator:a2d6d01ddaca5c83f1e0574823d17f206 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7271ceb5acd8cbf8c4cb103a9f7f6368 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7271ceb5acd8cbf8c4cb103a9f7f6368">inputShapeCombineRegion:</a></td></tr>
<tr class="separator:a7271ceb5acd8cbf8c4cb103a9f7f6368 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa689039fda371cb06c2e33183ddfd7cd inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa689039fda371cb06c2e33183ddfd7cd">insertActionGroupWithName:andGroup:</a></td></tr>
<tr class="separator:aa689039fda371cb06c2e33183ddfd7cd inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef54289b1456c75e70ae8ea08762be2c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aef54289b1456c75e70ae8ea08762be2c">intersectWithArea:andIntersection:</a></td></tr>
<tr class="separator:aef54289b1456c75e70ae8ea08762be2c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1410c9f9bbfa16176048f5f5304aa072 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1410c9f9bbfa16176048f5f5304aa072">isAncestor:</a></td></tr>
<tr class="separator:a1410c9f9bbfa16176048f5f5304aa072 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abe2b4d5aa03a9e16a1b0b901eb7d5ddf inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abe2b4d5aa03a9e16a1b0b901eb7d5ddf">isComposited</a></td></tr>
<tr class="separator:abe2b4d5aa03a9e16a1b0b901eb7d5ddf inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3423e25abd513b50942344320fe0ad01 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3423e25abd513b50942344320fe0ad01">isDrawable</a></td></tr>
<tr class="separator:a3423e25abd513b50942344320fe0ad01 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a40bea8af8c41c27b8aa3daf04b4b0a93 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a40bea8af8c41c27b8aa3daf04b4b0a93">isFocus</a></td></tr>
<tr class="separator:a40bea8af8c41c27b8aa3daf04b4b0a93 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a528b81ff78e755d5c3c7bf819bad4346 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a528b81ff78e755d5c3c7bf819bad4346">isSensitive</a></td></tr>
<tr class="separator:a528b81ff78e755d5c3c7bf819bad4346 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac1c2c40164a097b5e02b9032847641e8 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac1c2c40164a097b5e02b9032847641e8">isToplevel</a></td></tr>
<tr class="separator:ac1c2c40164a097b5e02b9032847641e8 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6c035b677e2b3104f8f31317cb54e63b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6c035b677e2b3104f8f31317cb54e63b">isVisible</a></td></tr>
<tr class="separator:a6c035b677e2b3104f8f31317cb54e63b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aac193bede5729cdfbc37480a2a9f50b1 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aac193bede5729cdfbc37480a2a9f50b1">keynavFailed:</a></td></tr>
<tr class="separator:aac193bede5729cdfbc37480a2a9f50b1 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9979d4479c9d7e325ba62532c3852000 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GList *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a9979d4479c9d7e325ba62532c3852000">listAccelClosures</a></td></tr>
<tr class="separator:a9979d4479c9d7e325ba62532c3852000 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6da60dcfb97fd5d26a7f17a2cfc6badc inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(const gchar **) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6da60dcfb97fd5d26a7f17a2cfc6badc">listActionPrefixes</a></td></tr>
<tr class="separator:a6da60dcfb97fd5d26a7f17a2cfc6badc inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a47decdb6f7659b5a8bd43be00385844c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GList *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a47decdb6f7659b5a8bd43be00385844c">listMnemonicLabels</a></td></tr>
<tr class="separator:a47decdb6f7659b5a8bd43be00385844c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad14f1a1d618e9077733922449ce63cf6 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ad14f1a1d618e9077733922449ce63cf6">map</a></td></tr>
<tr class="separator:ad14f1a1d618e9077733922449ce63cf6 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aea6173a39482420a935f3c261149ca8c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aea6173a39482420a935f3c261149ca8c">mnemonicActivate:</a></td></tr>
<tr class="separator:aea6173a39482420a935f3c261149ca8c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5649fc7fe9bc19316b2c2b1986d42c28 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a5649fc7fe9bc19316b2c2b1986d42c28">modifyBaseWithState:andColor:</a></td></tr>
<tr class="separator:a5649fc7fe9bc19316b2c2b1986d42c28 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a50e976a3c7831fbcc18a6fae5c5fda56 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a50e976a3c7831fbcc18a6fae5c5fda56">modifyBgWithState:andColor:</a></td></tr>
<tr class="separator:a50e976a3c7831fbcc18a6fae5c5fda56 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4703525b25265590d79020e7252d0a1b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4703525b25265590d79020e7252d0a1b">modifyCursorWithPrimary:andSecondary:</a></td></tr>
<tr class="separator:a4703525b25265590d79020e7252d0a1b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a74b01ac3098c6145a8bc7d34ea866509 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a74b01ac3098c6145a8bc7d34ea866509">modifyFgWithState:andColor:</a></td></tr>
<tr class="separator:a74b01ac3098c6145a8bc7d34ea866509 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9af39fb46882c1c5c2a1034b6cdac799 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a9af39fb46882c1c5c2a1034b6cdac799">modifyFont:</a></td></tr>
<tr class="separator:a9af39fb46882c1c5c2a1034b6cdac799 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a71767829b33aecfb6dbbbb6c0002bab8 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a71767829b33aecfb6dbbbb6c0002bab8">modifyStyle:</a></td></tr>
<tr class="separator:a71767829b33aecfb6dbbbb6c0002bab8 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3054e88109435d5376b7432878004b07 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3054e88109435d5376b7432878004b07">modifyTextWithState:andColor:</a></td></tr>
<tr class="separator:a3054e88109435d5376b7432878004b07 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab9497e604fa20880240adf8e5f23249b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab9497e604fa20880240adf8e5f23249b">overrideBackgroundColorWithState:andColor:</a></td></tr>
<tr class="separator:ab9497e604fa20880240adf8e5f23249b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5e9689020633173c026fe7cd053507db inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a5e9689020633173c026fe7cd053507db">overrideColorWithState:andColor:</a></td></tr>
<tr class="separator:a5e9689020633173c026fe7cd053507db inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7d83d6facc8960c52ef0f37f56b71456 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7d83d6facc8960c52ef0f37f56b71456">overrideCursorWithCursor:andSecondaryCursor:</a></td></tr>
<tr class="separator:a7d83d6facc8960c52ef0f37f56b71456 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad23c9554f782ec5f06d6149b3825c23f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ad23c9554f782ec5f06d6149b3825c23f">overrideFont:</a></td></tr>
<tr class="separator:ad23c9554f782ec5f06d6149b3825c23f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac248f93aa49c5e775d6d5df93ccba2af inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac248f93aa49c5e775d6d5df93ccba2af">overrideSymbolicColorWithName:andColor:</a></td></tr>
<tr class="separator:ac248f93aa49c5e775d6d5df93ccba2af inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a12622c4b380c9007043da3177e81e8aa inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a12622c4b380c9007043da3177e81e8aa">pathWithPathLength:andPath:andPathReversed:</a></td></tr>
<tr class="separator:a12622c4b380c9007043da3177e81e8aa inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae258b9f503fe8aa097eb6a4ac96b44f2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae258b9f503fe8aa097eb6a4ac96b44f2">queueAllocate</a></td></tr>
<tr class="separator:ae258b9f503fe8aa097eb6a4ac96b44f2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4aae1336c0e2dcb08be4774d2ebe57f7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4aae1336c0e2dcb08be4774d2ebe57f7">queueComputeExpand</a></td></tr>
<tr class="separator:a4aae1336c0e2dcb08be4774d2ebe57f7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a397a2f86ddd1cfd7778410de7eb7c9a6 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a397a2f86ddd1cfd7778410de7eb7c9a6">queueDraw</a></td></tr>
<tr class="separator:a397a2f86ddd1cfd7778410de7eb7c9a6 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abd55800adfc42adadadb7ab6025f0e2f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abd55800adfc42adadadb7ab6025f0e2f">queueDrawAreaWithX:andY:andWidth:andHeight:</a></td></tr>
<tr class="separator:abd55800adfc42adadadb7ab6025f0e2f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac06bdcc0d01cd4fc6889b5f41aa698e4 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac06bdcc0d01cd4fc6889b5f41aa698e4">queueDrawRegion:</a></td></tr>
<tr class="separator:ac06bdcc0d01cd4fc6889b5f41aa698e4 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a57ea2b06dfeacd0a658c32bdc91468c7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a57ea2b06dfeacd0a658c32bdc91468c7">queueResize</a></td></tr>
<tr class="separator:a57ea2b06dfeacd0a658c32bdc91468c7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa45c06501e4ab39c63f71e62e6da7495 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa45c06501e4ab39c63f71e62e6da7495">queueResizeNoRedraw</a></td></tr>
<tr class="separator:aa45c06501e4ab39c63f71e62e6da7495 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab73862f0fc23d7dd6c8e23dd29614bff inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab73862f0fc23d7dd6c8e23dd29614bff">realize</a></td></tr>
<tr class="separator:ab73862f0fc23d7dd6c8e23dd29614bff inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa0e9189128f88ddcba28fa071348f02f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(cairo_region_t *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa0e9189128f88ddcba28fa071348f02f">regionIntersect:</a></td></tr>
<tr class="separator:aa0e9189128f88ddcba28fa071348f02f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8cd7cf9072471ba4832f295b0227091c inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8cd7cf9072471ba4832f295b0227091c">registerWindow:</a></td></tr>
<tr class="separator:a8cd7cf9072471ba4832f295b0227091c inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3d13e915a1e393e2040449e385183e0f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3d13e915a1e393e2040449e385183e0f">removeAcceleratorWithAccelGroup:andAccelKey:andAccelMods:</a></td></tr>
<tr class="separator:a3d13e915a1e393e2040449e385183e0f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a643b6c0d2ce828876e1e4e225193d260 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a643b6c0d2ce828876e1e4e225193d260">removeMnemonicLabel:</a></td></tr>
<tr class="separator:a643b6c0d2ce828876e1e4e225193d260 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa8ca32a6ce14d6dba580300408aeb12f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa8ca32a6ce14d6dba580300408aeb12f">removeTickCallback:</a></td></tr>
<tr class="separator:aa8ca32a6ce14d6dba580300408aeb12f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a82b1fdd309f049c9f43f35516951d1e7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkPixbuf *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a82b1fdd309f049c9f43f35516951d1e7">renderIconWithStockId:andSize:andDetail:</a></td></tr>
<tr class="separator:a82b1fdd309f049c9f43f35516951d1e7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0e84ded29a2b2a9f1a0ed629be9db5cb inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GdkPixbuf *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a0e84ded29a2b2a9f1a0ed629be9db5cb">renderIconPixbufWithStockId:andSize:</a></td></tr>
<tr class="separator:a0e84ded29a2b2a9f1a0ed629be9db5cb inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8d4a9a0a25f245ae6f9ec4f605ba57f4 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8d4a9a0a25f245ae6f9ec4f605ba57f4">reparent:</a></td></tr>
<tr class="separator:a8d4a9a0a25f245ae6f9ec4f605ba57f4 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af464c26c504c62e173ebf96ca5897897 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af464c26c504c62e173ebf96ca5897897">resetRcStyles</a></td></tr>
<tr class="separator:af464c26c504c62e173ebf96ca5897897 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7fe988f7b82f68af5093a9e7ae7aa624 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7fe988f7b82f68af5093a9e7ae7aa624">resetStyle</a></td></tr>
<tr class="separator:a7fe988f7b82f68af5093a9e7ae7aa624 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a223360a3b7871a5e57e5ff5db93d59ec inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(gint) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a223360a3b7871a5e57e5ff5db93d59ec">sendExpose:</a></td></tr>
<tr class="separator:a223360a3b7871a5e57e5ff5db93d59ec inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a621cf231992241ea4b6a712a1c72bc60 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a621cf231992241ea4b6a712a1c72bc60">sendFocusChange:</a></td></tr>
<tr class="separator:a621cf231992241ea4b6a712a1c72bc60 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa6f616f327918b4a5ebeb8ce74dc7364 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aa6f616f327918b4a5ebeb8ce74dc7364">setAccelPathWithAccelPath:andAccelGroup:</a></td></tr>
<tr class="separator:aa6f616f327918b4a5ebeb8ce74dc7364 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6e6bc9bce25661bd01d345b619c45f75 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6e6bc9bce25661bd01d345b619c45f75">setAllocation:</a></td></tr>
<tr class="separator:a6e6bc9bce25661bd01d345b619c45f75 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afe291d4a47b8153e09759db24d7390a0 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#afe291d4a47b8153e09759db24d7390a0">setAppPaintable:</a></td></tr>
<tr class="separator:afe291d4a47b8153e09759db24d7390a0 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abfa0fa606bb6b4806b57e38ab5105c7e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abfa0fa606bb6b4806b57e38ab5105c7e">setCanDefault:</a></td></tr>
<tr class="separator:abfa0fa606bb6b4806b57e38ab5105c7e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acdb5b0ff287adff2967debc6f3a5d909 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#acdb5b0ff287adff2967debc6f3a5d909">setCanFocus:</a></td></tr>
<tr class="separator:acdb5b0ff287adff2967debc6f3a5d909 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6413144416976875ff2cddb457dcb47b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6413144416976875ff2cddb457dcb47b">setChildVisible:</a></td></tr>
<tr class="separator:a6413144416976875ff2cddb457dcb47b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7be14cf860b4de3eaadb244692a78cb7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7be14cf860b4de3eaadb244692a78cb7">setClip:</a></td></tr>
<tr class="separator:a7be14cf860b4de3eaadb244692a78cb7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a89a87db3d8f4f5d8845a11a47d4dbef4 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a89a87db3d8f4f5d8845a11a47d4dbef4">setCompositeName:</a></td></tr>
<tr class="separator:a89a87db3d8f4f5d8845a11a47d4dbef4 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abea446f072aae2b7b5ec45f9d1918b38 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#abea446f072aae2b7b5ec45f9d1918b38">setDeviceEnabledWithDevice:andEnabled:</a></td></tr>
<tr class="separator:abea446f072aae2b7b5ec45f9d1918b38 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae17b6069d7a6799347bddf614cb6300e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae17b6069d7a6799347bddf614cb6300e">setDeviceEventsWithDevice:andEvents:</a></td></tr>
<tr class="separator:ae17b6069d7a6799347bddf614cb6300e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a46eb42bb649a1abd59b1e398e6e3c58d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a46eb42bb649a1abd59b1e398e6e3c58d">setDirection:</a></td></tr>
<tr class="separator:a46eb42bb649a1abd59b1e398e6e3c58d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adcfda1434b8a006065595260ecb2361a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#adcfda1434b8a006065595260ecb2361a">setDoubleBuffered:</a></td></tr>
<tr class="separator:adcfda1434b8a006065595260ecb2361a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac9578fc2db474f42281e9d2039fb9214 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac9578fc2db474f42281e9d2039fb9214">setEvents:</a></td></tr>
<tr class="separator:ac9578fc2db474f42281e9d2039fb9214 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a71625cf1471dcd8a095420c06921bb88 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a71625cf1471dcd8a095420c06921bb88">setFocusOnClick:</a></td></tr>
<tr class="separator:a71625cf1471dcd8a095420c06921bb88 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8c00c395c4c35b5ab2961d294b79b5bd inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8c00c395c4c35b5ab2961d294b79b5bd">setFontMap:</a></td></tr>
<tr class="separator:a8c00c395c4c35b5ab2961d294b79b5bd inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab709e7da857cc413349e76c82a4eb644 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ab709e7da857cc413349e76c82a4eb644">setFontOptions:</a></td></tr>
<tr class="separator:ab709e7da857cc413349e76c82a4eb644 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a909f65ffdce391704302d83763920f10 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a909f65ffdce391704302d83763920f10">setHalign:</a></td></tr>
<tr class="separator:a909f65ffdce391704302d83763920f10 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1ae312130de54ba26f948e30e6cbe3a2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1ae312130de54ba26f948e30e6cbe3a2">setHasTooltip:</a></td></tr>
<tr class="separator:a1ae312130de54ba26f948e30e6cbe3a2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d5ad35eaf1aa483a1e45961a752c47d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a2d5ad35eaf1aa483a1e45961a752c47d">setHasWindow:</a></td></tr>
<tr class="separator:a2d5ad35eaf1aa483a1e45961a752c47d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6ab2506e8e063882714af8e792676927 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6ab2506e8e063882714af8e792676927">setHexpand:</a></td></tr>
<tr class="separator:a6ab2506e8e063882714af8e792676927 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aacb4fdf95b3b5b4fa8aafef1b9c01df0 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aacb4fdf95b3b5b4fa8aafef1b9c01df0">setHexpandSet:</a></td></tr>
<tr class="separator:aacb4fdf95b3b5b4fa8aafef1b9c01df0 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2e904b919493da61d474e6226e13884d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a2e904b919493da61d474e6226e13884d">setMapped:</a></td></tr>
<tr class="separator:a2e904b919493da61d474e6226e13884d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3c4a59759408832a079189cda6c8689e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3c4a59759408832a079189cda6c8689e">setMarginBottom:</a></td></tr>
<tr class="separator:a3c4a59759408832a079189cda6c8689e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a56e29b11df29273292a35ef0119d4d7d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a56e29b11df29273292a35ef0119d4d7d">setMarginEnd:</a></td></tr>
<tr class="separator:a56e29b11df29273292a35ef0119d4d7d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acdeb4e26f5cdd0f7af4e5aaa87dea0d2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#acdeb4e26f5cdd0f7af4e5aaa87dea0d2">setMarginLeft:</a></td></tr>
<tr class="separator:acdeb4e26f5cdd0f7af4e5aaa87dea0d2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac335c54485edd4855e9945dca7dbbc6e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac335c54485edd4855e9945dca7dbbc6e">setMarginRight:</a></td></tr>
<tr class="separator:ac335c54485edd4855e9945dca7dbbc6e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1415b3e839cf72a0512d4b4d1594878e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1415b3e839cf72a0512d4b4d1594878e">setMarginStart:</a></td></tr>
<tr class="separator:a1415b3e839cf72a0512d4b4d1594878e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af3a59b808cedc70dcc84a33d96d142c4 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af3a59b808cedc70dcc84a33d96d142c4">setMarginTop:</a></td></tr>
<tr class="separator:af3a59b808cedc70dcc84a33d96d142c4 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a44a6a0461dfaeb56e2b3ff0e5ec47088 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a44a6a0461dfaeb56e2b3ff0e5ec47088">setName:</a></td></tr>
<tr class="separator:a44a6a0461dfaeb56e2b3ff0e5ec47088 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adafb02c611faf14312893a91defaaa5e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#adafb02c611faf14312893a91defaaa5e">setNoShowAll:</a></td></tr>
<tr class="separator:adafb02c611faf14312893a91defaaa5e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a151995f128f9bb6cc22812c25c074d49 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a151995f128f9bb6cc22812c25c074d49">setOpacity:</a></td></tr>
<tr class="separator:a151995f128f9bb6cc22812c25c074d49 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af56ad043233d7343c7d3bf0d33c9ed49 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af56ad043233d7343c7d3bf0d33c9ed49">setParent:</a></td></tr>
<tr class="separator:af56ad043233d7343c7d3bf0d33c9ed49 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac06f0b53ee3781718f509499fa6783fb inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac06f0b53ee3781718f509499fa6783fb">setParentWindow:</a></td></tr>
<tr class="separator:ac06f0b53ee3781718f509499fa6783fb inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a565bfecd9ee4606ccb1c949220cdb3 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a4a565bfecd9ee4606ccb1c949220cdb3">setRealized:</a></td></tr>
<tr class="separator:a4a565bfecd9ee4606ccb1c949220cdb3 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a485c2ae222bf338d20b566f94beafeaa inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a485c2ae222bf338d20b566f94beafeaa">setReceivesDefault:</a></td></tr>
<tr class="separator:a485c2ae222bf338d20b566f94beafeaa inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac6214115d0bb3524a139687db29183dc inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac6214115d0bb3524a139687db29183dc">setRedrawOnAllocate:</a></td></tr>
<tr class="separator:ac6214115d0bb3524a139687db29183dc inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af779d72c265ad6b420088a4e677795f9 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#af779d72c265ad6b420088a4e677795f9">setSensitive:</a></td></tr>
<tr class="separator:af779d72c265ad6b420088a4e677795f9 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adb3a0759ea886cf3d993df16b638771a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#adb3a0759ea886cf3d993df16b638771a">setSizeRequestWithWidth:andHeight:</a></td></tr>
<tr class="separator:adb3a0759ea886cf3d993df16b638771a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae1e6710e2f81bdd00df56af1843a04d2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ae1e6710e2f81bdd00df56af1843a04d2">setState:</a></td></tr>
<tr class="separator:ae1e6710e2f81bdd00df56af1843a04d2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3b89087c99f47400392ca1c6d1736129 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3b89087c99f47400392ca1c6d1736129">setStateFlagsWithFlags:andClear:</a></td></tr>
<tr class="separator:a3b89087c99f47400392ca1c6d1736129 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a308d2aeb940c9f6693111bdc4e9019a2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a308d2aeb940c9f6693111bdc4e9019a2">setStyle:</a></td></tr>
<tr class="separator:a308d2aeb940c9f6693111bdc4e9019a2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1e810a26a2ca787b1199b00a11ce3b4d inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1e810a26a2ca787b1199b00a11ce3b4d">setSupportMultidevice:</a></td></tr>
<tr class="separator:a1e810a26a2ca787b1199b00a11ce3b4d inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a11b94bc82753589ce7cc19b0ecd3c29e inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a11b94bc82753589ce7cc19b0ecd3c29e">setTooltipMarkup:</a></td></tr>
<tr class="separator:a11b94bc82753589ce7cc19b0ecd3c29e inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afafca4e6bd6d73ec51fb84b1426dc455 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#afafca4e6bd6d73ec51fb84b1426dc455">setTooltipText:</a></td></tr>
<tr class="separator:afafca4e6bd6d73ec51fb84b1426dc455 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a326a2bb86862cc26924598f52665f87f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a326a2bb86862cc26924598f52665f87f">setTooltipWindow:</a></td></tr>
<tr class="separator:a326a2bb86862cc26924598f52665f87f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a67893ebb6d07677f3d00608540a9d5df inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a67893ebb6d07677f3d00608540a9d5df">setValign:</a></td></tr>
<tr class="separator:a67893ebb6d07677f3d00608540a9d5df inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a46f0ca07fb2cbe2004f37b0ee2edfe76 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a46f0ca07fb2cbe2004f37b0ee2edfe76">setVexpand:</a></td></tr>
<tr class="separator:a46f0ca07fb2cbe2004f37b0ee2edfe76 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a54edff6d04876a172d6f3cbf324962bc inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a54edff6d04876a172d6f3cbf324962bc">setVexpandSet:</a></td></tr>
<tr class="separator:a54edff6d04876a172d6f3cbf324962bc inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afcc4c3c6070f49c2cf49ac6328774d97 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#afcc4c3c6070f49c2cf49ac6328774d97">setVisible:</a></td></tr>
<tr class="separator:afcc4c3c6070f49c2cf49ac6328774d97 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a31a85055a1b7bdfe704b5dc21bba1234 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a31a85055a1b7bdfe704b5dc21bba1234">setVisual:</a></td></tr>
<tr class="separator:a31a85055a1b7bdfe704b5dc21bba1234 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a501ab42e3088c78603aee0228371909f inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a501ab42e3088c78603aee0228371909f">setWindow:</a></td></tr>
<tr class="separator:a501ab42e3088c78603aee0228371909f inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afed4ead169c3614070d3a52955afe373 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#afed4ead169c3614070d3a52955afe373">shapeCombineRegion:</a></td></tr>
<tr class="separator:afed4ead169c3614070d3a52955afe373 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7b5d401676c78dbccb41f4ad8d3383af inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a7b5d401676c78dbccb41f4ad8d3383af">show</a></td></tr>
<tr class="separator:a7b5d401676c78dbccb41f4ad8d3383af inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1263a8ad40d5f71f74dd9e957628749a inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1263a8ad40d5f71f74dd9e957628749a">showAll</a></td></tr>
<tr class="separator:a1263a8ad40d5f71f74dd9e957628749a inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a99a69302361c3191a11763332a657318 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a99a69302361c3191a11763332a657318">showNow</a></td></tr>
<tr class="separator:a99a69302361c3191a11763332a657318 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3759d78a2a09fe63af25bf3b02028dba inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3759d78a2a09fe63af25bf3b02028dba">sizeAllocate:</a></td></tr>
<tr class="separator:a3759d78a2a09fe63af25bf3b02028dba inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a63c9d00979e2ee28dc3ea33262ac3464 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a63c9d00979e2ee28dc3ea33262ac3464">sizeAllocateWithBaselineWithAllocation:andBaseline:</a></td></tr>
<tr class="separator:a63c9d00979e2ee28dc3ea33262ac3464 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a12eb9f5051b0406e87ad256c1da99d28 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a12eb9f5051b0406e87ad256c1da99d28">sizeRequest:</a></td></tr>
<tr class="separator:a12eb9f5051b0406e87ad256c1da99d28 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef49bd32369b6ebba3a6113debe49059 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aef49bd32369b6ebba3a6113debe49059">styleAttach</a></td></tr>
<tr class="separator:aef49bd32369b6ebba3a6113debe49059 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6f5e46d70736a8878e84d2ff7689b6b2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a6f5e46d70736a8878e84d2ff7689b6b2">styleGetPropertyWithPropertyName:andValue:</a></td></tr>
<tr class="separator:a6f5e46d70736a8878e84d2ff7689b6b2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaa45bebc29fb3ba57b53f94f83f2a342 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#aaa45bebc29fb3ba57b53f94f83f2a342">styleGetValistWithFirstPropertyName:andVarArgs:</a></td></tr>
<tr class="separator:aaa45bebc29fb3ba57b53f94f83f2a342 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1ab0ebd7170c0edf4d32d521f19869f7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a1ab0ebd7170c0edf4d32d521f19869f7">thawChildNotify</a></td></tr>
<tr class="separator:a1ab0ebd7170c0edf4d32d521f19869f7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3fa237e6e9a657ac27fff2fa94128fb2 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a3fa237e6e9a657ac27fff2fa94128fb2">translateCoordinatesWithDestWidget:andSrcX:andSrcY:andDestX:andDestY:</a></td></tr>
<tr class="separator:a3fa237e6e9a657ac27fff2fa94128fb2 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0510c02173a437fdd49d94d562f412b3 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a0510c02173a437fdd49d94d562f412b3">triggerTooltipQuery</a></td></tr>
<tr class="separator:a0510c02173a437fdd49d94d562f412b3 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0273ae8822a1f19b27b78c04def9165b inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a0273ae8822a1f19b27b78c04def9165b">unmap</a></td></tr>
<tr class="separator:a0273ae8822a1f19b27b78c04def9165b inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8b9b596cb260a701ddbe450521fbc571 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a8b9b596cb260a701ddbe450521fbc571">unparent</a></td></tr>
<tr class="separator:a8b9b596cb260a701ddbe450521fbc571 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a35765c8138aed8d79a05d661e14cab47 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#a35765c8138aed8d79a05d661e14cab47">unrealize</a></td></tr>
<tr class="separator:a35765c8138aed8d79a05d661e14cab47 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afca614d00df68991eeadb12864232df7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#afca614d00df68991eeadb12864232df7">unregisterWindow:</a></td></tr>
<tr class="separator:afca614d00df68991eeadb12864232df7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac2598a4f7e6c9ea33b1d04c9c64ac4c7 inherit pub_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKWidget.html#ac2598a4f7e6c9ea33b1d04c9c64ac4c7">unsetStateFlags:</a></td></tr>
<tr class="separator:ac2598a4f7e6c9ea33b1d04c9c64ac4c7 inherit pub_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_interfaceCGTKBase"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_interfaceCGTKBase')"><img src="closed.png" alt="-"/> Instance Methods inherited from <a class="el" href="interfaceCGTKBase.html">CGTKBase</a></td></tr>
<tr class="memitem:a94d3a3ecf62077e420e370ca4a72bbd6 inherit pub_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBase.html#a94d3a3ecf62077e420e370ca4a72bbd6">initWithGObject:</a></td></tr>
<tr class="separator:a94d3a3ecf62077e420e370ca4a72bbd6 inherit pub_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad080954f73c40813909f6a477d482b75 inherit pub_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBase.html#ad080954f73c40813909f6a477d482b75">setGObject:</a></td></tr>
<tr class="separator:ad080954f73c40813909f6a477d482b75 inherit pub_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a07553be10a943fead663d4b3f5ed791d inherit pub_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(GObject *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBase.html#a07553be10a943fead663d4b3f5ed791d">GOBJECT</a></td></tr>
<tr class="separator:a07553be10a943fead663d4b3f5ed791d inherit pub_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a94d3a3ecf62077e420e370ca4a72bbd6 inherit pub_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBase.html#a94d3a3ecf62077e420e370ca4a72bbd6">initWithGObject:</a></td></tr>
<tr class="separator:a94d3a3ecf62077e420e370ca4a72bbd6 inherit pub_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad080954f73c40813909f6a477d482b75 inherit pub_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBase.html#ad080954f73c40813909f6a477d482b75">setGObject:</a></td></tr>
<tr class="separator:ad080954f73c40813909f6a477d482b75 inherit pub_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a07553be10a943fead663d4b3f5ed791d inherit pub_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(GObject *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="interfaceCGTKBase.html#a07553be10a943fead663d4b3f5ed791d">GOBJECT</a></td></tr>
<tr class="separator:a07553be10a943fead663d4b3f5ed791d inherit pub_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_interfaceCGTKWidget"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_interfaceCGTKWidget')"><img src="closed.png" alt="-"/> Class Methods inherited from <a class="el" href="interfaceCGTKWidget.html">CGTKWidget</a></td></tr>
<tr class="memitem:a0bd57b572cd41e78a0f78a45eb3aac0a inherit pub_static_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top">(GtkTextDirection) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="interfaceCGTKWidget.html#a0bd57b572cd41e78a0f78a45eb3aac0a">getDefaultDirection</a></td></tr>
<tr class="separator:a0bd57b572cd41e78a0f78a45eb3aac0a inherit pub_static_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a39125b678a41fc67b33efe9fd0bf84af inherit pub_static_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top"><a id="a39125b678a41fc67b33efe9fd0bf84af"></a>
(GtkStyle *) </td><td class="memItemRight" valign="bottom">+ <b>getDefaultStyle</b></td></tr>
<tr class="separator:a39125b678a41fc67b33efe9fd0bf84af inherit pub_static_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a89e1556f7e47fd5dce259cb30360b789 inherit pub_static_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top"><a id="a89e1556f7e47fd5dce259cb30360b789"></a>
(void) </td><td class="memItemRight" valign="bottom">+ <b>popCompositeChild</b></td></tr>
<tr class="separator:a89e1556f7e47fd5dce259cb30360b789 inherit pub_static_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6ca397ec9ebb220659a04c0a4db9aab4 inherit pub_static_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top"><a id="a6ca397ec9ebb220659a04c0a4db9aab4"></a>
(void) </td><td class="memItemRight" valign="bottom">+ <b>pushCompositeChild</b></td></tr>
<tr class="separator:a6ca397ec9ebb220659a04c0a4db9aab4 inherit pub_static_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a880634844ada752e696c721afa52f055 inherit pub_static_methods_interfaceCGTKWidget"><td class="memItemLeft" align="right" valign="top"><a id="a880634844ada752e696c721afa52f055"></a>
(void) </td><td class="memItemRight" valign="bottom">+ <b>setDefaultDirection:</b></td></tr>
<tr class="separator:a880634844ada752e696c721afa52f055 inherit pub_static_methods_interfaceCGTKWidget"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_static_methods_interfaceCGTKBase"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_interfaceCGTKBase')"><img src="closed.png" alt="-"/> Class Methods inherited from <a class="el" href="interfaceCGTKBase.html">CGTKBase</a></td></tr>
<tr class="memitem:a804322c9fb01b3873c9fd6d12f1f64a3 inherit pub_static_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interfaceCGTKBase.html">CGTKBase</a> *) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="interfaceCGTKBase.html#a804322c9fb01b3873c9fd6d12f1f64a3">withGObject:</a></td></tr>
<tr class="separator:a804322c9fb01b3873c9fd6d12f1f64a3 inherit pub_static_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a804322c9fb01b3873c9fd6d12f1f64a3 inherit pub_static_methods_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="interfaceCGTKBase.html">CGTKBase</a> *) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="interfaceCGTKBase.html#a804322c9fb01b3873c9fd6d12f1f64a3">withGObject:</a></td></tr>
<tr class="separator:a804322c9fb01b3873c9fd6d12f1f64a3 inherit pub_static_methods_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pro_attribs_interfaceCGTKBase"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_interfaceCGTKBase')"><img src="closed.png" alt="-"/> Protected Attributes inherited from <a class="el" href="interfaceCGTKBase.html">CGTKBase</a></td></tr>
<tr class="memitem:a16378c0eef600564798376045483e689 inherit pro_attribs_interfaceCGTKBase"><td class="memItemLeft" align="right" valign="top">GObject * </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceCGTKBase.html#a16378c0eef600564798376045483e689">__gObject</a></td></tr>
<tr class="separator:a16378c0eef600564798376045483e689 inherit pro_attribs_interfaceCGTKBase"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Method Documentation</h2>
<a id="ac2faf6efc0b4e086eff9e31759ce73b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2faf6efc0b4e086eff9e31759ce73b7">◆ </a></span>getChildRevealed()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) getChildRevealed </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>-(BOOL*)getChildRevealed;</p>
<dl class="section return"><dt>Returns</dt><dd>BOOL </dd></dl>
</div>
</div>
<a id="ae8727fa7f9007c48228da543cb52386c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae8727fa7f9007c48228da543cb52386c">◆ </a></span>getRevealChild()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) getRevealChild </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>-(BOOL*)getRevealChild;</p>
<dl class="section return"><dt>Returns</dt><dd>BOOL </dd></dl>
</div>
</div>
<a id="aae97d87143cb987f0f01d7161fc274a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae97d87143cb987f0f01d7161fc274a8">◆ </a></span>getTransitionDuration()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (guint) getTransitionDuration </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>-(guint*)getTransitionDuration;</p>
<dl class="section return"><dt>Returns</dt><dd>guint </dd></dl>
</div>
</div>
<a id="a505c7081e5524dcab1fcbf023566c83a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a505c7081e5524dcab1fcbf023566c83a">◆ </a></span>getTransitionType()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (GtkRevealerTransitionType) getTransitionType </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>-(GtkRevealerTransitionType*)getTransitionType;</p>
<dl class="section return"><dt>Returns</dt><dd>GtkRevealerTransitionType </dd></dl>
</div>
</div>
<a id="a53d34850b0873611933656a93238a872"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a53d34850b0873611933656a93238a872">◆ </a></span>init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) init </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructors </p>
</div>
</div>
<a id="a493772f0d7580e575fb6c4d40fbefd98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a493772f0d7580e575fb6c4d40fbefd98">◆ </a></span>REVEALER()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (GtkRevealer*) REVEALER </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Methods </p>
</div>
</div>
<a id="a025227948311c65d5e514304295e6008"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a025227948311c65d5e514304295e6008">◆ </a></span>setRevealChild:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setRevealChild: </td>
<td></td>
<td class="paramtype">(BOOL) </td>
<td class="paramname"><em>revealChild</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>-(void*)<a class="el" href="interfaceCGTKRevealer.html#a025227948311c65d5e514304295e6008">setRevealChild:</a> revealChild;</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">revealChild</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ab493ca7b7c28cc610a5be0a91bab74aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab493ca7b7c28cc610a5be0a91bab74aa">◆ </a></span>setTransitionDuration:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setTransitionDuration: </td>
<td></td>
<td class="paramtype">(guint) </td>
<td class="paramname"><em>duration</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>-(void*)<a class="el" href="interfaceCGTKRevealer.html#ab493ca7b7c28cc610a5be0a91bab74aa">setTransitionDuration:</a> duration;</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">duration</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aea4f2ff04ef2a003304abf3a39b740c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea4f2ff04ef2a003304abf3a39b740c4">◆ </a></span>setTransitionType:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setTransitionType: </td>
<td></td>
<td class="paramtype">(GtkRevealerTransitionType) </td>
<td class="paramname"><em>transition</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>-(void*)<a class="el" href="interfaceCGTKRevealer.html#aea4f2ff04ef2a003304abf3a39b740c4">setTransitionType:</a> transition;</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">transition</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="CGTKRevealer_8h_source.html">CGTKRevealer.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Nov 4 2017 23:23:29 for CoreGTKGen by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
|
tylerburton/coregtkgen
|
docs/reference/html/interfaceCGTKRevealer.html
|
HTML
|
gpl-2.0
| 162,724 |
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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, USA
*
*
******************************************************************************/
#ifndef __RTW_LED_H_
#define __RTW_LED_H_
#include <drv_conf.h>
#include <osdep_service.h>
#include <drv_types.h>
#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
#define LED_BLINK_NORMAL_INTERVAL 100
#define LED_BLINK_SLOWLY_INTERVAL 200
#define LED_BLINK_LONG_INTERVAL 400
#define LED_BLINK_NO_LINK_INTERVAL_ALPHA 1000
#define LED_BLINK_LINK_INTERVAL_ALPHA 500 //500
#define LED_BLINK_SCAN_INTERVAL_ALPHA 180 //150
#define LED_BLINK_FASTER_INTERVAL_ALPHA 50
#define LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA 5000
#define LED_BLINK_NORMAL_INTERVAL_NETTRONIX 100
#define LED_BLINK_SLOWLY_INTERVAL_NETTRONIX 2000
#define LED_BLINK_SLOWLY_INTERVAL_PORNET 1000
#define LED_BLINK_NORMAL_INTERVAL_PORNET 100
#define LED_BLINK_FAST_INTERVAL_BITLAND 30
// 060403, rcnjko: Customized for AzWave.
#define LED_CM2_BLINK_ON_INTERVAL 250
#define LED_CM2_BLINK_OFF_INTERVAL 4750
#define LED_CM8_BLINK_INTERVAL 500 //for QMI
#define LED_CM8_BLINK_OFF_INTERVAL 3750 //for QMI
// 080124, lanhsin: Customized for RunTop
#define LED_RunTop_BLINK_INTERVAL 300
// 060421, rcnjko: Customized for Sercomm Printer Server case.
#define LED_CM3_BLINK_INTERVAL 1500
typedef enum _LED_CTL_MODE{
LED_CTL_POWER_ON = 1,
LED_CTL_LINK = 2,
LED_CTL_NO_LINK = 3,
LED_CTL_TX = 4,
LED_CTL_RX = 5,
LED_CTL_SITE_SURVEY = 6,
LED_CTL_POWER_OFF = 7,
LED_CTL_START_TO_LINK = 8,
LED_CTL_START_WPS = 9,
LED_CTL_STOP_WPS = 10,
LED_CTL_START_WPS_BOTTON = 11, //added for runtop
LED_CTL_STOP_WPS_FAIL = 12, //added for ALPHA
LED_CTL_STOP_WPS_FAIL_OVERLAP = 13, //added for BELKIN
LED_CTL_CONNECTION_NO_TRANSFER = 14,
}LED_CTL_MODE;
typedef enum _LED_STATE_871x{
LED_UNKNOWN = 0,
RTW_LED_ON = 1,
RTW_LED_OFF = 2,
LED_BLINK_NORMAL = 3,
LED_BLINK_SLOWLY = 4,
LED_BLINK_POWER_ON = 5,
LED_BLINK_SCAN = 6, // LED is blinking during scanning period, the # of times to blink is depend on time for scanning.
LED_BLINK_NO_LINK = 7, // LED is blinking during no link state.
LED_BLINK_StartToBlink = 8,// Customzied for Sercomm Printer Server case
LED_BLINK_TXRX = 9,
LED_BLINK_WPS = 10, // LED is blinkg during WPS communication
LED_BLINK_WPS_STOP = 11, //for ALPHA
LED_BLINK_WPS_STOP_OVERLAP = 12, //for BELKIN
LED_BLINK_RUNTOP = 13, // Customized for RunTop
LED_BLINK_CAMEO = 14,
LED_BLINK_XAVI = 15,
LED_BLINK_ALWAYS_ON = 16,
}LED_STATE_871x;
typedef enum _LED_PIN_871x{
LED_PIN_NULL = 0,
LED_PIN_LED0 = 1,
LED_PIN_LED1 = 2,
LED_PIN_LED2 = 3,
LED_PIN_GPIO0 = 4,
}LED_PIN_871x;
typedef struct _LED_871x{
struct rtw_adapter *padapter;
LED_PIN_871x LedPin; // Identify how to implement this SW led.
LED_STATE_871x CurrLedState; // Current LED state.
LED_STATE_871x BlinkingLedState; // Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are.
u8 bLedOn; // true if LED is ON, false if LED is OFF.
u8 bLedBlinkInProgress; // true if it is blinking, false o.w..
u8 bLedWPSBlinkInProgress;
u32 BlinkTimes; // Number of times to toggle led state for blinking.
_timer BlinkTimer; // Timer object for led blinking.
u8 bSWLedCtrl;
// ALPHA, added by chiyoko, 20090106
u8 bLedNoLinkBlinkInProgress;
u8 bLedLinkBlinkInProgress;
u8 bLedStartToLinkBlinkInProgress;
u8 bLedScanBlinkInProgress;
struct work_struct BlinkWorkItem; // Workitem used by BlinkTimer to manipulate H/W to blink LED.
} LED_871x, *PLED_871x;
#define IS_LED_WPS_BLINKING(_LED_871x) (((PLED_871x)_LED_871x)->CurrLedState==LED_BLINK_WPS \
|| ((PLED_871x)_LED_871x)->CurrLedState==LED_BLINK_WPS_STOP \
|| ((PLED_871x)_LED_871x)->bLedWPSBlinkInProgress)
#define IS_LED_BLINKING(_LED_871x) (((PLED_871x)_LED_871x)->bLedWPSBlinkInProgress \
||((PLED_871x)_LED_871x)->bLedScanBlinkInProgress)
//================================================================================
// LED customization.
//================================================================================
typedef enum _LED_STRATEGY_871x{
SW_LED_MODE0 = 0, // SW control 1 LED via GPIO0. It is default option.
SW_LED_MODE1= 1, // 2 LEDs, through LED0 and LED1. For ALPHA.
SW_LED_MODE2 = 2, // SW control 1 LED via GPIO0, customized for AzWave 8187 minicard.
SW_LED_MODE3 = 3, // SW control 1 LED via GPIO0, customized for Sercomm Printer Server case.
SW_LED_MODE4 = 4, //for Edimax / Belkin
SW_LED_MODE5 = 5, //for Sercomm / Belkin
SW_LED_MODE6 = 6, //for 88CU minicard, porting from ce SW_LED_MODE7
HW_LED = 50, // HW control 2 LEDs, LED0 and LED1 (there are 4 different control modes, see MAC.CONFIG1 for details.)
LED_ST_NONE = 99,
}LED_STRATEGY_871x, *PLED_STRATEGY_871x;
void
LedControl871x(
struct rtw_adapter *padapter,
LED_CTL_MODE LedAction
);
struct led_priv{
/* add for led controll */
LED_871x SwLed0;
LED_871x SwLed1;
LED_STRATEGY_871x LedStrategy;
u8 bRegUseLed;
void (*LedControlHandler)(struct rtw_adapter *padapter, LED_CTL_MODE LedAction);
/* add for led controll */
};
#ifdef CONFIG_SW_LED
#define rtw_led_control(adapter, LedAction) \
do { \
if((adapter)->ledpriv.LedControlHandler) \
(adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); \
} while(0)
#else //CONFIG_SW_LED
#define rtw_led_control(adapter, LedAction)
#endif //CONFIG_SW_LED
void BlinkTimerCallback(void *data);
void BlinkWorkItemCallback(struct work_struct *work);
void ResetLedStatus(PLED_871x pLed);
void
InitLed871x(
struct rtw_adapter *padapter,
PLED_871x pLed,
LED_PIN_871x LedPin
);
void
DeInitLed871x(
PLED_871x pLed
);
//hal...
extern void BlinkHandler(PLED_871x pLed);
#endif //__RTW_LED_H_
|
olegk0/rk3x_kernel_3.0.36
|
drivers/net/wireless/rtl8723au_lwfinger/include/rtw_led.h
|
C
|
gpl-2.0
| 6,499 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ONIX Responsive Business & Portfolio Template</title>
<!-- Mobile Specific Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- CSS files begin-->
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700|Open+Sans+Condensed:700,300,300italic|Open+Sans:400,300italic,400italic,600,600italic,700,700italic,800,800italic|PT+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<link href="assets/css/responsiveslides.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/prettyPhoto.css" type='text/css'>
<link rel="stylesheet" href="assets/build/mediaelementplayer.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/slide-in.css" />
<!--[if lt IE 9]><link rel="stylesheet" type="text/css" media="screen" href="assets/css/slide-in.ie.css" /><![endif]-->
<link href="assets/css/style.css" rel="stylesheet">
<!-- Color Style Setting CSS file-->
<link href="assets/css/color-theme/color-sgrey.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- fav and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<!-- Head
================================================== -->
<div class="top-bar">
<div class="container">
<div class="row">
<div class="span6">
<!-- text widget begin here -->
<ul class="info-text pull-left">
<li>
<a href="#">Lorem ipsum dolor sit amet, consectetuer adipiscing elit Aenean commodo ligula eget.</a>
</li>
<li>
<a href="#">
This informational text widget - Buy this theme now !
</a>
</li>
<li>
<a href="#">
Lorem ipsum dolor sit
</a>
amet, consectetuer adipiscing elit. Aenean commodo ligula eget.
</li>
</ul>
</div>
<div class="span6">
<!-- social begin here -->
<ul class="socicon right top-w">
<li>
<a href="#" class="share-icon">
</a>
</li>
<li>
<a href="#" class="google">
</a>
</li>
<li>
<a href="#" class="facebook">
</a>
</li>
<li>
<a href="#" class="twitter">
</a>
</li>
<li>
<a href="#" class="flickr">
</a>
</li>
<li>
<a href="#" class="dribbble">
</a>
</li>
<li>
<a href="#" class="linkedin">
</a>
</li>
<li class="last">
<a href="#" class="vimeo">
</a>
</li>
</ul>
<form class="navbar-search pull-right" action="">
<input class="search-query" type="text">
</form>
</div>
</div>
</div>
</div>
<!-- Logo / Menu
================================================== -->
<header class="header">
<div class="container strip-line">
<div class="row">
<div class="span4">
<a href="index.html" class="logo">
<img src="assets/img/logo.png" alt="">
</a>
</div>
<div class="span8">
<nav>
<ul class="right">
<li>
<a href="index.html">
home
</a>
<ul>
<li>
<a href="index_2.html">
home two
</a>
</li>
</ul>
</li>
<li>
<a href="about.html">
about
</a>
</li>
<li>
<a href="features.html">
features
</a>
</li>
<li class="current">
<a href="portfolio.html">
portfolio
</a>
<ul>
<li>
<a href="portfolio-two.html">
portfolio two
</a>
</li>
<li>
<a href="portfolio-three.html">
portfolio three
</a>
</li>
<li>
<a href="portfolio-single.html">
single portfolio
</a>
</li>
<li>
<a href="portfolio-single-2.html">
single portfolio slider
</a>
</li>
<li>
<a href="portfolio-single-3.html">
single portfolio video
</a>
</li>
</ul>
</li>
<li>
<a href="blog.html">
blog
</a>
<ul>
<li>
<a href="blog_rs.html">
blog right sidebar
</a>
</li>
<li>
<a href="single-post.html">
single post
</a>
<ul>
<li>
<a href="#">
example level
</a>
</li>
<li>
<a href="#">
example level
</a>
</li>
</ul>
</li>
</ul>
</li>
<li>
<a href="contact.html">
contact
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="slider-cont">
<div class="container">
<header id="pagehead">
<h1>Portfolio <small> ⁄ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </small></h1>
</header>
</div>
</div>
<div class="container">
<!-- Portfolio filter
================================================== -->
<section>
<div class="row">
<ul id="portfolio-filter" class="span12">
<li>
<a href="javascript:void(0)" title="" class="currents">All</a>
</li>
<li>
<a href="javascript:void(0)" title="">Web</a>
</li>
<li>
<a href="javascript:void(0)" title="">Video</a>
</li>
<li>
<a href="javascript:void(0)" title="">Audio</a>
</li>
</ul>
</div>
<!-- Portfolio item
================================================== -->
<ul class="thumbnails portfolio" id="containment-portfolio">
<li class="span3 item-block web all">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="portfolio-single.html">
<img src="assets/img/example-sites/example1.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single-2.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
<li class="span3 item-block video all">
<iframe src="http://player.vimeo.com/video/28220269?title=0&byline=0&portrait=0" width="270" height="130" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<div class="desc">
<a href="portfolio-single-3.html">Vimeo Video </a>
<p> <em>Portfolio Item Vimeo</em> </p>
</div>
</li>
<li class="span3 item-block web all">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="#">
<img src="assets/img/example-sites/example1.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
<li class="span3 item-block">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="#">
<img src="assets/img/example-sites/example2.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single-2.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
<li class="span3 item-block audio all">
<audio src="assets/media/adg3com_electrofreak.mp3" type="audio/mp3" controls="controls"></audio>
<div class="desc">
<a href="portfolio-single.html">Local Audio </a>
<p> <em>Portfolio Item Audio</em> </p>
</div>
</li>
<li class="span3 item-block">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="#">
<img src="assets/img/example-sites/example2.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
<li class="span3 item-block">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="#">
<img src="assets/img/example-sites/example1.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
<li class="span3 item-block video all">
<div class="row">
<div class="span3">
<video src="assets/media/VH_videoAsset.flv" type="video/flv" controls="controls"></video>
</div>
</div>
<div class="desc">
<a href="portfolio-single-3.html"> Local Video </a>
<p> <em>Portfolio Item Local Video</em> </p>
</div>
</li>
<li class="span3 item-block web all">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="portfolio-single.html">
<img src="assets/img/example-sites/example1.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single-2.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
<li class="span3 item-block video all">
<iframe src="http://player.vimeo.com/video/28220269?title=0&byline=0&portrait=0" width="270" height="130" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<div class="desc">
<a href="portfolio-single-3.html">Vimeo Video </a>
<p> <em>Portfolio Item Vimeo</em> </p>
</div>
</li>
<li class="span3 item-block web all">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="#">
<img src="assets/img/example-sites/example1.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
<li class="span3 item-block">
<a href="assets/img/bootstrap-mdo-sfmoma-01.jpg" class="zoom" rel="prettyPhoto" title="Image Title"></a>
<a href="#" class="link"></a>
<a class="thumbnail" href="#">
<img src="assets/img/example-sites/example2.jpg" alt="example-item">
</a>
<div class="desc">
<a href="portfolio-single-2.html"> Images </a>
<p> <em>Portfolio Item Images</em> </p>
</div>
</li>
</ul>
</section>
<div class="divider"></div>
</div><!-- /container -->
<!-- Footer
================================================== -->
<footer>
<div class="container">
<div class="row">
<div class="span4">
<h3>About</h3>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.</p>
<h3>Connect With Us</h3>
<!-- social begin here -->
<ul class="socicon left">
<li>
<a href="#" class="share-icon">
</a>
</li>
<li>
<a href="#" class="google">
</a>
</li>
<li>
<a href="#" class="facebook">
</a>
</li>
<li>
<a href="#" class="twitter">
</a>
</li>
<li>
<a href="#" class="flickr">
</a>
</li>
<li>
<a href="#" class="dribbble">
</a>
</li>
<li>
<a href="#" class="linkedin">
</a>
</li>
<li class="last">
<a href="#" class="vimeo">
</a>
</li>
</ul>
</div>
<!-- tweets begin here -->
<div class="span4">
<h3>Latest Tweets</h3>
<div class="tweets">
<p>
Loading Tweets...
</p>
<ul id="tweet-list">
</ul>
</div>
</div>
<div class="span4">
<!-- flickr begin here -->
<h3>From Flickr</h3>
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=8&source=user&user=52617155@N08&layout=x&display=random&size=s"></script>
</div>
<div class="span12 copy">
© 2012 NLINE. All Rights Reserved.
</div>
</div>
</div>
</footer>
<!-- JavaScript files begin-->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="assets/js/jquery.form.js"></script>
<script src="assets/js/jquery.ufvalidator-1.0.5.js"></script>
<script src="assets/js/jquery.easing.1.3.js"></script>
<script src="assets/js/jquery.cycle.all.js"></script>
<script src="assets/js/jquery.prettyPhoto.js"></script>
<script src="assets/js/google-code-prettify/prettify.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/application.js"></script>
<script src="assets/js/responsiveslides.min.js"></script>
<script src="assets/build/mediaelement-and-player.min.js"></script>
<script src="assets/js/gmap3.min.js"></script>
<script src="assets/js/custom.js"></script>
<script src="assets/js/jquery.ui.totop.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
</body>
</html>
|
alvarotarela/php_users
|
Users/application/views/layouts/onix-business-portfolio-template/12-skins-v2/onix-html-color-sgrey/portfolio.html
|
HTML
|
gpl-2.0
| 19,153 |
<?php
// +----------------------------------------------------------------------
// | TOPThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2013 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <[email protected]>
// +----------------------------------------------------------------------
namespace Think\Db\Driver;
use Think\Db;
defined('THINK_PATH') or exit();
/**
* Mongo数据库驱动 必须配合MongoModel使用
*/
class Mongo extends Db{
protected $_mongo = null; // MongoDb Object
protected $_collection = null; // MongoCollection Object
protected $_dbName = ''; // dbName
protected $_collectionName = ''; // collectionName
protected $_cursor = null; // MongoCursor Object
protected $comparison = array('neq'=>'ne','ne'=>'ne','gt'=>'gt','egt'=>'gte','gte'=>'gte','lt'=>'lt','elt'=>'lte','lte'=>'lte','in'=>'in','not in'=>'nin','nin'=>'nin');
/**
* 架构函数 读取数据库配置信息
* @access public
* @param array $config 数据库配置数组
*/
public function __construct($config=''){
if ( !class_exists('mongoClient') ) {
throw_exception(L('_NOT_SUPPERT_').':mongoClient');
}
if(!empty($config)) {
$this->config = $config;
if(empty($this->config['params'])) {
$this->config['params'] = array();
}
}
}
/**
* 连接数据库方法
* @access public
*/
public function connect($config='',$linkNum=0) {
if ( !isset($this->linkID[$linkNum]) ) {
if(empty($config)) $config = $this->config;
$host = 'mongodb://'.($config['username']?"{$config['username']}":'').($config['password']?":{$config['password']}@":'').$config['hostname'].($config['hostport']?":{$config['hostport']}":'').'/'.($config['database']?"{$config['database']}":'');
try{
$this->linkID[$linkNum] = new \mongoClient( $host,$config['params']);
}catch (\MongoConnectionException $e){
throw_exception($e->getmessage());
}
// 标记连接成功
$this->connected = true;
// 注销数据库连接配置信息
if(1 != C('DB_DEPLOY_TYPE')) unset($this->config);
}
return $this->linkID[$linkNum];
}
/**
* 切换当前操作的Db和Collection
* @access public
* @param string $collection collection
* @param string $db db
* @param boolean $master 是否主服务器
* @return void
*/
public function switchCollection($collection,$db='',$master=true){
// 当前没有连接 则首先进行数据库连接
if ( !$this->_linkID ) $this->initConnect($master);
try{
if(!empty($db)) { // 传人Db则切换数据库
// 当前MongoDb对象
$this->_dbName = $db;
$this->_mongo = $this->_linkID->selectDb($db);
}
// 当前MongoCollection对象
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.getCollection('.$collection.')';
}
if($this->_collectionName != $collection) {
N('db_read',1);
// 记录开始执行时间
G('queryStartTime');
$this->_collection = $this->_mongo->selectCollection($collection);
$this->debug();
$this->_collectionName = $collection; // 记录当前Collection名称
}
}catch (MongoException $e){
throw_exception($e->getMessage());
}
}
/**
* 释放查询结果
* @access public
*/
public function free() {
$this->_cursor = null;
}
/**
* 执行命令
* @access public
* @param array $command 指令
* @return array
*/
public function command($command=array()) {
N('db_write',1);
$this->queryStr = 'command:'.json_encode($command);
// 记录开始执行时间
G('queryStartTime');
$result = $this->_mongo->command($command);
$this->debug();
if(!$result['ok']) {
throw_exception($result['errmsg']);
}
return $result;
}
/**
* 执行语句
* @access public
* @param string $code sql指令
* @param array $args 参数
* @return mixed
*/
public function execute($code,$args=array()) {
N('db_write',1);
$this->queryStr = 'execute:'.$code;
// 记录开始执行时间
G('queryStartTime');
$result = $this->_mongo->execute($code,$args);
$this->debug();
if($result['ok']) {
return $result['retval'];
}else{
throw_exception($result['errmsg']);
}
}
/**
* 关闭数据库
* @access public
*/
public function close() {
if($this->_linkID) {
$this->_linkID->close();
$this->_linkID = null;
$this->_mongo = null;
$this->_collection = null;
$this->_cursor = null;
}
}
/**
* 数据库错误信息
* @access public
* @return string
*/
public function error() {
$this->error = $this->_mongo->lastError();
trace($this->error,'','ERR');
return $this->error;
}
/**
* 插入记录
* @access public
* @param mixed $data 数据
* @param array $options 参数表达式
* @param boolean $replace 是否replace
* @return false | integer
*/
public function insert($data,$options=array(),$replace=false) {
if(isset($options['table'])) {
$this->switchCollection($options['table']);
}
$this->model = $options['model'];
N('db_write',1);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.insert(';
$this->queryStr .= $data?json_encode($data):'{}';
$this->queryStr .= ')';
}
try{
// 记录开始执行时间
G('queryStartTime');
$result = $replace? $this->_collection->save($data): $this->_collection->insert($data);
$this->debug();
if($result) {
$_id = $data['_id'];
if(is_object($_id)) {
$_id = $_id->__toString();
}
$this->lastInsID = $_id;
}
return $result;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
/**
* 插入多条记录
* @access public
* @param array $dataList 数据
* @param array $options 参数表达式
* @return bool
*/
public function insertAll($dataList,$options=array()) {
if(isset($options['table'])) {
$this->switchCollection($options['table']);
}
$this->model = $options['model'];
N('db_write',1);
try{
// 记录开始执行时间
G('queryStartTime');
$result = $this->_collection->batchInsert($dataList);
$this->debug();
return $result;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
/**
* 生成下一条记录ID 用于自增非MongoId主键
* @access public
* @param string $pk 主键名
* @return integer
*/
public function mongo_next_id($pk) {
N('db_read',1);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.find({},{'.$pk.':1}).sort({'.$pk.':-1}).limit(1)';
}
try{
// 记录开始执行时间
G('queryStartTime');
$result = $this->_collection->find(array(),array($pk=>1))->sort(array($pk=>-1))->limit(1);
$this->debug();
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
$data = $result->getNext();
return isset($data[$pk])?$data[$pk]+1:1;
}
/**
* 更新记录
* @access public
* @param mixed $data 数据
* @param array $options 表达式
* @return bool
*/
public function update($data,$options) {
if(isset($options['table'])) {
$this->switchCollection($options['table']);
}
$this->model = $options['model'];
N('db_write',1);
$query = $this->parseWhere($options['where']);
$set = $this->parseSet($data);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.update(';
$this->queryStr .= $query?json_encode($query):'{}';
$this->queryStr .= ','.json_encode($set).')';
}
try{
// 记录开始执行时间
G('queryStartTime');
if(isset($options['limit']) && $options['limit'] == 1) {
$multiple = array("multiple" => false);
}else{
$multiple = array("multiple" => true);
}
$result = $this->_collection->update($query,$set,$multiple);
$this->debug();
return $result;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
/**
* 删除记录
* @access public
* @param array $options 表达式
* @return false | integer
*/
public function delete($options=array()) {
if(isset($options['table'])) {
$this->switchCollection($options['table']);
}
$query = $this->parseWhere($options['where']);
$this->model = $options['model'];
N('db_write',1);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.remove('.json_encode($query).')';
}
try{
// 记录开始执行时间
G('queryStartTime');
$result = $this->_collection->remove($query);
$this->debug();
return $result;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
/**
* 清空记录
* @access public
* @param array $options 表达式
* @return false | integer
*/
public function clear($options=array()){
if(isset($options['table'])) {
$this->switchCollection($options['table']);
}
$this->model = $options['model'];
N('db_write',1);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.remove({})';
}
try{
// 记录开始执行时间
G('queryStartTime');
$result = $this->_collection->drop();
$this->debug();
return $result;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
/**
* 查找记录
* @access public
* @param array $options 表达式
* @return iterator
*/
public function select($options=array()) {
if(isset($options['table'])) {
$this->switchCollection($options['table'],'',false);
}
$cache = isset($options['cache'])?$options['cache']:false;
if($cache) { // 查询缓存检测
$key = is_string($cache['key'])?$cache['key']:md5(serialize($options));
$value = S($key,'','',$cache['type']);
if(false !== $value) {
return $value;
}
}
$this->model = $options['model'];
N('db_query',1);
$query = $this->parseWhere($options['where']);
$field = $this->parseField($options['field']);
try{
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.find(';
$this->queryStr .= $query? json_encode($query):'{}';
$this->queryStr .= $field? ','.json_encode($field):'';
$this->queryStr .= ')';
}
// 记录开始执行时间
G('queryStartTime');
$_cursor = $this->_collection->find($query,$field);
if($options['order']) {
$order = $this->parseOrder($options['order']);
if(C('DB_SQL_LOG')) {
$this->queryStr .= '.sort('.json_encode($order).')';
}
$_cursor = $_cursor->sort($order);
}
if(isset($options['page'])) { // 根据页数计算limit
if(strpos($options['page'],',')) {
list($page,$length) = explode(',',$options['page']);
}else{
$page = $options['page'];
}
$page = $page?$page:1;
$length = isset($length)?$length:(is_numeric($options['limit'])?$options['limit']:20);
$offset = $length*((int)$page-1);
$options['limit'] = $offset.','.$length;
}
if(isset($options['limit'])) {
list($offset,$length) = $this->parseLimit($options['limit']);
if(!empty($offset)) {
if(C('DB_SQL_LOG')) {
$this->queryStr .= '.skip('.intval($offset).')';
}
$_cursor = $_cursor->skip(intval($offset));
}
if(C('DB_SQL_LOG')) {
$this->queryStr .= '.limit('.intval($length).')';
}
$_cursor = $_cursor->limit(intval($length));
}
$this->debug();
$this->_cursor = $_cursor;
$resultSet = iterator_to_array($_cursor);
if($cache && $resultSet ) { // 查询缓存写入
S($key,$resultSet,$cache['expire'],$cache['type']);
}
return $resultSet;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
/**
* 查找某个记录
* @access public
* @param array $options 表达式
* @return array
*/
public function find($options=array()){
if(isset($options['table'])) {
$this->switchCollection($options['table'],'',false);
}
$cache = isset($options['cache'])?$options['cache']:false;
if($cache) { // 查询缓存检测
$key = is_string($cache['key'])?$cache['key']:md5(serialize($options));
$value = S($key,'','',$cache['type']);
if(false !== $value) {
return $value;
}
}
$this->model = $options['model'];
N('db_query',1);
$query = $this->parseWhere($options['where']);
$fields = $this->parseField($options['field']);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.findOne(';
$this->queryStr .= $query?json_encode($query):'{}';
$this->queryStr .= $fields?','.json_encode($fields):'';
$this->queryStr .= ')';
}
try{
// 记录开始执行时间
G('queryStartTime');
$result = $this->_collection->findOne($query,$fields);
$this->debug();
if($cache && $result ) { // 查询缓存写入
S($key,$result,$cache['expire'],$cache['type']);
}
return $result;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
/**
* 统计记录数
* @access public
* @param array $options 表达式
* @return iterator
*/
public function count($options=array()){
if(isset($options['table'])) {
$this->switchCollection($options['table'],'',false);
}
$this->model = $options['model'];
N('db_query',1);
$query = $this->parseWhere($options['where']);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName;
$this->queryStr .= $query?'.find('.json_encode($query).')':'';
$this->queryStr .= '.count()';
}
try{
// 记录开始执行时间
G('queryStartTime');
$count = $this->_collection->count($query);
$this->debug();
return $count;
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
}
public function group($keys,$initial,$reduce,$options=array()){
$this->_collection->group($keys,$initial,$reduce,$options);
}
/**
* 取得数据表的字段信息
* @access public
* @return array
*/
public function getFields($collection=''){
if(!empty($collection) && $collection != $this->_collectionName) {
$this->switchCollection($collection,'',false);
}
N('db_query',1);
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.'.$this->_collectionName.'.findOne()';
}
try{
// 记录开始执行时间
G('queryStartTime');
$result = $this->_collection->findOne();
$this->debug();
} catch (MongoCursorException $e) {
throw_exception($e->getMessage());
}
if($result) { // 存在数据则分析字段
$info = array();
foreach ($result as $key=>$val){
$info[$key] = array(
'name'=>$key,
'type'=>getType($val),
);
}
return $info;
}
// 暂时没有数据 返回false
return false;
}
/**
* 取得当前数据库的collection信息
* @access public
*/
public function getTables(){
if(C('DB_SQL_LOG')) {
$this->queryStr = $this->_dbName.'.getCollenctionNames()';
}
N('db_query',1);
// 记录开始执行时间
G('queryStartTime');
$list = $this->_mongo->listCollections();
$this->debug();
$info = array();
foreach ($list as $collection){
$info[] = $collection->getName();
}
return $info;
}
/**
* set分析
* @access protected
* @param array $data
* @return string
*/
protected function parseSet($data) {
$result = array();
foreach ($data as $key=>$val){
if(is_array($val)) {
switch($val[0]) {
case 'inc':
$result['$inc'][$key] = (int)$val[1];
break;
case 'set':
case 'unset':
case 'push':
case 'pushall':
case 'addtoset':
case 'pop':
case 'pull':
case 'pullall':
$result['$'.$val[0]][$key] = $val[1];
break;
default:
$result['$set'][$key] = $val;
}
}else{
$result['$set'][$key] = $val;
}
}
return $result;
}
/**
* order分析
* @access protected
* @param mixed $order
* @return array
*/
protected function parseOrder($order) {
if(is_string($order)) {
$array = explode(',',$order);
$order = array();
foreach ($array as $key=>$val){
$arr = explode(' ',trim($val));
if(isset($arr[1])) {
$arr[1] = $arr[1]=='asc'?1:-1;
}else{
$arr[1] = 1;
}
$order[$arr[0]] = $arr[1];
}
}
return $order;
}
/**
* limit分析
* @access protected
* @param mixed $limit
* @return array
*/
protected function parseLimit($limit) {
if(strpos($limit,',')) {
$array = explode(',',$limit);
}else{
$array = array(0,$limit);
}
return $array;
}
/**
* field分析
* @access protected
* @param mixed $fields
* @return array
*/
public function parseField($fields){
if(empty($fields)) {
$fields = array();
}
if(is_string($fields)) {
$fields = explode(',',$fields);
}
return $fields;
}
/**
* where分析
* @access protected
* @param mixed $where
* @return array
*/
public function parseWhere($where){
$query = array();
foreach ($where as $key=>$val){
if('_id' != $key && 0===strpos($key,'_')) {
// 解析特殊条件表达式
$query = $this->parseThinkWhere($key,$val);
}else{
// 查询字段的安全过滤
if(!preg_match('/^[A-Z_\|\&\-.a-z0-9]+$/',trim($key))){
throw_exception(L('_ERROR_QUERY_').':'.$key);
}
$key = trim($key);
if(strpos($key,'|')) {
$array = explode('|',$key);
$str = array();
foreach ($array as $k){
$str[] = $this->parseWhereItem($k,$val);
}
$query['$or'] = $str;
}elseif(strpos($key,'&')){
$array = explode('&',$key);
$str = array();
foreach ($array as $k){
$str[] = $this->parseWhereItem($k,$val);
}
$query = array_merge($query,$str);
}else{
$str = $this->parseWhereItem($key,$val);
$query = array_merge($query,$str);
}
}
}
return $query;
}
/**
* 特殊条件分析
* @access protected
* @param string $key
* @param mixed $val
* @return string
*/
protected function parseThinkWhere($key,$val) {
$query = array();
switch($key) {
case '_query': // 字符串模式查询条件
parse_str($val,$query);
if(isset($query['_logic']) && strtolower($query['_logic']) == 'or' ) {
unset($query['_logic']);
$query['$or'] = $query;
}
break;
case '_string':// MongoCode查询
$query['$where'] = new MongoCode($val);
break;
}
return $query;
}
/**
* where子单元分析
* @access protected
* @param string $key
* @param mixed $val
* @return array
*/
protected function parseWhereItem($key,$val) {
$query = array();
if(is_array($val)) {
if(is_string($val[0])) {
$con = strtolower($val[0]);
if(in_array($con,array('neq','ne','gt','egt','gte','lt','lte','elt'))) { // 比较运算
$k = '$'.$this->comparison[$con];
$query[$key] = array($k=>$val[1]);
}elseif('like'== $con){ // 模糊查询 采用正则方式
$query[$key] = new MongoRegex("/".$val[1]."/");
}elseif('mod'==$con){ // mod 查询
$query[$key] = array('$mod'=>$val[1]);
}elseif('regex'==$con){ // 正则查询
$query[$key] = new MongoRegex($val[1]);
}elseif(in_array($con,array('in','nin','not in'))){ // IN NIN 运算
$data = is_string($val[1])? explode(',',$val[1]):$val[1];
$k = '$'.$this->comparison[$con];
$query[$key] = array($k=>$data);
}elseif('all'==$con){ // 满足所有指定条件
$data = is_string($val[1])? explode(',',$val[1]):$val[1];
$query[$key] = array('$all'=>$data);
}elseif('between'==$con){ // BETWEEN运算
$data = is_string($val[1])? explode(',',$val[1]):$val[1];
$query[$key] = array('$gte'=>$data[0],'$lte'=>$data[1]);
}elseif('not between'==$con){
$data = is_string($val[1])? explode(',',$val[1]):$val[1];
$query[$key] = array('$lt'=>$data[0],'$gt'=>$data[1]);
}elseif('exp'==$con){ // 表达式查询
$query['$where'] = new MongoCode($val[1]);
}elseif('exists'==$con){ // 字段是否存在
$query[$key] =array('$exists'=>(bool)$val[1]);
}elseif('size'==$con){ // 限制属性大小
$query[$key] =array('$size'=>intval($val[1]));
}elseif('type'==$con){ // 限制字段类型 1 浮点型 2 字符型 3 对象或者MongoDBRef 5 MongoBinData 7 MongoId 8 布尔型 9 MongoDate 10 NULL 15 MongoCode 16 32位整型 17 MongoTimestamp 18 MongoInt64 如果是数组的话判断元素的类型
$query[$key] =array('$type'=>intval($val[1]));
}else{
$query[$key] = $val;
}
return $query;
}
}
$query[$key] = $val;
return $query;
}
}
|
545038947/haisys
|
ThinkPHP/Library/Think/Db/Driver/Mongo.class.php
|
PHP
|
gpl-2.0
| 26,886 |
/**
*
*/
#include <stdio.h>
#define NUM_ROWS_A 12 //rows of input [A]
#define NUM_COLUMNS_A 12 //columns of input [A]
#define NUM_ROWS_B 12 //rows of input [B]
#define NUM_COLUMNS_B 12 //columns of input [B]
#pragma xmp nodes p(*)
#pragma xmp template t(0:11)
#pragma xmp distribute t(block) onto p
double a[NUM_ROWS_A][NUM_COLUMNS_A]; //declare input [A]
double b[NUM_ROWS_B][NUM_COLUMNS_B];
double c[NUM_ROWS_A][NUM_COLUMNS_B];
#pragma xmp align b[i][*] with t(i)
#pragma xmp align c[i][*] with t(i)
int main(void){
int i;
#pragma xmp loop on t(j)
for (int j = 0; j < NUM_COLUMNS_B; j++) {
for(int i= 0; i < NUM_ROWS_A; i++) {
for(int k = 0; k < NUM_COLUMNS_A; k++) {
c[j][i] = c[j][i] + a[k][i] * b[j][k];
printf("Process %d is computing c[%d][%d]\n", xmp_node_num(), j, i);
}
}
}
return 0;
}
|
tempbottle/pop-cpp
|
examples/xmp-matrix/xmp-matrix.c
|
C
|
gpl-2.0
| 871 |
package mpicbg.spim.segmentation;
import fiji.tool.SliceListener;
import fiji.tool.SliceObserver;
import ij.IJ;
import ij.ImageJ;
import ij.ImagePlus;
import ij.ImageStack;
import ij.WindowManager;
import ij.gui.OvalRoi;
import ij.gui.Overlay;
import ij.gui.Roi;
import ij.io.Opener;
import ij.plugin.PlugIn;
import ij.process.ByteProcessor;
import ij.process.FloatProcessor;
import ij.process.ImageProcessor;
import ij.process.ShortProcessor;
import java.awt.Button;
import java.awt.Checkbox;
import java.awt.Color;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Label;
import java.awt.Rectangle;
import java.awt.Scrollbar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.List;
import mpicbg.imglib.algorithm.gauss.GaussianConvolutionReal;
import mpicbg.imglib.algorithm.math.LocalizablePoint;
import mpicbg.imglib.algorithm.scalespace.DifferenceOfGaussianPeak;
import mpicbg.imglib.algorithm.scalespace.DifferenceOfGaussianReal1;
import mpicbg.imglib.algorithm.scalespace.SubpixelLocalization;
import mpicbg.imglib.container.array.ArrayContainerFactory;
import mpicbg.imglib.cursor.LocalizableByDimCursor;
import mpicbg.imglib.cursor.LocalizableCursor;
import mpicbg.imglib.image.Image;
import mpicbg.imglib.image.ImageFactory;
import mpicbg.imglib.image.display.imagej.ImageJFunctions;
import mpicbg.imglib.multithreading.SimpleMultiThreading;
import mpicbg.imglib.outofbounds.OutOfBoundsStrategyMirrorFactory;
import mpicbg.imglib.outofbounds.OutOfBoundsStrategyValueFactory;
import mpicbg.imglib.type.numeric.real.FloatType;
import mpicbg.imglib.util.Util;
import mpicbg.spim.io.IOFunctions;
import mpicbg.spim.registration.ViewStructure;
import mpicbg.spim.registration.detection.DetectionSegmentation;
import net.imglib2.RandomAccess;
import net.imglib2.exception.ImgLibException;
import net.imglib2.img.ImagePlusAdapter;
import net.imglib2.img.imageplus.FloatImagePlus;
import net.imglib2.view.Views;
import spim.process.fusion.FusionHelper;
/**
* An interactive tool for determining the required sigma and peak threshold
*
* @author Stephan Preibisch
*/
public class InteractiveDoG implements PlugIn
{
final int extraSize = 40;
final int scrollbarSize = 1000;
float sigma = 0.5f;
float sigma2 = 0.5f;
float threshold = 0.0001f;
// steps per octave
public static int standardSenstivity = 4;
int sensitivity = standardSenstivity;
float imageSigma = 0.5f;
float sigmaMin = 0.5f;
float sigmaMax = 10f;
int sigmaInit = 300;
float thresholdMin = 0.0001f;
float thresholdMax = 1f;
int thresholdInit = 500;
double minIntensityImage = Double.NaN;
double maxIntensityImage = Double.NaN;
SliceObserver sliceObserver;
RoiListener roiListener;
ImagePlus imp;
int channel = 0;
Rectangle rectangle;
Image<FloatType> img;
FloatImagePlus< net.imglib2.type.numeric.real.FloatType > source;
ArrayList<DifferenceOfGaussianPeak<FloatType>> peaks;
Color originalColor = new Color( 0.8f, 0.8f, 0.8f );
Color inactiveColor = new Color( 0.95f, 0.95f, 0.95f );
public Rectangle standardRectangle;
boolean isComputing = false;
boolean isStarted = false;
boolean enableSigma2 = false;
boolean sigma2IsAdjustable = true;
boolean lookForMinima = false;
boolean lookForMaxima = true;
public static enum ValueChange { SIGMA, THRESHOLD, SLICE, ROI, MINMAX, ALL }
boolean isFinished = false;
boolean wasCanceled = false;
public boolean isFinished() { return isFinished; }
public boolean wasCanceled() { return wasCanceled; }
public double getInitialSigma() { return sigma; }
public void setInitialSigma( final float value )
{
sigma = value;
sigmaInit = computeScrollbarPositionFromValue( sigma, sigmaMin, sigmaMax, scrollbarSize );
}
public double getSigma2() { return sigma2; }
public double getThreshold() { return threshold; }
public void setThreshold( final float value )
{
threshold = value;
final double log1001 = Math.log10( scrollbarSize + 1);
thresholdInit = (int)Math.round( 1001-Math.pow(10, -(((threshold - thresholdMin)/(thresholdMax-thresholdMin))*log1001) + log1001 ) );
}
public boolean getSigma2WasAdjusted() { return enableSigma2; }
public boolean getLookForMaxima() { return lookForMaxima; }
public boolean getLookForMinima() { return lookForMinima; }
public void setLookForMaxima( final boolean lookForMaxima ) { this.lookForMaxima = lookForMaxima; }
public void setLookForMinima( final boolean lookForMinima ) { this.lookForMinima = lookForMinima; }
public void setSigmaMax( final float sigmaMax ) { this.sigmaMax = sigmaMax; }
public void setSigma2isAdjustable( final boolean state ) { sigma2IsAdjustable = state; }
// for the case that it is needed again, we can save one conversion
public FloatImagePlus< net.imglib2.type.numeric.real.FloatType > getConvertedImage() { return source; }
public InteractiveDoG( final ImagePlus imp, final int channel )
{
this.imp = imp;
this.channel = channel;
}
public InteractiveDoG( final ImagePlus imp ) { this.imp = imp; }
public InteractiveDoG() {}
public void setMinIntensityImage( final double min ) { this.minIntensityImage = min; }
public void setMaxIntensityImage( final double max ) { this.maxIntensityImage = max; }
@Override
public void run( String arg )
{
if ( imp == null )
imp = WindowManager.getCurrentImage();
standardRectangle = new Rectangle( imp.getWidth()/4, imp.getHeight()/4, imp.getWidth()/2, imp.getHeight()/2 );
if ( imp.getType() == ImagePlus.COLOR_RGB || imp.getType() == ImagePlus.COLOR_256 )
{
IJ.log( "Color images are not supported, please convert to 8, 16 or 32-bit grayscale" );
return;
}
Roi roi = imp.getRoi();
if ( roi == null )
{
//IJ.log( "A rectangular ROI is required to define the area..." );
imp.setRoi( standardRectangle );
roi = imp.getRoi();
}
if ( roi.getType() != Roi.RECTANGLE )
{
IJ.log( "Only rectangular rois are supported..." );
return;
}
// copy the ImagePlus into an ArrayImage<FloatType> for faster access
source = convertToFloat( imp, channel, 0, minIntensityImage, maxIntensityImage );
// show the interactive kit
displaySliders();
// add listener to the imageplus slice slider
sliceObserver = new SliceObserver( imp, new ImagePlusListener() );
// compute first version
updatePreview( ValueChange.ALL );
isStarted = true;
// check whenever roi is modified to update accordingly
roiListener = new RoiListener();
imp.getCanvas().addMouseListener( roiListener );
}
/**
* Updates the Preview with the current parameters (sigma, threshold, roi, slicenumber)
*
* @param change - what did change
*/
protected void updatePreview( final ValueChange change )
{
// check if Roi changed
boolean roiChanged = false;
Roi roi = imp.getRoi();
if ( roi == null || roi.getType() != Roi.RECTANGLE )
{
imp.setRoi( new Rectangle( standardRectangle ) );
roi = imp.getRoi();
roiChanged = true;
}
final Rectangle rect = roi.getBounds();
if ( roiChanged || img == null || change == ValueChange.SLICE ||
rect.getMinX() != rectangle.getMinX() || rect.getMaxX() != rectangle.getMaxX() ||
rect.getMinY() != rectangle.getMinY() || rect.getMaxY() != rectangle.getMaxY() )
{
rectangle = rect;
img = extractImage( source, rectangle, extraSize );
roiChanged = true;
}
// if we got some mouse click but the ROI did not change we can return
if ( !roiChanged && change == ValueChange.ROI )
{
isComputing = false;
return;
}
// compute the Difference Of Gaussian if necessary
if ( peaks == null || roiChanged || change == ValueChange.SIGMA || change == ValueChange.SLICE || change == ValueChange.ALL )
{
//
// Compute the Sigmas for the gaussian folding
//
final float k, K_MIN1_INV;
final float[] sigma, sigmaDiff;
if ( enableSigma2 )
{
sigma = new float[ 2 ];
sigma[ 0 ] = this.sigma;
sigma[ 1 ] = this.sigma2;
k = sigma[ 1 ] / sigma[ 0 ];
K_MIN1_INV = DetectionSegmentation.computeKWeight( k );
sigmaDiff = DetectionSegmentation.computeSigmaDiff( sigma, imageSigma );
}
else
{
k = (float)DetectionSegmentation.computeK( sensitivity );
K_MIN1_INV = DetectionSegmentation.computeKWeight( k );
sigma = DetectionSegmentation.computeSigma( k, this.sigma );
sigmaDiff = DetectionSegmentation.computeSigmaDiff( sigma, imageSigma );
}
// the upper boundary
this.sigma2 = sigma[ 1 ];
final DifferenceOfGaussianReal1<FloatType> dog = new DifferenceOfGaussianReal1<FloatType>( img, new OutOfBoundsStrategyValueFactory<FloatType>(), sigmaDiff[ 0 ], sigmaDiff[ 1 ], thresholdMin/4, K_MIN1_INV );
dog.setKeepDoGImage( true );
dog.process();
final SubpixelLocalization<FloatType> subpixel = new SubpixelLocalization<FloatType>( dog.getDoGImage(), dog.getPeaks() );
subpixel.process();
peaks = dog.getPeaks();
}
// extract peaks to show
Overlay o = imp.getOverlay();
if ( o == null )
{
o = new Overlay();
imp.setOverlay( o );
}
o.clear();
for ( final DifferenceOfGaussianPeak<FloatType> peak : peaks )
{
if ( ( peak.isMax() && lookForMaxima ) || ( peak.isMin() && lookForMinima ) )
{
final float x = peak.getPosition( 0 );
final float y = peak.getPosition( 1 );
if ( Math.abs( peak.getValue().get() ) > threshold &&
x >= extraSize/2 && y >= extraSize/2 &&
x < rect.width+extraSize/2 && y < rect.height+extraSize/2 )
{
final OvalRoi or = new OvalRoi( Util.round( x - sigma ) + rect.x - extraSize/2, Util.round( y - sigma ) + rect.y - extraSize/2, Util.round( sigma+sigma2 ), Util.round( sigma+sigma2 ) );
if ( peak.isMax() )
or.setStrokeColor( Color.green );
else if ( peak.isMin() )
or.setStrokeColor( Color.red );
o.add( or );
}
}
}
imp.updateAndDraw();
isComputing = false;
}
public static float computeSigma2( final float sigma1, final int sensitivity )
{
final float k = (float)DetectionSegmentation.computeK( sensitivity );
final float[] sigma = DetectionSegmentation.computeSigma( k, sigma1 );
return sigma[ 1 ];
}
/**
* Extract the current 2d region of interest from the souce image
*
* @param source - the source image, a {@link Image} which is a copy of the {@link ImagePlus}
* @param rectangle - the area of interest
* @param extraSize - the extra size around so that detections at the border of the roi are not messed up
* @return
*/
protected Image<FloatType> extractImage( final FloatImagePlus< net.imglib2.type.numeric.real.FloatType > source, final Rectangle rectangle, final int extraSize )
{
final Image<FloatType> img = new ImageFactory<FloatType>( new FloatType(), new ArrayContainerFactory() ).createImage( new int[]{ rectangle.width+extraSize, rectangle.height+extraSize } );
final int offsetX = rectangle.x - extraSize/2;
final int offsetY = rectangle.y - extraSize/2;
final int[] location = new int[ source.numDimensions() ];
if ( location.length > 2 )
location[ 2 ] = (imp.getCurrentSlice()-1)/imp.getNChannels();
final LocalizableCursor<FloatType> cursor = img.createLocalizableCursor();
final RandomAccess<net.imglib2.type.numeric.real.FloatType> positionable;
if ( offsetX >= 0 && offsetY >= 0 &&
offsetX + img.getDimension( 0 ) < source.dimension( 0 ) &&
offsetY + img.getDimension( 1 ) < source.dimension( 1 ) )
{
// it is completely inside so we need no outofbounds for copying
positionable = source.randomAccess();
}
else
{
positionable = Views.extendMirrorSingle( source ).randomAccess();
}
while ( cursor.hasNext() )
{
cursor.fwd();
cursor.getPosition( location );
location[ 0 ] += offsetX;
location[ 1 ] += offsetY;
positionable.setPosition( location );
cursor.getType().set( positionable.get().get() );
}
return img;
}
/**
* Normalize and make a copy of the {@link ImagePlus} into an {@link Image}>FloatType< for faster access when copying the slices
*
* @param imp - the {@link ImagePlus} input image
* @return - the normalized copy [0...1]
*/
public static FloatImagePlus< net.imglib2.type.numeric.real.FloatType > convertToFloat( final ImagePlus imp, int channel, int timepoint )
{
return convertToFloat( imp, channel, timepoint, Double.NaN, Double.NaN );
}
public static FloatImagePlus< net.imglib2.type.numeric.real.FloatType > convertToFloat( final ImagePlus imp, int channel, int timepoint, final double min, final double max )
{
// stupid 1-offset of imagej
channel++;
timepoint++;
final int h = imp.getHeight();
final int w = imp.getWidth();
final ArrayList< float[] > img = new ArrayList< float[] >();
if ( imp.getProcessor() instanceof FloatProcessor )
{
for ( int z = 0; z < imp.getNSlices(); ++z )
img.add( ( (float[])imp.getStack().getProcessor( imp.getStackIndex( channel, z + 1, timepoint ) ).getPixels() ).clone() );
}
else if ( imp.getProcessor() instanceof ByteProcessor )
{
for ( int z = 0; z < imp.getNSlices(); ++z )
{
final byte[] pixels = (byte[])imp.getStack().getProcessor( imp.getStackIndex( channel, z + 1, timepoint ) ).getPixels();
final float[] pixelsF = new float[ pixels.length ];
for ( int i = 0; i < pixels.length; ++i )
pixelsF[ i ] = pixels[ i ] & 0xff;
img.add( pixelsF );
}
}
else if ( imp.getProcessor() instanceof ShortProcessor )
{
for ( int z = 0; z < imp.getNSlices(); ++z )
{
final short[] pixels = (short[])imp.getStack().getProcessor( imp.getStackIndex( channel, z + 1, timepoint ) ).getPixels();
final float[] pixelsF = new float[ pixels.length ];
for ( int i = 0; i < pixels.length; ++i )
pixelsF[ i ] = pixels[ i ] & 0xffff;
img.add( pixelsF );
}
}
else // some color stuff or so
{
for ( int z = 0; z < imp.getNSlices(); ++z )
{
final ImageProcessor ip = imp.getStack().getProcessor( imp.getStackIndex( channel, z + 1, timepoint ) );
final float[] pixelsF = new float[ w * h ];
int i = 0;
for ( int y = 0; y < h; ++y )
for ( int x = 0; x < w; ++x )
pixelsF[ i++ ] = ip.getPixelValue( x, y );
img.add( pixelsF );
}
}
final FloatImagePlus< net.imglib2.type.numeric.real.FloatType > i = createImgLib2( img, w, h );
if ( Double.isNaN( min ) || Double.isNaN( max ) || Double.isInfinite( min ) || Double.isInfinite( max ) || min == max )
FusionHelper.normalizeImage( i );
else
FusionHelper.normalizeImage( i, (float)min, (float)max );
return i;
}
public static FloatImagePlus< net.imglib2.type.numeric.real.FloatType > createImgLib2( final List< float[] > img, final int w, final int h )
{
final ImagePlus imp;
if ( img.size() > 1 )
{
final ImageStack stack = new ImageStack( w, h );
for ( int z = 0; z < img.size(); ++z )
stack.addSlice( new FloatProcessor( w, h, img.get( z ) ) );
imp = new ImagePlus( "ImgLib2 FloatImagePlus (3d)", stack );
}
else
{
imp = new ImagePlus( "ImgLib2 FloatImagePlus (2d)", new FloatProcessor( w, h, img.get( 0 ) ) );
}
return ImagePlusAdapter.wrapFloat( imp );
}
/**
* Instantiates the panel for adjusting the paramters
*/
protected void displaySliders()
{
final Frame frame = new Frame("Adjust Difference-of-Gaussian Values");
frame.setSize( 400, 330 );
/* Instantiation */
final GridBagLayout layout = new GridBagLayout();
final GridBagConstraints c = new GridBagConstraints();
final Scrollbar sigma1 = new Scrollbar ( Scrollbar.HORIZONTAL, sigmaInit, 10, 0, 10 + scrollbarSize );
this.sigma = computeValueFromScrollbarPosition( sigmaInit, sigmaMin, sigmaMax, scrollbarSize);
final Scrollbar threshold = new Scrollbar ( Scrollbar.HORIZONTAL, thresholdInit, 10, 0, 10 + scrollbarSize );
final float log1001 = (float)Math.log10( scrollbarSize + 1);
this.threshold = thresholdMin + ( (log1001 - (float)Math.log10(1001-thresholdInit))/log1001 ) * (thresholdMax-thresholdMin);
this.sigma2 = computeSigma2( this.sigma, this.sensitivity );
final int sigma2init = computeScrollbarPositionFromValue( this.sigma2, sigmaMin, sigmaMax, scrollbarSize );
final Scrollbar sigma2 = new Scrollbar ( Scrollbar.HORIZONTAL, sigma2init, 10, 0, 10 + scrollbarSize );
final Label sigmaText1 = new Label( "Sigma 1 = " + this.sigma, Label.CENTER );
final Label sigmaText2 = new Label( "Sigma 2 = " + this.sigma2, Label.CENTER );
final Label thresholdText = new Label( "Threshold = " + this.threshold, Label.CENTER );
final Button apply = new Button( "Apply to Stack (will take some time)" );
final Button button = new Button( "Done" );
final Button cancel = new Button( "Cancel" );
final Checkbox sigma2Enable = new Checkbox( "Enable Manual Adjustment of Sigma 2 ", enableSigma2 );
final Checkbox min = new Checkbox( "Look for Minima (red)", lookForMinima );
final Checkbox max = new Checkbox( "Look for Maxima (green)", lookForMaxima );
/* Location */
frame.setLayout( layout );
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
c.weightx = 1;
frame.add ( sigma1, c );
++c.gridy;
frame.add( sigmaText1, c );
++c.gridy;
frame.add ( sigma2, c );
++c.gridy;
frame.add( sigmaText2, c );
++c.gridy;
c.insets = new Insets(0,65,0,65);
frame.add( sigma2Enable, c );
++c.gridy;
c.insets = new Insets(10,0,0,0);
frame.add ( threshold, c );
c.insets = new Insets(0,0,0,0);
++c.gridy;
frame.add( thresholdText, c );
++c.gridy;
c.insets = new Insets(0,130,0,75);
frame.add( min, c );
++c.gridy;
c.insets = new Insets(0,125,0,75);
frame.add( max, c );
++c.gridy;
c.insets = new Insets(0,75,0,75);
frame.add( apply, c );
++c.gridy;
c.insets = new Insets(10,150,0,150);
frame.add( button, c );
++c.gridy;
c.insets = new Insets(10,150,0,150);
frame.add( cancel, c );
/* Configuration */
sigma1.addAdjustmentListener( new SigmaListener( sigmaText1, sigmaMin, sigmaMax, scrollbarSize, sigma1, sigma2, sigmaText2 ) );
sigma2.addAdjustmentListener( new Sigma2Listener( sigmaMin, sigmaMax, scrollbarSize, sigma2, sigmaText2 ) );
threshold.addAdjustmentListener( new ThresholdListener( thresholdText, thresholdMin, thresholdMax ) );
button.addActionListener( new FinishedButtonListener( frame, false ) );
cancel.addActionListener( new FinishedButtonListener( frame, true ) );
apply.addActionListener( new ApplyButtonListener() );
min.addItemListener( new MinListener() );
max.addItemListener( new MaxListener() );
sigma2Enable.addItemListener( new EnableListener( sigma2, sigmaText2 ) );
if ( !sigma2IsAdjustable )
sigma2Enable.setEnabled( false );
frame.addWindowListener( new FrameListener( frame ) );
frame.setVisible( true );
originalColor = sigma2.getBackground();
sigma2.setBackground( inactiveColor );
sigmaText1.setFont( sigmaText1.getFont().deriveFont( Font.BOLD ) );
thresholdText.setFont( thresholdText.getFont().deriveFont( Font.BOLD ) );
}
protected class EnableListener implements ItemListener
{
final Scrollbar sigma2;
final Label sigmaText2;
public EnableListener( final Scrollbar sigma2, final Label sigmaText2 )
{
this.sigmaText2 = sigmaText2;
this.sigma2 = sigma2;
}
@Override
public void itemStateChanged( final ItemEvent arg0 )
{
if ( arg0.getStateChange() == ItemEvent.DESELECTED )
{
sigmaText2.setFont( sigmaText2.getFont().deriveFont( Font.PLAIN ) );
sigma2.setBackground( inactiveColor );
enableSigma2 = false;
}
else if ( arg0.getStateChange() == ItemEvent.SELECTED )
{
sigmaText2.setFont( sigmaText2.getFont().deriveFont( Font.BOLD ) );
sigma2.setBackground( originalColor );
enableSigma2 = true;
}
}
}
protected class MinListener implements ItemListener
{
@Override
public void itemStateChanged( final ItemEvent arg0 )
{
boolean oldState = lookForMinima;
if ( arg0.getStateChange() == ItemEvent.DESELECTED )
lookForMinima = false;
else if ( arg0.getStateChange() == ItemEvent.SELECTED )
lookForMinima = true;
if ( lookForMinima != oldState )
{
while ( isComputing )
SimpleMultiThreading.threadWait( 10 );
updatePreview( ValueChange.MINMAX );
}
}
}
protected class MaxListener implements ItemListener
{
@Override
public void itemStateChanged( final ItemEvent arg0 )
{
boolean oldState = lookForMaxima;
if ( arg0.getStateChange() == ItemEvent.DESELECTED )
lookForMaxima = false;
else if ( arg0.getStateChange() == ItemEvent.SELECTED )
lookForMaxima = true;
if ( lookForMaxima != oldState )
{
while ( isComputing )
SimpleMultiThreading.threadWait( 10 );
updatePreview( ValueChange.MINMAX );
}
}
}
/**
* Tests whether the ROI was changed and will recompute the preview
*
* @author Stephan Preibisch
*/
protected class RoiListener implements MouseListener
{
@Override
public void mouseClicked(MouseEvent e) {}
@Override
public void mouseEntered(MouseEvent e) {}
@Override
public void mouseExited(MouseEvent e) {}
@Override
public void mousePressed(MouseEvent e) {}
@Override
public void mouseReleased( final MouseEvent e )
{
// here the ROI might have been modified, let's test for that
final Roi roi = imp.getRoi();
if ( roi == null || roi.getType() != Roi.RECTANGLE )
return;
while ( isComputing )
SimpleMultiThreading.threadWait( 10 );
updatePreview( ValueChange.ROI );
}
}
protected class ApplyButtonListener implements ActionListener
{
@Override
public void actionPerformed( final ActionEvent arg0 )
{
ImagePlus imp;
try
{
imp = source.getImagePlus();
}
catch (ImgLibException e)
{
imp = null;
e.printStackTrace();
}
// convert ImgLib2 image to ImgLib1 image via the imageplus
final Image< FloatType > source = ImageJFunctions.wrapFloat( imp );
IOFunctions.println( "Computing DoG ... " );
// test the parameters on the complete stack
final ArrayList<DifferenceOfGaussianPeak<FloatType>> peaks =
DetectionSegmentation.extractBeadsLaPlaceImgLib(
source,
new OutOfBoundsStrategyMirrorFactory<FloatType>(),
imageSigma,
sigma,
sigma2,
threshold,
threshold/4,
lookForMaxima,
lookForMinima,
ViewStructure.DEBUG_MAIN );
IOFunctions.println( "Drawing DoG result ... " );
// display as extra image
Image<FloatType> detections = source.createNewImage();
final LocalizableByDimCursor<FloatType> c = detections.createLocalizableByDimCursor();
for ( final DifferenceOfGaussianPeak<FloatType> peak : peaks )
{
final LocalizablePoint p = new LocalizablePoint( new float[]{ peak.getSubPixelPosition( 0 ), peak.getSubPixelPosition( 1 ), peak.getSubPixelPosition( 2 ) } );
c.setPosition( p );
c.getType().set( 1 );
}
IOFunctions.println( "Convolving DoG result ... " );
final GaussianConvolutionReal<FloatType> gauss = new GaussianConvolutionReal<FloatType>( detections, new OutOfBoundsStrategyValueFactory<FloatType>(), 2 );
gauss.process();
detections = gauss.getResult();
IOFunctions.println( "Showing DoG result ... " );
ImageJFunctions.show( detections );
}
}
protected class FinishedButtonListener implements ActionListener
{
final Frame parent;
final boolean cancel;
public FinishedButtonListener( Frame parent, final boolean cancel )
{
this.parent = parent;
this.cancel = cancel;
}
@Override
public void actionPerformed( final ActionEvent arg0 )
{
wasCanceled = cancel;
close( parent, sliceObserver, imp, roiListener );
}
}
protected class FrameListener extends WindowAdapter
{
final Frame parent;
public FrameListener( Frame parent )
{
super();
this.parent = parent;
}
@Override
public void windowClosing (WindowEvent e)
{
close( parent, sliceObserver, imp, roiListener );
}
}
protected final void close( final Frame parent, final SliceObserver sliceObserver, final ImagePlus imp, final RoiListener roiListener )
{
if ( parent != null )
parent.dispose();
if ( sliceObserver != null )
sliceObserver.unregister();
if ( imp != null )
{
if ( roiListener != null )
imp.getCanvas().removeMouseListener( roiListener );
imp.getOverlay().clear();
imp.updateAndDraw();
}
isFinished = true;
}
protected class Sigma2Listener implements AdjustmentListener
{
final float min, max;
final int scrollbarSize;
final Scrollbar sigmaScrollbar2;
final Label sigma2Label;
public Sigma2Listener( final float min, final float max, final int scrollbarSize, final Scrollbar sigmaScrollbar2, final Label sigma2Label )
{
this.min = min;
this.max = max;
this.scrollbarSize = scrollbarSize;
this.sigmaScrollbar2 = sigmaScrollbar2;
this.sigma2Label = sigma2Label;
}
@Override
public void adjustmentValueChanged( final AdjustmentEvent event )
{
if ( enableSigma2 )
{
sigma2 = computeValueFromScrollbarPosition( event.getValue(), min, max, scrollbarSize );
if ( sigma2 < sigma )
{
sigma2 = sigma + 0.001f;
sigmaScrollbar2.setValue( computeScrollbarPositionFromValue( sigma2, min, max, scrollbarSize ) );
}
sigma2Label.setText( "Sigma 2 = " + sigma2 );
if ( !event.getValueIsAdjusting() )
{
while ( isComputing )
{
SimpleMultiThreading.threadWait( 10 );
}
updatePreview( ValueChange.SIGMA );
}
}
else
{
// if no manual adjustment simply reset it
sigmaScrollbar2.setValue( computeScrollbarPositionFromValue( sigma2, min, max, scrollbarSize ) );
}
}
}
protected class SigmaListener implements AdjustmentListener
{
final Label label;
final float min, max;
final int scrollbarSize;
final Scrollbar sigmaScrollbar1;
final Scrollbar sigmaScrollbar2;
final Label sigmaText2;
public SigmaListener( final Label label, final float min, final float max, final int scrollbarSize, final Scrollbar sigmaScrollbar1, final Scrollbar sigmaScrollbar2, final Label sigmaText2 )
{
this.label = label;
this.min = min;
this.max = max;
this.scrollbarSize = scrollbarSize;
this.sigmaScrollbar1 = sigmaScrollbar1;
this.sigmaScrollbar2 = sigmaScrollbar2;
this.sigmaText2 = sigmaText2;
}
@Override
public void adjustmentValueChanged( final AdjustmentEvent event )
{
sigma = computeValueFromScrollbarPosition( event.getValue(), min, max, scrollbarSize );
if ( !enableSigma2 )
{
sigma2 = computeSigma2( sigma, sensitivity );
sigmaText2.setText( "Sigma 2 = " + sigma2 );
sigmaScrollbar2.setValue( computeScrollbarPositionFromValue( sigma2, min, max, scrollbarSize ) );
}
else if ( sigma > sigma2 )
{
sigma = sigma2 - 0.001f;
sigmaScrollbar1.setValue( computeScrollbarPositionFromValue( sigma, min, max, scrollbarSize ) );
}
label.setText( "Sigma 1 = " + sigma );
if ( !event.getValueIsAdjusting() )
{
while ( isComputing )
{
SimpleMultiThreading.threadWait( 10 );
}
updatePreview( ValueChange.SIGMA );
}
}
}
protected static float computeValueFromScrollbarPosition( final int scrollbarPosition, final float min, final float max, final int scrollbarSize )
{
return min + (scrollbarPosition/(float)scrollbarSize) * (max-min);
}
protected static int computeScrollbarPositionFromValue( final float sigma, final float min, final float max, final int scrollbarSize )
{
return Util.round( ((sigma - min)/(max-min)) * scrollbarSize );
}
protected class ThresholdListener implements AdjustmentListener
{
final Label label;
final float min, max;
final float log1001 = (float)Math.log10(1001);
public ThresholdListener( final Label label, final float min, final float max )
{
this.label = label;
this.min = min;
this.max = max;
}
@Override
public void adjustmentValueChanged( final AdjustmentEvent event )
{
threshold = min + ( (log1001 - (float)Math.log10(1001-event.getValue()))/log1001 ) * (max-min);
label.setText( "Threshold = " + threshold );
if ( !isComputing )
{
updatePreview( ValueChange.THRESHOLD );
}
else if ( !event.getValueIsAdjusting() )
{
while ( isComputing )
{
SimpleMultiThreading.threadWait( 10 );
}
updatePreview( ValueChange.THRESHOLD );
}
}
}
protected class ImagePlusListener implements SliceListener
{
@Override
public void sliceChanged(ImagePlus arg0)
{
if ( isStarted )
{
while ( isComputing )
{
SimpleMultiThreading.threadWait( 10 );
}
updatePreview( ValueChange.SLICE );
}
}
}
public static void main( String[] args )
{
new ImageJ();
ImagePlus imp = new Opener().openImage( "/home/preibisch/Documents/Microscopy/SPIM/Harvard/f11e6/exp3/img_Ch0_Angle0.tif.zip" );
//ImagePlus imp = new Opener().openImage( "D:/Documents and Settings/Stephan/My Documents/Downloads/1-315--0.08-isotropic-subvolume/1-315--0.08-isotropic-subvolume.tif" );
imp.show();
imp.setSlice( 27 );
imp.setRoi( imp.getWidth()/4, imp.getHeight()/4, imp.getWidth()/2, imp.getHeight()/2 );
new InteractiveDoG().run( null );
}
}
|
psteinb/SPIM_Registration
|
src/main/java/mpicbg/spim/segmentation/InteractiveDoG.java
|
Java
|
gpl-2.0
| 30,536 |
<?php
$name='KievitCyr-ExtraBold';
$type='TTF';
$desc=array (
'Ascent' => 872,
'Descent' => -250,
'CapHeight' => 872,
'Flags' => 262148,
'FontBBox' => '[-56 -250 1278 872]',
'ItalicAngle' => 0,
'StemV' => 165,
'MissingWidth' => 566,
);
$up=-143;
$ut=20;
$ttffile='C:/wamp/www/alfakasko/mpdf/ttfonts/KvCyXb_.ttf';
$TTCfontID='0';
$originalsize=20632;
$sip=false;
$smp=false;
$BMPselected=false;
$fontkey='kievitB';
$panose=' 0 0 2 0 8 3 0 0 0 0 0 0';
$haskerninfo=false;
$unAGlyphs=false;
?>
|
vponomarev279/mpdf
|
ttfontdata/kievitB.mtx.php
|
PHP
|
gpl-2.0
| 506 |
#ifndef __EVENT_BROWSER_TAB_INDICES_GET_ALL_H__
#define __EVENT_BROWSER_TAB_INDICES_GET_ALL_H__
/*LICENSE_START*/
/*
* Copyright (C) 2014 Washington University School of Medicine
*
* 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.
*/
/*LICENSE_END*/
#include "Event.h"
namespace caret {
class EventBrowserTabIndicesGetAll : public Event {
public:
EventBrowserTabIndicesGetAll();
virtual ~EventBrowserTabIndicesGetAll();
void addBrowserTabIndex(const int32_t browserTabIndex);
std::vector<int32_t> getAllBrowserTabIndices() const;
bool isValidBrowserTabIndex(const int32_t browserTabIndex);
// ADD_NEW_METHODS_HERE
private:
EventBrowserTabIndicesGetAll(const EventBrowserTabIndicesGetAll&);
EventBrowserTabIndicesGetAll& operator=(const EventBrowserTabIndicesGetAll&);
std::vector<int32_t> m_browserTabIndices;
// ADD_NEW_MEMBERS_HERE
};
#ifdef __EVENT_BROWSER_TAB_INDICES_GET_ALL_DECLARE__
// <PLACE DECLARATIONS OF STATIC MEMBERS HERE>
#endif // __EVENT_BROWSER_TAB_INDICES_GET_ALL_DECLARE__
} // namespace
#endif //__EVENT_BROWSER_TAB_INDICES_GET_ALL_H__
|
Washington-University/workbench
|
src/Common/EventBrowserTabIndicesGetAll.h
|
C
|
gpl-2.0
| 1,920 |
/**
* \file
* \brief Common IPC interface.
* \ingroup l4_api
*/
/*
* (c) 2008-2009 Adam Lackorzynski <[email protected]>,
* Alexander Warg <[email protected]>,
* Björn Döbel <[email protected]>,
* Torsten Frenzel <[email protected]>
* economic rights: Technische Universität Dresden (Germany)
*
* This file is part of TUD:OS and distributed under the terms of the
* GNU General Public License 2.
* Please see the COPYING-GPL-2 file for details.
*
* As a special exception, you may use this file as part of a free software
* library without restriction. Specifically, if other files instantiate
* templates or use macros or inline functions from this file, or you compile
* this file and link it with other files to produce an executable, this
* file does not by itself cause the resulting executable to be covered by
* the GNU General Public License. This exception does not however
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*/
#ifndef __L4SYS__INCLUDE__L4API_FIASCO__IPC_H__
#define __L4SYS__INCLUDE__L4API_FIASCO__IPC_H__
#include <l4/sys/types.h>
#include <l4/sys/utcb.h>
#include <l4/sys/err.h>
/**
* \defgroup l4_ipc_api Object Invocation
* \ingroup l4_api
* \brief API for L4 object invocation.
*
* <c>\#include <l4/sys/ipc.h></c>
*
* General abstractions for L4 object invocation. The basic principle is that
* all objects are denoted by a capability that is accessed via a capability
* selector (see \link l4_cap_api Capabilities \endlink).
*
* This set of functions is common to all kinds of objects provided by the
* L4 micro kernel. The concrete semantics of an invocation depends on the
* object that shall be invoked.
*
* Objects may be invoked in various ways, the most common way is to use
* a \em call operation (l4_ipc_call()). However, there are a lot more
* flavours available that have a semantics depending on the object.
*
* \see \ref l4_kernel_object_gate_api
*
*/
/*****************************************************************************
*** IPC result checking
*****************************************************************************/
/**
* \defgroup l4_ipc_err_api Error Handling
* \ingroup l4_ipc_api
* \brief Error handling for L4 object invocation.
*
* <c>\#include <l4/sys/ipc.h></c>
*/
/**
* \brief Error codes in the \em error TCR.
* \ingroup l4_ipc_err_api
*
* The error codes are accessible via the \em error TCR, see
* #l4_thread_regs_t.error.
*/
enum l4_ipc_tcr_error_t
{
L4_IPC_ERROR_MASK = 0x1F, /**< Mask for error bits. */
L4_IPC_SND_ERR_MASK = 0x01, /**< Send error mask. */
L4_IPC_ENOT_EXISTENT = 0x04, /**< Non-existing destination or source.
** \ingroup l4_ipc_api
**/
L4_IPC_RETIMEOUT = 0x03, /**< Timeout during receive operation.
** \ingroup l4_ipc_api
**/
L4_IPC_SETIMEOUT = 0x02, /**< Timeout during send operation.
** \ingroup l4_ipc_api
**/
L4_IPC_RECANCELED = 0x07, /**< Receive operation canceled.
** \ingroup l4_ipc_api
**/
L4_IPC_SECANCELED = 0x06, /**< Send operation canceled.
** \ingroup l4_ipc_api
**/
L4_IPC_REMAPFAILED = 0x11, /**< Map flexpage failed in receive
** operation.
** \ingroup l4_ipc_api
**/
L4_IPC_SEMAPFAILED = 0x10, /**< Map flexpage failed in send operation.
** \ingroup l4_ipc_api
**/
L4_IPC_RESNDPFTO = 0x0b, /**< Send-pagefault timeout in receive
** operation.
** \ingroup l4_ipc_api
**/
L4_IPC_SESNDPFTO = 0x0a, /**< Send-pagefault timeout in send
** operation.
** \ingroup l4_ipc_api
**/
L4_IPC_RERCVPFTO = 0x0d, /**< Receive-pagefault timeout in receive
** operation.
** \ingroup l4_ipc_api
**/
L4_IPC_SERCVPFTO = 0x0c, /**< Receive-pagefault timeout in send
** operation.
** \ingroup l4_ipc_api
**/
L4_IPC_REABORTED = 0x0f, /**< Receive operation aborted.
** \ingroup l4_ipc_api
**/
L4_IPC_SEABORTED = 0x0e, /**< Send operation aborted.
** \ingroup l4_ipc_api
**/
L4_IPC_REMSGCUT = 0x09, /**< Cut receive message, due to
** message buffer is too small.
** \ingroup l4_ipc_api
**/
L4_IPC_SEMSGCUT = 0x08, /**< Cut send message. due to
** message buffer is too small,
** \ingroup l4_ipc_api
**/
};
/**
* \brief Get the error code for an object invocation.
* \ingroup l4_ipc_err_api
*
* \param tag Return value of the invocation.
* \param utcb UTCB that was used for the invocation.
*
* \return 0 if no error condition is set,
* error code otherwise (see #l4_ipc_tcr_error_t).
*/
L4_INLINE l4_umword_t
l4_ipc_error(l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW;
/**
* \brief Return error code of a system call return message tag.
* \ingroup l4_ipc_err_api
* \param tag System call return message type
* \return 0 for no error, error number in case of error
*/
L4_INLINE long
l4_error(l4_msgtag_t tag) L4_NOTHROW;
L4_INLINE long
l4_error_u(l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW;
/*****************************************************************************
*** IPC results
*****************************************************************************/
/**
* \brief Returns whether an error occurred in send phase of an invocation.
* \ingroup l4_ipc_err_api
*
* \pre l4_msgtag_has_error(tag) == true
* \param utcb UTCB to check.
*
* \return Boolean value.
*/
L4_INLINE int l4_ipc_is_snd_error(l4_utcb_t *utcb) L4_NOTHROW;
/**
* \brief Returns whether an error occurred in receive phase of an invocation.
* \ingroup l4_ipc_err_api
*
* \pre l4_msgtag_has_error(tag) == true
* \param utcb UTCB to check.
*
* \return Boolean value.
*/
L4_INLINE int l4_ipc_is_rcv_error(l4_utcb_t *utcb) L4_NOTHROW;
/**
* \brief Get the error condition of the last invocation from the TCR.
* \ingroup l4_ipc_err_api
*
* \pre l4_msgtag_has_error(tag) == true
* \param utcb UTCB to check.
*
* \return Error condition of type l4_ipc_tcr_error_t.
*/
L4_INLINE int l4_ipc_error_code(l4_utcb_t *utcb) L4_NOTHROW;
/*****************************************************************************
*** IPC calls
*****************************************************************************/
/**
* \brief Send a message to an object (do \b not wait for a reply).
* \ingroup l4_ipc_api
*
* \param dest Capability selector for the destination object.
* \param utcb UTCB of the caller.
* \param tag Descriptor for the message to be sent.
* \param timeout Timeout pair (see #l4_timeout_t) only send part is relevant.
*
* \return result tag
*
* A message is sent to the destination object. There is no receive phase
* included. The invoker continues working after sending the message.
*
* \attention This is a special-purpose message transfer, objects usually
* support only invocation via l4_ipc_call().
*/
L4_INLINE l4_msgtag_t
l4_ipc_send(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_msgtag_t tag,
l4_timeout_t timeout) L4_NOTHROW;
/**
* \brief Wait for an incoming message from any possible sender.
* \ingroup l4_ipc_api
*
* \param utcb UTCB of the caller.
* \retval label Label assigned to the source object (IPC gate or IRQ).
* \param timeout Timeout pair (see #l4_timeout_t, only the receive part is
* used).
*
* \return return tag
*
* This operation does an open wait, and therefore needs no capability to
* denote the possible source of a message. This means the calling thread
* waits for an incoming message from any possible source.
* There is no send phase included in this operation.
*
* The usual usage of this function is to call that function when entering a
* server loop in a user-level server that implements user-level objects,
* see also #l4_ipc_reply_and_wait().
*/
L4_INLINE l4_msgtag_t
l4_ipc_wait(l4_utcb_t *utcb, l4_umword_t *label,
l4_timeout_t timeout) L4_NOTHROW;
/**
* \brief Wait for a message from a specific source.
* \ingroup l4_ipc_api
*
* \param object Object to receive a message from.
* \param timeout Timeout pair (see #l4_timeout_t, only the receive part
* matters).
* \param utcb UTCB of the caller.
*
* \return result tag.
*
* This operation waits for a message from the specified object. Messages from
* other sources are not accepted by this operation. The operation does not
* include a send phase, this means no message is sent to the object.
*
* \note This operation is usually used to receive messages from a specific IRQ
* or thread. However, it is not common to use this operation for normal
* applications.
*/
L4_INLINE l4_msgtag_t
l4_ipc_receive(l4_cap_idx_t object, l4_utcb_t *utcb,
l4_timeout_t timeout) L4_NOTHROW;
/**
* \brief Object call (usual invocation).
* \ingroup l4_ipc_api
*
* \param object Capability selector for the object to call.
* \param utcb UTCB of the caller.
* \param tag Message tag to describe the message to be sent.
* \param timeout Timeout pair for send an receive phase (see #l4_timeout_t).
*
* \return result tag
*
* A message is sent to the object and the invoker waits for a
* reply from the object. Messages from other sources are not accepted.
* \note The send-to-receive transition needs no time, the object can reply
* with a send timeout of zero.
*/
L4_INLINE l4_msgtag_t
l4_ipc_call(l4_cap_idx_t object, l4_utcb_t *utcb, l4_msgtag_t tag,
l4_timeout_t timeout) L4_NOTHROW;
/**
* \brief Reply and wait operation (uses the \em reply capability).
* \ingroup l4_ipc_api
*
* \param tag Describes the message to be sent as reply.
* \param utcb UTCB of the caller.
* \retval label Label assigned to the source object of the received message.
* \param timeout Timeout pair (see #l4_timeout_t).
* \return result tag
*
* A message is sent to the previous caller using the implicit reply
* capability. Afterwards the invoking thread waits for a message from any
* source.
* \note This is the standard server operation: it sends a reply to the actual
* client and waits for the next incoming request, which may come from
* any other client.
*/
L4_INLINE l4_msgtag_t
l4_ipc_reply_and_wait(l4_utcb_t *utcb, l4_msgtag_t tag,
l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW;
/**
* \brief Send a message and do an open wait.
* \ingroup l4_ipc_api
*
* \param dest Object to send a message to.
* \param utcb UTCB of the caller.
* \param tag Describes the message that shall be sent.
* \retval label Label assigned to the source object of the receive phase.
* \param timeout Timeout pair (see #l4_timeout_t).
* \return result tag
*
* A message is sent to the destination object and the invoking thread waits
* for a reply from any source.
*
* \note This is a special-purpose operation and shall not be used in general
* applications.
*/
L4_INLINE l4_msgtag_t
l4_ipc_send_and_wait(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_msgtag_t tag,
l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW;
/**
* \defgroup l4_ipc_rt_api Realtime API
* \ingroup l4_ipc_api
* \internal
*/
#if 0
/**
* Wait for next period.
* \ingroup l4_ipc_rt_api
*
* \param utcb UTCB of the caller.
* \param label Label
* \param timeout IPC timeout (see #l4_ipc_timeout).
*
* \return result tag
*/
L4_INLINE l4_msgtag_t
l4_ipc_wait_next_period(l4_utcb_t *utcb,
l4_umword_t *label,
l4_timeout_t timeout);
#endif
/**
* \brief Generic L4 object invocation.
* \ingroup l4_ipc_api
*
* \param dest Destination object.
* \param utcb UTCB of the caller.
* \param flags Invocation flags (see #l4_syscall_flags_t).
* \param slabel Send label if applicable (may be seen by the receiver).
* \param tag Sending message tag.
* \retval rlabel Receiving label.
* \param timeout Timeout pair (see #l4_timeout_t).
*
* \return return tag
*/
L4_INLINE l4_msgtag_t
l4_ipc(l4_cap_idx_t dest,
l4_utcb_t *utcb,
l4_umword_t flags,
l4_umword_t slabel,
l4_msgtag_t tag,
l4_umword_t *rlabel,
l4_timeout_t timeout) L4_NOTHROW;
/**
* \brief Sleep for an amount of time.
* \ingroup l4_ipc_api
*
* \param timeout Timeout pair (see #l4_timeout_t, the receive part matters).
*
* \return error code:
* - #L4_IPC_RETIMEOUT: success
* - #L4_IPC_RECANCELED woken up by a different thread
* (l4_thread_ex_regs()).
*
* The invoking thread waits until the timeout
* is expired or the wait was aborted by another thread by l4_thread_ex_regs().
*/
L4_INLINE l4_msgtag_t
l4_ipc_sleep(l4_timeout_t timeout) L4_NOTHROW;
/**
* \brief Add a flex-page to be sent to the UTCB
* \ingroup l4_ipc_api
*
* \param snd_fpage Flex-page.
* \param snd_base Send base.
* \param tag Tag to be modified.
* \retval tag Modified tag, the number of items will be increased,
* all other values in the tag will be retained.
*
* \return 0 on success, negative error code otherwise
*/
L4_INLINE int
l4_sndfpage_add(l4_fpage_t const snd_fpage, unsigned long snd_base,
l4_msgtag_t *tag) L4_NOTHROW;
/*
* \internal
* \ingroup l4_ipc_api
*/
L4_INLINE int
l4_sndfpage_add_u(l4_fpage_t const snd_fpage, unsigned long snd_base,
l4_msgtag_t *tag, l4_utcb_t *utcb) L4_NOTHROW;
/************************************************************************
* Implementations
**********************/
L4_INLINE l4_umword_t
l4_ipc_error(l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
{
if (!l4_msgtag_has_error(tag))
return 0;
return l4_utcb_tcr_u(utcb)->error & L4_IPC_ERROR_MASK;
}
L4_INLINE long
l4_error_u(l4_msgtag_t tag, l4_utcb_t *u) L4_NOTHROW
{
if (l4_msgtag_has_error(tag))
return -(L4_EIPC_LO + (l4_utcb_tcr_u(u)->error & L4_IPC_ERROR_MASK));
return l4_msgtag_label(tag);
}
L4_INLINE long
l4_error(l4_msgtag_t tag) L4_NOTHROW
{
return l4_error_u(tag, l4_utcb());
}
L4_INLINE int l4_ipc_is_snd_error(l4_utcb_t *u) L4_NOTHROW
{ return !(l4_utcb_tcr_u(u)->error & 1) == 0; }
L4_INLINE int l4_ipc_is_rcv_error(l4_utcb_t *u) L4_NOTHROW
{ return l4_utcb_tcr_u(u)->error & 1; }
L4_INLINE int l4_ipc_error_code(l4_utcb_t *u) L4_NOTHROW
{ return l4_utcb_tcr_u(u)->error & L4_IPC_ERROR_MASK; }
/*
* \internal
* \ingroup l4_ipc_api
*/
L4_INLINE int
l4_sndfpage_add_u(l4_fpage_t const snd_fpage, unsigned long snd_base,
l4_msgtag_t *tag, l4_utcb_t *utcb) L4_NOTHROW
{
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
int i = l4_msgtag_words(*tag) + 2 * l4_msgtag_items(*tag);
if (i >= L4_UTCB_GENERIC_DATA_SIZE - 1)
return -L4_ENOMEM;
v->mr[i] = snd_base | L4_ITEM_MAP | L4_ITEM_CONT;
v->mr[i + 1] = snd_fpage.raw;
*tag = l4_msgtag(l4_msgtag_label(*tag), l4_msgtag_words(*tag),
l4_msgtag_items(*tag) + 1, l4_msgtag_flags(*tag));
return 0;
}
L4_INLINE int
l4_sndfpage_add(l4_fpage_t const snd_fpage, unsigned long snd_base,
l4_msgtag_t *tag) L4_NOTHROW
{
return l4_sndfpage_add_u(snd_fpage, snd_base, tag, l4_utcb());
}
#endif /* ! __L4SYS__INCLUDE__L4API_FIASCO__IPC_H__ */
|
MicroTrustRepos/microkernel
|
src/l4/pkg/l4sys/include/ipc.h
|
C
|
gpl-2.0
| 16,662 |
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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; version 2 of the License.
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 St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
#include "ftdefs.h"
typedef struct st_ft_docstat {
FT_WORD *list;
uint uniq;
double sum;
} FT_DOCSTAT;
typedef struct st_my_ft_parser_param
{
TREE *wtree;
MEM_ROOT *mem_root;
} MY_FT_PARSER_PARAM;
static int FT_WORD_cmp(CHARSET_INFO* cs, FT_WORD *w1, FT_WORD *w2)
{
return ha_compare_text(cs, (uchar*) w1->pos, w1->len,
(uchar*) w2->pos, w2->len, 0);
}
static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
{
word->weight=LWS_IN_USE;
docstat->sum+=word->weight;
memcpy((docstat->list)++, word, sizeof(FT_WORD));
return 0;
}
/* transforms tree of words into the array, applying normalization */
FT_WORD * ft_linearize(TREE *wtree, MEM_ROOT *mem_root)
{
FT_WORD *wlist,*p;
FT_DOCSTAT docstat;
DBUG_ENTER("ft_linearize");
if ((wlist=(FT_WORD *) alloc_root(mem_root, sizeof(FT_WORD)*
(1+wtree->elements_in_tree))))
{
docstat.list=wlist;
docstat.uniq=wtree->elements_in_tree;
docstat.sum=0;
tree_walk(wtree,(tree_walk_action)&walk_and_copy,&docstat,left_root_right);
}
delete_tree(wtree, 0);
if (!wlist)
DBUG_RETURN(NULL);
docstat.list->pos=NULL;
for (p=wlist;p->pos;p++)
{
p->weight=PRENORM_IN_USE;
}
for (p=wlist;p->pos;p++)
{
p->weight/=NORM_IN_USE;
}
DBUG_RETURN(wlist);
}
my_bool ft_boolean_check_syntax_string(const uchar *str)
{
uint i, j;
if (!str ||
(strlen((char*) str)+1 != sizeof(DEFAULT_FTB_SYNTAX)) ||
(str[0] != ' ' && str[1] != ' '))
return 1;
for (i=0; i<sizeof(DEFAULT_FTB_SYNTAX); i++)
{
/* limiting to 7-bit ascii only */
if ((unsigned char)(str[i]) > 127 || my_isalnum(default_charset_info, str[i]))
return 1;
for (j=0; j<i; j++)
if (str[i] == str[j] && (i != 11 || j != 10))
return 1;
}
return 0;
}
/*
RETURN VALUE
0 - eof
1 - word found
2 - left bracket
3 - right bracket
4 - stopword found
*/
uchar ft_get_word(CHARSET_INFO *cs, const uchar **start, const uchar *end,
FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param)
{
const uchar *doc=*start;
int ctype;
uint mwc, length;
int mbl;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
param->weight_adjust= param->wasign= 0;
param->type= FT_TOKEN_EOF;
while (doc<end)
{
for (; doc < end; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
break;
if (*doc == FTB_RQUOT && param->quot)
{
*start=doc+1;
param->type= FT_TOKEN_RIGHT_PAREN;
goto ret;
}
if (!param->quot)
{
if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
{
/* param->prev=' '; */
*start=doc+1;
if (*doc == FTB_LQUOT)
param->quot= (char*) 1;
param->type= (*doc == FTB_RBR ? FT_TOKEN_RIGHT_PAREN : FT_TOKEN_LEFT_PAREN);
goto ret;
}
if (param->prev == ' ')
{
if (*doc == FTB_YES ) { param->yesno=+1; continue; } else
if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else
if (*doc == FTB_NO ) { param->yesno=-1; continue; } else
if (*doc == FTB_INC ) { param->weight_adjust++; continue; } else
if (*doc == FTB_DEC ) { param->weight_adjust--; continue; } else
if (*doc == FTB_NEG ) { param->wasign= !param->wasign; continue; }
}
}
param->prev=*doc;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
param->weight_adjust= param->wasign= 0;
}
mwc=length=0;
for (word->pos= doc; doc < end; length++,
doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
mwc=0;
else if (!misc_word_char(*doc) || mwc)
break;
else
mwc++;
}
param->prev='A'; /* be sure *prev is true_word_char */
word->len= (uint)(doc-word->pos) - mwc;
if ((param->trunc=(doc<end && *doc == FTB_TRUNC)))
doc++;
if (((length >= ft_min_word_len && !is_stopword((char*) word->pos,
word->len))
|| param->trunc) && length < ft_max_word_len)
{
*start=doc;
param->type= FT_TOKEN_WORD;
goto ret;
}
else if (length) /* make sure length > 0 (if start contains spaces only) */
{
*start= doc;
param->type= FT_TOKEN_STOPWORD;
goto ret;
}
}
if (param->quot)
{
*start= doc;
param->type= 3; /* FT_RBR */
goto ret;
}
ret:
return param->type;
}
uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end,
FT_WORD *word, my_bool skip_stopwords)
{
uchar *doc= *start;
uint mwc, length;
int mbl;
int ctype;
DBUG_ENTER("ft_simple_get_word");
do
{
for (;; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
if (doc >= end)
DBUG_RETURN(0);
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
break;
}
mwc= length= 0;
for (word->pos= doc; doc < end; length++,
doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
mwc= 0;
else if (!misc_word_char(*doc) || mwc)
break;
else
mwc++;
}
word->len= (uint)(doc-word->pos) - mwc;
if (skip_stopwords == FALSE ||
(length >= ft_min_word_len && length < ft_max_word_len &&
!is_stopword((char*) word->pos, word->len)))
{
*start= doc;
DBUG_RETURN(1);
}
} while (doc < end);
DBUG_RETURN(0);
}
void ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
{
DBUG_ENTER("ft_parse_init");
if (!is_tree_inited(wtree))
init_tree(wtree, 0, 0, sizeof(FT_WORD), (qsort_cmp2)&FT_WORD_cmp, 0,
(void*)cs, MYF(0));
DBUG_VOID_RETURN;
}
static int ft_add_word(MYSQL_FTPARSER_PARAM *param,
const char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
{
TREE *wtree;
FT_WORD w;
MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam;
DBUG_ENTER("ft_add_word");
wtree= ft_param->wtree;
if (param->flags & MYSQL_FTFLAGS_NEED_COPY)
{
uchar *ptr;
DBUG_ASSERT(wtree->with_delete == 0);
ptr= (uchar *)alloc_root(ft_param->mem_root, word_len);
memcpy(ptr, word, word_len);
w.pos= ptr;
}
else
w.pos= (uchar*) word;
w.len= word_len;
if (!tree_insert(wtree, &w, 0, wtree->custom_arg))
{
delete_tree(wtree, 0);
DBUG_RETURN(1);
}
DBUG_RETURN(0);
}
static int ft_parse_internal(MYSQL_FTPARSER_PARAM *param,
const char *doc_arg, int doc_len)
{
uchar *doc= (uchar*) doc_arg;
uchar *end= doc + doc_len;
MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam;
TREE *wtree= ft_param->wtree;
FT_WORD w;
DBUG_ENTER("ft_parse_internal");
while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE))
if (param->mysql_add_word(param, (char*) w.pos, w.len, 0))
DBUG_RETURN(1);
DBUG_RETURN(0);
}
int ft_parse(TREE *wtree, uchar *doc, int doclen,
struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
{
MY_FT_PARSER_PARAM my_param;
DBUG_ENTER("ft_parse");
DBUG_ASSERT(parser);
my_param.wtree= wtree;
my_param.mem_root= mem_root;
param->mysql_parse= ft_parse_internal;
param->mysql_add_word= ft_add_word;
param->mysql_ftparam= &my_param;
param->cs= wtree->custom_arg;
param->doc= (char*) doc;
param->length= doclen;
param->mode= MYSQL_FTPARSER_SIMPLE_MODE;
DBUG_RETURN(parser->parse(param));
}
#define MAX_PARAM_NR 2
MYSQL_FTPARSER_PARAM* ftparser_alloc_param(MI_INFO *info)
{
if (!info->ftparser_param)
{
/*
. info->ftparser_param can not be zero after the initialization,
because it always includes built-in fulltext parser. And built-in
parser can be called even if the table has no fulltext indexes and
no varchar/text fields.
ftb_find_relevance... parser (ftb_find_relevance_parse,
ftb_find_relevance_add_word) calls ftb_check_phrase... parser
(ftb_check_phrase_internal, ftb_phrase_add_word). Thus MAX_PARAM_NR=2.
*/
info->ftparser_param= (MYSQL_FTPARSER_PARAM *)
my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) *
info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL));
init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, MYF(0));
}
return info->ftparser_param;
}
MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info,
uint keynr, uint paramnr)
{
uint32 ftparser_nr;
struct st_mysql_ftparser *parser;
if (!ftparser_alloc_param(info))
return 0;
if (keynr == NO_SUCH_KEY)
{
ftparser_nr= 0;
parser= &ft_default_parser;
}
else
{
ftparser_nr= info->s->keyinfo[keynr].ftkey_nr;
parser= info->s->keyinfo[keynr].parser;
}
DBUG_ASSERT(paramnr < MAX_PARAM_NR);
ftparser_nr= ftparser_nr*MAX_PARAM_NR + paramnr;
if (! info->ftparser_param[ftparser_nr].mysql_add_word)
{
/* Note, that mysql_add_word is used here as a flag:
mysql_add_word == 0 - parser is not initialized
mysql_add_word != 0 - parser is initialized, or no
initialization needed. */
info->ftparser_param[ftparser_nr].mysql_add_word=
(int (*)(struct st_mysql_ftparser_param *, const char *, int,
MYSQL_FTPARSER_BOOLEAN_INFO *)) 1;
if (parser->init && parser->init(&info->ftparser_param[ftparser_nr]))
return 0;
}
return &info->ftparser_param[ftparser_nr];
}
void ftparser_call_deinitializer(MI_INFO *info)
{
uint i, j, keys= info->s->state.header.keys;
free_root(&info->ft_memroot, MYF(0));
if (! info->ftparser_param)
return;
for (i= 0; i < keys; i++)
{
MI_KEYDEF *keyinfo= &info->s->keyinfo[i];
for (j=0; j < MAX_PARAM_NR; j++)
{
MYSQL_FTPARSER_PARAM *ftparser_param=
&info->ftparser_param[keyinfo->ftkey_nr * MAX_PARAM_NR + j];
if (keyinfo->flag & HA_FULLTEXT && ftparser_param->mysql_add_word)
{
if (keyinfo->parser->deinit)
keyinfo->parser->deinit(ftparser_param);
ftparser_param->mysql_add_word= 0;
}
else
break;
}
}
}
|
tempesta-tech/mariadb_10.2
|
storage/myisam/ft_parser.c
|
C
|
gpl-2.0
| 11,421 |
<?php
/**
* File containing ezcomNotification class
*
* @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*
*/
/**
* ezcomNotification persistent object class definition
*
*/
class ezcomNotification extends eZPersistentObject
{
/**
* Construct, use {@link ezcomNotification::create()} to create new objects.
*
* @param array $row
*/
public function __construct( $row )
{
parent::__construct( $row );
}
/**
* Fields definition
*
* @return array
*/
public static function definition()
{
static $def = array( 'fields' => array( 'id' => array( 'name' => 'ID',
'datatype' => 'integer',
'default' => 0,
'required' => true ),
'contentobject_id' => array( 'name' => 'ContentObjectID',
'datatype' => 'integer',
'default' => 0,
'required' => true ),
'language_id' => array( 'name' => 'LanguageID',
'datatype' => 'integer',
'default' => 0,
'required' => true ),
'send_time' => array( 'name' => 'SendTime',
'datatype' => 'integer',
'default' => 0,
'required' => true ),
'status' => array( 'name' => 'Status',
'datatype' => 'integer',
'default' => 1,
'required' => true ),
'comment_id' => array( 'name' => 'CommentID',
'datatype' => 'integer',
'default' => 0,
'required' => true ) ),
'keys' => array( 'id' ),
'function_attributes' => array(),
'increment_key' => 'id',
'class_name' => 'ezcomNotification',
'name' => 'ezcomment_notification' );
return $def;
}
/**
* Create new ezcomNotification object
*
* @static
* @param array $row
* @return ezcomNotification
*/
public static function create( $row = array() )
{
$object = new self( $row );
return $object;
}
/**
* Fetch notification by given id
*
* @param int $id
* @return null|ezcomNotification
*/
static function fetch( $id )
{
$cond = array( 'id' => $id );
$return = eZPersistentObject::fetchObject( self::definition(), null, $cond );
return $return;
}
/**
* Fetch the list of notification
* @param $length: count of the notification to be fetched
* @param $status: the status of the notification
* @param $offset: offset
* @return notification list
*/
static function fetchNotificationList( $status = 1, $length = null, $offset = 0, $sorts = null )
{
$cond = array();
if ( is_null( $status ) )
{
$cond = null;
}
else
{
$cond['status'] = $status;
}
$limit = array();
if ( is_null( $length ) )
{
$limit = null;
}
else
{
$limit['offset'] = $offset;
$limit['length'] = $length;
}
return eZPersistentObject::fetchObjectList( self::definition(), null, $cond, $sorts, $limit );
}
/**
* clean up the notification quque
* @param unknown_type $contentObjectID
* @param unknown_type $languageID
* @param unknown_type $commentID
* @return unknown_type
*/
public static function cleanUpNotification( $contentObjectID, $language )
{
//1. fetch the queue, judge if there is data
//
}
}
?>
|
ETSGlobal/ezpublish_built
|
extension/ezcomments/classes/ezcomnotification.php
|
PHP
|
gpl-2.0
| 4,981 |
/*
* linux/fs/ext4/ialloc.c
*
* Copyright (C) 1992, 1993, 1994, 1995
* Remy Card ([email protected])
* Laboratoire MASI - Institut Blaise Pascal
* Universite Pierre et Marie Curie (Paris VI)
*
* BSD ufs-inspired inode and directory allocation by
* Stephen Tweedie ([email protected]), 1993
* Big-endian to little-endian byte-swapping/bitmaps by
* David S. Miller ([email protected]), 1995
*/
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd2.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
#include <linux/random.h>
#include <linux/bitops.h>
#include <linux/blkdev.h>
#include <asm/byteorder.h>
#include "ext4.h"
#include "ext4_jbd2.h"
#include "xattr.h"
#include "acl.h"
#include <trace/events/ext4.h>
/*
* ialloc.c contains the inodes allocation and deallocation routines
*/
/*
* The free inodes are managed by bitmaps. A file system contains several
* blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap
* block for inodes, N blocks for the inode table and data blocks.
*
* The file system contains group descriptors which are located after the
* super block. Each descriptor contains the number of the bitmap block and
* the free blocks count in the block.
*/
/*
* To avoid calling the atomic setbit hundreds or thousands of times, we only
* need to use it within a single byte (to ensure we get endianness right).
* We can use memset for the rest of the bitmap as there are no other users.
*/
void ext4_mark_bitmap_end(int start_bit, int end_bit, char *bitmap)
{
int i;
if (start_bit >= end_bit)
return;
ext4_debug("mark end bits +%d through +%d used\n", start_bit, end_bit);
for (i = start_bit; i < ((start_bit + 7) & ~7UL); i++)
ext4_set_bit(i, bitmap);
if (i < end_bit)
memset(bitmap + (i >> 3), 0xff, (end_bit - i) >> 3);
}
/* Initializes an uninitialized inode bitmap */
static unsigned ext4_init_inode_bitmap(struct super_block *sb,
struct buffer_head *bh,
ext4_group_t block_group,
struct ext4_group_desc *gdp)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
J_ASSERT_BH(bh, buffer_locked(bh));
/* If checksum is bad mark all blocks and inodes use to prevent
* allocation, essentially implementing a per-group read-only flag. */
if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
ext4_error(sb, "Checksum bad for group %u", block_group);
ext4_free_group_clusters_set(sb, gdp, 0);
ext4_free_inodes_set(sb, gdp, 0);
ext4_itable_unused_set(sb, gdp, 0);
memset(bh->b_data, 0xff, sb->s_blocksize);
return 0;
}
memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8);
ext4_mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), sb->s_blocksize * 8,
bh->b_data);
return EXT4_INODES_PER_GROUP(sb);
}
void ext4_end_bitmap_read(struct buffer_head *bh, int uptodate)
{
if (uptodate) {
set_buffer_uptodate(bh);
set_bitmap_uptodate(bh);
}
unlock_buffer(bh);
put_bh(bh);
}
/*
* Read the inode allocation bitmap for a given block_group, reading
* into the specified slot in the superblock's bitmap cache.
*
* Return buffer_head of bitmap on success or NULL.
*/
static struct buffer_head *
ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
{
struct ext4_group_desc *desc;
struct buffer_head *bh = NULL;
ext4_fsblk_t bitmap_blk;
desc = ext4_get_group_desc(sb, block_group, NULL);
if (!desc)
return NULL;
bitmap_blk = ext4_inode_bitmap(sb, desc);
bh = sb_getblk(sb, bitmap_blk);
if (unlikely(!bh)) {
ext4_error(sb, "Cannot read inode bitmap - "
"block_group = %u, inode_bitmap = %llu",
block_group, bitmap_blk);
return NULL;
}
if (bitmap_uptodate(bh))
return bh;
lock_buffer(bh);
if (bitmap_uptodate(bh)) {
unlock_buffer(bh);
return bh;
}
ext4_lock_group(sb, block_group);
if (desc->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {
ext4_init_inode_bitmap(sb, bh, block_group, desc);
set_bitmap_uptodate(bh);
set_buffer_uptodate(bh);
ext4_unlock_group(sb, block_group);
unlock_buffer(bh);
return bh;
}
ext4_unlock_group(sb, block_group);
if (buffer_uptodate(bh)) {
/*
* if not uninit if bh is uptodate,
* bitmap is also uptodate
*/
set_bitmap_uptodate(bh);
unlock_buffer(bh);
return bh;
}
/*
* submit the buffer_head for reading
*/
trace_ext4_load_inode_bitmap(sb, block_group);
bh->b_end_io = ext4_end_bitmap_read;
get_bh(bh);
submit_bh(READ, bh);
wait_on_buffer(bh);
if (!buffer_uptodate(bh)) {
put_bh(bh);
ext4_error(sb, "Cannot read inode bitmap - "
"block_group = %u, inode_bitmap = %llu",
block_group, bitmap_blk);
return NULL;
}
return bh;
}
/*
* NOTE! When we get the inode, we're the only people
* that have access to it, and as such there are no
* race conditions we have to worry about. The inode
* is not on the hash-lists, and it cannot be reached
* through the filesystem because the directory entry
* has been deleted earlier.
*
* HOWEVER: we must make sure that we get no aliases,
* which means that we have to call "clear_inode()"
* _before_ we mark the inode not in use in the inode
* bitmaps. Otherwise a newly created file might use
* the same inode number (not actually the same pointer
* though), and then we'd have two inodes sharing the
* same inode number and space on the harddisk.
*/
void ext4_free_inode(handle_t *handle, struct inode *inode)
{
struct super_block *sb = inode->i_sb;
int is_directory;
unsigned long ino;
struct buffer_head *bitmap_bh = NULL;
struct buffer_head *bh2;
ext4_group_t block_group;
unsigned long bit;
struct ext4_group_desc *gdp;
struct ext4_super_block *es;
struct ext4_sb_info *sbi;
int fatal = 0, err, count, cleared;
if (!sb) {
printk(KERN_ERR "EXT4-fs: %s:%d: inode on "
"nonexistent device\n", __func__, __LINE__);
return;
}
if (atomic_read(&inode->i_count) > 1) {
ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: count=%d",
__func__, __LINE__, inode->i_ino,
atomic_read(&inode->i_count));
return;
}
if (inode->i_nlink) {
ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: nlink=%d\n",
__func__, __LINE__, inode->i_ino, inode->i_nlink);
return;
}
sbi = EXT4_SB(sb);
ino = inode->i_ino;
ext4_debug("freeing inode %lu\n", ino);
trace_ext4_free_inode(inode);
/*
* Note: we must free any quota before locking the superblock,
* as writing the quota to disk may need the lock as well.
*/
dquot_initialize(inode);
ext4_xattr_delete_inode(handle, inode);
dquot_free_inode(inode);
dquot_drop(inode);
is_directory = S_ISDIR(inode->i_mode);
/* Do this BEFORE marking the inode not in use or returning an error */
ext4_clear_inode(inode);
es = EXT4_SB(sb)->s_es;
if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
ext4_error(sb, "reserved or nonexistent inode %lu", ino);
goto error_return;
}
block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
bit = (ino - 1) % EXT4_INODES_PER_GROUP(sb);
bitmap_bh = ext4_read_inode_bitmap(sb, block_group);
if (!bitmap_bh)
goto error_return;
BUFFER_TRACE(bitmap_bh, "get_write_access");
fatal = ext4_journal_get_write_access(handle, bitmap_bh);
if (fatal)
goto error_return;
fatal = -ESRCH;
gdp = ext4_get_group_desc(sb, block_group, &bh2);
if (gdp) {
BUFFER_TRACE(bh2, "get_write_access");
fatal = ext4_journal_get_write_access(handle, bh2);
}
ext4_lock_group(sb, block_group);
cleared = ext4_test_and_clear_bit(bit, bitmap_bh->b_data);
if (fatal || !cleared) {
ext4_unlock_group(sb, block_group);
goto out;
}
count = ext4_free_inodes_count(sb, gdp) + 1;
ext4_free_inodes_set(sb, gdp, count);
if (is_directory) {
count = ext4_used_dirs_count(sb, gdp) - 1;
ext4_used_dirs_set(sb, gdp, count);
percpu_counter_dec(&sbi->s_dirs_counter);
}
gdp->bg_checksum = ext4_group_desc_csum(sbi, block_group, gdp);
ext4_unlock_group(sb, block_group);
percpu_counter_inc(&sbi->s_freeinodes_counter);
if (sbi->s_log_groups_per_flex) {
ext4_group_t f = ext4_flex_group(sbi, block_group);
atomic_inc(&sbi->s_flex_groups[f].free_inodes);
if (is_directory)
atomic_dec(&sbi->s_flex_groups[f].used_dirs);
}
BUFFER_TRACE(bh2, "call ext4_handle_dirty_metadata");
fatal = ext4_handle_dirty_metadata(handle, NULL, bh2);
out:
if (cleared) {
BUFFER_TRACE(bitmap_bh, "call ext4_handle_dirty_metadata");
err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
if (!fatal)
fatal = err;
ext4_mark_super_dirty(sb);
} else {
/* for debugging, sangwoo2.lee */
print_bh(sb, bitmap_bh, 0, EXT4_BLOCK_SIZE(sb));
/* for debugging */
ext4_error(sb, "bit already cleared for inode %lu", ino);
}
error_return:
brelse(bitmap_bh);
ext4_std_error(sb, fatal);
}
struct orlov_stats {
__u64 free_clusters;
__u32 free_inodes;
__u32 used_dirs;
};
/*
* Helper function for Orlov's allocator; returns critical information
* for a particular block group or flex_bg. If flex_size is 1, then g
* is a block group number; otherwise it is flex_bg number.
*/
static void get_orlov_stats(struct super_block *sb, ext4_group_t g,
int flex_size, struct orlov_stats *stats)
{
struct ext4_group_desc *desc;
struct flex_groups *flex_group = EXT4_SB(sb)->s_flex_groups;
if (flex_size > 1) {
stats->free_inodes = atomic_read(&flex_group[g].free_inodes);
stats->free_clusters = atomic64_read(&flex_group[g].free_clusters);
stats->used_dirs = atomic_read(&flex_group[g].used_dirs);
return;
}
desc = ext4_get_group_desc(sb, g, NULL);
if (desc) {
stats->free_inodes = ext4_free_inodes_count(sb, desc);
stats->free_clusters = ext4_free_group_clusters(sb, desc);
stats->used_dirs = ext4_used_dirs_count(sb, desc);
} else {
stats->free_inodes = 0;
stats->free_clusters = 0;
stats->used_dirs = 0;
}
}
/*
* Orlov's allocator for directories.
*
* We always try to spread first-level directories.
*
* If there are blockgroups with both free inodes and free blocks counts
* not worse than average we return one with smallest directory count.
* Otherwise we simply return a random group.
*
* For the rest rules look so:
*
* It's OK to put directory into a group unless
* it has too many directories already (max_dirs) or
* it has too few free inodes left (min_inodes) or
* it has too few free blocks left (min_blocks) or
* Parent's group is preferred, if it doesn't satisfy these
* conditions we search cyclically through the rest. If none
* of the groups look good we just look for a group with more
* free inodes than average (starting at parent's group).
*/
static int find_group_orlov(struct super_block *sb, struct inode *parent,
ext4_group_t *group, umode_t mode,
const struct qstr *qstr)
{
ext4_group_t parent_group = EXT4_I(parent)->i_block_group;
struct ext4_sb_info *sbi = EXT4_SB(sb);
ext4_group_t real_ngroups = ext4_get_groups_count(sb);
int inodes_per_group = EXT4_INODES_PER_GROUP(sb);
unsigned int freei, avefreei, grp_free;
ext4_fsblk_t freeb, avefreec;
unsigned int ndirs;
int max_dirs, min_inodes;
ext4_grpblk_t min_clusters;
ext4_group_t i, grp, g, ngroups;
struct ext4_group_desc *desc;
struct orlov_stats stats;
int flex_size = ext4_flex_bg_size(sbi);
struct dx_hash_info hinfo;
ngroups = real_ngroups;
if (flex_size > 1) {
ngroups = (real_ngroups + flex_size - 1) >>
sbi->s_log_groups_per_flex;
parent_group >>= sbi->s_log_groups_per_flex;
}
freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter);
avefreei = freei / ngroups;
freeb = EXT4_C2B(sbi,
percpu_counter_read_positive(&sbi->s_freeclusters_counter));
avefreec = freeb;
do_div(avefreec, ngroups);
ndirs = percpu_counter_read_positive(&sbi->s_dirs_counter);
if (S_ISDIR(mode) &&
((parent == sb->s_root->d_inode) ||
(ext4_test_inode_flag(parent, EXT4_INODE_TOPDIR)))) {
int best_ndir = inodes_per_group;
int ret = -1;
if (qstr) {
hinfo.hash_version = DX_HASH_HALF_MD4;
hinfo.seed = sbi->s_hash_seed;
ext4fs_dirhash(qstr->name, qstr->len, &hinfo);
grp = hinfo.hash;
} else
get_random_bytes(&grp, sizeof(grp));
parent_group = (unsigned)grp % ngroups;
for (i = 0; i < ngroups; i++) {
g = (parent_group + i) % ngroups;
get_orlov_stats(sb, g, flex_size, &stats);
if (!stats.free_inodes)
continue;
if (stats.used_dirs >= best_ndir)
continue;
if (stats.free_inodes < avefreei)
continue;
if (stats.free_clusters < avefreec)
continue;
grp = g;
ret = 0;
best_ndir = stats.used_dirs;
}
if (ret)
goto fallback;
found_flex_bg:
if (flex_size == 1) {
*group = grp;
return 0;
}
/*
* We pack inodes at the beginning of the flexgroup's
* inode tables. Block allocation decisions will do
* something similar, although regular files will
* start at 2nd block group of the flexgroup. See
* ext4_ext_find_goal() and ext4_find_near().
*/
grp *= flex_size;
for (i = 0; i < flex_size; i++) {
if (grp+i >= real_ngroups)
break;
desc = ext4_get_group_desc(sb, grp+i, NULL);
if (desc && ext4_free_inodes_count(sb, desc)) {
*group = grp+i;
return 0;
}
}
goto fallback;
}
max_dirs = ndirs / ngroups + inodes_per_group / 16;
min_inodes = avefreei - inodes_per_group*flex_size / 4;
if (min_inodes < 1)
min_inodes = 1;
min_clusters = avefreec - EXT4_CLUSTERS_PER_GROUP(sb)*flex_size / 4;
/*
* Start looking in the flex group where we last allocated an
* inode for this parent directory
*/
if (EXT4_I(parent)->i_last_alloc_group != ~0) {
parent_group = EXT4_I(parent)->i_last_alloc_group;
if (flex_size > 1)
parent_group >>= sbi->s_log_groups_per_flex;
}
for (i = 0; i < ngroups; i++) {
grp = (parent_group + i) % ngroups;
get_orlov_stats(sb, grp, flex_size, &stats);
if (stats.used_dirs >= max_dirs)
continue;
if (stats.free_inodes < min_inodes)
continue;
if (stats.free_clusters < min_clusters)
continue;
goto found_flex_bg;
}
fallback:
ngroups = real_ngroups;
avefreei = freei / ngroups;
fallback_retry:
parent_group = EXT4_I(parent)->i_block_group;
for (i = 0; i < ngroups; i++) {
grp = (parent_group + i) % ngroups;
desc = ext4_get_group_desc(sb, grp, NULL);
if (desc) {
grp_free = ext4_free_inodes_count(sb, desc);
if (grp_free && grp_free >= avefreei) {
*group = grp;
return 0;
}
}
}
if (avefreei) {
/*
* The free-inodes counter is approximate, and for really small
* filesystems the above test can fail to find any blockgroups
*/
avefreei = 0;
goto fallback_retry;
}
return -1;
}
static int find_group_other(struct super_block *sb, struct inode *parent,
ext4_group_t *group, umode_t mode)
{
ext4_group_t parent_group = EXT4_I(parent)->i_block_group;
ext4_group_t i, last, ngroups = ext4_get_groups_count(sb);
struct ext4_group_desc *desc;
int flex_size = ext4_flex_bg_size(EXT4_SB(sb));
/*
* Try to place the inode is the same flex group as its
* parent. If we can't find space, use the Orlov algorithm to
* find another flex group, and store that information in the
* parent directory's inode information so that use that flex
* group for future allocations.
*/
if (flex_size > 1) {
int retry = 0;
try_again:
parent_group &= ~(flex_size-1);
last = parent_group + flex_size;
if (last > ngroups)
last = ngroups;
for (i = parent_group; i < last; i++) {
desc = ext4_get_group_desc(sb, i, NULL);
if (desc && ext4_free_inodes_count(sb, desc)) {
*group = i;
return 0;
}
}
if (!retry && EXT4_I(parent)->i_last_alloc_group != ~0) {
retry = 1;
parent_group = EXT4_I(parent)->i_last_alloc_group;
goto try_again;
}
/*
* If this didn't work, use the Orlov search algorithm
* to find a new flex group; we pass in the mode to
* avoid the topdir algorithms.
*/
*group = parent_group + flex_size;
if (*group > ngroups)
*group = 0;
return find_group_orlov(sb, parent, group, mode, NULL);
}
/*
* Try to place the inode in its parent directory
*/
*group = parent_group;
desc = ext4_get_group_desc(sb, *group, NULL);
if (desc && ext4_free_inodes_count(sb, desc) &&
ext4_free_group_clusters(sb, desc))
return 0;
/*
* We're going to place this inode in a different blockgroup from its
* parent. We want to cause files in a common directory to all land in
* the same blockgroup. But we want files which are in a different
* directory which shares a blockgroup with our parent to land in a
* different blockgroup.
*
* So add our directory's i_ino into the starting point for the hash.
*/
*group = (*group + parent->i_ino) % ngroups;
/*
* Use a quadratic hash to find a group with a free inode and some free
* blocks.
*/
for (i = 1; i < ngroups; i <<= 1) {
*group += i;
if (*group >= ngroups)
*group -= ngroups;
desc = ext4_get_group_desc(sb, *group, NULL);
if (desc && ext4_free_inodes_count(sb, desc) &&
ext4_free_group_clusters(sb, desc))
return 0;
}
/*
* That failed: try linear search for a free inode, even if that group
* has no free blocks.
*/
*group = parent_group;
for (i = 0; i < ngroups; i++) {
if (++*group >= ngroups)
*group = 0;
desc = ext4_get_group_desc(sb, *group, NULL);
if (desc && ext4_free_inodes_count(sb, desc))
return 0;
}
return -1;
}
/*
* There are two policies for allocating an inode. If the new inode is
* a directory, then a forward search is made for a block group with both
* free space and a low directory-to-inode ratio; if that fails, then of
* the groups with above-average free space, that group with the fewest
* directories already is chosen.
*
* For other inodes, search forward from the parent directory's block
* group to find a free inode.
*/
struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
umode_t mode, const struct qstr *qstr,
__u32 goal, uid_t *owner, int nblocks)
{
struct super_block *sb;
struct buffer_head *inode_bitmap_bh = NULL;
struct buffer_head *group_desc_bh;
ext4_group_t ngroups, group = 0;
unsigned long ino = 0;
struct inode *inode;
struct ext4_group_desc *gdp = NULL;
struct ext4_inode_info *ei;
struct ext4_sb_info *sbi;
int ret2, err = 0;
struct inode *ret;
ext4_group_t i;
ext4_group_t flex_group;
/* Cannot create files in a deleted directory */
if (!dir || !dir->i_nlink)
return ERR_PTR(-EPERM);
sb = dir->i_sb;
ngroups = ext4_get_groups_count(sb);
trace_ext4_request_inode(dir, mode);
inode = new_inode(sb);
if (!inode)
return ERR_PTR(-ENOMEM);
ei = EXT4_I(inode);
sbi = EXT4_SB(sb);
if (!goal)
goal = sbi->s_inode_goal;
if (goal && goal <= le32_to_cpu(sbi->s_es->s_inodes_count)) {
group = (goal - 1) / EXT4_INODES_PER_GROUP(sb);
ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb);
ret2 = 0;
goto got_group;
}
if (S_ISDIR(mode))
ret2 = find_group_orlov(sb, dir, &group, mode, qstr);
else
ret2 = find_group_other(sb, dir, &group, mode);
got_group:
EXT4_I(dir)->i_last_alloc_group = group;
err = -ENOSPC;
if (ret2 == -1)
goto out;
/*
* Normally we will only go through one pass of this loop,
* unless we get unlucky and it turns out the group we selected
* had its last inode grabbed by someone else.
*/
for (i = 0; i < ngroups; i++, ino = 0) {
err = -EIO;
gdp = ext4_get_group_desc(sb, group, &group_desc_bh);
if (!gdp) {
ext4_debug("ext4_get_group_desc error: %d\n", group);
print_bh(sb, group_desc_bh, 0, EXT4_BLOCK_SIZE(sb));
goto fail;
}
if (inode_bitmap_bh) {
ext4_handle_release_buffer(handle, inode_bitmap_bh);
brelse(inode_bitmap_bh);
}
inode_bitmap_bh = ext4_read_inode_bitmap(sb, group);
if (!inode_bitmap_bh) {
ext4_debug("ext4_read_inode_bitmap error: %d\n", group);
goto fail;
}
repeat_in_this_group:
ino = ext4_find_next_zero_bit((unsigned long *)
inode_bitmap_bh->b_data,
EXT4_INODES_PER_GROUP(sb), ino);
if (ino >= EXT4_INODES_PER_GROUP(sb))
goto next_group;
if (group == 0 && (ino+1) < EXT4_FIRST_INO(sb)) {
ext4_error(sb, "reserved inode found cleared - "
"inode=%lu", ino + 1);
continue;
}
if (!handle) {
BUG_ON(nblocks <= 0);
handle = ext4_journal_start_sb(dir->i_sb, nblocks);
if (IS_ERR(handle)) {
err = PTR_ERR(handle);
goto fail;
}
}
BUFFER_TRACE(inode_bitmap_bh, "get_write_access");
err = ext4_journal_get_write_access(handle, inode_bitmap_bh);
if (err)
goto fail;
ext4_lock_group(sb, group);
ret2 = ext4_test_and_set_bit(ino, inode_bitmap_bh->b_data);
ext4_unlock_group(sb, group);
ino++; /* the inode bitmap is zero-based */
if (!ret2)
goto got; /* we grabbed the inode! */
if (ino < EXT4_INODES_PER_GROUP(sb))
goto repeat_in_this_group;
next_group:
if (++group == ngroups)
group = 0;
}
ext4_handle_release_buffer(handle, inode_bitmap_bh);
err = -ENOSPC;
goto out;
got:
BUFFER_TRACE(inode_bitmap_bh, "call ext4_handle_dirty_metadata");
err = ext4_handle_dirty_metadata(handle, NULL, inode_bitmap_bh);
if (err) {
ext4_debug("ext4_handle_dirty_metadata error\n");
goto fail;
}
/* We may have to initialize the block bitmap if it isn't already */
if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
struct buffer_head *block_bitmap_bh;
block_bitmap_bh = ext4_read_block_bitmap(sb, group);
if (!block_bitmap_bh) {
err = -EIO;
goto out;
}
BUFFER_TRACE(block_bitmap_bh, "get block bitmap access");
err = ext4_journal_get_write_access(handle, block_bitmap_bh);
if (err) {
brelse(block_bitmap_bh);
ext4_debug("ext4_journal_get_write_access error\n");
goto fail;
}
BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap");
err = ext4_handle_dirty_metadata(handle, NULL, block_bitmap_bh);
/* recheck and clear flag under lock if we still need to */
ext4_lock_group(sb, group);
if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
ext4_free_group_clusters_set(sb, gdp,
ext4_free_clusters_after_init(sb, group, gdp));
gdp->bg_checksum = ext4_group_desc_csum(sbi, group,
gdp);
}
ext4_unlock_group(sb, group);
brelse(block_bitmap_bh);
if (err) {
ext4_debug("ext4_handle_dirty_metadata error\n");
goto fail;
}
}
BUFFER_TRACE(group_desc_bh, "get_write_access");
err = ext4_journal_get_write_access(handle, group_desc_bh);
if (err) {
ext4_debug("ext4_journal_get_write_access error\n");
goto fail;
}
/* Update the relevant bg descriptor fields */
if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
int free;
struct ext4_group_info *grp = ext4_get_group_info(sb, group);
down_read(&grp->alloc_sem); /* protect vs itable lazyinit */
ext4_lock_group(sb, group); /* while we modify the bg desc */
free = EXT4_INODES_PER_GROUP(sb) -
ext4_itable_unused_count(sb, gdp);
if (gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {
gdp->bg_flags &= cpu_to_le16(~EXT4_BG_INODE_UNINIT);
free = 0;
}
/*
* Check the relative inode number against the last used
* relative inode number in this group. if it is greater
* we need to update the bg_itable_unused count
*/
if (ino > free)
ext4_itable_unused_set(sb, gdp,
(EXT4_INODES_PER_GROUP(sb) - ino));
up_read(&grp->alloc_sem);
} else {
ext4_lock_group(sb, group);
}
ext4_free_inodes_set(sb, gdp, ext4_free_inodes_count(sb, gdp) - 1);
if (S_ISDIR(mode)) {
ext4_used_dirs_set(sb, gdp, ext4_used_dirs_count(sb, gdp) + 1);
if (sbi->s_log_groups_per_flex) {
ext4_group_t f = ext4_flex_group(sbi, group);
atomic_inc(&sbi->s_flex_groups[f].used_dirs);
}
}
if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp);
}
ext4_unlock_group(sb, group);
BUFFER_TRACE(group_desc_bh, "call ext4_handle_dirty_metadata");
err = ext4_handle_dirty_metadata(handle, NULL, group_desc_bh);
if (err) {
ext4_debug("ext4_handle_dirty_metadata error\n");
goto fail;
}
percpu_counter_dec(&sbi->s_freeinodes_counter);
if (S_ISDIR(mode))
percpu_counter_inc(&sbi->s_dirs_counter);
ext4_mark_super_dirty(sb);
if (sbi->s_log_groups_per_flex) {
flex_group = ext4_flex_group(sbi, group);
atomic_dec(&sbi->s_flex_groups[flex_group].free_inodes);
}
if (owner) {
inode->i_mode = mode;
inode->i_uid = owner[0];
inode->i_gid = owner[1];
} else if (test_opt(sb, GRPID)) {
inode->i_mode = mode;
inode->i_uid = current_fsuid();
inode->i_gid = dir->i_gid;
} else
inode_init_owner(inode, dir, mode);
inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb);
/* This is the optimal IO size (for stat), not the fs block size */
inode->i_blocks = 0;
inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime =
ext4_current_time(inode);
memset(ei->i_data, 0, sizeof(ei->i_data));
ei->i_dir_start_lookup = 0;
ei->i_disksize = 0;
/* Don't inherit extent flag from directory, amongst others. */
ei->i_flags =
ext4_mask_flags(mode, EXT4_I(dir)->i_flags & EXT4_FL_INHERITED);
ei->i_file_acl = 0;
ei->i_dtime = 0;
ei->i_block_group = group;
ei->i_last_alloc_group = ~0;
ext4_set_inode_flags(inode);
if (IS_DIRSYNC(inode))
ext4_handle_sync(handle);
if (insert_inode_locked(inode) < 0) {
/*
* Likely a bitmap corruption causing inode to be allocated
* twice.
*/
ext4_debug("insert_inode_locked error\n");
if(inode_bitmap_bh)
print_bh(sb, inode_bitmap_bh, 0, EXT4_BLOCK_SIZE(sb));
err = -EIO;
goto fail;
}
spin_lock(&sbi->s_next_gen_lock);
inode->i_generation = sbi->s_next_generation++;
spin_unlock(&sbi->s_next_gen_lock);
ext4_clear_state_flags(ei); /* Only relevant on 32-bit archs */
ext4_set_inode_state(inode, EXT4_STATE_NEW);
ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize;
ret = inode;
dquot_initialize(inode);
err = dquot_alloc_inode(inode);
if (err)
goto fail_drop;
err = ext4_init_acl(handle, inode, dir);
if (err)
goto fail_free_drop;
err = ext4_init_security(handle, inode, dir, qstr);
if (err)
goto fail_free_drop;
if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
/* set extent flag only for directory, file and normal symlink*/
if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) {
ext4_set_inode_flag(inode, EXT4_INODE_EXTENTS);
ext4_ext_tree_init(handle, inode);
}
}
if (ext4_handle_valid(handle)) {
ei->i_sync_tid = handle->h_transaction->t_tid;
ei->i_datasync_tid = handle->h_transaction->t_tid;
}
err = ext4_mark_inode_dirty(handle, inode);
if (err) {
ext4_std_error(sb, err);
goto fail_free_drop;
}
ext4_debug("allocating inode %lu\n", inode->i_ino);
trace_ext4_allocate_inode(inode, dir, mode);
goto really_out;
fail:
ext4_std_error(sb, err);
out:
iput(inode);
ret = ERR_PTR(err);
really_out:
brelse(inode_bitmap_bh);
return ret;
fail_free_drop:
dquot_free_inode(inode);
fail_drop:
dquot_drop(inode);
inode->i_flags |= S_NOQUOTA;
clear_nlink(inode);
unlock_new_inode(inode);
iput(inode);
brelse(inode_bitmap_bh);
return ERR_PTR(err);
}
/* Verify that we are loading a valid orphan from disk */
struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
{
unsigned long max_ino = le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count);
ext4_group_t block_group;
int bit;
struct buffer_head *bitmap_bh;
struct inode *inode = NULL;
long err = -EIO;
/* Error cases - e2fsck has already cleaned up for us */
if (ino > max_ino) {
ext4_warning(sb, "bad orphan ino %lu! e2fsck was run?", ino);
goto error;
}
block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
bit = (ino - 1) % EXT4_INODES_PER_GROUP(sb);
bitmap_bh = ext4_read_inode_bitmap(sb, block_group);
if (!bitmap_bh) {
ext4_warning(sb, "inode bitmap error for orphan %lu", ino);
goto error;
}
/* Having the inode bit set should be a 100% indicator that this
* is a valid orphan (no e2fsck run on fs). Orphans also include
* inodes that were being truncated, so we can't check i_nlink==0.
*/
if (!ext4_test_bit(bit, bitmap_bh->b_data))
goto bad_orphan;
inode = ext4_iget(sb, ino);
if (IS_ERR(inode))
goto iget_failed;
/*
* If the orphans has i_nlinks > 0 then it should be able to be
* truncated, otherwise it won't be removed from the orphan list
* during processing and an infinite loop will result.
*/
if (inode->i_nlink && !ext4_can_truncate(inode))
goto bad_orphan;
if (NEXT_ORPHAN(inode) > max_ino)
goto bad_orphan;
brelse(bitmap_bh);
return inode;
iget_failed:
err = PTR_ERR(inode);
inode = NULL;
bad_orphan:
ext4_warning(sb, "bad orphan inode %lu! e2fsck was run?", ino);
printk(KERN_NOTICE "ext4_test_bit(bit=%d, block=%llu) = %d\n",
bit, (unsigned long long)bitmap_bh->b_blocknr,
ext4_test_bit(bit, bitmap_bh->b_data));
printk(KERN_NOTICE "inode=%p\n", inode);
if (inode) {
printk(KERN_NOTICE "is_bad_inode(inode)=%d\n",
is_bad_inode(inode));
printk(KERN_NOTICE "NEXT_ORPHAN(inode)=%u\n",
NEXT_ORPHAN(inode));
printk(KERN_NOTICE "max_ino=%lu\n", max_ino);
printk(KERN_NOTICE "i_nlink=%u\n", inode->i_nlink);
/* Avoid freeing blocks if we got a bad deleted inode */
if (inode->i_nlink == 0)
inode->i_blocks = 0;
iput(inode);
}
brelse(bitmap_bh);
error:
return ERR_PTR(err);
}
unsigned long ext4_count_free_inodes(struct super_block *sb)
{
unsigned long desc_count;
struct ext4_group_desc *gdp;
ext4_group_t i, ngroups = ext4_get_groups_count(sb);
#ifdef EXT4FS_DEBUG
struct ext4_super_block *es;
unsigned long bitmap_count, x;
struct buffer_head *bitmap_bh = NULL;
es = EXT4_SB(sb)->s_es;
desc_count = 0;
bitmap_count = 0;
gdp = NULL;
for (i = 0; i < ngroups; i++) {
gdp = ext4_get_group_desc(sb, i, NULL);
if (!gdp)
continue;
desc_count += ext4_free_inodes_count(sb, gdp);
brelse(bitmap_bh);
bitmap_bh = ext4_read_inode_bitmap(sb, i);
if (!bitmap_bh)
continue;
x = ext4_count_free(bitmap_bh->b_data,
EXT4_INODES_PER_GROUP(sb) / 8);
printk(KERN_DEBUG "group %lu: stored = %d, counted = %lu\n",
(unsigned long) i, ext4_free_inodes_count(sb, gdp), x);
bitmap_count += x;
}
brelse(bitmap_bh);
printk(KERN_DEBUG "ext4_count_free_inodes: "
"stored = %u, computed = %lu, %lu\n",
le32_to_cpu(es->s_free_inodes_count), desc_count, bitmap_count);
return desc_count;
#else
desc_count = 0;
for (i = 0; i < ngroups; i++) {
gdp = ext4_get_group_desc(sb, i, NULL);
if (!gdp)
continue;
desc_count += ext4_free_inodes_count(sb, gdp);
cond_resched();
}
return desc_count;
#endif
}
/* Called at mount-time, super-block is locked */
unsigned long ext4_count_dirs(struct super_block * sb)
{
unsigned long count = 0;
ext4_group_t i, ngroups = ext4_get_groups_count(sb);
for (i = 0; i < ngroups; i++) {
struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL);
if (!gdp)
continue;
count += ext4_used_dirs_count(sb, gdp);
}
return count;
}
/*
* Zeroes not yet zeroed inode table - just write zeroes through the whole
* inode table. Must be called without any spinlock held. The only place
* where it is called from on active part of filesystem is ext4lazyinit
* thread, so we do not need any special locks, however we have to prevent
* inode allocation from the current group, so we take alloc_sem lock, to
* block ext4_new_inode() until we are finished.
*/
int ext4_init_inode_table(struct super_block *sb, ext4_group_t group,
int barrier)
{
struct ext4_group_info *grp = ext4_get_group_info(sb, group);
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_group_desc *gdp = NULL;
struct buffer_head *group_desc_bh;
handle_t *handle;
ext4_fsblk_t blk;
int num, ret = 0, used_blks = 0;
/* This should not happen, but just to be sure check this */
if (sb->s_flags & MS_RDONLY) {
ret = 1;
goto out;
}
gdp = ext4_get_group_desc(sb, group, &group_desc_bh);
if (!gdp)
goto out;
/*
* We do not need to lock this, because we are the only one
* handling this flag.
*/
if (gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED))
goto out;
handle = ext4_journal_start_sb(sb, 1);
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
goto out;
}
down_write(&grp->alloc_sem);
/*
* If inode bitmap was already initialized there may be some
* used inodes so we need to skip blocks with used inodes in
* inode table.
*/
if (!(gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)))
used_blks = DIV_ROUND_UP((EXT4_INODES_PER_GROUP(sb) -
ext4_itable_unused_count(sb, gdp)),
sbi->s_inodes_per_block);
if ((used_blks < 0) || (used_blks > sbi->s_itb_per_group)) {
ext4_error(sb, "Something is wrong with group %u: "
"used itable blocks: %d; "
"itable unused count: %u",
group, used_blks,
ext4_itable_unused_count(sb, gdp));
ret = 1;
goto err_out;
}
blk = ext4_inode_table(sb, gdp) + used_blks;
num = sbi->s_itb_per_group - used_blks;
BUFFER_TRACE(group_desc_bh, "get_write_access");
ret = ext4_journal_get_write_access(handle,
group_desc_bh);
if (ret)
goto err_out;
/*
* Skip zeroout if the inode table is full. But we set the ZEROED
* flag anyway, because obviously, when it is full it does not need
* further zeroing.
*/
if (unlikely(num == 0))
goto skip_zeroout;
ext4_debug("going to zero out inode table in group %d\n",
group);
ret = sb_issue_zeroout(sb, blk, num, GFP_NOFS);
if (ret < 0)
goto err_out;
if (barrier)
blkdev_issue_flush(sb->s_bdev, GFP_NOFS, NULL);
skip_zeroout:
ext4_lock_group(sb, group);
gdp->bg_flags |= cpu_to_le16(EXT4_BG_INODE_ZEROED);
gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp);
ext4_unlock_group(sb, group);
BUFFER_TRACE(group_desc_bh,
"call ext4_handle_dirty_metadata");
ret = ext4_handle_dirty_metadata(handle, NULL,
group_desc_bh);
err_out:
up_write(&grp->alloc_sem);
ext4_journal_stop(handle);
out:
return ret;
}
|
CurtisMJ/g800f_custom_kernel
|
fs/ext4/ialloc.c
|
C
|
gpl-2.0
| 33,970 |
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/xr19rel/WINNT_5.2_Depend/mozilla/netwerk/socket/base/nsITransportSecurityInfo.idl
*/
#ifndef __gen_nsITransportSecurityInfo_h__
#define __gen_nsITransportSecurityInfo_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsITransportSecurityInfo */
#define NS_ITRANSPORTSECURITYINFO_IID_STR "0d0a6b62-d4a9-402e-a197-6bc6e358fec9"
#define NS_ITRANSPORTSECURITYINFO_IID \
{0x0d0a6b62, 0xd4a9, 0x402e, \
{ 0xa1, 0x97, 0x6b, 0xc6, 0xe3, 0x58, 0xfe, 0xc9 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsITransportSecurityInfo : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITRANSPORTSECURITYINFO_IID)
/* readonly attribute unsigned long securityState; */
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState) = 0;
/* readonly attribute wstring shortSecurityDescription; */
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription) = 0;
/* readonly attribute wstring errorMessage; */
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsITransportSecurityInfo, NS_ITRANSPORTSECURITYINFO_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITRANSPORTSECURITYINFO \
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState); \
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription); \
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITRANSPORTSECURITYINFO(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState) { return _to GetSecurityState(aSecurityState); } \
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription) { return _to GetShortSecurityDescription(aShortSecurityDescription); } \
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage) { return _to GetErrorMessage(aErrorMessage); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITRANSPORTSECURITYINFO(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSecurityState(aSecurityState); } \
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetShortSecurityDescription(aShortSecurityDescription); } \
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetErrorMessage(aErrorMessage); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsTransportSecurityInfo : public nsITransportSecurityInfo
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSITRANSPORTSECURITYINFO
nsTransportSecurityInfo();
private:
~nsTransportSecurityInfo();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsTransportSecurityInfo, nsITransportSecurityInfo)
nsTransportSecurityInfo::nsTransportSecurityInfo()
{
/* member initializers and constructor code */
}
nsTransportSecurityInfo::~nsTransportSecurityInfo()
{
/* destructor code */
}
/* readonly attribute unsigned long securityState; */
NS_IMETHODIMP nsTransportSecurityInfo::GetSecurityState(PRUint32 *aSecurityState)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute wstring shortSecurityDescription; */
NS_IMETHODIMP nsTransportSecurityInfo::GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute wstring errorMessage; */
NS_IMETHODIMP nsTransportSecurityInfo::GetErrorMessage(PRUnichar * *aErrorMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsITransportSecurityInfo_h__ */
|
nikgoodley-ibboost/forklabs-javaxpcom
|
tools/xulrunner-1.9.0.13-sdk/include/necko/nsITransportSecurityInfo.h
|
C
|
gpl-2.0
| 4,359 |
from flask import request, jsonify
from sql_classes import UrlList, Acl, UserGroup, User, Role
def _node_base_and_rest(path):
"""
Returns a tuple: (the substring of a path after the last nodeSeparator, the preceding path before it)
If 'base' includes its own baseSeparator - return only a string after it
So if a path is 'OU=Group,OU=Dept,OU=Company', the tuple result would be ('OU=Group,OU=Dept', 'Company')
"""
node_separator = ','
base_separator = '='
node_base = path[path.rfind(node_separator) + 1:]
if path.find(node_separator) != -1:
node_preceding = path[:len(path) - len(node_base) - 1]
else:
node_preceding = ''
return (node_preceding, node_base[node_base.find(base_separator) + 1:])
def _place_user_onto_tree(user, usertree, user_groups):
"""
Places a 'user' object on a 'usertree' object according to user's pathField string key
"""
curr_node = usertree
# Decompose 'OU=Group,OU=Dept,OU=Company' into ('OU=Group,OU=Dept', 'Company')
preceding, base = _node_base_and_rest(user['distinguishedName'])
full_node_path = ''
# Place all path groups onto a tree starting from the outermost
while base != '':
node_found = False
full_node_path = 'OU=' + base + (',' if full_node_path != '' else '') + full_node_path
# Search for corresponding base element on current hierarchy level
for obj in curr_node:
if obj.get('text') == None:
continue
if obj['text'] == base:
node_found = True
curr_node = obj['children']
break
# Create a new group node
if not node_found:
curr_node.append({
'id': 'usergroup_' + str(user_groups[full_node_path]),
'text': base,
'objectType': 'UserGroup',
'children': []
})
curr_node = curr_node[len(curr_node) - 1]['children']
preceding, base = _node_base_and_rest(preceding)
curr_node.append({
'id': 'user_' + str(user['id']),
'text': user['cn'],
'leaf': True,
'iconCls': 'x-fa fa-user' if user['status'] == 1 else 'x-fa fa-user-times',
'objectType': 'User'
})
def _sort_tree(subtree, sort_field):
"""
Sorts a subtree node by a sortField key of each element
"""
# Sort eval function, first by group property, then by text
subtree['children'] = sorted(
subtree['children'],
key=lambda obj: (1 if obj.get('children') == None else 0, obj[sort_field]))
for tree_elem in subtree['children']:
if tree_elem.get('children') != None:
_sort_tree(tree_elem, sort_field)
def _collapse_terminal_nodes(subtree):
"""
Collapses tree nodes which doesn't contain subgroups, just tree leaves
"""
subtree_has_group_nodes = False
for tree_elem in subtree['children']:
if tree_elem.get('children') != None:
subtree_has_group_nodes = True
_collapse_terminal_nodes(tree_elem)
subtree['expanded'] = subtree_has_group_nodes
def _expand_all_nodes(subtree):
"""
Expand all level nodes
"""
for tree_elem in subtree['children']:
if tree_elem.get('children') != None:
_expand_all_nodes(tree_elem)
subtree['expanded'] = True
def _get_user_tree(current_user_properties, Session):
"""
Build user tree
"""
current_user_permissions = current_user_properties['user_permissions']
session = Session()
# Get all groups
query_result = session.query(UserGroup.id, UserGroup.distinguishedName).all()
user_groups = {}
for query_result_row in query_result:
user_groups[query_result_row.distinguishedName] = query_result_row.id
# Get all users if ViewUsers permission present
if next((item for item in current_user_permissions if item['permissionName'] == 'ViewUsers'), None) != None:
query_result = session.query(
User.id.label('user_id'), User.cn, User.status, UserGroup.id.label('usergroup_id'),
UserGroup.distinguishedName).join(UserGroup).filter(User.hidden == 0).all()
# Get just the requester otherwise
else:
query_result = session.query(
User.id.label('user_id'), User.cn, User.status, UserGroup.id.label('usergroup_id'),
UserGroup.distinguishedName).join(UserGroup).\
filter(User.id == current_user_properties['user_object']['id'], User.hidden == 0).all()
Session.remove()
# Future tree
user_tree = []
# Place each user on a tree
for query_result_row in query_result:
user_object = {
'id': query_result_row.user_id,
'distinguishedName': query_result_row.distinguishedName,
'status': query_result_row.status,
'cn': query_result_row.cn
}
_place_user_onto_tree(user_object, user_tree, user_groups)
user_tree = {
'id': 'usergroup_0',
'objectType': 'UserGroup',
'text': 'Пользователи',
'children': user_tree
}
# Sort tree elements
_sort_tree(user_tree, 'text')
# Collapse/expand tree nodes
if next((item for item in current_user_permissions if item['permissionName'] == 'ViewUsers'), None) != None:
_collapse_terminal_nodes(user_tree)
else:
_expand_all_nodes(user_tree)
return user_tree
def _get_url_lists(Session):
"""
Get URL lists
"""
session = Session()
# Get all urllists from DB
query_result = session.query(UrlList.id, UrlList.name, UrlList.whitelist).all()
Session.remove()
urllist_list = []
# Making a list of them
for query_result_row in query_result:
url_list_object = {
'id': 'urllist_' + str(query_result_row.id),
'text': query_result_row.name,
'leaf': True,
'iconCls': 'x-fa fa-unlock' if query_result_row.whitelist else 'x-fa fa-lock',
'objectType': 'UrlList'
}
urllist_list.append(url_list_object)
url_lists = {
'id': 'urllists',
'objectType': 'UrlLists',
'text': 'Списки URL',
'iconCls': 'x-fa fa-cog',
'children': urllist_list
}
# Sort tree elements
_sort_tree(url_lists, 'text')
return url_lists
def _get_acls(Session):
"""
Get ACLs
"""
session = Session()
# Get all access control lists from DB
query_result = session.query(Acl.id, Acl.name).all()
Session.remove()
acl_list = []
# Making a list of them
for query_result_row in query_result:
acl_object = {
'id': 'acl_' + str(query_result_row.id),
'text': query_result_row.name,
'leaf': True,
'iconCls': 'x-fa fa-filter',
'objectType': 'AclContents'
}
acl_list.append(acl_object)
acls = {
'id': 'acls',
'objectType': 'Acls',
'text': 'Списки доступа',
'iconCls': 'x-fa fa-cog',
'children': acl_list
}
# Sort tree elements
_sort_tree(acls, 'text')
return acls
def _get_roles(Session):
"""
Get user roles
"""
session = Session()
# Get all roles from DB
query_result = session.query(Role.id, Role.name).all()
Session.remove()
roles_list = []
# Making a list of them
for query_result_row in query_result:
role_object = {
'id': 'role_' + str(query_result_row.id),
'text': query_result_row.name,
'leaf': True,
'iconCls': 'x-fa fa-key',
'objectType': 'Role'
}
roles_list.append(role_object)
roles = {
'id': 'roles',
'objectType': 'Roles',
'text': 'Роли',
'iconCls': 'x-fa fa-cog',
'children': roles_list
}
# Sorting tree elements
_sort_tree(roles, 'text')
return roles
def select_tree(current_user_properties, node_name, Session):
url_lists_node = None
acls_node = None
roles_node = None
users_node = None
current_user_permissions = current_user_properties['user_permissions']
if next((item for item in current_user_permissions if item['permissionName'] == 'ViewSettings'), None) != None:
if node_name in ['root', 'urllists']:
url_lists_node = _get_url_lists(Session)
if node_name in ['root', 'acls']:
acls_node = _get_acls(Session)
if next((item for item in current_user_permissions if item['permissionName'] == 'ViewPermissions'), None) != None:
if node_name in ['root', 'roles']:
roles_node = _get_roles(Session)
if node_name in ['root']:
users_node = _get_user_tree(current_user_properties, Session)
if node_name == 'root':
children_list = []
if url_lists_node is not None:
children_list.append(url_lists_node)
if acls_node is not None:
children_list.append(acls_node)
if roles_node is not None:
children_list.append(roles_node)
if users_node is not None:
children_list.append(users_node)
result = {
'success': True,
'children': children_list
}
elif node_name == 'urllists':
if next((item for item in current_user_permissions if item['permissionName'] == 'ViewSettings'), None) != None:
result = {
'success': True,
'children': url_lists_node['children']
}
else:
return Response('Forbidden', 403)
elif node_name == 'acls':
if next((item for item in current_user_permissions if item['permissionName'] == 'ViewSettings'), None) != None:
result = {
'success': True,
'children': acls_node['children']
}
else:
return Response('Forbidden', 403)
elif node_name == 'roles':
if next((item for item in current_user_permissions if item['permissionName'] == 'ViewPermissions'), None) != None:
result = {
'success': True,
'children': roles_node['children']
}
else:
return Response('Forbidden', 403)
return jsonify(result)
|
Aclz/Tentacles
|
python3/app/backend/maintree.py
|
Python
|
gpl-2.0
| 10,439 |
<?php
/* core/themes/stable/templates/navigation/menu--toolbar.html.twig */
class __TwigTemplate_6d5e9324ee90ee9b5c8803c6bf39943fec4c217cff21756d529e71138cf50b3a extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
$tags = array("import" => 21, "macro" => 29, "if" => 31, "for" => 37, "set" => 39);
$filters = array();
$functions = array("link" => 47);
try {
$this->env->getExtension('sandbox')->checkSecurity(
array('import', 'macro', 'if', 'for', 'set'),
array(),
array('link')
);
} catch (Twig_Sandbox_SecurityError $e) {
$e->setTemplateFile($this->getTemplateName());
if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
// line 21
$context["menus"] = $this;
// line 22
echo "
";
// line 27
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar($context["menus"]->getmenu_links((isset($context["items"]) ? $context["items"] : null), (isset($context["attributes"]) ? $context["attributes"] : null), 0)));
echo "
";
}
// line 29
public function getmenu_links($__items__ = null, $__attributes__ = null, $__menu_level__ = null, ...$__varargs__)
{
$context = $this->env->mergeGlobals(array(
"items" => $__items__,
"attributes" => $__attributes__,
"menu_level" => $__menu_level__,
"varargs" => $__varargs__,
));
$blocks = array();
ob_start();
try {
// line 30
echo " ";
$context["menus"] = $this;
// line 31
echo " ";
if ((isset($context["items"]) ? $context["items"] : null)) {
// line 32
echo " ";
if (((isset($context["menu_level"]) ? $context["menu_level"] : null) == 0)) {
// line 33
echo " <ul";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute((isset($context["attributes"]) ? $context["attributes"] : null), "addClass", array(0 => "toolbar-menu"), "method"), "html", null, true));
echo ">
";
} else {
// line 35
echo " <ul class=\"toolbar-menu\">
";
}
// line 37
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["items"]) ? $context["items"] : null));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 38
echo " ";
// line 39
$context["classes"] = array(0 => "menu-item", 1 => (($this->getAttribute( // line 41
$context["item"], "is_expanded", array())) ? ("menu-item--expanded") : ("")), 2 => (($this->getAttribute( // line 42
$context["item"], "is_collapsed", array())) ? ("menu-item--collapsed") : ("")), 3 => (($this->getAttribute( // line 43
$context["item"], "in_active_trail", array())) ? ("menu-item--active-trail") : ("")));
// line 46
echo " <li";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["item"], "attributes", array()), "addClass", array(0 => (isset($context["classes"]) ? $context["classes"] : null)), "method"), "html", null, true));
echo ">
";
// line 47
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->env->getExtension('drupal_core')->getLink($this->getAttribute($context["item"], "title", array()), $this->getAttribute($context["item"], "url", array())), "html", null, true));
echo "
";
// line 48
if ($this->getAttribute($context["item"], "below", array())) {
// line 49
echo " ";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar($context["menus"]->getmenu_links($this->getAttribute($context["item"], "below", array()), (isset($context["attributes"]) ? $context["attributes"] : null), ((isset($context["menu_level"]) ? $context["menu_level"] : null) + 1))));
echo "
";
}
// line 51
echo " </li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 53
echo " </ul>
";
}
} catch (Exception $e) {
ob_end_clean();
throw $e;
} catch (Throwable $e) {
ob_end_clean();
throw $e;
}
return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
}
public function getTemplateName()
{
return "core/themes/stable/templates/navigation/menu--toolbar.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 124 => 53, 117 => 51, 111 => 49, 109 => 48, 105 => 47, 100 => 46, 98 => 43, 97 => 42, 96 => 41, 95 => 39, 93 => 38, 88 => 37, 84 => 35, 78 => 33, 75 => 32, 72 => 31, 69 => 30, 55 => 29, 48 => 27, 45 => 22, 43 => 21,);
}
public function getSource()
{
return "{#
/**
* @file
* Theme override to display a toolbar menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
* - title: The menu link title.
* - url: The menu link url, instance of \\Drupal\\Core\\Url
* - localized_options: Menu link localized options.
* - is_expanded: TRUE if the link has visible children within the current
* menu tree.
* - is_collapsed: TRUE if the link has children within the current menu tree
* that are not currently visible.
* - in_active_trail: TRUE if the link is in the active trail.
*/
#}
{% import _self as menus %}
{#
We call a macro which calls itself to render the full tree.
@see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul{{ attributes.addClass('toolbar-menu') }}>
{% else %}
<ul class=\"toolbar-menu\">
{% endif %}
{% for item in items %}
{%
set classes = [
'menu-item',
item.is_expanded ? 'menu-item--expanded',
item.is_collapsed ? 'menu-item--collapsed',
item.in_active_trail ? 'menu-item--active-trail',
]
%}
<li{{ item.attributes.addClass(classes) }}>
{{ link(item.title, item.url) }}
{% if item.below %}
{{ menus.menu_links(item.below, attributes, menu_level + 1) }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
";
}
}
|
suruchi10/newrepo
|
sites/drupal-8.dd/files/php/twig/596d9f9815a73_menu--toolbar.html.twig_tygcDb3aAI8l_rxPgfBnz0oJU/TsdWiV50UGMMzQDbKZxdPubu_ft8_iB9Bvy9p1rB-z8.php
|
PHP
|
gpl-2.0
| 8,688 |
<?php
/**
* ---------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2015-2021 Teclib' and contributors.
*
* http://glpi-project.org
*
* based on GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2014 by the INDEPNET Development Team.
*
* ---------------------------------------------------------------------
*
* LICENSE
*
* This file is part of GLPI.
*
* GLPI 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.
*
* GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
* ---------------------------------------------------------------------
*/
/**
* @since 0.85
*/
include ('../inc/includes.php');
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkCentralAccess();
// Make a select box
if ($_POST['items_id']
&& $_POST['itemtype'] && class_exists($_POST['itemtype'])) {
$devicetype = $_POST['itemtype'];
$linktype = $devicetype::getItem_DeviceType();
if (count($linktype::getSpecificities())) {
$keys = array_keys($linktype::getSpecificities());
array_walk($keys, function (&$val) use ($DB) { return $DB->quoteName($val); });
$name_field = new QueryExpression(
"CONCAT_WS(' - ', " . implode(', ', $keys) . ")"
. "AS ".$DB->quoteName("name")
);
} else {
$name_field = 'id AS name';
}
$result = $DB->request(
[
'SELECT' => ['id', $name_field],
'FROM' => $linktype::getTable(),
'WHERE' => [
$devicetype::getForeignKeyField() => $_POST['items_id'],
'itemtype' => '',
]
]
);
echo "<table width='100%'><tr><td>" . __('Choose an existing device') . "</td><td rowspan='2'>" .
__('and/or') . "</td><td>" . __('Add new devices') . '</td></tr>';
echo "<tr><td>";
if ($result->count() == 0) {
echo __('No unaffected device !');
} else {
$devices = [];
foreach ($result as $row) {
$name = $row['name'];
if (empty($name)) {
$name = $row['id'];
}
$devices[$row['id']] = $name;
}
Dropdown::showFromArray($linktype::getForeignKeyField(), $devices, ['multiple' => true]);
}
echo "</td><td>";
Dropdown::showNumber('new_devices', ['min' => 0, 'max' => 10]);
echo "</td></tr></table>";
}
|
smartcitiescommunity/Civikmind
|
ajax/selectUnaffectedOrNewItem_Device.php
|
PHP
|
gpl-2.0
| 2,921 |
/*
***************************************************************************
* Ralink Tech Inc.
* 4F, No. 2 Technology 5th Rd.
* Science-based Industrial Park
* Hsin-chu, Taiwan, R.O.C.
*
* (c) Copyright 2002, Ralink Technology, Inc.
*
* All rights reserved. Ralink's source code is an unpublished work and the
* use of a copyright notice does not imply otherwise. This source code
* contains confidential trade secret material of Ralink Tech. Any attemp
* or participation in deciphering, decoding, reverse engineering or in any
* way altering the source code is stricitly prohibited, unless the prior
* written consent of Ralink Technology, Inc. is obtained.
***************************************************************************
Module Name:
rbus_prop_dev.c
Abstract:
Create and register network interface for RBUS based chipsets in linux platform.
Revision History:
Who When What
-------- ---------- ----------------------------------------------
*/
#ifdef RTMP_RBUS_SUPPORT
#define RTMP_MODULE_OS
#include "rt_config.h"
#if defined(CONFIG_RA_CLASSIFIER) && (!defined(CONFIG_RA_CLASSIFIER_MODULE))
extern int (*ra_classifier_init_func)(void);
extern void (*ra_classifier_release_func)(void);
extern struct proc_dir_entry *proc_ptr, *proc_ralink_wl_video;
#endif
#ifdef MEM_ALLOC_INFO_SUPPORT
extern MEM_INFO_LIST MemInfoList;
extern MEM_INFO_LIST PktInfoList;
#endif /*MEM_ALLOC_INFO_SUPPORT*/
static struct pci_device_id mt_rbus_tbl[] DEVINITDATA = {
#ifdef MT7622
{PCI_DEVICE(0x14c3, 0x7622)},
#endif /* MT7622 */
{} /* terminate list */
};
MODULE_DEVICE_TABLE(pci, mt_rbus_tbl);
#define RBUS_TSSI_CTRL_OFFSET 0x34
#define RBUS_PA_LNA_CTRL_OFFSET 0x38
int rbus_tssi_set(struct _RTMP_ADAPTER *ad, UCHAR mode)
{
struct pci_dev *dev = ((POS_COOKIE)ad->OS_Cookie)->pci_dev;
pci_write_config_byte(dev, RBUS_TSSI_CTRL_OFFSET, mode);
return 0;
}
int rbus_pa_lna_set(struct _RTMP_ADAPTER *ad, UINT32 mode)
{
struct pci_dev *dev = ((POS_COOKIE)ad->OS_Cookie)->pci_dev;
pci_write_config_dword(dev, RBUS_PA_LNA_CTRL_OFFSET, mode);
return 0;
}
static int DEVINIT mt_rbus_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
{
struct net_device *net_dev;
ULONG csr_addr;
INT rv;
void *handle = NULL;
RTMP_ADAPTER *pAd;
RTMP_OS_NETDEV_OP_HOOK netDevHook;
UINT32 Value;
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_TRACE, ("===> rt2880_probe\n"));
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
/*
* pci_set_consistent_dma_mask() will always be able to set the same
* or a smaller mask as pci_set_dma_mask()
*/
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
} else {
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_ERROR,
("set DMA mask failed\n"));
goto err_out;
}
#ifdef MEM_ALLOC_INFO_SUPPORT
MemInfoListInital();
#endif /* MEM_ALLOC_INFO_SUPPORT */
/* map physical address to virtual address for accessing register */
csr_addr = (unsigned long)ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
/* Allocate RTMP_ADAPTER adapter structure */
os_alloc_mem(NULL, (UCHAR **)&handle, sizeof(struct os_cookie));
if (!handle) {
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_ERROR, ("Allocate memory for os_cookie failed!\n"));
goto err_out;
}
os_zero_mem(handle, sizeof(struct os_cookie));
#ifdef OS_ABL_FUNC_SUPPORT
/* get DRIVER operations */
RTMP_DRV_OPS_FUNCTION(pRtmpDrvOps, NULL, NULL, NULL);
#endif /* OS_ABL_FUNC_SUPPORT */
rv = RTMPAllocAdapterBlock(handle, (VOID **)&pAd);
if (rv != NDIS_STATUS_SUCCESS) {
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_ERROR, (" RTMPAllocAdapterBlock != NDIS_STATUS_SUCCESS\n"));
os_free_mem(handle);
goto err_out;
}
/* Here are the RTMP_ADAPTER structure with rbus-bus specific parameters. */
pAd->PciHif.CSRBaseAddress = (PUCHAR)csr_addr;
RTMP_IO_READ32(pAd, TOP_HCR, &Value);
pAd->ChipID = Value;
/*is not a regular method*/
((POS_COOKIE)handle)->pci_dev = (VOID *)pdev;
((POS_COOKIE)handle)->pDev = &pdev->dev;
RtmpRaDevCtrlInit(pAd, RTMP_DEV_INF_RBUS);
net_dev = RtmpPhyNetDevInit(pAd, &netDevHook);
if (net_dev == NULL)
goto err_out_free_radev;
/*assign net_dev as pdev's privdate*/
pci_set_drvdata(pdev, net_dev);
/* Here are the net_device structure with pci-bus specific parameters. */
net_dev->irq = pdev->irq; /* Interrupt IRQ number */
net_dev->base_addr = csr_addr; /* Save CSR virtual address and irq to device structure */
RTMP_DRIVER_CHIP_PREPARE(pAd);
/*All done, it's time to register the net device to kernel. */
/* Register this device */
rv = RtmpOSNetDevAttach(pAd->OpMode, net_dev, &netDevHook);
if (rv) {
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_ERROR, ("failed to call RtmpOSNetDevAttach(), rv=%d!\n", rv));
goto err_out_free_netdev;
}
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_TRACE, ("%s: at CSR addr 0x%lx, IRQ %ld.\n", net_dev->name, (ULONG)csr_addr, (long int)net_dev->irq));
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_TRACE, ("<=== %s()\n", __func__));
#if defined(CONFIG_RA_CLASSIFIER) && (!defined(CONFIG_RA_CLASSIFIER_MODULE))
proc_ptr = proc_ralink_wl_video;
if (ra_classifier_init_func != NULL)
ra_classifier_init_func();
#endif
return 0;
err_out_free_netdev:
RtmpOSNetDevFree(net_dev);
#ifdef MEM_ALLOC_INFO_SUPPORT
{
UINT32 memalctotal, pktalctotal;
memalctotal = ShowMemAllocInfo();
pktalctotal = ShowPktAllocInfo();
if ((memalctotal != 0) || (pktalctotal != 0)) {
MTWF_LOG(DBG_CAT_INIT, DBG_SUBCAT_ALL, DBG_LVL_ERROR,
("Error: Memory leak!!\n"));
ASSERT(0);
}
MIListExit(&MemInfoList);
MIListExit(&PktInfoList);
}
#endif /* MEM_ALLOC_INFO_SUPPORT */
err_out_free_radev:
/* free RTMP_ADAPTER strcuture and os_cookie*/
RTMPFreeAdapter(pAd);
err_out:
return -ENODEV;
}
static VOID DEVEXIT mt_rbus_remove(struct pci_dev *pci_dev)
{
struct net_device *net_dev = pci_get_drvdata(pci_dev);
RTMP_ADAPTER *pAd;
if (net_dev == NULL)
return;
/* pAd = net_dev->priv; */
GET_PAD_FROM_NET_DEV(pAd, net_dev);
if (pAd != NULL) {
RtmpPhyNetDevExit(pAd, net_dev);
RtmpRaDevCtrlExit(pAd);
} else
RtmpOSNetDevDetach(net_dev);
/* Free the root net_device. */
RtmpOSNetDevFree(net_dev);
#if defined(CONFIG_RA_CLASSIFIER) && (!defined(CONFIG_RA_CLASSIFIER_MODULE))
proc_ptr = proc_ralink_wl_video;
if (ra_classifier_release_func != NULL)
ra_classifier_release_func();
#endif
#ifdef MEM_ALLOC_INFO_SUPPORT
{
UINT32 memalctotal, pktalctotal;
memalctotal = ShowMemAllocInfo();
pktalctotal = ShowPktAllocInfo();
if ((memalctotal != 0) || (pktalctotal != 0)) {
MTWF_LOG(DBG_CAT_INIT, DBG_SUBCAT_ALL, DBG_LVL_ERROR,
("Error: Memory leak!!\n"));
ASSERT(0);
}
MIListExit(&MemInfoList);
MIListExit(&PktInfoList);
}
#endif /* MEM_ALLOC_INFO_SUPPORT */
}
/*
* Our PCI driver structure
*/
static struct pci_driver mt_rbus_driver = {
name:
"mt_rbus",
id_table :
mt_rbus_tbl,
probe :
mt_rbus_probe,
remove :
DEVEXIT_P(mt_rbus_remove),
};
/*
* Driver module load/unload function
*/
int __init wbsys_module_init(void)
{
MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_ERROR, ("register %s\n", RTMP_DRV_NAME));
#ifdef MEM_ALLOC_INFO_SUPPORT
MemInfoListInital();
#endif /* MEM_ALLOC_INFO_SUPPORT */
return pci_register_driver(&mt_rbus_driver);
}
void __exit wbsys_module_exit(void)
{
pci_unregister_driver(&mt_rbus_driver);
}
/** @} */
/** @} */
#ifndef MULTI_INF_SUPPORT
module_init(wbsys_module_init);
module_exit(wbsys_module_exit);
#endif /* MULTI_INF_SUPPORT */
#endif /* RTMP_RBUS_SUPPORT */
|
tossp/lede-k3
|
package/lean/mt/drivers/mt7615d/src/mt_wifi/os/linux/rbus_prop_dev.c
|
C
|
gpl-2.0
| 7,562 |
<?php
/**
* Indonesia Provinces
*
*/
global $pms_states;
$pms_states['ID'] = array(
'AC' => __( 'Daerah Istimewa Aceh', 'paid-member-subscriptions' ),
'SU' => __( 'Sumatera Utara', 'paid-member-subscriptions' ),
'SB' => __( 'Sumatera Barat', 'paid-member-subscriptions' ),
'RI' => __( 'Riau', 'paid-member-subscriptions' ),
'KR' => __( 'Kepulauan Riau', 'paid-member-subscriptions' ),
'JA' => __( 'Jambi', 'paid-member-subscriptions' ),
'SS' => __( 'Sumatera Selatan', 'paid-member-subscriptions' ),
'BB' => __( 'Bangka Belitung', 'paid-member-subscriptions' ),
'BE' => __( 'Bengkulu', 'paid-member-subscriptions' ),
'LA' => __( 'Lampung', 'paid-member-subscriptions' ),
'JK' => __( 'DKI Jakarta', 'paid-member-subscriptions' ),
'JB' => __( 'Jawa Barat', 'paid-member-subscriptions' ),
'BT' => __( 'Banten', 'paid-member-subscriptions' ),
'JT' => __( 'Jawa Tengah', 'paid-member-subscriptions' ),
'JI' => __( 'Jawa Timur', 'paid-member-subscriptions' ),
'YO' => __( 'Daerah Istimewa Yogyakarta', 'paid-member-subscriptions' ),
'BA' => __( 'Bali', 'paid-member-subscriptions' ),
'NB' => __( 'Nusa Tenggara Barat', 'paid-member-subscriptions' ),
'NT' => __( 'Nusa Tenggara Timur', 'paid-member-subscriptions' ),
'KB' => __( 'Kalimantan Barat', 'paid-member-subscriptions' ),
'KT' => __( 'Kalimantan Tengah', 'paid-member-subscriptions' ),
'KI' => __( 'Kalimantan Timur', 'paid-member-subscriptions' ),
'KS' => __( 'Kalimantan Selatan', 'paid-member-subscriptions' ),
'KU' => __( 'Kalimantan Utara', 'paid-member-subscriptions' ),
'SA' => __( 'Sulawesi Utara', 'paid-member-subscriptions' ),
'ST' => __( 'Sulawesi Tengah', 'paid-member-subscriptions' ),
'SG' => __( 'Sulawesi Tenggara', 'paid-member-subscriptions' ),
'SR' => __( 'Sulawesi Barat', 'paid-member-subscriptions' ),
'SN' => __( 'Sulawesi Selatan', 'paid-member-subscriptions' ),
'GO' => __( 'Gorontalo', 'paid-member-subscriptions' ),
'MA' => __( 'Maluku', 'paid-member-subscriptions' ),
'MU' => __( 'Maluku Utara', 'paid-member-subscriptions' ),
'PA' => __( 'Papua', 'paid-member-subscriptions' ),
'PB' => __( 'Papua Barat', 'paid-member-subscriptions' )
);
|
developerdinesh/theme
|
wp-content/plugins/paid-member-subscriptions/i18n/ID.php
|
PHP
|
gpl-2.0
| 2,157 |
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package test.auctionportal;
import static com.sun.org.apache.xerces.internal.jaxp.JAXPConstants.JAXP_SCHEMA_LANGUAGE;
import static com.sun.org.apache.xerces.internal.jaxp.JAXPConstants.JAXP_SCHEMA_SOURCE;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.math.BigInteger;
import java.nio.file.Paths;
import java.util.GregorianCalendar;
import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import jaxp.library.JAXPFileReadOnlyBaseTest;
import static jaxp.library.JAXPTestUtilities.bomStream;
import org.testng.annotations.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMConfiguration;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.TypeInfo;
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSSerializer;
import static test.auctionportal.HiBidConstants.PORTAL_ACCOUNT_NS;
import static test.auctionportal.HiBidConstants.XML_DIR;
/**
* This is the user controller class for the Auction portal HiBid.com.
*/
public class AuctionController extends JAXPFileReadOnlyBaseTest {
/**
* Check for DOMErrorHandler handling DOMError. Before fix of bug 4890927
* DOMConfiguration.setParameter("well-formed",true) throws an exception.
*
* @throws Exception If any errors occur.
*/
@Test(groups = {"readLocalFiles"})
public void testCreateNewItem2Sell() throws Exception {
String xmlFile = XML_DIR + "novelsInvalid.xml";
Document document = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().parse(xmlFile);
document.getDomConfig().setParameter("well-formed", true);
DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS");
MyDOMOutput domOutput = new MyDOMOutput();
domOutput.setByteStream(System.out);
LSSerializer writer = impl.createLSSerializer();
writer.write(document, domOutput);
}
/**
* Check for DOMErrorHandler handling DOMError. Before fix of bug 4896132
* test throws DOM Level 1 node error.
*
* @throws Exception If any errors occur.
*/
@Test(groups = {"readLocalFiles"})
public void testCreateNewItem2SellRetry() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
Document document = dbf.newDocumentBuilder().parse(xmlFile);
DOMConfiguration domConfig = document.getDomConfig();
MyDOMErrorHandler errHandler = new MyDOMErrorHandler();
domConfig.setParameter("error-handler", errHandler);
DOMImplementationLS impl =
(DOMImplementationLS) DOMImplementationRegistry.newInstance()
.getDOMImplementation("LS");
LSSerializer writer = impl.createLSSerializer();
MyDOMOutput domoutput = new MyDOMOutput();
domoutput.setByteStream(System.out);
writer.write(document, domoutput);
document.normalizeDocument();
writer.write(document, domoutput);
assertFalse(errHandler.isError());
}
/**
* Check if setting the attribute to be of type ID works. This will affect
* the Attr.isID method according to the spec.
*
* @throws Exception If any errors occur.
*/
@Test(groups = {"readLocalFiles"})
public void testCreateID() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
Document document = dbf.newDocumentBuilder().parse(xmlFile);
Element account = (Element)document
.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "Account").item(0);
account.setIdAttributeNS(PORTAL_ACCOUNT_NS, "accountID", true);
Attr aID = account.getAttributeNodeNS(PORTAL_ACCOUNT_NS, "accountID");
assertTrue(aID.isId());
}
/**
* Check the user data on the node.
*
* @throws Exception If any errors occur.
*/
@Test(groups = {"readLocalFiles"})
public void testCheckingUserData() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document document = docBuilder.parse(xmlFile);
Element account = (Element)document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "Account").item(0);
assertEquals(account.getNodeName(), "acc:Account");
Element firstName = (Element) document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "FirstName").item(0);
assertEquals(firstName.getNodeName(), "FirstName");
Document doc1 = docBuilder.newDocument();
Element someName = doc1.createElement("newelem");
someName.setUserData("mykey", "dd",
(operation, key, data, src, dst) -> {
System.err.println("In UserDataHandler" + key);
System.out.println("In UserDataHandler");
});
Element impAccount = (Element)document.importNode(someName, true);
assertEquals(impAccount.getNodeName(), "newelem");
document.normalizeDocument();
String data = (someName.getUserData("mykey")).toString();
assertEquals(data, "dd");
}
/**
* Check the UTF-16 XMLEncoding xml file.
*
* @throws Exception If any errors occur.
* @see <a href="content/movies.xml">movies.xml</a>
*/
@Test(groups = {"readLocalFiles"})
public void testCheckingEncoding() throws Exception {
// Note since movies.xml is UTF-16 encoding. We're not using stanard XML
// file suffix.
String xmlFile = XML_DIR + "movies.xml.data";
try (InputStream source = bomStream("UTF-16", xmlFile)) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
Document document = dbf.newDocumentBuilder().parse(source);
assertEquals(document.getXmlEncoding(), "UTF-16");
assertEquals(document.getXmlStandalone(), true);
}
}
/**
* Check validation API features. A schema which is including in Bug 4909119
* used to be testing for the functionalities.
*
* @throws Exception If any errors occur.
* @see <a href="content/userDetails.xsd">userDetails.xsd</a>
*/
@Test(groups = {"readLocalFiles"})
public void testGetOwnerInfo() throws Exception {
String schemaFile = XML_DIR + "userDetails.xsd";
String xmlFile = XML_DIR + "userDetails.xml";
try(FileInputStream fis = new FileInputStream(xmlFile)) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA_NS_URI);
SchemaFactory schemaFactory = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(Paths.get(schemaFile).toFile());
Validator validator = schema.newValidator();
MyErrorHandler eh = new MyErrorHandler();
validator.setErrorHandler(eh);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
docBuilder.setErrorHandler(eh);
Document document = docBuilder.parse(fis);
DOMResult dResult = new DOMResult();
DOMSource domSource = new DOMSource(document);
validator.validate(domSource, dResult);
assertFalse(eh.isAnyError());
}
}
/**
* Check grammar caching with imported schemas.
*
* @throws Exception If any errors occur.
* @see <a href="content/coins.xsd">coins.xsd</a>
* @see <a href="content/coinsImportMe.xsd">coinsImportMe.xsd</a>
*/
@Test(groups = {"readLocalFiles"})
public void testGetOwnerItemList() throws Exception {
String xsdFile = XML_DIR + "coins.xsd";
String xmlFile = XML_DIR + "coins.xml";
try(FileInputStream fis = new FileInputStream(xmlFile)) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA_NS_URI);
dbf.setValidating(false);
SchemaFactory schemaFactory = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(new File(((xsdFile))));
MyErrorHandler eh = new MyErrorHandler();
Validator validator = schema.newValidator();
validator.setErrorHandler(eh);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document document = docBuilder.parse(fis);
validator.validate(new DOMSource(document), new DOMResult());
assertFalse(eh.isAnyError());
}
}
/**
* Check for the same imported schemas but will use SAXParserFactory and try
* parsing using the SAXParser. SCHEMA_SOURCE attribute is using for this
* test.
*
* @throws Exception If any errors occur.
* @see <a href="content/coins.xsd">coins.xsd</a>
* @see <a href="content/coinsImportMe.xsd">coinsImportMe.xsd</a>
*/
@Test(groups = {"readLocalFiles"})
public void testGetOwnerItemList1() throws Exception {
String xsdFile = XML_DIR + "coins.xsd";
String xmlFile = XML_DIR + "coins.xml";
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setValidating(true);
SAXParser sp = spf.newSAXParser();
sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA_NS_URI);
sp.setProperty(JAXP_SCHEMA_SOURCE, xsdFile);
MyErrorHandler eh = new MyErrorHandler();
sp.parse(new File(xmlFile), eh);
assertFalse(eh.isAnyError());
}
/**
* Check usage of javax.xml.datatype.Duration class.
*
* @throws Exception If any errors occur.
*/
@Test(groups = {"readLocalFiles"})
public void testGetItemDuration() throws Exception {
String xmlFile = XML_DIR + "itemsDuration.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
Document document = dbf.newDocumentBuilder().parse(xmlFile);
Element durationElement = (Element) document.getElementsByTagName("sellDuration").item(0);
NodeList childList = durationElement.getChildNodes();
for (int i = 0; i < childList.getLength(); i++) {
System.out.println("child " + i + childList.item(i));
}
Duration duration = DatatypeFactory.newInstance().newDuration("P365D");
Duration sellDuration = DatatypeFactory.newInstance().newDuration(childList.item(0).getNodeValue());
assertFalse(sellDuration.isShorterThan(duration));
assertFalse(sellDuration.isLongerThan(duration));
assertEquals(sellDuration.getField(DatatypeConstants.DAYS), BigInteger.valueOf(365));
assertEquals(sellDuration.normalizeWith(new GregorianCalendar(1999, 2, 22)), duration);
Duration myDuration = sellDuration.add(duration);
assertEquals(myDuration.normalizeWith(new GregorianCalendar(2003, 2, 22)),
DatatypeFactory.newInstance().newDuration("P730D"));
}
/**
* Check usage of TypeInfo interface introduced in DOM L3.
*
* @throws Exception If any errors occur.
*/
@Test(groups = {"readLocalFiles"})
public void testGetTypeInfo() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(true);
dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA_NS_URI);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
docBuilder.setErrorHandler(new MyErrorHandler());
Document document = docBuilder.parse(xmlFile);
Element userId = (Element)document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "UserID").item(0);
TypeInfo typeInfo = userId.getSchemaTypeInfo();
assertTrue(typeInfo.getTypeName().equals("nonNegativeInteger"));
assertTrue(typeInfo.getTypeNamespace().equals(W3C_XML_SCHEMA_NS_URI));
Element role = (Element)document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "Role").item(0);
TypeInfo roletypeInfo = role.getSchemaTypeInfo();
assertTrue(roletypeInfo.getTypeName().equals("BuyOrSell"));
assertTrue(roletypeInfo.getTypeNamespace().equals(PORTAL_ACCOUNT_NS));
}
}
|
lostdj/Jaklin-OpenJDK-JAXP
|
test/javax/xml/jaxp/functional/test/auctionportal/AuctionController.java
|
Java
|
gpl-2.0
| 14,668 |
<?php
/**
* Custom functions that act independently of the theme templates
*
* Eventually, some of the functionality here could be replaced by core features
*
* @package Decode
*/
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*/
if ( ! function_exists( 'decode_page_menu_args' ) ) {
function decode_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'decode_page_menu_args' );
}
/**
* Adds custom classes to the array of body classes.
*/
if ( ! function_exists( 'decode_body_classes' ) ) {
function decode_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
return $classes;
}
}
add_filter( 'body_class', 'decode_body_classes' );
/**
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
*/
if ( ! function_exists( 'decode_enhanced_image_navigation' ) ) {
function decode_enhanced_image_navigation( $url, $id ) {
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
return $url;
$image = get_post( $id );
if ( ! empty( $image->post_parent ) && $image->post_parent != $id )
$url .= '#main';
return $url;
}
}
add_filter( 'attachment_link', 'decode_enhanced_image_navigation', 10, 2 );
/**
* Highlight search terms in search results.
*/
function decode_highlight_search_results( $text ) {
if ( is_search() ) {
$sr = get_search_query();
$keys = implode( '|', explode( ' ', get_search_query() ) );
if ($keys != '') { // Check for empty search, and don't modify text if empty
$text = preg_replace( '/(' . $keys .')/iu', '<mark class="search-highlight">\0</mark>', $text );
}
}
return $text;
}
add_filter( 'the_excerpt', 'decode_highlight_search_results' );
add_filter( 'the_title', 'decode_highlight_search_results' );
/**
* Link to post in excerpt [...] links.
*/
if ( ! function_exists( 'link_ellipses' ) ) {
function link_ellipses( $more ) {
if ( ! is_search() ) {
return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">[…]</a>';
}
}
}
add_filter( 'excerpt_more', 'link_ellipses' );
if ( ! function_exists( '_wp_render_title_tag' ) ) :
/**
* Filters wp_title to print a neat <title> tag based on what is being viewed.
*
* @param string $title Default title text for current view.
* @param string $sep Optional separator.
* @return string The filtered title.
*/
function decode_wp_title( $title, $sep ) {
if ( is_feed() ) {
return $title;
}
global $page, $paged;
// Add the blog name
$title .= get_bloginfo( 'name', 'display' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title .= " $sep $site_description";
}
// Add a page number if necessary:
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
$title .= " $sep " . sprintf( __( 'Page %s', 'decode' ), max( $paged, $page ) );
}
return $title;
}
add_filter( 'wp_title', 'decode_wp_title', 10, 2 );
endif;
if ( ! function_exists( '_wp_render_title_tag' ) ) :
/**
* Title shim for sites older than WordPress 4.1.
*
* @link https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/
* @todo Remove this function when WordPress 4.3 is released.
*/
function decode_render_title() {
?>
<title><?php wp_title( '|', false, 'right' ); ?></title>
<?php
}
add_action( 'wp_head', 'decode_render_title' );
endif;
/**
* Sets the authordata global when viewing an author archive.
*
* This provides backwards compatibility for WP versions below 3.7
* that don't have this change:
* http://core.trac.wordpress.org/changeset/25574.
*
* It removes the need to call the_post() and rewind_posts() in an author
* template to print information about the author.
*
* @global WP_Query $wp_query WordPress Query object.
* @return void
*/
if ( ! function_exists( 'decode_setup_author' ) ) {
function decode_setup_author() {
global $wp_query;
if ( $wp_query->is_author() && isset( $wp_query->post ) ) {
$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
}
}
}
add_action( 'wp', 'decode_setup_author' );
|
casrep/wordpress-blog
|
wp-content/themes/decode/inc/extras.php
|
PHP
|
gpl-2.0
| 4,335 |
/*
Adept MobileRobots Robotics Interface for Applications (ARIA)
Copyright (C) 2004-2005 ActivMedia Robotics LLC
Copyright (C) 2006-2010 MobileRobots Inc.
Copyright (C) 2011-2014 Adept Technology
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
If you wish to redistribute ARIA under different terms, contact
Adept MobileRobots for information about a commercial version of ARIA at
[email protected] or
Adept MobileRobots, 10 Columbia Drive, Amherst, NH 03031; +1-603-881-7960
*/
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.40
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.mobilerobots.Aria;
public class ArUrg extends ArLaser {
/* (begin code from javabody_derived typemap) */
private long swigCPtr;
/* for internal use by swig only */
public ArUrg(long cPtr, boolean cMemoryOwn) {
super(AriaJavaJNI.SWIGArUrgUpcast(cPtr), cMemoryOwn);
swigCPtr = cPtr;
}
/* for internal use by swig only */
public static long getCPtr(ArUrg obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
/* (end code from javabody_derived typemap) */
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
AriaJavaJNI.delete_ArUrg(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
public ArUrg(int laserNumber, String name) {
this(AriaJavaJNI.new_ArUrg__SWIG_0(laserNumber, name), true);
}
public ArUrg(int laserNumber) {
this(AriaJavaJNI.new_ArUrg__SWIG_1(laserNumber), true);
}
public boolean blockingConnect() {
return AriaJavaJNI.ArUrg_blockingConnect(swigCPtr, this);
}
public boolean asyncConnect() {
return AriaJavaJNI.ArUrg_asyncConnect(swigCPtr, this);
}
public boolean disconnect() {
return AriaJavaJNI.ArUrg_disconnect(swigCPtr, this);
}
public boolean isConnected() {
return AriaJavaJNI.ArUrg_isConnected(swigCPtr, this);
}
public boolean isTryingToConnect() {
return AriaJavaJNI.ArUrg_isTryingToConnect(swigCPtr, this);
}
public void log() {
AriaJavaJNI.ArUrg_log(swigCPtr, this);
}
}
|
sfe1012/Robot
|
java/com/mobilerobots/Aria/ArUrg.java
|
Java
|
gpl-2.0
| 3,101 |
/* Definitions for bytecode */
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
#ifdef __cplusplus
extern "C" {
#endif
/* Bytecode object */
typedef struct {
PyObject_HEAD
int co_argcount; /* #arguments, except *args */
int co_nlocals; /* #local variables */
int co_stacksize; /* #entries needed for evaluation stack */
int co_flags; /* CO_..., see below */
PyObject *co_code; /* instruction opcodes */
PyObject *co_consts; /* list (constants used) */
PyObject *co_names; /* list of strings (names used) */
PyObject *co_varnames; /* tuple of strings (local variable names) */
PyObject *co_freevars; /* tuple of strings (free variable names) */
PyObject *co_cellvars; /* tuple of strings (cell variable names) */
/* The rest doesn't count for hash/cmp */
PyObject *co_filename; /* string (where it was loaded from) */
PyObject *co_name; /* string (name, for reference) */
int co_firstlineno; /* first source line number */
PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) */
} PyCodeObject;
/* Masks for co_flags above */
#define CO_OPTIMIZED 0x0001
#define CO_NEWLOCALS 0x0002
#define CO_VARARGS 0x0004
#define CO_VARKEYWORDS 0x0008
#define CO_NESTED 0x0010
#define CO_GENERATOR 0x0020
/* The CO_NOFREE flag is set if there are no free or cell variables.
This information is redundant, but it allows a single flag test
to determine whether there is any extra work to be done when the
call frame it setup.
*/
#define CO_NOFREE 0x0040
/* XXX Temporary hack. Until generators are a permanent part of the
language, we need a way for a code object to record that generators
were *possible* when it was compiled. This is so code dynamically
compiled *by* a code object knows whether to allow yield stmts. In
effect, this passes on the "from __future__ import generators" state
in effect when the code block was compiled. */
#define CO_GENERATOR_ALLOWED 0x1000 /* no longer used in an essential way */
#define CO_FUTURE_DIVISION 0x2000
PyAPI_DATA(PyTypeObject) PyCode_Type;
#define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
/* Public interface */
struct _node; /* Declare the existence of this type */
PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
PyAPI_FUNC(PyCodeObject *) PyCode_New(
int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *);
/* same as struct above */
PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
/* Future feature support */
typedef struct {
int ff_found_docstring;
int ff_last_lineno;
int ff_features;
} PyFutureFeatures;
PyAPI_FUNC(PyFutureFeatures *) PyNode_Future(struct _node *, const char *);
PyAPI_FUNC(PyCodeObject *) PyNode_CompileFlags(struct _node *, const char *,
PyCompilerFlags *);
#define FUTURE_NESTED_SCOPES "nested_scopes"
#define FUTURE_GENERATORS "generators"
#define FUTURE_DIVISION "division"
/* for internal use only */
#define _PyCode_GETCODEPTR(co, pp) \
((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \
((co)->co_code, 0, (void **)(pp)))
#ifdef __cplusplus
}
#endif
#endif /* !Py_COMPILE_H */
|
trivoldus28/pulsarch-verilog
|
tools/local/bas-release/bas,3.9/lib/python/include/python2.3/compile.h
|
C
|
gpl-2.0
| 3,391 |
#include <Instrument.h> // the base class for this instrument
#include <vector>
using std::vector;
class PHASER : public Instrument {
public:
PHASER();
virtual ~PHASER();
virtual int init(double *, int);
virtual int configure();
virtual int run();
private:
void doupdate();
float *_in;
int _nargs, _inchan, _branch;
float _amp, _wetdry, _pan, _lfofreq, _reverbtime;
int _insamps;
int _numfilters;
Ooscili *lfo;
Oallpassi *allpassptr; // temporary pointer to initialize vector
vector<Oallpassi*> _filtervector; // array of allpass filters
};
|
CLOUDS-Interactive-Documentary/RTCmix
|
insts/std/PHASER/PHASER.h
|
C
|
gpl-2.0
| 573 |
<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute smd/ulsph_stress command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID smd/ulsph_stress
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>smd/ulsph_stress = style name of this compute command
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all smd/ulsph_stress
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that outputs the Cauchy stress tensor.
</P>
<P>See <A HREF = "USER/smd/SMD_LAMMPS_userguide.pdf">this PDF guide</A> to using Smooth Mach Dynamics in LAMMPS.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-particle vector of vectors (tensors),
which can be accessed by any command that uses per-particle values
from a compute as input. See <A HREF = "Section_howto.html#howto_15">Section_howto 15</A>
for an overview of LAMMPS output options.
</P>
<P>The values will be given in <A HREF = "units.html">units</A> of pressure.
</P>
<P>The per-particle vector has 7 entries. The first six entries correspond to the xx, yy, zz, xy, xz, yz components
of the symmetric Cauchy stress tensor. The seventh entry is the second invariant of the stress tensor, i.e.,
the von Mises equivalent stress.
</P>
<P><B>Restrictions:</B>
</P>
<P>This compute is part of the USER-SMD package. It is only enabled if
LAMMPS was built with that package. See the <A HREF = "Section_start.html#start_3">Making LAMMPS</A>
section for more info. This compute can only be used for particles which interact with the updated Lagrangian SPH pair style.
</P>
<P><B>Related commands:</B>
</P>
<PRE><A HREF = "compute_smd_ulsph_strain.html">smd/ulsph_strain</A>, <A HREF = "compute_smd_ulsph_strain_rate.html">smd/ulsph_strain_rate</A>
<A HREF = "compute_smd_tlsph_stress.html">smd/tlsph_stress</A>
</PRE>
<P><B>Default:</B> none
</P>
</HTML>
|
qipa/lammps
|
doc/doc2/compute_smd_ulsph_stress.html
|
HTML
|
gpl-2.0
| 2,020 |
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
#include <mln/core/image/dmorph/sub_image.hh>
#include <mln/core/image/dmorph/image_if.hh>
#include <mln/fun/p2b/chess.hh>
#include <mln/border/get.hh>
#include <mln/literal/origin.hh>
struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
{
}
mln::box2d b_;
bool operator()(const mln::point2d& p) const
{
return b_.has(p);
}
};
int main()
{
using namespace mln;
typedef image2d<int> I;
box2d b(literal::origin, point2d(1,1));
f_box2d_t f_b(b);
I ima(3,3, 51);
mln_assertion(border::get(ima) == 51);
mln_assertion(ima.has(point2d(2,2)) == true);
sub_image<I, box2d> sub(ima, b);
mln_assertion(sub.has(point2d(2,2)) == false &&
sub.has(point2d(2,2)) == false);
mln_assertion(border::get(sub) == 0);
image_if<I, f_box2d_t> imaif(ima, f_b);
mln_assertion(imaif.has(point2d(2,2)) == false &&
ima.has(point2d(2,2)) == true);
mln_assertion(border::get(imaif) == 0);
mln_assertion(border::get((ima | b) | f_b) == 0);
}
|
glazzara/olena
|
milena/tests/border/get.cc
|
C++
|
gpl-2.0
| 2,307 |
<?php
/**
* GISMO block
*
* @package block_gismo
* @copyright eLab Christian Milani
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// error mode
$error_mode = (isset($error_mode) AND in_array($error_mode, array("json", "moodle"))) ? $error_mode : "moodle";
// define constants
if (!defined('ROOT')) {
//define('ROOT', (realpath(dirname( __FILE__ )) . DIRECTORY_SEPARATOR));
define('ROOT', substr(realpath(dirname(__FILE__)), 0, stripos(realpath(dirname(__FILE__)), "blocks", 0)) . 'blocks/gismo/');
}
//$path_base=substr(realpath(dirname( __FILE__ )),0,stripos(realpath(dirname( __FILE__ )),"blocks",0)).'blocks/gismo/';
if (!defined('LIB_DIR')) {
define('LIB_DIR', ROOT . "lib" . DIRECTORY_SEPARATOR);
//define('LIB_DIR', $path_base . "lib" . DIRECTORY_SEPARATOR);
}
// include moodle config file
require_once realpath(ROOT . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "config.php");
$q = optional_param('q', '', PARAM_TEXT);
$srv_data_encoded = required_param('srv_data',PARAM_RAW);
// query filter between pages
$query = (isset($q)) ? addslashes($q) : '';
// LIBRARIES MANAGEMENT
// Please use this section to set server side and cliend side libraries to be included
// server side: please note that '.php' extension will be automatically added
$server_side_libraries = array("third_parties" => array());
// client side: please note that '.js' extension will NOT be automatically added, in order to allow to create file thgat can be parsed by PHP
$client_side_libraries = array("gismo" => array("gismo.js.php", "top_menu.js.php", "left_menu.js.php", "time_line.js", "gismo_util.js"),
"third_parties" => array("jquery/jquery-1.10.0.min.js",
"jquery-ui-1.10.3/js/jquery-ui-1.10.3.custom.min.js",
"jqplot.1.0.8r1250/jquery.jqplot.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.barRenderer.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.canvasAxisLabelRenderer.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.canvasAxisTickRenderer.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.canvasTextRenderer.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.categoryAxisRenderer.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.dateAxisRenderer.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.highlighter.min.js",
"jqplot.1.0.8r1250/plugins/jqplot.pointLabels.min.js",
"simpleFadeSlideShow/fadeSlideShow.min.js"
));
// include server-side libraries libraries
if (is_array($server_side_libraries) AND count($server_side_libraries) > 0) {
foreach ($server_side_libraries as $key => $server_side_libs) {
if (is_array($server_side_libs) AND count($server_side_libs) > 0) {
foreach ($server_side_libs as $server_side_lib) {
$lib_full_path = LIB_DIR . $key . DIRECTORY_SEPARATOR . "server_side" . DIRECTORY_SEPARATOR . $server_side_lib . ".php";
if (is_file($lib_full_path) AND is_readable($lib_full_path)) {
require_once $lib_full_path;
}
}
}
}
}
// check input data
if (!isset($srv_data_encoded)) {
block_gismo\GISMOutil::gismo_error('err_srv_data_not_set', $error_mode);
exit;
}
$srv_data = (object) unserialize(base64_decode(urldecode($srv_data_encoded)));
// course id
if (!property_exists($srv_data, "course_id")) {
block_gismo\GISMOutil::gismo_error('err_course_not_set', $error_mode);
exit;
}
// block instance id
if (!property_exists($srv_data, "block_instance_id")) {
block_gismo\GISMOutil::gismo_error('err_block_instance_id_not_set', $error_mode);
exit;
}
// check authentication
switch ($error_mode) {
case "json":
try {
require_login($srv_data->course_id, false, NULL, true, true);
} catch (Exception $e) {
block_gismo\GISMOutil::gismo_error("err_authentication", $error_mode);
exit;
}
break;
case "moodle":
default:
require_login();
break;
}
// extract the course
if (!$course = $DB->get_record("course", array("id" => intval($srv_data->course_id)))) {
block_gismo\GISMOutil::gismo_error('err_course_not_set', $error_mode);
exit;
}
// context
$context_obj = context_block::instance(intval($srv_data->block_instance_id));
//Get block_gismo settings
$gismoconfig = get_config('block_gismo');
if ($gismoconfig->student_reporting === "false") {
// check authorization
require_capability('block/gismo:view', $context_obj);
}
// get gismo settings
$gismo_settings = $DB->get_field("block_instances", "configdata", array("id" => intval($srv_data->block_instance_id)));
if (is_null($gismo_settings) OR $gismo_settings === "") {
$gismo_settings = get_object_vars(block_gismo\GISMOutil::get_default_options());
} else {
$gismo_settings = get_object_vars(unserialize(base64_decode($gismo_settings)));
if (is_array($gismo_settings) AND count($gismo_settings) > 0) {
foreach ($gismo_settings as $key => $value) {
if (is_numeric($value)) {
if (strval(intval($value)) === strval($value)) {
$gismo_settings[$key] = intval($value);
} else if (strval(floatval($value)) === strval($value)) {
$gismo_settings[$key] = floatval($value);
}
}
}
}
// include_hidden_items
if (!array_key_exists("include_hidden_items", $gismo_settings)) {
$gismo_settings["include_hidden_items"] = 1;
}
}
$block_gismo_config = json_encode($gismo_settings);
// actor (teacher or student)
$actor = "student";
if (has_capability("block/gismo:trackuser", $context_obj)) {
$actor = "student";
}
if (has_capability("block/gismo:trackteacher", $context_obj)) {
$actor = "teacher";
}
?>
|
lglopezf/Moodle2.8.2_Adaptativo_Trus_Model
|
blocks/gismo/common.php
|
PHP
|
gpl-2.0
| 5,932 |
#!/usr/bin/env python
"""
gateway tests - Users
Copyright 2009 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import unittest
import omero
import gatewaytest.library as lib
from omero.gateway.scripts import dbhelpers
class UserTest (lib.GTest):
def testUsers (self):
self.loginAsUser()
# Try reconnecting without disconnect
self._has_connected = False
self.doConnect()
self.loginAsAuthor()
self.loginAsAdmin()
def testSaveAs (self):
for u in (self.AUTHOR, self.ADMIN):
# Test image should be owned by author
self.loginAsAuthor()
image = self.getTestImage()
ownername = image.getOwnerOmeName()
# Now login as author or admin
self.doLogin(u)
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
image = self.getTestImage()
self.assertEqual(ownername, self.AUTHOR.name)
# Create some object
param = omero.sys.Parameters()
param.map = {'ns': omero.rtypes.rstring('weblitz.UserTest.testSaveAs')}
anns = self.gateway.getQueryService().findAllByQuery('from CommentAnnotation as a where a.ns=:ns', param)
self.assertEqual(len(anns), 0)
self.gateway.SERVICE_OPTS.setOmeroGroup()
ann = omero.gateway.CommentAnnotationWrapper(conn=self.gateway)
ann.setNs(param.map['ns'].val)
ann.setValue('foo')
ann.saveAs(image.getDetails())
# Annotations are owned by author
self.loginAsAuthor()
try:
anns = self.gateway.getQueryService().findAllByQuery('from CommentAnnotation as a where a.ns=:ns', param)
self.assertEqual(len(anns), 1)
self.assertEqual(omero.gateway.CommentAnnotationWrapper(self.gateway, anns[0]).getOwnerOmeName(), self.AUTHOR.name)
finally:
self.gateway.getUpdateService().deleteObject(ann._obj)
anns = self.gateway.getQueryService().findAllByQuery('from CommentAnnotation as a where a.ns=:ns', param)
self.assertEqual(len(anns), 0)
def testCrossGroupSave (self):
self.loginAsUser()
uid = self.gateway.getUserId()
self.loginAsAdmin()
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
d = self.getTestDataset()
did = d.getId()
g = d.getDetails().getGroup()
admin = self.gateway.getAdminService()
admin.addGroups(omero.model.ExperimenterI(uid, False), [g._obj])
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
# make sure the group is groupwrite enabled
perms = str(d.getDetails().getGroup().getDetails().permissions)
admin.changePermissions(g._obj, omero.model.PermissionsI('rwrw--'))
d = self.getTestDataset()
g = d.getDetails().getGroup()
self.assert_(g.getDetails().permissions.isGroupWrite())
self.loginAsUser()
# User is now a member of the group to which testDataset belongs, which has groupWrite==True
# But the default group for User is diferent
try:
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
d = self.getTestDataset()
did = d.getId()
n = d.getName()
d.setName(n+'_1')
d.save()
d = self.gateway.getObject('dataset', did)
self.assertEqual(d.getName(), n+'_1')
d.setName(n)
d.save()
d = self.gateway.getObject('dataset', did)
self.assertEqual(d.getName(), n)
finally:
self.loginAsAdmin()
admin = self.gateway.getAdminService()
# Revert group permissions and remove user from group
admin.changePermissions(g._obj, omero.model.PermissionsI(perms))
admin.removeGroups(omero.model.ExperimenterI(uid, False), [g._obj])
def testCrossGroupRead (self):
self.loginAsAuthor()
u = self.gateway.getUpdateService()
p = self.getTestProject()
self.assertEqual(str(p.getDetails().permissions)[4], '-')
d = p.getDetails()
g = d.getGroup()
self.loginAsUser()
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
self.assert_(not g.getId() in self.gateway.getEventContext().memberOfGroups)
self.assertEqual(self.gateway.getObject('project', p.getId()), None)
def testGroupOverObjPermissions (self):
""" Object accesss must be dependent only of group permissions """
ns = 'omero.test.ns'
# Author
self.loginAsAuthor()
# create group with rw----
# create project and annotation in that group
p = dbhelpers.ProjectEntry('testAnnotationPermissions', None, create_group='testAnnotationPermissions', group_perms='rw----')
try:
p = p.create(self.gateway)
except dbhelpers.BadGroupPermissionsException:
self.loginAsAdmin()
admin = self.gateway.getAdminService()
admin.changePermissions(admin.lookupGroup('testAnnotationPermissions'), omero.model.PermissionsI('rw----'))
self.loginAsAuthor()
p = p.create(self.gateway)
pid = p.getId()
g = p.getDetails().getGroup()._obj
try:
# Admin
# add User to group
self.loginAsUser()
uid = self.gateway.getUserId()
self.loginAsAdmin()
admin = self.gateway.getAdminService()
admin.addGroups(omero.model.ExperimenterI(uid, False), [g])
# User
# try to read project and annotation, which fails
self.loginAsUser()
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
self.assertEqual(self.gateway.getObject('project', pid), None)
# Admin
# Chmod project to rwrw--
self.loginAsAdmin()
admin = self.gateway.getAdminService()
admin.changePermissions(g, omero.model.PermissionsI('rwrw--'))
# Author
# check project has proper permissions
self.loginAsAuthor()
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
pa = self.gateway.getObject('project', pid)
self.assertNotEqual(pa, None)
# User
# read project and annotation
self.loginAsUser()
self.gateway.SERVICE_OPTS.setOmeroGroup('-1')
self.assertNotEqual(self.gateway.getObject('project', pid), None)
finally:
self.loginAsAuthor()
handle = self.gateway.deleteObjects('Project', [p.getId()], deleteAnns=True, deleteChildren=True)
self.waitOnCmd(self.gateway.c, handle)
if __name__ == '__main__':
unittest.main()
|
rleigh-dundee/openmicroscopy
|
components/tools/OmeroPy/test/gatewaytest/user.py
|
Python
|
gpl-2.0
| 6,878 |
<?php
/**
* The following variables are available in this template:
* - $this: the CrudCode object
*/
?>
<div id="mainPage" class="main">
<?php
echo "<?php\n";
$nameColumn = $this->guessNameColumn($this->tableSchema->columns);
$label = $this->pluralize($this->class2name($this->modelClass));
echo "\$this->breadcrumbs=array(
'$label'=>array('index'),
\$model->{$nameColumn}=>array('view','id'=>\$model->{$this->tableSchema->primaryKey}),
'Update',
);\n";
?>
$title=Yii::t('default', 'Update <?php echo $this->modelClass ?>: ');
$contextDesc = Yii::t('default', 'Available actions that may be taken on <?php echo $this->modelClass; ?>.');
$this->menu=array(
array('label'=> Yii::t('default', 'Create a new <?php echo $this->modelClass; ?>'), 'url'=>array('create'),'description' => Yii::t('default', 'This action create a new <?php echo $this->modelClass; ?>')),
array('label'=> Yii::t('default', 'List <?php echo $this->modelClass; ?>'), 'url'=>array('index'),'description' => Yii::t('default', 'This action list all <?php echo $this->pluralize($this->class2name($this->modelClass)) ?>, you can search, delete and update')),
);
?>
<div class="twoColumn">
<div class="columnone" style="padding-right: 1em">
<?php echo "<?php echo \$this->renderPartial('_form', array('model'=>\$model,'title'=>\$title)); ?>"; ?>
</div>
<div class="columntwo">
<?php echo "<?php echo \$this->renderPartial('////common/defaultcontext', array('contextDesc'=>\$contextDesc)); ?>"; ?>
</div>
</div>
</div>
|
ipti/tag
|
app/gii/crud/templates/yvj/update.php
|
PHP
|
gpl-2.0
| 1,608 |
/*
Copyright 2007-2011 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#define _XOPEN_SOURCE 500
#include <assert.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include "lilv_internal.h"
static void
lilv_node_set_numerics_from_string(LilvNode* val)
{
char* locale;
char* endptr;
switch (val->type) {
case LILV_VALUE_URI:
case LILV_VALUE_BLANK:
case LILV_VALUE_STRING:
break;
case LILV_VALUE_INT:
// FIXME: locale kludge, need a locale independent strtol
locale = lilv_strdup(setlocale(LC_NUMERIC, NULL));
setlocale(LC_NUMERIC, "POSIX");
val->val.int_val = strtol(val->str_val, &endptr, 10);
setlocale(LC_NUMERIC, locale);
free(locale);
break;
case LILV_VALUE_FLOAT:
// FIXME: locale kludge, need a locale independent strtod
locale = lilv_strdup(setlocale(LC_NUMERIC, NULL));
setlocale(LC_NUMERIC, "POSIX");
val->val.float_val = strtod(val->str_val, &endptr);
setlocale(LC_NUMERIC, locale);
free(locale);
break;
case LILV_VALUE_BOOL:
val->val.bool_val = (!strcmp(val->str_val, "true"));
break;
}
}
/** Note that if @a type is numeric or boolean, the returned value is corrupt
* until lilv_node_set_numerics_from_string is called. It is not
* automatically called from here to avoid overhead and imprecision when the
* exact string value is known.
*/
LilvNode*
lilv_node_new(LilvWorld* world, LilvNodeType type, const char* str)
{
LilvNode* val = malloc(sizeof(struct LilvNodeImpl));
val->world = world;
val->type = type;
switch (type) {
case LILV_VALUE_URI:
val->val.uri_val = sord_new_uri(world->world, (const uint8_t*)str);
val->str_val = (char*)sord_node_get_string(val->val.uri_val);
break;
case LILV_VALUE_BLANK:
val->val.uri_val = sord_new_blank(world->world, (const uint8_t*)str);
val->str_val = (char*)sord_node_get_string(val->val.uri_val);
case LILV_VALUE_STRING:
case LILV_VALUE_INT:
case LILV_VALUE_FLOAT:
case LILV_VALUE_BOOL:
val->str_val = lilv_strdup(str);
break;
}
return val;
}
/** Create a new LilvNode from @a node, or return NULL if impossible */
LilvNode*
lilv_node_new_from_node(LilvWorld* world, const SordNode* node)
{
LilvNode* result = NULL;
SordNode* datatype_uri = NULL;
LilvNodeType type = LILV_VALUE_STRING;
switch (sord_node_get_type(node)) {
case SORD_URI:
result = malloc(sizeof(struct LilvNodeImpl));
result->world = (LilvWorld*)world;
result->type = LILV_VALUE_URI;
result->val.uri_val = sord_node_copy(node);
result->str_val = (char*)sord_node_get_string(result->val.uri_val);
break;
case SORD_BLANK:
result = malloc(sizeof(struct LilvNodeImpl));
result->world = (LilvWorld*)world;
result->type = LILV_VALUE_BLANK;
result->val.uri_val = sord_node_copy(node);
result->str_val = (char*)sord_node_get_string(result->val.uri_val);
break;
case SORD_LITERAL:
datatype_uri = sord_node_get_datatype(node);
if (datatype_uri) {
if (sord_node_equals(datatype_uri, world->xsd_boolean_node))
type = LILV_VALUE_BOOL;
else if (sord_node_equals(datatype_uri, world->xsd_decimal_node)
|| sord_node_equals(datatype_uri, world->xsd_double_node))
type = LILV_VALUE_FLOAT;
else if (sord_node_equals(datatype_uri, world->xsd_integer_node))
type = LILV_VALUE_INT;
else
LILV_ERRORF("Unknown datatype `%s'\n",
sord_node_get_string(datatype_uri));
}
result = lilv_node_new(world, type, (const char*)sord_node_get_string(node));
switch (result->type) {
case LILV_VALUE_INT:
case LILV_VALUE_FLOAT:
case LILV_VALUE_BOOL:
lilv_node_set_numerics_from_string(result);
default:
break;
}
break;
default:
assert(false);
}
return result;
}
LILV_API
LilvNode*
lilv_new_uri(LilvWorld* world, const char* uri)
{
return lilv_node_new(world, LILV_VALUE_URI, uri);
}
LILV_API
LilvNode*
lilv_new_string(LilvWorld* world, const char* str)
{
return lilv_node_new(world, LILV_VALUE_STRING, str);
}
LILV_API
LilvNode*
lilv_new_int(LilvWorld* world, int val)
{
char str[32];
snprintf(str, sizeof(str), "%d", val);
LilvNode* ret = lilv_node_new(world, LILV_VALUE_INT, str);
ret->val.int_val = val;
return ret;
}
LILV_API
LilvNode*
lilv_new_float(LilvWorld* world, float val)
{
char str[32];
snprintf(str, sizeof(str), "%f", val);
LilvNode* ret = lilv_node_new(world, LILV_VALUE_FLOAT, str);
ret->val.float_val = val;
return ret;
}
LILV_API
LilvNode*
lilv_new_bool(LilvWorld* world, bool val)
{
LilvNode* ret = lilv_node_new(world, LILV_VALUE_BOOL, val ? "true" : "false");
ret->val.bool_val = val;
return ret;
}
LILV_API
LilvNode*
lilv_node_duplicate(const LilvNode* val)
{
if (val == NULL)
return NULL;
LilvNode* result = malloc(sizeof(struct LilvNodeImpl));
result->world = val->world;
result->type = val->type;
switch (val->type) {
case LILV_VALUE_URI:
case LILV_VALUE_BLANK:
result->val.uri_val = sord_node_copy(val->val.uri_val);
result->str_val = (char*)sord_node_get_string(result->val.uri_val);
break;
default:
result->str_val = lilv_strdup(val->str_val);
result->val = val->val;
}
return result;
}
LILV_API
void
lilv_node_free(LilvNode* val)
{
if (val) {
switch (val->type) {
case LILV_VALUE_URI:
case LILV_VALUE_BLANK:
sord_node_free(val->world->world, val->val.uri_val);
break;
default:
free(val->str_val);
}
free(val);
}
}
LILV_API
bool
lilv_node_equals(const LilvNode* value, const LilvNode* other)
{
if (value == NULL && other == NULL)
return true;
else if (value == NULL || other == NULL)
return false;
else if (value->type != other->type)
return false;
switch (value->type) {
case LILV_VALUE_URI:
return sord_node_equals(value->val.uri_val, other->val.uri_val);
case LILV_VALUE_BLANK:
case LILV_VALUE_STRING:
return !strcmp(value->str_val, other->str_val);
case LILV_VALUE_INT:
return (value->val.int_val == other->val.int_val);
case LILV_VALUE_FLOAT:
return (value->val.float_val == other->val.float_val);
case LILV_VALUE_BOOL:
return (value->val.bool_val == other->val.bool_val);
}
return false; /* shouldn't get here */
}
LILV_API
char*
lilv_node_get_turtle_token(const LilvNode* value)
{
size_t len = 0;
char* result = NULL;
char* locale = NULL;
switch (value->type) {
case LILV_VALUE_URI:
len = strlen(value->str_val) + 3;
result = calloc(len, 1);
snprintf(result, len, "<%s>", value->str_val);
break;
case LILV_VALUE_BLANK:
len = strlen(value->str_val) + 3;
result = calloc(len, 1);
snprintf(result, len, "_:%s", value->str_val);
break;
case LILV_VALUE_STRING:
case LILV_VALUE_BOOL:
result = lilv_strdup(value->str_val);
break;
case LILV_VALUE_INT:
// INT64_MAX is 9223372036854775807 (19 digits) + 1 for sign
// FIXME: locale kludge, need a locale independent snprintf
locale = lilv_strdup(setlocale(LC_NUMERIC, NULL));
len = 20;
result = calloc(len, 1);
setlocale(LC_NUMERIC, "POSIX");
snprintf(result, len, "%d", value->val.int_val);
setlocale(LC_NUMERIC, locale);
break;
case LILV_VALUE_FLOAT:
// FIXME: locale kludge, need a locale independent snprintf
locale = lilv_strdup(setlocale(LC_NUMERIC, NULL));
len = 20; // FIXME: proper maximum value?
result = calloc(len, 1);
setlocale(LC_NUMERIC, "POSIX");
snprintf(result, len, "%f", value->val.float_val);
setlocale(LC_NUMERIC, locale);
break;
}
free(locale);
return result;
}
LILV_API
bool
lilv_node_is_uri(const LilvNode* value)
{
return (value && value->type == LILV_VALUE_URI);
}
LILV_API
const char*
lilv_node_as_uri(const LilvNode* value)
{
assert(lilv_node_is_uri(value));
return value->str_val;
}
const SordNode*
lilv_node_as_node(const LilvNode* value)
{
assert(lilv_node_is_uri(value));
return value->val.uri_val;
}
LILV_API
bool
lilv_node_is_blank(const LilvNode* value)
{
return (value && value->type == LILV_VALUE_BLANK);
}
LILV_API
const char*
lilv_node_as_blank(const LilvNode* value)
{
assert(lilv_node_is_blank(value));
return value->str_val;
}
LILV_API
bool
lilv_node_is_literal(const LilvNode* value)
{
if (!value)
return false;
switch (value->type) {
case LILV_VALUE_STRING:
case LILV_VALUE_INT:
case LILV_VALUE_FLOAT:
return true;
default:
return false;
}
}
LILV_API
bool
lilv_node_is_string(const LilvNode* value)
{
return (value && value->type == LILV_VALUE_STRING);
}
LILV_API
const char*
lilv_node_as_string(const LilvNode* value)
{
return value->str_val;
}
LILV_API
bool
lilv_node_is_int(const LilvNode* value)
{
return (value && value->type == LILV_VALUE_INT);
}
LILV_API
int
lilv_node_as_int(const LilvNode* value)
{
assert(value);
assert(lilv_node_is_int(value));
return value->val.int_val;
}
LILV_API
bool
lilv_node_is_float(const LilvNode* value)
{
return (value && value->type == LILV_VALUE_FLOAT);
}
LILV_API
float
lilv_node_as_float(const LilvNode* value)
{
assert(lilv_node_is_float(value) || lilv_node_is_int(value));
if (lilv_node_is_float(value))
return value->val.float_val;
else // lilv_node_is_int(value)
return (float)value->val.int_val;
}
LILV_API
bool
lilv_node_is_bool(const LilvNode* value)
{
return (value && value->type == LILV_VALUE_BOOL);
}
LILV_API
bool
lilv_node_as_bool(const LilvNode* value)
{
assert(value);
assert(lilv_node_is_bool(value));
return value->val.bool_val;
}
|
ccherrett/oom
|
dependencies/lilvbundle/lilv-0.5.0/src/node.c
|
C
|
gpl-2.0
| 10,040 |
/*
* #%L
* BSD implementations of Bio-Formats readers and writers
* %%
* Copyright (C) 2005 - 2016 Open Microscopy Environment:
* - Board of Regents of the University of Wisconsin-Madison
* - Glencoe Software, Inc.
* - University of Dundee
* %%
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package loci.formats.codec;
import java.io.IOException;
import java.util.Vector;
import loci.common.ByteArrayHandle;
import loci.common.DataTools;
import loci.common.RandomAccessInputStream;
import loci.formats.FormatException;
import loci.formats.UnsupportedCompressionException;
/**
* Decompresses lossless JPEG images.
*
* @author Melissa Linkert melissa at glencoesoftware.com
*/
public class LosslessJPEGCodec extends BaseCodec {
// -- Constants --
// Start of Frame markers - non-differential, Huffman coding
private static final int SOF0 = 0xffc0; // baseline DCT
private static final int SOF1 = 0xffc1; // extended sequential DCT
private static final int SOF2 = 0xffc2; // progressive DCT
private static final int SOF3 = 0xffc3; // lossless (sequential)
// Start of Frame markers - differential, Huffman coding
private static final int SOF5 = 0xffc5; // differential sequential DCT
private static final int SOF6 = 0xffc6; // differential progressive DCT
private static final int SOF7 = 0xffc7; // differential lossless (sequential)
// Start of Frame markers - non-differential, arithmetic coding
private static final int JPG = 0xffc8; // reserved for JPEG extensions
private static final int SOF9 = 0xffc9; // extended sequential DCT
private static final int SOF10 = 0xffca; // progressive DCT
private static final int SOF11 = 0xffcb; // lossless (sequential)
// Start of Frame markers - differential, arithmetic coding
private static final int SOF13 = 0xffcd; // differential sequential DCT
private static final int SOF14 = 0xffce; // differential progressive DCT
private static final int SOF15 = 0xffcf; // differential lossless (sequential)
private static final int DHT = 0xffc4; // define Huffman table(s)
private static final int DAC = 0xffcc; // define arithmetic coding conditions
// Restart interval termination
private static final int RST_0 = 0xffd0;
private static final int RST_1 = 0xffd1;
private static final int RST_2 = 0xffd2;
private static final int RST_3 = 0xffd3;
private static final int RST_4 = 0xffd4;
private static final int RST_5 = 0xffd5;
private static final int RST_6 = 0xffd6;
private static final int RST_7 = 0xffd7;
private static final int SOI = 0xffd8; // start of image
private static final int EOI = 0xffd9; // end of image
private static final int SOS = 0xffda; // start of scan
private static final int DQT = 0xffdb; // define quantization table(s)
private static final int DNL = 0xffdc; // define number of lines
private static final int DRI = 0xffdd; // define restart interval
private static final int DHP = 0xffde; // define hierarchical progression
private static final int EXP = 0xffdf; // expand reference components
private static final int COM = 0xfffe; // comment
// -- Codec API methods --
/* @see Codec#compress(byte[], CodecOptions) */
@Override
public byte[] compress(byte[] data, CodecOptions options)
throws FormatException
{
throw new UnsupportedCompressionException(
"Lossless JPEG compression not supported");
}
/**
* The CodecOptions parameter should have the following fields set:
* {@link CodecOptions#interleaved interleaved}
* {@link CodecOptions#littleEndian littleEndian}
*
* @see Codec#decompress(RandomAccessInputStream, CodecOptions)
*/
@Override
public byte[] decompress(RandomAccessInputStream in, CodecOptions options)
throws FormatException, IOException
{
if (in == null)
throw new IllegalArgumentException("No data to decompress.");
if (options == null) options = CodecOptions.getDefaultOptions();
byte[] buf = new byte[0];
int width = 0, height = 0;
int bitsPerSample = 0, nComponents = 0, bytesPerSample = 0;
int[] horizontalSampling = null, verticalSampling = null;
int[] quantizationTable = null;
short[][] huffmanTables = null;
int startPredictor = 0, endPredictor = 0;
int pointTransform = 0;
int[] dcTable = null, acTable = null;
while (in.getFilePointer() < in.length() - 1) {
int code = in.readShort() & 0xffff;
int length = in.readShort() & 0xffff;
long fp = in.getFilePointer();
if (length > 0xff00) {
length = 0;
in.seek(fp - 2);
}
else if (code == SOS) {
nComponents = in.read();
dcTable = new int[nComponents];
acTable = new int[nComponents];
for (int i=0; i<nComponents; i++) {
int componentSelector = in.read();
int tableSelector = in.read();
dcTable[i] = (tableSelector & 0xf0) >> 4;
acTable[i] = tableSelector & 0xf;
}
startPredictor = in.read();
endPredictor = in.read();
pointTransform = in.read() & 0xf;
// read image data
byte[] toDecode = new byte[(int) (in.length() - in.getFilePointer())];
in.read(toDecode);
// scrub out byte stuffing
ByteVector b = new ByteVector();
for (int i=0; i<toDecode.length; i++) {
byte val = toDecode[i];
if (val == (byte) 0xff) {
if (toDecode[i + 1] == 0)
b.add(val);
i++;
} else {
b.add(val);
}
}
toDecode = b.toByteArray();
RandomAccessInputStream bb = new RandomAccessInputStream(
new ByteArrayHandle(toDecode));
HuffmanCodec huffman = new HuffmanCodec();
HuffmanCodecOptions huffmanOptions = new HuffmanCodecOptions();
huffmanOptions.bitsPerSample = bitsPerSample;
huffmanOptions.maxBytes = buf.length / nComponents;
int nextSample = 0;
while (nextSample < buf.length / nComponents) {
for (int i=0; i<nComponents; i++) {
huffmanOptions.table = huffmanTables[dcTable[i]];
int v = 0;
if (huffmanTables != null) {
v = huffman.getSample(bb, huffmanOptions);
if (nextSample == 0) {
v += (int) Math.pow(2, bitsPerSample - 1);
}
}
else {
throw new UnsupportedCompressionException(
"Arithmetic coding not supported");
}
// apply predictor to the sample
int predictor = startPredictor;
if (nextSample < width * bytesPerSample) predictor = 1;
else if ((nextSample % (width * bytesPerSample)) == 0) {
predictor = 2;
}
int componentOffset = i * (buf.length / nComponents);
int indexA = nextSample - bytesPerSample + componentOffset;
int indexB = nextSample - width * bytesPerSample + componentOffset;
int indexC = nextSample - (width + 1) * bytesPerSample +
componentOffset;
int sampleA = indexA < 0 ? 0 :
DataTools.bytesToInt(buf, indexA, bytesPerSample, false);
int sampleB = indexB < 0 ? 0 :
DataTools.bytesToInt(buf, indexB, bytesPerSample, false);
int sampleC = indexC < 0 ? 0 :
DataTools.bytesToInt(buf, indexC, bytesPerSample, false);
if (nextSample > 0) {
int pred = 0;
switch (predictor) {
case 1:
pred = sampleA;
break;
case 2:
pred = sampleB;
break;
case 3:
pred = sampleC;
break;
case 4:
pred = sampleA + sampleB + sampleC;
break;
case 5:
pred = sampleA + ((sampleB - sampleC) / 2);
break;
case 6:
pred = sampleB + ((sampleA - sampleC) / 2);
break;
case 7:
pred = (sampleA + sampleB) / 2;
break;
}
v += pred;
}
int offset = componentOffset + nextSample;
DataTools.unpackBytes(v, buf, offset, bytesPerSample, false);
}
nextSample += bytesPerSample;
}
bb.close();
}
else {
length -= 2; // stored length includes length param
if (length == 0) continue;
if (code == EOI) { }
else if (code == SOF3) {
// lossless w/Huffman coding
bitsPerSample = in.read();
height = in.readShort();
width = in.readShort();
nComponents = in.read();
horizontalSampling = new int[nComponents];
verticalSampling = new int[nComponents];
quantizationTable = new int[nComponents];
for (int i=0; i<nComponents; i++) {
in.skipBytes(1);
int s = in.read();
horizontalSampling[i] = (s & 0xf0) >> 4;
verticalSampling[i] = s & 0x0f;
quantizationTable[i] = in.read();
}
bytesPerSample = bitsPerSample / 8;
if ((bitsPerSample % 8) != 0) bytesPerSample++;
buf = new byte[width * height * nComponents * bytesPerSample];
}
else if (code == SOF11) {
throw new UnsupportedCompressionException(
"Arithmetic coding is not yet supported");
}
else if (code == DHT) {
if (huffmanTables == null) {
huffmanTables = new short[4][];
}
int bytesRead = 0;
while (bytesRead < length) {
int s = in.read();
byte tableClass = (byte) ((s & 0xf0) >> 4);
byte destination = (byte) (s & 0xf);
int[] nCodes = new int[16];
Vector table = new Vector();
for (int i=0; i<nCodes.length; i++) {
nCodes[i] = in.read();
table.add(new Short((short) nCodes[i]));
}
for (int i=0; i<nCodes.length; i++) {
for (int j=0; j<nCodes[i]; j++) {
table.add(new Short((short) (in.read() & 0xff)));
}
}
huffmanTables[destination] = new short[table.size()];
for (int i=0; i<huffmanTables[destination].length; i++) {
huffmanTables[destination][i] = ((Short) table.get(i)).shortValue();
}
bytesRead += table.size() + 1;
}
}
in.seek(fp + length);
}
}
if (options.interleaved && nComponents > 1) {
// data is stored in planar (RRR...GGG...BBB...) order
byte[] newBuf = new byte[buf.length];
for (int i=0; i<buf.length; i+=nComponents*bytesPerSample) {
for (int c=0; c<nComponents; c++) {
int src = c * (buf.length / nComponents) + (i / nComponents);
int dst = i + c * bytesPerSample;
System.arraycopy(buf, src, newBuf, dst, bytesPerSample);
}
}
buf = newBuf;
}
if (options.littleEndian && bytesPerSample > 1) {
// data is stored in big endian order
// reverse the bytes in each sample
byte[] newBuf = new byte[buf.length];
for (int i=0; i<buf.length; i+=bytesPerSample) {
for (int q=0; q<bytesPerSample; q++) {
newBuf[i + bytesPerSample - q - 1] = buf[i + q];
}
}
buf = newBuf;
}
return buf;
}
}
|
imunro/bioformats
|
components/formats-bsd/src/loci/formats/codec/LosslessJPEGCodec.java
|
Java
|
gpl-2.0
| 12,867 |
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that
* other 'pages' on your WordPress site will use a different template.
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
get_header(); ?>
<div id="main-content" class="main-content">
<?php
if (is_front_page() && twentyfourteen_has_featured_posts()) {
// Include the featured content template.
get_template_part('featured-content');
}
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
// Start the Loop.
while (have_posts()) : the_post();
// Include the page content template.
get_template_part('content', 'page');
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
endwhile;
?>
</div>
<!-- #content -->
</div>
<!-- #primary -->
<?php get_sidebar('content'); ?>
</div><!-- #main-content -->
<?php
get_sidebar();
get_footer();
|
richardbota/WordPress-Theme-Development-with-Bootstrap
|
wp-content/themes/twentyfourteen/page.php
|
PHP
|
gpl-2.0
| 1,451 |
\par
\chapter{{\tt DenseMtx}: Dense matrix object}
\par
The {\tt DenseMtx} object contains a dense matrix along with row and
column indices.
The entries in the matrix can be double precision real or double
precision complex.
It needs to be able to manage its own storage, much like the {\tt
Chv} and {\tt SubMtx} objects that are used during the
factor and solves, so we include
this capability via a contained {\tt DV} object.
A {\tt DenseMtx} object may also be found in a list, so there is
a {\tt next} field that points to another {\tt DenseMtx} object.
\par
The {\tt DenseMtx} object also exists in an MPI environment,
where it holds the solution and right hand side matrices.
Since each of these two matrices is distributed, a processor
{\it owns} only part of the global matrix, and so the need for row
and column indices to specify which rows and columns are present on
which processor.
|
zagl/ccx-user
|
application/SPOOLES.2.2/DenseMtx/doc/intro.tex
|
TeX
|
gpl-2.0
| 896 |
#
# create TRD geometry from patch file
#
SOURCE=Create_TRD_Geometry_v13p_3e.C
TARGET=Create_TRD_Geometry_v13p_1m.C
PATCH=p3etop1m.patch
#
echo
echo cp $SOURCE $TARGET
echo patch $TARGET $PATCH
echo root -l $TARGET
echo
#
cp $SOURCE $TARGET
patch $TARGET $PATCH
root -l $TARGET
|
NicolasWinckler/CbmRoot
|
macro/trd/geometry/trd.v13/create_TRD_Geometry_v13p_1m.sh
|
Shell
|
gpl-2.0
| 282 |
#ifndef CGITCP_H
#define CGITCP_H
#include "httpd.h"
int cgiTcp(HttpdConnData *connData);
#endif
|
twischer/WLAN-RGB-Para
|
esp-link/cgiadv/cgitcp.h
|
C
|
gpl-2.0
| 100 |
<?php
namespace SJBR\StaticInfoTables\Domain\Model;
/***************************************************************
* Copyright notice
*
* (c) 2011-2012 Armin Rüdiger Vieweg <[email protected]>
* (c) 2013 Stanislas Rolland <typo3(arobas)sjbr.ca>
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project 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.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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 copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* The Country model
*
* @copyright Copyright belongs to the respective authors
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class Country extends AbstractEntity {
/**
* The German short name
* @var string
*/
protected $shortNameDe = '';
/**
* Sets the German short name.
*
* @param string $shortNameDe
*
* @return void
*/
public function setShortNameDe($shortNameDe) {
$this->shortNameDe = $shortNameDe;
}
/**
* Gets the German short name.
*
* @return string
*/
public function getShortNameDe() {
return $this->shortNameDe;
}
}
?>
|
Loopshape/Portfolio
|
hostweb/typo3conf/ext/static_info_tables_de/Classes/Domain/Model/Country.php
|
PHP
|
gpl-2.0
| 1,688 |
using System;
using System.Reflection;
namespace OLPL_API_Server.Areas.HelpPage.ModelDescriptions
{
public interface IModelDocumentationProvider
{
string GetDocumentation(MemberInfo member);
string GetDocumentation(Type type);
}
}
|
gholpl/OLPL_API-Server
|
OLPL-API-Server/obj/Debug/Package/PackageTmp/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs
|
C#
|
gpl-2.0
| 260 |
#ifndef WSITileGraphicsItem_H
#define WSITileGraphicsItem_H
#include <QGraphicsItem>
#include <memory>
class TileManager;
class MultiResolutionImage;
class WSITileGraphicsItem : public QGraphicsItem {
public:
// make sure to set `item` to NULL in the constructor
WSITileGraphicsItem(QPixmap* item, unsigned int tileX, unsigned int tileY, unsigned int tileSize, unsigned int tileByteSize, unsigned int itemLevel, unsigned int lastRenderLevel, const std::vector<float>& imgDownsamples, TileManager* manager);
~WSITileGraphicsItem();
// you will need to add a destructor
// (and probably a copy constructor and assignment operator)
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
void debugPrint();
unsigned int getTileX() { return _tileX; }
unsigned int getTileY() { return _tileY; }
unsigned int getTileLevel() { return _itemLevel; }
unsigned int getTileSize() { return _tileSize; }
private:
// you'll probably want to store information about where you're
// going to load the pixmap from, too
QPixmap *_item;
float _physicalSize;
float _upperLOD;
float _lowerLOD;
unsigned int _itemLevel;
unsigned int _tileX;
unsigned int _tileY;
unsigned int _tileSize;
unsigned int _tileByteSize;
unsigned int _lastRenderLevel;
QRectF _boundingRect;
TileManager* _manager;
};
#endif
|
mcd8604/ASAP
|
workstation/WSITileGraphicsItem.h
|
C
|
gpl-2.0
| 1,461 |
/***************************************************************************
* Copyright (C) 2003 by Roberto Raggi *
* [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. *
* *
***************************************************************************/
#ifndef __cppsupport_events_h
#define __cppsupport_events_h
#include "kdevdeepcopy.h"
#include <qevent.h>
#include <qvaluelist.h>
#if QT_VERSION < 0x030100
#include <kdevmutex.h>
#else
#include <qmutex.h>
#endif
enum
{
Event_FileParsed = QEvent::User + 1000
};
class FileParsedEvent: public QCustomEvent
{
public:
FileParsedEvent( const QString& fileName, const QValueList<Problem>& problems, bool fromDisk = false )
: QCustomEvent( Event_FileParsed ), m_fileName( deepCopy( fileName ) ), m_fromDisk( fromDisk )
{
// the members are deep copies
QValueListConstIterator<Problem> it = problems.begin();
while ( it != problems.end() )
{
Problem p = *it;
m_problems.append( Problem( deepCopy( p.text() ), p.line(), p.column(), p.level() ) );
m_problems.back().setFileName( deepCopy( p.fileName() ) );
++it;
}
}
QString fileName() const
{
return m_fileName;
}
QValueList<Problem> problems() const
{
return m_problems;
}
bool fromDisk() {
return m_fromDisk;
}
private:
QString m_fileName;
QValueList<Problem> m_problems;
bool m_fromDisk;
private:
FileParsedEvent( const FileParsedEvent& source );
void operator = ( const FileParsedEvent& source );
};
#endif // __cppsupport_events_h
// kate: indent-mode csands; tab-width 4;
|
serghei/kde3-kdevelop
|
languages/cpp/cppsupport_events.h
|
C
|
gpl-2.0
| 2,051 |
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.geom.Path2D;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
/**
* Scaled Line Clipping rendering test
*/
public class ScaleClipTest {
static final boolean SAVE_IMAGE = false;
static final int SIZE = 50;
enum SCALE_MODE {
ORTHO,
NON_ORTHO,
COMPLEX
};
public static void main(String[] args) {
// First display which renderer is tested:
// JDK9 only:
System.setProperty("sun.java2d.renderer.verbose", "true");
System.out.println("Testing renderer: ");
// Other JDK:
String renderer = "undefined";
try {
renderer = sun.java2d.pipe.RenderingEngine.getInstance().getClass().getName();
System.out.println(renderer);
} catch (Throwable th) {
// may fail with JDK9 jigsaw (jake)
if (false) {
System.err.println("Unable to get RenderingEngine.getInstance()");
th.printStackTrace();
}
}
System.out.println("ScaleClipTest: size = " + SIZE);
final BufferedImage image = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_INT_ARGB);
boolean fail = false;
// testNegativeScale:
for (SCALE_MODE mode : SCALE_MODE.values()) {
try {
testNegativeScale(image, mode);
} catch (IllegalStateException ise) {
System.err.println("testNegativeScale[" + mode + "] failed:");
ise.printStackTrace();
fail = true;
}
}
// testMarginScale:
for (SCALE_MODE mode : SCALE_MODE.values()) {
try {
testMarginScale(image, mode);
} catch (IllegalStateException ise) {
System.err.println("testMarginScale[" + mode + "] failed:");
ise.printStackTrace();
fail = true;
}
}
// Fail at the end:
if (fail) {
throw new RuntimeException("ScaleClipTest has failures.");
}
}
private static void testNegativeScale(final BufferedImage image, final SCALE_MODE mode) {
final Graphics2D g2d = (Graphics2D) image.getGraphics();
try {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
g2d.setBackground(Color.WHITE);
g2d.clearRect(0, 0, SIZE, SIZE);
g2d.setColor(Color.BLACK);
// Bug in TransformingPathConsumer2D.adjustClipScale()
// non ortho scale only
final double scale = -1.0;
final AffineTransform at;
switch (mode) {
default:
case ORTHO:
at = AffineTransform.getScaleInstance(scale, scale);
break;
case NON_ORTHO:
at = AffineTransform.getScaleInstance(scale, scale + 1e-5);
break;
case COMPLEX:
at = AffineTransform.getScaleInstance(scale, scale);
at.concatenate(AffineTransform.getShearInstance(1e-4, 1e-4));
break;
}
g2d.setTransform(at);
// Set cap/join to reduce clip margin:
g2d.setStroke(new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
final Path2D p = new Path2D.Double();
p.moveTo(scale * 10, scale * 10);
p.lineTo(scale * (SIZE - 10), scale * (SIZE - 10));
g2d.draw(p);
if (SAVE_IMAGE) {
try {
final File file = new File("ScaleClipTest-testNegativeScale-" + mode + ".png");
System.out.println("Writing file: " + file.getAbsolutePath());
ImageIO.write(image, "PNG", file);
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
// Check image:
// 25, 25 = black
checkPixel(image.getData(), 25, 25, Color.BLACK.getRGB());
} finally {
g2d.dispose();
}
}
private static void testMarginScale(final BufferedImage image, final SCALE_MODE mode) {
final Graphics2D g2d = (Graphics2D) image.getGraphics();
try {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
g2d.setBackground(Color.WHITE);
g2d.clearRect(0, 0, SIZE, SIZE);
g2d.setColor(Color.BLACK);
// Bug in Stroker.init()
// ortho scale only: scale used twice !
final double scale = 1e-2;
final AffineTransform at;
switch (mode) {
default:
case ORTHO:
at = AffineTransform.getScaleInstance(scale, scale);
break;
case NON_ORTHO:
at = AffineTransform.getScaleInstance(scale, scale + 1e-5);
break;
case COMPLEX:
at = AffineTransform.getScaleInstance(scale, scale);
at.concatenate(AffineTransform.getShearInstance(1e-4, 1e-4));
break;
}
g2d.setTransform(at);
final double invScale = 1.0 / scale;
// Set cap/join to reduce clip margin:
final float w = (float) (3.0 * invScale);
g2d.setStroke(new BasicStroke(w, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
final Path2D p = new Path2D.Double();
p.moveTo(invScale * -0.5, invScale * 10);
p.lineTo(invScale * -0.5, invScale * (SIZE - 10));
g2d.draw(p);
if (SAVE_IMAGE) {
try {
final File file = new File("ScaleClipTest-testMarginScale-" + mode + ".png");
System.out.println("Writing file: " + file.getAbsolutePath());
ImageIO.write(image, "PNG", file);
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
// Check image:
// 0, 25 = black
checkPixel(image.getData(), 0, 25, Color.BLACK.getRGB());
} finally {
g2d.dispose();
}
}
private static void checkPixel(final Raster raster,
final int x, final int y,
final int expected) {
final int[] rgb = (int[]) raster.getDataElements(x, y, null);
if (rgb[0] != expected) {
throw new IllegalStateException("bad pixel at (" + x + ", " + y
+ ") = " + rgb[0] + " expected: " + expected);
}
}
}
|
JetBrains/jdk8u_jdk
|
test/sun/java2d/marlin/ScaleClipTest.java
|
Java
|
gpl-2.0
| 8,526 |
<!-- Creator : groff version 1.21 -->
<!-- CreationDate: Mon Dec 7 09:14:09 2015 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>NTFSDEBUG</title>
</head>
<body>
<h1 align="center">NTFSDEBUG</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#EXIT CODES">EXIT CODES</a><br>
<a href="#EXAMPLES">EXAMPLES</a><br>
<a href="#KNOWN ISSUES">KNOWN ISSUES</a><br>
<a href="#AVAILABILITY">AVAILABILITY</a><br>
<hr>
<h2>NAME
<a name="NAME"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">ntfsdebug
− Efficiently dump the metadata contents of an NTFS
volume.</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>ntfsdebug</b>
<i>device|image</i></p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><i><b>ntfsdebug</b></i>
will efficiently extract all relevant metadata from an NTFS
volume and dump it to standard output. It works at disk
sector level and copies only the used data. Unused disk
space becomes zero. <b>ntfsdebug</b> can be useful to exact
the metadata snapshot of an NTFS file system for developers
to investigate and troubleshoot users’ issues using
the clone without the risk of destroying the original file
system.</p>
<h2>EXIT CODES
<a name="EXIT CODES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">The exit code
is 0 on success, non−zero otherwise.</p>
<h2>EXAMPLES
<a name="EXAMPLES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Dump NTFS
metadata on /dev/sda1 to a compressed metadata image:</p>
<p style="margin-left:22%; margin-top: 1em"><b>ntfsdebug
/dev/sda1 | bzip2 > sda1.img.bz2</b></p>
<p style="margin-left:11%; margin-top: 1em">Dump NTFS
metadata to a remote host, using ssh. Please note that ssh
may ask for a password.</p>
<p style="margin-left:22%; margin-top: 1em"><b>ntfsdebug
/dev/sda1 | bzip2 | ssh host ’cat >
sda1.img.bzip2’</b></p>
<h2>KNOWN ISSUES
<a name="KNOWN ISSUES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">If you find a
problem then please send an email describing it to
[email protected].</p>
<h2>AVAILABILITY
<a name="AVAILABILITY"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>ntfsdebug</b>
is part of the <b>Tuxera NTFS</b> package.</p>
<hr>
</body>
</html>
|
artemh/asuswrt-merlin
|
release/src/router/tuxera/broadcom_arm_7114/ntfs/docs/html/ntfsdebug.html
|
HTML
|
gpl-2.0
| 2,939 |
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef EC_GOOGLE_WILCO_COMMANDS_H
#define EC_GOOGLE_WILCO_COMMANDS_H
#include <types.h>
enum {
/* Read and clear power state information */
KB_POWER_SMI = 0x04,
/* Read but do not clear power state information */
KB_POWER_STATUS = 0x05,
/* Inform the EC about the reason host is turning off */
KB_POWER_OFF = 0x08,
/* Control wireless radios */
KB_RADIO_CONTROL = 0x2b,
/* Save PS/2 data before S3 suspend */
KB_SAVE = 0x2f,
/* Restore PS/2 data after S3 resume */
KB_RESTORE = 0x30,
/* Manage the EC control of camera power */
KB_CAMERA = 0x33,
/* Retrieve information about the EC */
KB_EC_INFO = 0x38,
/* Set ACPI mode on or off */
KB_ACPI = 0x3a,
/* Board ID */
KB_BOARD_ID = 0x3d,
/* Change ACPI wake up source */
KB_ACPI_WAKEUP_CHANGE = 0x4a,
/* Manage the EC power button passthru to the host */
KB_POWER_BUTTON_TO_HOST = 0x3e,
/* Manage the EC control of speaker mute */
KB_HW_MUTE_CONTROL = 0x60,
/* Inform the EC that the host is about to enter S3 */
KB_SLP_EN = 0x64,
/* Inform the EC about BIOS boot progress */
KB_BIOS_PROGRESS = 0xc2,
/* Inform the EC that a fatal error occurred */
KB_ERR_CODE = 0x7b,
/* Set CPU ID */
KB_CPU_ID = 0xbf,
};
enum ec_ram_addr {
/* Indicate if EC uses signed firmware */
EC_RAM_SIGNED_FW = 0x5c,
/* Indicate support for S0ix */
EC_RAM_S0IX_SUPPORT = 0xb8,
};
enum set_acpi_mode_cmd {
ACPI_OFF = 0,
ACPI_ON
};
enum bios_progress_code {
BIOS_PROGRESS_BEFORE_MEMORY = 0x00,
BIOS_PROGRESS_MEMORY_INIT = 0x01,
BIOS_PROGRESS_VIDEO_INIT = 0x02,
BIOS_PROGRESS_LOGO_DISPLAYED = 0x03,
BIOS_PROGRESS_POST_COMPLETE = 0x04,
};
enum ec_audio_mute {
AUDIO_MUTE = 0, /* Mute speakers immediately */
AUDIO_UNMUTE_125MS, /* Unmute in 125ms */
};
enum ec_radio {
RADIO_WIFI = 0,
RADIO_WWAN,
RADIO_BT,
};
enum ec_radio_action {
RADIO_READ = 1,
RADIO_WRITE,
RADIO_TOGGLE,
};
enum ec_camera {
CAMERA_ON = 0,
CAMERA_OFF
};
enum ec_err_code {
DLED_MEMORY = 0x03,
DLED_PANEL = 0x10,
DLED_ROM = 0x19,
};
/**
* wilco_ec_radio_control() - Control wireless radios.
* @ec_radio: Wireless radio type.
* @state: Turn radio on or off.
* Return: 0 if successful or negative error code on failure.
*/
int wilco_ec_radio_control(enum ec_radio radio, uint8_t state);
/*
* EC Information
*/
enum get_ec_info_cmd {
GET_EC_LABEL = 0,
GET_EC_SVN_REV,
GET_EC_MODEL_NO,
GET_EC_BUILD_DATE
};
#define EC_INFO_MAX_SIZE 9
struct ec_response_get_ec_info {
char data[EC_INFO_MAX_SIZE]; /* ASCII NUL terminated string */
};
/**
* wilco_ec_get_info
*
* Read a specific information string from the EC and return it in
* the caller-provided buffer of at least EC_INFO_MAX_SIZE bytes.
*
* @cmd: Information to retrieve
* @info: Character array of EC_INFO_MAX_SIZE bytes
*
* Returns 0 if successful and resulting string is in 'info'
* Returns -1 if the EC command fails
*/
int wilco_ec_get_info(enum get_ec_info_cmd cmd, char *info);
/**
* wilco_ec_print_all_info
*
* Retrieve and print all the information strings from the EC:
*
* GET_EC_LABEL
* GET_EC_SVN_REV
* GET_EC_MODEL_NO
* GET_EC_BUILD_DATE
*/
void wilco_ec_print_all_info(void);
/*
* EC Power State
*/
enum ec_power_off_reason {
EC_PWROFF_FLASH = 0x11,
EC_PWROFF_AC_REMOVED = 0x12,
EC_PWROFF_BAT_REMOVED = 0x13,
EC_PWROFF_LOBAT = 0x15,
EC_PWROFF_PWRB_IN_POST = 0x16,
EC_PWROFF_FORCE_IMMEDIATE = 0x18,
EC_PWROFF_WDT = 0x1b,
EC_PWROFF_FORCE_THERMAL = 0x22,
EC_PWROFF_ERR_CODE = 0x23,
EC_PWROFF_PAID_PWRGD = 0x27,
EC_PWROFF_PAID_CPU = 0x28,
EC_PWROFF_PAID_GFX = 0x29,
EC_PWROFF_PAID_CLK = 0x2a,
EC_PWROFF_PAID_NOMEMORY = 0x2b,
EC_PWROFF_PAID_MEMORY_ERR = 0x2c,
EC_PWROFF_PAID_MEMORY_SPD = 0x2d,
EC_SWOFF_ACPI = 0x31,
EC_SWOFF_BOOT_PASSWORD = 0x33,
EC_SWOFF_DISK_PASSWORD = 0x34,
EC_SWOFF_POWER_CYCLE = 0x37,
EC_SWOFF_HARD_RESET = 0x3b,
EC_SWOFF_FSMI = 0x3f,
EC_PWRLOG_THERMTRIP = 0x41,
EC_PWRLOG_NO_S5 = 0x42,
EC_PWROFF_4S_PWRB = 0x44,
EC_PWROFF_ASF2_FORCEOFF = 0x45,
EC_PWROFF_PWRB_THERMAL = 0x48,
EC_PWROFF_AOAC_TIMER = 0x4b,
};
/**
* wilco_ec_power_off
*
* Tell the EC why the host is about to power off.
*/
void wilco_ec_power_off(enum ec_power_off_reason reason);
/**
* wilco_ec_slp_en
*
* Tell the EC that the host is entering a sleep state.
*/
void wilco_ec_slp_en(void);
enum ec_pm1_state {
EC_PM1_AC_AVAIL = BIT(0), /* AC available */
EC_PM1_BAT_AVAIL = BIT(1), /* Battery available */
EC_PM1_LO_BAT1 = BIT(2), /* Battery 1 low */
EC_PM1_LO_BAT2 = BIT(3), /* Battery 2 low */
EC_PM1_LID_OPEN = BIT(4), /* Lid is open */
EC_PM1_LCD_POWER = BIT(5), /* LCD is powered */
EC_PM1_OVER_TEMP = BIT(6), /* CPU is over temperature */
EC_PM1_DOCKED = BIT(7), /* System is docked */
};
enum ec_pm2_state {
EC_PM2_SYS_MB_PCIE = BIT(0), /* MB has PCIe */
EC_PM2_SYS_MB_SATA = BIT(1), /* MB has SATA */
EC_PM2_PWRB_PRESSED = BIT(2), /* Power button is pressed */
EC_PM2_TURBO_MODE = BIT(3), /* Turbo mode */
};
enum ec_pm3_state {
EC_PM3_BAT1_PRES = BIT(2), /* Battery 1 is present */
EC_PM3_BAT2_PRES = BIT(3), /* Battery 2 is present */
EC_PM3_LOWER_PSTATE = BIT(6), /* EC requests lower P-state */
EC_PM3_CPU_THROTTLE = BIT(7), /* EC requests CPU throttle */
};
enum ec_pm4_state {
EC_PM4_BAT1_CHG = BIT(0), /* Battery 1 is being charged */
EC_PM4_BAT2_CHG = BIT(1), /* Battery 2 is being charged */
EC_PM4_BAT1_PWR = BIT(2), /* Battery 1 is powering the system */
EC_PM4_BAT2_PWR = BIT(3), /* Battery 2 is powering the system */
EC_PM4_PANEL_STATE = BIT(5), /* Panel power state */
};
enum ec_pm5_state {
EC_PM5_INT_HD_SATA = BIT(7), /* Internal SATA HDD */
};
enum ec_pm6_state {
EC_PM6_WLAN_SWITCH = BIT(0), /* Wireless switch */
EC_PM6_SYS_MB_MODEM = BIT(1), /* MB has modem */
EC_PM6_ETH_STATE = BIT(2), /* Ethernet cable state */
EC_PM6_AC_UPDATE = BIT(3), /* Update AC information */
};
enum ec_pm1_event {
EC_EV1_PWRB_PRESSED = BIT(0), /* Power button was pressed */
EC_EV1_HOTKEY_PRESSED = BIT(1), /* Hotkey was pressed */
EC_EV1_STATE_CHANGED = BIT(2), /* PMx state changed */
};
enum ec_pm2_event {
EC_EV2_ACPI_MONSWITCH = BIT(0), /* Monitor switch status */
};
struct ec_pm_event_state {
uint8_t event[2]; /* ec_pm{1,2}_event */
uint8_t state[6]; /* ec_pm{1,2,3,4,5,6}_state */
uint8_t hotkey; /* Hotkey, if pressed */
uint16_t ac_type; /* AC adapter information */
};
/**
* wilco_ec_get_pm
*
* Retrieve power and event information from the EC.
*
* @pm: Power event state structure to fill out
* @clear: Clear EC event state after reading
*
* Returns 0 if EC command was successful
* Returns -1 if EC command failed
*/
int wilco_ec_get_pm(struct ec_pm_event_state *pm, bool clear);
/**
* wilco_ec_get_lid_state
*
* Retrieve the lid state without clearing it in the EC.
*
* Returns 1 if the lid is open, 0 if it is closed
* Returns -1 if the EC command failed
*/
int wilco_ec_get_lid_state(void);
/**
* wilco_ec_get_board_id
*
* Retrieve the board ID value from the EC.
* @id: Pointer to variable to store the ID read from the EC.
*
* Returns number of bytes transferred from the EC
* Returns -1 if the EC command failed
*/
int wilco_ec_get_board_id(uint8_t *id);
enum ec_wake_change {
WAKE_OFF = 0,
WAKE_ON
};
/**
* wilco_ec_change_wake_source
*
* Change acpi wake up source.
* @source: Wake up source that can be enabled/disabled.
* @ec_wake_change: On/off switch.
*
* Returns -1 if the EC command failed
*/
int wilco_ec_change_wake(uint8_t source, enum ec_wake_change change);
enum ec_acpi_wake_events {
EC_ACPI_WAKE_PWRB = BIT(0), /* Wake up by power button */
EC_ACPI_WAKE_LID = BIT(1), /* Wake up by lid switch */
EC_ACPI_WAKE_RTC = BIT(5), /* Wake up by RTC */
};
/**
* wilco_ec_signed_fw
*
* Indicate if the EC uses signed firmware.
*
* Returns 1 if EC uses signed firmware, otherwise returns 0
*/
int wilco_ec_signed_fw(void);
/**
* wilco_ec_save_post_code
*
* Save this post code as the most recent progress step. If the boot fails
* and calls die_notify() this post code will be used to send an error code
* to the EC indicating the failure.
*
* @post_code: Post code to save
*/
void wilco_ec_save_post_code(uint8_t post_code);
/**
* wilco_ec_set_cpuid
*
* Set CPU ID to EC.
*
* @cpuid: read CPU ID from cpu_eax(1)
* @cpu_cores: cores of CPU
* @gpu_cores: cores of GPU
*
* Returns 0 if EC command was successful
* Returns -1 if EC command failed
*/
int wilco_ec_set_cpuid(uint32_t cpuid, uint8_t cpu_cores, uint8_t gpu_cores);
#endif /* EC_GOOGLE_WILCO_COMMANDS_H */
|
coreboot/coreboot
|
src/ec/google/wilco/commands.h
|
C
|
gpl-2.0
| 8,557 |
# Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# 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
"""Standard input/out/err support.
API Stability: semi-stable
Future Plans: support for stderr, perhaps
Maintainer: U{Itamar Shtull-Trauring<mailto:[email protected]>}
"""
# system imports
import sys, os, select, errno
# Sibling Imports
import abstract, fdesc, protocol
from main import CONNECTION_LOST
_stdio_in_use = 0
class StandardIOWriter(abstract.FileDescriptor):
connected = 1
ic = 0
def __init__(self):
abstract.FileDescriptor.__init__(self)
self.fileno = sys.__stdout__.fileno
fdesc.setNonBlocking(self.fileno())
def writeSomeData(self, data):
try:
return os.write(self.fileno(), data)
return rv
except IOError, io:
if io.args[0] == errno.EAGAIN:
return 0
elif io.args[0] == errno.EPERM:
return 0
return CONNECTION_LOST
except OSError, ose:
if ose.errno == errno.EPIPE:
return CONNECTION_LOST
if ose.errno == errno.EAGAIN:
return 0
raise
def connectionLost(self, reason):
abstract.FileDescriptor.connectionLost(self, reason)
os.close(self.fileno())
class StandardIO(abstract.FileDescriptor):
"""I can connect Standard IO to a twisted.protocol
I act as a selectable for sys.stdin, and provide a write method that writes
to stdout.
"""
def __init__(self, protocol):
"""Create me with a protocol.
This will fail if a StandardIO has already been instantiated.
"""
abstract.FileDescriptor.__init__(self)
global _stdio_in_use
if _stdio_in_use:
raise RuntimeError, "Standard IO already in use."
_stdio_in_use = 1
self.fileno = sys.__stdin__.fileno
fdesc.setNonBlocking(self.fileno())
self.protocol = protocol
self.startReading()
self.writer = StandardIOWriter()
self.protocol.makeConnection(self)
def write(self, data):
"""Write some data to standard output.
"""
self.writer.write(data)
def doRead(self):
"""Some data's readable from standard input.
"""
return fdesc.readFromFD(self.fileno(), self.protocol.dataReceived)
def closeStdin(self):
"""Close standard input.
"""
self.writer.loseConnection()
def connectionLost(self, reason):
"""The connection was lost.
"""
self.protocol.connectionLost()
|
fxia22/ASM_xf
|
PythonD/site_python/twisted/internet/stdio.py
|
Python
|
gpl-2.0
| 3,287 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.