text
stringlengths 4
6.14k
|
|---|
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <glib-object.h>
#include "core/core-types.h"
#include "xcf-private.h"
#include "xcf-seek.h"
#include "gimp-intl.h"
gboolean
xcf_seek_pos (XcfInfo *info,
guint pos,
GError **error)
{
if (info->cp != pos)
{
info->cp = pos;
if (fseek (info->fp, info->cp, SEEK_SET) == -1)
{
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
_("Could not seek in XCF file: %s"),
g_strerror (errno));
return FALSE;
}
}
return TRUE;
}
gboolean
xcf_seek_end (XcfInfo *info,
GError **error)
{
if (fseek (info->fp, 0, SEEK_END) == -1)
{
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
_("Could not seek in XCF file: %s"),
g_strerror (errno));
return FALSE;
}
info->cp = ftell (info->fp);
if (fseek (info->fp, 0, SEEK_END) == -1)
{
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
_("Could not seek in XCF file: %s"),
g_strerror (errno));
return FALSE;
}
return TRUE;
}
|
/*
* This file is part of libbluray
* Copyright (C) 2013 Petri Hintukainen <phintuka@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "dirs.h"
#include "util/strutl.h"
#include "util/logging.h"
#include <stdlib.h>
#include <string.h>
/*
* Based on XDG Base Directory Specification
* http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
*/
#define USER_CFG_DIR ".config"
#define USER_CACHE_DIR ".cache"
#define USER_DATA_DIR ".local/share"
#define SYSTEM_CFG_DIR "/etc/xdg"
char *file_get_config_home(void)
{
const char *xdg_home = getenv("XDG_CONFIG_HOME");
if (xdg_home && *xdg_home) {
return str_dup(xdg_home);
}
const char *user_home = getenv("HOME");
if (user_home && *user_home) {
return str_printf("%s/%s", user_home, USER_CFG_DIR);
}
BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");
return NULL;
}
char *file_get_data_home(void)
{
const char *xdg_home = getenv("XDG_DATA_HOME");
if (xdg_home && *xdg_home) {
return str_dup(xdg_home);
}
const char *user_home = getenv("HOME");
if (user_home && *user_home) {
return str_printf("%s/%s", user_home, USER_DATA_DIR);
}
BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");
return NULL;
}
char *file_get_cache_home(void)
{
const char *xdg_cache = getenv("XDG_CACHE_HOME");
if (xdg_cache && *xdg_cache) {
return str_dup(xdg_cache);
}
const char *user_home = getenv("HOME");
if (user_home && *user_home) {
return str_printf("%s/%s", user_home, USER_CACHE_DIR);
}
BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");
return NULL;
}
const char *file_get_config_system(const char *dir)
{
static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0"
if (!dirs) {
const char *xdg_sys = getenv("XDG_CONFIG_DIRS");
if (xdg_sys && *xdg_sys) {
dirs = calloc(1, strlen(xdg_sys) + 2);
if (!dirs) {
return NULL;
}
strcpy(dirs, xdg_sys);
char *pt = dirs;
while (NULL != (pt = strchr(pt, ':'))) {
*pt++ = 0;
}
} else {
dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0);
}
}
if (!dir) {
// first call
dir = dirs;
} else {
// next call
dir += strlen(dir) + 1;
if (!*dir) {
// end of list
dir = NULL;
}
}
return dir;
}
|
/**************************************************************************//**
* @file efm32gg_burtc_ret.h
* @brief EFM32GG_BURTC_RET register and bit field definitions
* @version 4.2.1
******************************************************************************
* @section License
* <b>Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com</b>
******************************************************************************
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software.@n
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.@n
* 3. This notice may not be removed or altered from any source distribution.
*
* DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc.
* has no obligation to support this Software. Silicon Laboratories, Inc. is
* providing the Software "AS IS", with no express or implied warranties of any
* kind, including, but not limited to, any implied warranties of
* merchantability or fitness for any particular purpose or warranties against
* infringement of any proprietary rights of a third party.
*
* Silicon Laboratories, Inc. will not be liable for any consequential,
* incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software.
*
*****************************************************************************/
/**************************************************************************//**
* @addtogroup Parts
* @{
******************************************************************************/
/**************************************************************************//**
* @brief BURTC_RET EFM32GG BURTC RET
*****************************************************************************/
typedef struct
{
__IO uint32_t REG; /**< Retention Register */
} BURTC_RET_TypeDef;
/** @} End of group Parts */
|
/*
* Copyright (C) 2015 HAW Hamburg
* 2016 Freie Universität Berlin
* 2016 INRIA
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_atmega1281
* @{
*
* @file
* @brief CPU specific definitions for internal peripheral handling
*
* @author René Herthel <rene-herthel@outlook.de>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Francisco Acosta <francisco.acosta@inria.fr>
*/
#ifndef PERIPH_CPU_H
#define PERIPH_CPU_H
#ifdef __cplusplus
extern "C" {
#endif
#include "periph_cpu_common.h"
/**
* @brief Available ports on the ATmega1281 family
*/
enum {
PORT_A = 0, /**< port A */
PORT_B = 1, /**< port B */
PORT_C = 2, /**< port C */
PORT_D = 3, /**< port D */
PORT_E = 4, /**< port E */
PORT_F = 5, /**< port F */
PORT_G = 6, /**< port G */
};
/**
* @name Defines for the I2C interface
* @{
*/
#define I2C_PORT_REG PORTD
#define I2C_PIN_MASK (1 << PORTD0) | (1 << PORTD1)
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CPU_H */
/** @} */
|
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _WOWNT32_
#define _WOWNT32_
LPVOID WINAPI WOWGetVDMPointer(DWORD vp,DWORD dwBytes,WINBOOL fProtectedMode);
LPVOID WINAPI WOWGetVDMPointerFix(DWORD vp,DWORD dwBytes,WINBOOL fProtectedMode);
VOID WINAPI WOWGetVDMPointerUnfix(DWORD vp);
WORD WINAPI WOWGlobalAlloc16(WORD wFlags,DWORD cb);
WORD WINAPI WOWGlobalFree16(WORD hMem);
DWORD WINAPI WOWGlobalLock16(WORD hMem);
WINBOOL WINAPI WOWGlobalUnlock16(WORD hMem);
DWORD WINAPI WOWGlobalAllocLock16(WORD wFlags,DWORD cb,WORD *phMem);
WORD WINAPI WOWGlobalUnlockFree16(DWORD vpMem);
DWORD WINAPI WOWGlobalLockSize16(WORD hMem,PDWORD pcb);
VOID WINAPI WOWYield16(VOID);
VOID WINAPI WOWDirectedYield16(WORD htask16);
typedef enum _WOW_HANDLE_TYPE {
WOW_TYPE_HWND,WOW_TYPE_HMENU,WOW_TYPE_HDWP,WOW_TYPE_HDROP,WOW_TYPE_HDC,WOW_TYPE_HFONT,WOW_TYPE_HMETAFILE,WOW_TYPE_HRGN,WOW_TYPE_HBITMAP,
WOW_TYPE_HBRUSH,WOW_TYPE_HPALETTE,WOW_TYPE_HPEN,WOW_TYPE_HACCEL,WOW_TYPE_HTASK,WOW_TYPE_FULLHWND
} WOW_HANDLE_TYPE;
HANDLE WINAPI WOWHandle32 (WORD,WOW_HANDLE_TYPE);
WORD WINAPI WOWHandle16 (HANDLE,WOW_HANDLE_TYPE);
#define HWND_32(h16) ((HWND) (WOWHandle32(h16,WOW_TYPE_HWND)))
#define HMENU_32(h16) ((HMENU) (WOWHandle32(h16,WOW_TYPE_HMENU)))
#define HDWP_32(h16) ((HDWP) (WOWHandle32(h16,WOW_TYPE_HDWP)))
#define HDROP_32(h16) ((HDROP) (WOWHandle32(h16,WOW_TYPE_HDROP)))
#define HDC_32(h16) ((HDC) (WOWHandle32(h16,WOW_TYPE_HDC)))
#define HFONT_32(h16) ((HFONT) (WOWHandle32(h16,WOW_TYPE_HFONT)))
#define HMETAFILE_32(h16) ((HMETAFILE) (WOWHandle32(h16,WOW_TYPE_HMETAFILE)))
#define HRGN_32(h16) ((HRGN) (WOWHandle32(h16,WOW_TYPE_HRGN)))
#define HBITMAP_32(h16) ((HBITMAP) (WOWHandle32(h16,WOW_TYPE_HBITMAP)))
#define HBRUSH_32(h16) ((HBRUSH) (WOWHandle32(h16,WOW_TYPE_HBRUSH)))
#define HPALETTE_32(h16) ((HPALETTE) (WOWHandle32(h16,WOW_TYPE_HPALETTE)))
#define HPEN_32(h16) ((HPEN) (WOWHandle32(h16,WOW_TYPE_HPEN)))
#define HACCEL_32(h16) ((HACCEL) (WOWHandle32(h16,WOW_TYPE_HACCEL)))
#define HTASK_32(h16) ((DWORD) (WOWHandle32(h16,WOW_TYPE_HTASK)))
#define FULLHWND_32(h16) ((HWND) (WOWHandle32(h16,WOW_TYPE_FULLHWND)))
#define HWND_16(h32) (WOWHandle16(h32,WOW_TYPE_HWND))
#define HMENU_16(h32) (WOWHandle16(h32,WOW_TYPE_HMENU))
#define HDWP_16(h32) (WOWHandle16(h32,WOW_TYPE_HDWP))
#define HDROP_16(h32) (WOWHandle16(h32,WOW_TYPE_HDROP))
#define HDC_16(h32) (WOWHandle16(h32,WOW_TYPE_HDC))
#define HFONT_16(h32) (WOWHandle16(h32,WOW_TYPE_HFONT))
#define HMETAFILE_16(h32) (WOWHandle16(h32,WOW_TYPE_HMETAFILE))
#define HRGN_16(h32) (WOWHandle16(h32,WOW_TYPE_HRGN))
#define HBITMAP_16(h32) (WOWHandle16(h32,WOW_TYPE_HBITMAP))
#define HBRUSH_16(h32) (WOWHandle16(h32,WOW_TYPE_HBRUSH))
#define HPALETTE_16(h32) (WOWHandle16(h32,WOW_TYPE_HPALETTE))
#define HPEN_16(h32) (WOWHandle16(h32,WOW_TYPE_HPEN))
#define HACCEL_16(h32) (WOWHandle16(h32,WOW_TYPE_HACCEL))
#define HTASK_16(h32) (WOWHandle16(h32,WOW_TYPE_HTASK))
DWORD WINAPI WOWCallback16(DWORD vpfn16,DWORD dwParam);
#define WCB16_MAX_CBARGS (16)
#define WCB16_PASCAL (0x0)
#define WCB16_CDECL (0x1)
WINBOOL WINAPI WOWCallback16Ex(DWORD vpfn16,DWORD dwFlags,DWORD cbArgs,PVOID pArgs,PDWORD pdwRetCode);
#endif
|
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2001 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef TagNodeList_h
#define TagNodeList_h
#include "AtomicString.h"
#include "DynamicNodeList.h"
namespace WebCore {
// NodeList that limits to a particular tag.
class TagNodeList : public DynamicNodeList {
public:
static PassRefPtr<TagNodeList> create(PassRefPtr<Node> rootNode, const AtomicString& namespaceURI, const AtomicString& localName, DynamicNodeList::Caches* caches)
{
return adoptRef(new TagNodeList(rootNode, namespaceURI, localName, caches));
}
private:
TagNodeList(PassRefPtr<Node> rootNode, const AtomicString& namespaceURI, const AtomicString& localName, DynamicNodeList::Caches* caches);
virtual bool nodeMatches(Element*) const;
AtomicString m_namespaceURI;
AtomicString m_localName;
};
} // namespace WebCore
#endif // TagNodeList_h
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkImageInPlaceFilter.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkImageInPlaceFilter - Filter that operates in place.
// .SECTION Description
// vtkImageInPlaceFilter is a filter super class that
// operates directly on the input region. The data is copied
// if the requested region has different extent than the input region
// or some other object is referencing the input region.
#ifndef vtkImageInPlaceFilter_h
#define vtkImageInPlaceFilter_h
#include "vtkCommonExecutionModelModule.h" // For export macro
#include "vtkImageAlgorithm.h"
class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageInPlaceFilter : public vtkImageAlgorithm
{
public:
vtkTypeMacro(vtkImageInPlaceFilter,vtkImageAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkImageInPlaceFilter();
~vtkImageInPlaceFilter();
virtual int RequestData(vtkInformation *request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
void CopyData(vtkImageData *in, vtkImageData *out, int* outExt);
private:
vtkImageInPlaceFilter(const vtkImageInPlaceFilter&); // Not implemented.
void operator=(const vtkImageInPlaceFilter&); // Not implemented.
};
#endif
|
// Copyright 2010 Todd Ditchendorf
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import <Cocoa/Cocoa.h>
@class PKParseTree;
@interface PKParseTreeView : NSView
- (void)drawParseTree:(PKParseTree *)t;
@property (nonatomic, retain) PKParseTree *root;
@property (nonatomic, retain) NSDictionary *leafAttrs;
@property (nonatomic, retain) NSDictionary *parentAttrs;
@end
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_TEST_BASE_SCOPED_BUNDLE_SWIZZLER_MAC_H_
#define CHROME_TEST_BASE_SCOPED_BUNDLE_SWIZZLER_MAC_H_
#include <memory>
#include "base/macros.h"
namespace base {
namespace mac {
class ScopedObjCClassSwizzler;
} // namespace mac
} // namespace base
// Within a given scope, swizzles the implementation of +[NSBundle mainBundle]
// to return a partial mock of the original bundle. This partial mock has a
// custom bundle identifier.
// Since this class swizzles a class method, it doesn't make sense to have more
// than one instance of this class in existence at the same time.
// The primary purpose of this class is to stub out the behavior of NSBundle for
// AppKit, which makes assumptions about the functionality of +[NSBundle
// mainBundle]. Code in Chrome should not require the use of this method, since
// the NSBundle is always accessed through bundle_locations.h, and that NSBundle
// can be directly stubbed.
class ScopedBundleSwizzlerMac {
public:
ScopedBundleSwizzlerMac();
~ScopedBundleSwizzlerMac();
private:
std::unique_ptr<base::mac::ScopedObjCClassSwizzler> class_swizzler_;
DISALLOW_COPY_AND_ASSIGN(ScopedBundleSwizzlerMac);
};
#endif // CHROME_TEST_BASE_SCOPED_BUNDLE_SWIZZLER_MAC_H_
|
/* A Bison parser, made by GNU Bison 2.7. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2012 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
# define YY_YY_GLSLANG_TAB_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* "%code requires" blocks. */
#define YYLTYPE TSourceLoc
#define YYLTYPE_IS_DECLARED 1
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
INVARIANT = 258,
HIGH_PRECISION = 259,
MEDIUM_PRECISION = 260,
LOW_PRECISION = 261,
PRECISION = 262,
ATTRIBUTE = 263,
CONST_QUAL = 264,
BOOL_TYPE = 265,
FLOAT_TYPE = 266,
INT_TYPE = 267,
BREAK = 268,
CONTINUE = 269,
DO = 270,
ELSE = 271,
FOR = 272,
IF = 273,
DISCARD = 274,
RETURN = 275,
BVEC2 = 276,
BVEC3 = 277,
BVEC4 = 278,
IVEC2 = 279,
IVEC3 = 280,
IVEC4 = 281,
VEC2 = 282,
VEC3 = 283,
VEC4 = 284,
MATRIX2 = 285,
MATRIX3 = 286,
MATRIX4 = 287,
IN_QUAL = 288,
OUT_QUAL = 289,
INOUT_QUAL = 290,
UNIFORM = 291,
VARYING = 292,
STRUCT = 293,
VOID_TYPE = 294,
WHILE = 295,
SAMPLER2D = 296,
SAMPLERCUBE = 297,
SAMPLER_EXTERNAL_OES = 298,
SAMPLER2DRECT = 299,
IDENTIFIER = 300,
TYPE_NAME = 301,
FLOATCONSTANT = 302,
INTCONSTANT = 303,
BOOLCONSTANT = 304,
LEFT_OP = 305,
RIGHT_OP = 306,
INC_OP = 307,
DEC_OP = 308,
LE_OP = 309,
GE_OP = 310,
EQ_OP = 311,
NE_OP = 312,
AND_OP = 313,
OR_OP = 314,
XOR_OP = 315,
MUL_ASSIGN = 316,
DIV_ASSIGN = 317,
ADD_ASSIGN = 318,
MOD_ASSIGN = 319,
LEFT_ASSIGN = 320,
RIGHT_ASSIGN = 321,
AND_ASSIGN = 322,
XOR_ASSIGN = 323,
OR_ASSIGN = 324,
SUB_ASSIGN = 325,
LEFT_PAREN = 326,
RIGHT_PAREN = 327,
LEFT_BRACKET = 328,
RIGHT_BRACKET = 329,
LEFT_BRACE = 330,
RIGHT_BRACE = 331,
DOT = 332,
COMMA = 333,
COLON = 334,
EQUAL = 335,
SEMICOLON = 336,
BANG = 337,
DASH = 338,
TILDE = 339,
PLUS = 340,
STAR = 341,
SLASH = 342,
PERCENT = 343,
LEFT_ANGLE = 344,
RIGHT_ANGLE = 345,
VERTICAL_BAR = 346,
CARET = 347,
AMPERSAND = 348,
QUESTION = 349
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
struct {
union {
TString *string;
float f;
int i;
bool b;
};
TSymbol* symbol;
} lex;
struct {
TOperator op;
union {
TIntermNode* intermNode;
TIntermNodePair nodePair;
TIntermTyped* intermTypedNode;
TIntermAggregate* intermAggregate;
};
union {
TPublicType type;
TPrecision precision;
TQualifier qualifier;
TFunction* function;
TParameter param;
TField* field;
TFieldList* fieldList;
};
} interm;
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
} YYLTYPE;
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (TParseContext* context);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/ex3ndr/Develop/actor-platform/actor-apps/core/src/main/java/im/actor/model/entity/content/internal/LocalFastThumb.java
//
#ifndef _ImActorModelEntityContentInternalLocalFastThumb_H_
#define _ImActorModelEntityContentInternalLocalFastThumb_H_
#include "J2ObjC_header.h"
#include "im/actor/model/droidkit/bser/BserObject.h"
@class AMFastThumb;
@class BSBserValues;
@class BSBserWriter;
@class IOSByteArray;
@interface ImActorModelEntityContentInternalLocalFastThumb : BSBserObject
#pragma mark Public
- (instancetype)initWithByteArray:(IOSByteArray *)data;
- (instancetype)initWithAMFastThumb:(AMFastThumb *)fastThumb;
- (instancetype)initWithInt:(jint)w
withInt:(jint)h
withByteArray:(IOSByteArray *)image;
- (jint)getH;
- (IOSByteArray *)getImage;
- (jint)getW;
- (void)parseWithBSBserValues:(BSBserValues *)values;
- (void)serializeWithBSBserWriter:(BSBserWriter *)writer;
@end
J2OBJC_EMPTY_STATIC_INIT(ImActorModelEntityContentInternalLocalFastThumb)
FOUNDATION_EXPORT void ImActorModelEntityContentInternalLocalFastThumb_initWithAMFastThumb_(ImActorModelEntityContentInternalLocalFastThumb *self, AMFastThumb *fastThumb);
FOUNDATION_EXPORT ImActorModelEntityContentInternalLocalFastThumb *new_ImActorModelEntityContentInternalLocalFastThumb_initWithAMFastThumb_(AMFastThumb *fastThumb) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT void ImActorModelEntityContentInternalLocalFastThumb_initWithInt_withInt_withByteArray_(ImActorModelEntityContentInternalLocalFastThumb *self, jint w, jint h, IOSByteArray *image);
FOUNDATION_EXPORT ImActorModelEntityContentInternalLocalFastThumb *new_ImActorModelEntityContentInternalLocalFastThumb_initWithInt_withInt_withByteArray_(jint w, jint h, IOSByteArray *image) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT void ImActorModelEntityContentInternalLocalFastThumb_initWithByteArray_(ImActorModelEntityContentInternalLocalFastThumb *self, IOSByteArray *data);
FOUNDATION_EXPORT ImActorModelEntityContentInternalLocalFastThumb *new_ImActorModelEntityContentInternalLocalFastThumb_initWithByteArray_(IOSByteArray *data) NS_RETURNS_RETAINED;
J2OBJC_TYPE_LITERAL_HEADER(ImActorModelEntityContentInternalLocalFastThumb)
#endif // _ImActorModelEntityContentInternalLocalFastThumb_H_
|
/* arch/arm/mach-zynq/include/mach/slcr.h
*
* Copyright (C) 2012 Xilinx
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*/
#ifndef __MACH_SLCR_H__
#define __MACH_SLCR_H__
extern void xslcr_write(u32 offset, u32 val);
extern u32 xslcr_read(u32 offset);
extern void xslcr_system_reset(void);
extern void xslcr_init_preload_fpga(void);
extern void xslcr_init_postload_fpga(void);
#endif /* __MACH_SLCR_H__ */
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QRASTERWINDOW_H
#define QRASTERWINDOW_H
#include <QtGui/QPaintDeviceWindow>
QT_BEGIN_NAMESPACE
class QRasterWindowPrivate;
class Q_GUI_EXPORT QRasterWindow : public QPaintDeviceWindow
{
Q_OBJECT
Q_DECLARE_PRIVATE(QRasterWindow)
public:
explicit QRasterWindow(QWindow *parent = 0);
protected:
int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
QPaintDevice *redirected(QPoint *) const Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(QRasterWindow)
};
QT_END_NAMESPACE
#endif
|
/// @file AP_MotorsTailsitter.h
/// @brief Motor control class for tailsitters
#pragma once
#include <AP_Common/AP_Common.h>
#include <AP_Math/AP_Math.h>
#include <SRV_Channel/SRV_Channel.h>
#include "AP_MotorsMulticopter.h"
/// @class AP_MotorsTailsitter
class AP_MotorsTailsitter : public AP_MotorsMulticopter {
public:
/// Constructor
AP_MotorsTailsitter(uint16_t loop_rate, uint16_t speed_hz = AP_MOTORS_SPEED_DEFAULT);
// init
void init(motor_frame_class frame_class, motor_frame_type frame_type);
// set frame class (i.e. quad, hexa, heli) and type (i.e. x, plus)
void set_frame_class_and_type(motor_frame_class frame_class, motor_frame_type frame_type) {}
void set_update_rate( uint16_t speed_hz ) {}
void output_test(uint8_t motor_seq, int16_t pwm) {}
// output_to_motors - sends output to named servos
void output_to_motors();
// return 0 motor mask
uint16_t get_motor_mask() { return 0; }
protected:
// calculate motor outputs
void output_armed_stabilizing();
// calculated outputs
float _aileron; // -1..1
float _elevator; // -1..1
float _rudder; // -1..1
float _throttle; // 0..1
};
|
/** @file fsfat_test.h
*
* mbed Microcontroller Library
* Copyright (c) 2006-2016 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Header file for test support data structures and function API.
*/
#ifndef __FSFAT_TEST_H
#define __FSFAT_TEST_H
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Defines */
//#define FSFAT_INIT_1_TABLE_HEAD { "a", ""}
#define FSFAT_INIT_1_TABLE_MID_NODE { "/sd/01234567.txt", "abcdefghijklmnopqrstuvwxyz"}
//#define FSFAT_INIT_1_TABLE_TAIL { "/sd/fopentst/hello/world/animal/wobbly/dog/foot/backrght.txt", "present"}
#define FSFAT_TEST_RW_TABLE_SENTINEL 0xffffffff
#define FSFAT_TEST_BYTE_DATA_TABLE_SIZE 256
#define FSFAT_UTEST_MSG_BUF_SIZE 256
#define FSFAT_UTEST_DEFAULT_TIMEOUT_MS 10000
#define FSFAT_MBED_HOSTTEST_TIMEOUT 60
#define FSFAT_MAX_FILE_BASENAME 8
#define FSFAT_MAX_FILE_EXTNAME 3
#define FSFAT_BUF_MAX_LENGTH 64
#define FSFAT_FILENAME_MAX_LENGTH 255
/* support macro for make string for utest _MESSAGE macros, which dont support formatted output */
#define FSFAT_TEST_UTEST_MESSAGE(_buf, _max_len, _fmt, ...) \
do \
{ \
snprintf((_buf), (_max_len), (_fmt), __VA_ARGS__); \
}while(0);
/*
* Structures
*/
/* kv data for test */
typedef struct fsfat_kv_data_t {
const char *filename;
const char *value;
} fsfat_kv_data_t;
extern const uint8_t fsfat_test_byte_data_table[FSFAT_TEST_BYTE_DATA_TABLE_SIZE];
int32_t fsfat_test_create(const char *filename, const char *data, size_t len);
int32_t fsfat_test_delete(const char *key_name);
int32_t fsfat_test_filename_gen(char *name, const size_t len);
#ifdef __cplusplus
}
#endif
#endif /* __FSFAT_TEST_H */
|
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_BINARY_MESSENGER_H_
#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_BINARY_MESSENGER_H_
#include <cassert>
#include <functional>
#include <map>
#include <string>
#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
namespace flutter {
// A trivial BinaryMessenger implementation for use in tests.
class TestBinaryMessenger : public BinaryMessenger {
public:
using SendHandler = std::function<void(const std::string& channel,
const uint8_t* message,
size_t message_size,
BinaryReply reply)>;
// Creates a new messenge that forwards all calls to |send_handler|.
explicit TestBinaryMessenger(SendHandler send_handler = nullptr)
: send_handler_(std::move(send_handler)) {}
virtual ~TestBinaryMessenger() = default;
// Prevent copying.
TestBinaryMessenger(TestBinaryMessenger const&) = delete;
TestBinaryMessenger& operator=(TestBinaryMessenger const&) = delete;
// Simulates a message from the engine on the given channel.
//
// Returns false if no handler is registered on that channel.
bool SimulateEngineMessage(const std::string& channel,
const uint8_t* message,
size_t message_size,
BinaryReply reply) {
auto handler = registered_handlers_.find(channel);
if (handler == registered_handlers_.end()) {
return false;
}
(handler->second)(message, message_size, reply);
return true;
}
// |flutter::BinaryMessenger|
void Send(const std::string& channel,
const uint8_t* message,
size_t message_size,
BinaryReply reply) const override {
// If something under test sends a message, the test should be handling it.
assert(send_handler_);
send_handler_(channel, message, message_size, reply);
}
// |flutter::BinaryMessenger|
void SetMessageHandler(const std::string& channel,
BinaryMessageHandler handler) override {
if (handler) {
registered_handlers_[channel] = handler;
} else {
registered_handlers_.erase(channel);
}
}
private:
// Handler to call for SendMessage.
SendHandler send_handler_;
// Mapping of channel name to registered handlers.
std::map<std::string, BinaryMessageHandler> registered_handlers_;
};
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_BINARY_MESSENGER_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_TEST_TEST_WEB_VIEW_CONTENT_VIEW_H_
#define IOS_WEB_PUBLIC_TEST_TEST_WEB_VIEW_CONTENT_VIEW_H_
#import "ios/web/public/web_state/ui/crw_web_view_content_view.h"
// A test version of CRWWebViewContentView.
@interface TestWebViewContentView : CRWWebViewContentView
// Initializes the CRWTestWebContentView. Since |webView| and |scrollView| may
// be mock objects, they will not be added as subviews.
- (instancetype)initWithMockWebView:(id)webView scrollView:(id)scrollView;
// CRWTestWebViewContentViews should be initialized via |-initWithMockWebView:
// scrollView:|.
- (instancetype)initWithWebView:(UIView*)webView
scrollView:(UIScrollView*)scrollView NS_UNAVAILABLE;
@end
#endif // IOS_WEB_PUBLIC_TEST_TEST_WEB_VIEW_CONTENT_VIEW_H_
|
#ifdef HAVE_CONFIG_H
#include "../ext_config.h"
#endif
#include <php.h>
#include "../php_ext.h"
#include "../ext.h"
#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "kernel/main.h"
#include "kernel/operators.h"
#include "kernel/memory.h"
/**
* OO operations
*/
ZEPHIR_INIT_CLASS(Test_BranchPrediction) {
ZEPHIR_REGISTER_CLASS(Test, BranchPrediction, test, branchprediction, test_branchprediction_method_entry, 0);
return SUCCESS;
}
PHP_METHOD(Test_BranchPrediction, testLikely1) {
if (likely(1 == 1)) {
RETURN_BOOL(1);
} else {
RETURN_BOOL(0);
}
}
PHP_METHOD(Test_BranchPrediction, testLikely2) {
zval *a;
zephir_fetch_params(0, 1, 0, &a);
if (likely(ZEPHIR_IS_LONG_IDENTICAL(a, 1))) {
RETURN_BOOL(1);
} else {
RETURN_BOOL(0);
}
}
PHP_METHOD(Test_BranchPrediction, testUnlikely1) {
if (likely(1 == 1)) {
RETURN_BOOL(1);
} else {
RETURN_BOOL(0);
}
}
PHP_METHOD(Test_BranchPrediction, testUnlikely2) {
zval *a;
zephir_fetch_params(0, 1, 0, &a);
if (likely(ZEPHIR_IS_LONG_IDENTICAL(a, 1))) {
RETURN_BOOL(1);
} else {
RETURN_BOOL(0);
}
}
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#ifndef _ICorJitInfo
#define _ICorJitInfo
#include "runtimedetails.h"
#include "ieememorymanager.h"
#include "methodcallsummarizer.h"
class interceptor_ICJI : public ICorJitInfo
{
#include "icorjitinfoimpl.h"
public:
//Added to help us track the original icji and be able to easily indirect
//to it. And a simple way to keep one memory manager instance per instance.
ICorJitInfo *original_ICorJitInfo;
MethodCallSummarizer *mcs;
};
#endif
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __cplusplus
#error This header can only be compiled as C++.
#endif
#ifndef BITCOIN_PROTOCOL_H
#define BITCOIN_PROTOCOL_H
#include "netbase.h"
#include "serialize.h"
#include "uint256.h"
#include "version.h"
#include <stdint.h>
#include <string>
#define MESSAGE_START_SIZE 4
/** Message header.
* (4) message start.
* (12) command.
* (4) size.
* (4) checksum.
*/
class CMessageHeader
{
public:
CMessageHeader();
CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
std::string GetCommand() const;
bool IsValid() const;
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(nMessageSize);
READWRITE(nChecksum);
}
// TODO: make private (improves encapsulation)
public:
enum {
COMMAND_SIZE = 12,
MESSAGE_SIZE_SIZE = sizeof(int),
CHECKSUM_SIZE = sizeof(int),
MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE,
CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE,
HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum {
NODE_NETWORK = (1 << 0),
// NODE_BLOOM means the node is capable and willing to handle bloom-filtered connections.
// Bitcoin Core nodes used to support this by default, without advertising this bit,
// but no longer do as of protocol version 70011 (= NO_BLOOM_VERSION)
NODE_BLOOM = (1 << 2),
// NODE_BLOOM_WITHOUT_MN means the node has the same features as NODE_BLOOM with the only difference
// that the node doens't want to receive master nodes messages. (the 1<<3 was not picked as constant because on bitcoin 0.14 is witness and we want that update here )
NODE_BLOOM_WITHOUT_MN = (1 << 4),
// Bits 24-31 are reserved for temporary experiments. Just pick a bit that
// isn't getting used, or one not being used much, and notify the
// bitcoin-development mailing list. Remember that service bits are just
// unauthenticated advertisements, so your code must be robust against
// collisions and other cases where nodes may be advertising a service they
// do not actually support. Other service bits should be allocated via the
// BIP process.
};
/** A CService with information about it as peer */
class CAddress : public CService
{
public:
CAddress();
explicit CAddress(CService ipIn, uint64_t nServicesIn = NODE_NETWORK);
void Init();
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
if (ser_action.ForRead())
Init();
if (nType & SER_DISK)
READWRITE(nVersion);
if ((nType & SER_DISK) ||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
READWRITE(nTime);
READWRITE(nServices);
READWRITE(*(CService*)this);
}
// TODO: make private (improves encapsulation)
public:
uint64_t nServices;
// disk and network only
unsigned int nTime;
// memory only
int64_t nLastTry;
};
/** inv message data */
class CInv
{
public:
CInv();
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(type);
READWRITE(hash);
}
friend bool operator<(const CInv& a, const CInv& b);
bool IsKnownType() const;
bool IsMasterNodeType() const;
const char* GetCommand() const;
std::string ToString() const;
// TODO: make private (improves encapsulation)
public:
int type;
uint256 hash;
};
enum {
MSG_TX = 1,
MSG_BLOCK,
// Nodes may always request a MSG_FILTERED_BLOCK in a getdata, however,
// MSG_FILTERED_BLOCK should not appear in any invs except as a part of getdata.
MSG_FILTERED_BLOCK,
MSG_TXLOCK_REQUEST,
MSG_TXLOCK_VOTE,
MSG_SPORK,
MSG_MASTERNODE_WINNER,
MSG_MASTERNODE_SCANNING_ERROR,
MSG_BUDGET_VOTE,
MSG_BUDGET_PROPOSAL,
MSG_BUDGET_FINALIZED,
MSG_BUDGET_FINALIZED_VOTE,
MSG_MASTERNODE_QUORUM,
MSG_MASTERNODE_ANNOUNCE,
MSG_MASTERNODE_PING,
MSG_DSTX
};
#endif // BITCOIN_PROTOCOL_H
|
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 2001-2013 The R Core Team.
*
* 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, 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, a copy is available at
* http://www.r-project.org/Licenses/
*/
#include <R.h>
#include <Rinternals.h>
#include "methods.h"
SEXP R_get_slot(SEXP obj, SEXP name)
{
return R_do_slot(obj, name);
}
SEXP R_set_slot(SEXP obj, SEXP name, SEXP value)
{
return R_do_slot_assign(obj, name, value);
}
SEXP R_hasSlot(SEXP obj, SEXP name)
{
return ScalarLogical(R_has_slot(obj, name));
}
|
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2009, 2011, 2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, 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 General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
//
// ISO C++ 14882: 22.1 Locales
//
// Information as gleaned from /usr/include/ctype.h on NetBSD.
// Full details can be found from the CVS files at:
// anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h
// See www.netbsd.org for details of access.
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/// @brief Base class for ctype.
struct ctype_base
{
// Non-standard typedefs.
typedef const unsigned char* __to_type;
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned char mask;
#ifndef _CTYPE_U
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask xdigit = _N | _X;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask graph = _P | _U | _L | _N;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
#else
static const mask upper = _CTYPE_U;
static const mask lower = _CTYPE_L;
static const mask alpha = _CTYPE_U | _CTYPE_L;
static const mask digit = _CTYPE_N;
static const mask xdigit = _CTYPE_N | _CTYPE_X;
static const mask space = _CTYPE_S;
static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B;
static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N;
static const mask cntrl = _CTYPE_C;
static const mask punct = _CTYPE_P;
static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N;
#endif
};
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
|
/* gmp_vsscanf -- formatted input from a string.
Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
The GNU MP 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 General Public License
for more details.
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#include <stdarg.h>
#include <string.h>
#include "gmp-impl.h"
int
gmp_vsscanf (const char *s, const char *fmt, va_list ap)
{
#if SSCANF_WRITABLE_INPUT
/* We only actually need this if there's standard C types in fmt, and if
"s" is not already writable, but it's too much trouble to check that,
and in any case this writable sscanf input business is only for a few
old systems. */
size_t size;
char *alloc;
int ret;
size = strlen (s) + 1;
alloc = __GMP_ALLOCATE_FUNC_TYPE (size, char);
memcpy (alloc, s, size);
s = alloc;
ret = __gmp_doscan (&__gmp_sscanf_funs, (void *) &s, fmt, ap);
(*__gmp_free_func) (alloc, size);
return ret;
#else
return __gmp_doscan (&__gmp_sscanf_funs, (void *) &s, fmt, ap);
#endif
}
|
#pragma once
#include <QtCore/QString>
#include <utility>
namespace build_style
{
std::pair<bool, QString> RunCurrentStyleTests();
} // namespace build_style
|
/* VMS 64bit crt0 returning Unix style condition codes .
Copyright (C) 2001 Free Software Foundation, Inc.
Contributed by Douglas B. Rupp (rupp@gnat.com).
This file is part of GCC.
GCC 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, or (at your option)
any later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
GCC 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 GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#if !defined(__DECC)
You Lose! This file can only be compiled with DEC C.
#else
/* This file can only be compiled with DEC C, due to the call to
lib$establish and the pragmas pointer_size. */
#pragma __pointer_size short
#include <stdlib.h>
#include <string.h>
#include <ssdef.h>
#include <stsdef.h>
#include <errnodef.h>
extern void decc$main ();
extern int main ();
static int
handler (sigargs, mechargs)
void *sigargs;
void *mechargs;
{
return SS$_RESIGNAL;
}
int
__main (arg1, arg2, arg3, image_file_desc, arg5, arg6)
void *arg1, *arg2, *arg3;
void *image_file_desc;
void *arg5, *arg6)
{
int argc;
char **argv;
char **envp;
#pragma __pointer_size long
int i;
char **long_argv;
char **long_envp;
int status;
#pragma __pointer_size short
lib$establish (handler);
decc$main (arg1, arg2, arg3, image_file_desc,
arg5, arg6, &argc, &argv, &envp);
#pragma __pointer_size long
/* Reallocate argv with 64 bit pointers. */
long_argv = (char **) malloc (sizeof (char *) * (argc + 1));
for (i = 0; i < argc; i++)
long_argv[i] = strdup (argv[i]);
long_argv[argc] = (char *) 0;
long_envp = (char **) malloc (sizeof (char *) * 5);
for (i = 0; envp[i]; i++)
long_envp[i] = strdup (envp[i]);
long_envp[i] = (char *) 0;
#pragma __pointer_size short
status = main (argc, long_argv, long_envp);
/* Map into a range of 0 - 255. */
status = status & 255;
if (status > 0)
{
int save_status = status;
status = C$_EXIT1 + ((status - 1) << STS$V_MSG_NO);
/* An exit failure status requires a "severe" error. All status values
are defined in errno with a successful (1) severity but can be
changed to an error (2) severity by adding 1. In addition for
compatibility with UNIX exit() routines we inhibit a run-time error
message from being generated on exit(1). */
if (save_status == 1)
{
status++;
status |= STS$M_INHIB_MSG;
}
}
if (status == 0)
status = SS$_NORMAL;
return status;
}
#endif
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_
#define SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_
#include <stddef.h>
#include <stdint.h>
#include <string>
#include "sync/base/sync_export.h"
namespace sync_pb {
class UniquePosition;
}
namespace syncer {
// A class to represent positions.
//
// Valid UniquePosition objects have the following properties:
//
// - a < b and b < c implies a < c (transitivity);
// - exactly one of a < b, b < a and a = b holds (trichotomy);
// - if a < b, there is a UniquePosition such that a < x < b (density);
// - there are UniquePositions x and y such that x < a < y (unboundedness);
// - if a and b were constructed with different unique suffixes, then a != b.
//
// As long as all UniquePositions used to sort a list were created with unique
// suffixes, then if any item changes its position in the list, only its
// UniquePosition value has to change to represent the new order, and all other
// values can stay the same.
//
// Note that the unique suffixes must be exactly |kSuffixLength| bytes long.
//
// The cost for all these features is potentially unbounded space usage. In
// practice, however, most ordinals should be not much longer than the suffix.
//
// This class currently has several bookmarks-related assumptions built in,
// though it could be adapted to be more generally useful.
class SYNC_EXPORT UniquePosition {
public:
static const size_t kSuffixLength;
static const size_t kCompressBytesThreshold;
static bool IsValidSuffix(const std::string& suffix);
static bool IsValidBytes(const std::string& bytes);
// Returns a valid, but mostly random suffix.
// Avoid using this; it can lead to inconsistent sort orderings if misused.
static std::string RandomSuffix();
// Returns an invalid position.
static UniquePosition CreateInvalid();
// Converts from a 'sync_pb::UniquePosition' protobuf to a UniquePosition.
// This may return an invalid position if the parsing fails.
static UniquePosition FromProto(const sync_pb::UniquePosition& proto);
// Creates a position with the given suffix. Ordering among positions created
// from this function is the same as that of the integer parameters that were
// passed in.
static UniquePosition FromInt64(int64_t i, const std::string& suffix);
// Returns a valid position. Its ordering is not defined.
static UniquePosition InitialPosition(const std::string& suffix);
// Returns positions compare smaller than, greater than, or between the input
// positions.
static UniquePosition Before(const UniquePosition& x,
const std::string& suffix);
static UniquePosition After(const UniquePosition& x,
const std::string& suffix);
static UniquePosition Between(const UniquePosition& before,
const UniquePosition& after,
const std::string& suffix);
// This constructor creates an invalid value.
UniquePosition();
bool LessThan(const UniquePosition& other) const;
bool Equals(const UniquePosition& other) const;
// Serializes the position's internal state to a protobuf.
void ToProto(sync_pb::UniquePosition* proto) const;
// Serializes the protobuf representation of this object as a string.
void SerializeToString(std::string* blob) const;
// Returns a human-readable representation of this item's internal state.
std::string ToDebugString() const;
// Returns the suffix.
std::string GetSuffixForTest() const;
// Performs a lossy conversion to an int64_t position. Positions converted to
// and from int64_ts using this and the FromInt64 function should maintain
// their
// relative orderings unless the int64_t values conflict.
int64_t ToInt64() const;
bool IsValid() const;
private:
friend class UniquePositionTest;
// Returns a string X such that (X ++ |suffix|) < |str|.
// |str| must be a trailing substring of a valid ordinal.
// |suffix| must be a valid unique suffix.
static std::string FindSmallerWithSuffix(const std::string& str,
const std::string& suffix);
// Returns a string X such that (X ++ |suffix|) > |str|.
// |str| must be a trailing substring of a valid ordinal.
// |suffix| must be a valid unique suffix.
static std::string FindGreaterWithSuffix(const std::string& str,
const std::string& suffix);
// Returns a string X such that |before| < (X ++ |suffix|) < |after|.
// |before| and after must be a trailing substrings of valid ordinals.
// |suffix| must be a valid unique suffix.
static std::string FindBetweenWithSuffix(const std::string& before,
const std::string& after,
const std::string& suffix);
// Expects a run-length compressed string as input. For internal use only.
explicit UniquePosition(const std::string& internal_rep);
// Expects an uncompressed prefix and suffix as input. The |suffix| parameter
// must be a suffix of |uncompressed|. For internal use only.
UniquePosition(const std::string& uncompressed, const std::string& suffix);
// Implementation of an order-preserving run-length compression scheme.
static std::string Compress(const std::string& input);
static std::string CompressImpl(const std::string& input);
static std::string Uncompress(const std::string& compressed);
static bool IsValidCompressed(const std::string& str);
// The position value after it has been run through the custom compression
// algorithm. See Compress() and Uncompress() functions above.
std::string compressed_;
bool is_valid_;
};
} // namespace syncer
#endif // SYNC_INTERNAL_API_PUBLIC_BASE_UNIQUE_POSITION_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_
#define CHROME_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_
#include <Windows.h>
#include "base/files/file_path.h"
#include "base/process/process_handle.h"
#include "base/strings/string16.h"
// The name of the watcher DLL.
extern const base::FilePath::CharType kChromeWatcherDll[];
// The name of the watcher DLLs entrypoint function.
extern const char kChromeWatcherDLLEntrypoint[];
// The subdirectory of the browser data directory where permanently failed crash
// reports will be stored.
extern const base::FilePath::CharType kPermanentlyFailedReportsSubdir[];
// The type of the watcher DLL's main entry point.
// Watches |parent_process|, whose main thread ID is |main_thread_id|, and
// records its exit code under |registry_path| in HKCU. A window named
// |message_window_name|, owned by |parent_process|, will be monitored for
// responsiveness. If SyzyASAN is enabled, a Kasko reporter process is also
// instantiated, using |browser_data_directory| to store crash reports.
// |on_initialized_event| will be signaled once the watcher process is fully
// initialized. Takes ownership of |parent_process| and |on_initialized_event|.
// |channel_name| is the current Chrome distribution channel (one of
// installer::kChromeChannelXXX).
typedef int (*ChromeWatcherMainFunction)(
const base::char16* registry_path,
HANDLE parent_process,
DWORD main_thread_id,
HANDLE on_initialized_event,
const base::char16* browser_data_directory,
const base::char16* message_window_name,
const base::char16* channel_name);
// Returns an RPC endpoint name for the identified client process. This method
// may be invoked in both the client and the watcher process with the PID of the
// client process to establish communication between the two using a common
// endpoint name.
base::string16 GetKaskoEndpoint(base::ProcessId client_process_id);
#endif // CHROME_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_
|
/* $NoKeywords:$ */
/**
* @file
*
* AMD Family_10 RB microcode patches
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: CPU/Family/0x10
* @e \$Revision: 35136 $ @e \$Date: 2010-07-16 11:29:48 +0800 (Fri, 16 Jul 2010) $
*
*/
/*
*****************************************************************************
*
* Copyright (c) 2011, Advanced Micro Devices, 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:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Advanced Micro Devices, Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. 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.
*
* ***************************************************************************
*
*/
/*----------------------------------------------------------------------------------------
* M O D U L E S U S E D
*----------------------------------------------------------------------------------------
*/
#include "AGESA.h"
#include "cpuRegisters.h"
#include "cpuEarlyInit.h"
#include "cpuFamilyTranslation.h"
#include "Filecode.h"
CODE_GROUP (G1_PEICC)
RDATA_GROUP (G1_PEICC)
#define FILECODE PROC_CPU_FAMILY_0X10_REVC_RB_F10RBMICROCODEPATCHTABLES_FILECODE
/*----------------------------------------------------------------------------------------
* D E F I N I T I O N S A N D M A C R O S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* T Y P E D E F S A N D S T R U C T U R E S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* P R O T O T Y P E S O F L O C A L F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* E X P O R T E D F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
extern CONST MICROCODE_PATCHES ROMDATA *CpuF10RbMicroCodePatchArray[];
extern CONST UINT8 ROMDATA CpuF10RbNumberOfMicrocodePatches;
/*---------------------------------------------------------------------------------------*/
/**
* Returns a table containing the appropriate microcode patches.
*
* @CpuServiceMethod{::F_CPU_GET_FAMILY_SPECIFIC_ARRAY}.
*
* @param[in] FamilySpecificServices The current Family Specific Services.
* @param[out] RbUcodePtr Points to the first entry in the table.
* @param[out] NumberOfElements Number of valid entries in the table.
* @param[in] StdHeader Header for library and services.
*
*/
VOID
GetF10RbMicroCodePatchesStruct (
IN CPU_SPECIFIC_SERVICES *FamilySpecificServices,
OUT CONST VOID **RbUcodePtr,
OUT UINT8 *NumberOfElements,
IN AMD_CONFIG_PARAMS *StdHeader
)
{
*NumberOfElements = CpuF10RbNumberOfMicrocodePatches;
*RbUcodePtr = &CpuF10RbMicroCodePatchArray[0];
}
|
/* sexp.h
Parsing s-expressions.
Copyright (C) 2002 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
GNU Nettle 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 copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#ifndef NETTLE_SEXP_H_INCLUDED
#define NETTLE_SEXP_H_INCLUDED
#include <stdarg.h>
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define sexp_iterator_first nettle_sexp_iterator_first
#define sexp_transport_iterator_first nettle_sexp_transport_iterator_first
#define sexp_iterator_next nettle_sexp_iterator_next
#define sexp_iterator_enter_list nettle_sexp_iterator_enter_list
#define sexp_iterator_exit_list nettle_sexp_iterator_exit_list
#define sexp_iterator_subexpr nettle_sexp_iterator_subexpr
#define sexp_iterator_get_uint32 nettle_sexp_iterator_get_uint32
#define sexp_iterator_check_type nettle_sexp_iterator_check_type
#define sexp_iterator_check_types nettle_sexp_iterator_check_types
#define sexp_iterator_assoc nettle_sexp_iterator_assoc
#define sexp_format nettle_sexp_format
#define sexp_vformat nettle_sexp_vformat
#define sexp_transport_format nettle_sexp_transport_format
#define sexp_transport_vformat nettle_sexp_transport_vformat
#define sexp_token_chars nettle_sexp_token_chars
enum sexp_type
{ SEXP_ATOM, SEXP_LIST, SEXP_END };
struct sexp_iterator
{
size_t length;
const uint8_t *buffer;
/* Points at the start of the current sub expression. */
size_t start;
/* If type is SEXP_LIST, pos points at the start of the current
* element. Otherwise, it points at the end. */
size_t pos;
unsigned level;
enum sexp_type type;
size_t display_length;
const uint8_t *display;
size_t atom_length;
const uint8_t *atom;
};
/* All these functions return 1 on success, 0 on failure */
/* Initializes the iterator. */
int
sexp_iterator_first(struct sexp_iterator *iterator,
size_t length, const uint8_t *input);
/* NOTE: Decodes the input string in place */
int
sexp_transport_iterator_first(struct sexp_iterator *iterator,
size_t length, uint8_t *input);
int
sexp_iterator_next(struct sexp_iterator *iterator);
/* Current element must be a list. */
int
sexp_iterator_enter_list(struct sexp_iterator *iterator);
/* Skips the rest of the current list */
int
sexp_iterator_exit_list(struct sexp_iterator *iterator);
#if 0
/* Skips out of as many lists as necessary to get back to the given
* level. */
int
sexp_iterator_exit_lists(struct sexp_iterator *iterator,
unsigned level);
#endif
/* Gets start and length of the current subexpression. Implies
* sexp_iterator_next. */
const uint8_t *
sexp_iterator_subexpr(struct sexp_iterator *iterator,
size_t *length);
int
sexp_iterator_get_uint32(struct sexp_iterator *iterator,
uint32_t *x);
/* Checks the type of the current expression, which should be a list
*
* (<type> ...)
*/
int
sexp_iterator_check_type(struct sexp_iterator *iterator,
const uint8_t *type);
const uint8_t *
sexp_iterator_check_types(struct sexp_iterator *iterator,
unsigned ntypes,
const uint8_t * const *types);
/* Current element must be a list. Looks up element of type
*
* (key rest...)
*
* For a matching key, the corresponding iterator is initialized
* pointing at the start of REST.
*
* On success, exits the current list.
*/
int
sexp_iterator_assoc(struct sexp_iterator *iterator,
unsigned nkeys,
const uint8_t * const *keys,
struct sexp_iterator *values);
/* Output functions. What is a reasonable API for this? It seems
* ugly to have to reimplement string streams. */
/* Declared for real in buffer.h */
struct nettle_buffer;
/* Returns the number of output characters, or 0 on out of memory. If
* buffer == NULL, just compute length.
*
* Format strings can contained matched parentheses, tokens ("foo" in
* the format string is formatted as "3:foo"), whitespace (which
* separates tokens but is otherwise ignored) and the following
* formatting specifiers:
*
* %s String represented as size_t length, const uint8_t *data.
*
* %t Optional display type, represented as
* size_t display_length, const uint8_t *display,
* display == NULL means no display type.
*
* %i Non-negative small integer, uint32_t.
*
* %b Non-negative bignum, mpz_t.
*
* %l Literal string (no length added), typically a balanced
* subexpression. Represented as size_t length, const uint8_t
* *data.
*
* %(, %) Allows insertion of unbalanced parenthesis.
*
* Modifiers:
*
* %0 For %s, %t and %l, says that there's no length argument,
* instead the string is NUL-terminated, and there's only one
* const uint8_t * argument.
*/
size_t
sexp_format(struct nettle_buffer *buffer,
const char *format, ...);
size_t
sexp_vformat(struct nettle_buffer *buffer,
const char *format, va_list args);
size_t
sexp_transport_format(struct nettle_buffer *buffer,
const char *format, ...);
size_t
sexp_transport_vformat(struct nettle_buffer *buffer,
const char *format, va_list args);
/* Classification for advanced syntax. */
extern const char
sexp_token_chars[0x80];
#define TOKEN_CHAR(c) ((c) < 0x80 && sexp_token_chars[(c)])
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_SEXP_H_INCLUDED */
|
/**
* Copyright (C) <2011> <Syracuse System Security (Sycure) Lab>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
* ModuleInfo.h
*
* Created on: Sep 14, 2011
* Author: lok
*/
#ifndef MODULEINFO_H_
#define MODULEINFO_H_
#include <string>
#include <inttypes.h>
#include "DS_utils/SymbolMap.h"
class ModuleInfo : public SymbolMap
{
public:
ModuleInfo(const std::string& name) : SymbolMap() { moduleName = name; }
const std::string& getName() { return moduleName; }
int getSymbol(std::string& str, uint32_t address)
{
std::string s;
int ret = SymbolMap::getSymbol(s, address);
if (ret == 0)
{
str = moduleName;
str.append(":");
str.append(s);
}
return (ret);
}
int getNearestSymbol(std::string& str, uint32_t address)
{
std::string s;
int ret = SymbolMap::getNearestSymbol(s, address);
if (ret == 0)
{
str = moduleName;
str.append(":");
str.append(s);
}
return (ret);
}
protected:
std::string moduleName;
};
#endif /* MODULEINFO_H_ */
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QEMULATIONPAINTENGINE_P_H
#define QEMULATIONPAINTENGINE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <private/qpaintengineex_p.h>
QT_BEGIN_NAMESPACE
class QEmulationPaintEngine : public QPaintEngineEx
{
public:
QEmulationPaintEngine(QPaintEngineEx *engine);
virtual bool begin(QPaintDevice *pdev);
virtual bool end();
virtual Type type() const;
virtual QPainterState *createState(QPainterState *orig) const;
virtual void fill(const QVectorPath &path, const QBrush &brush);
virtual void stroke(const QVectorPath &path, const QPen &pen);
virtual void clip(const QVectorPath &path, Qt::ClipOperation op);
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
virtual void drawStaticTextItem(QStaticTextItem *item);
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags);
virtual void clipEnabledChanged();
virtual void penChanged();
virtual void brushChanged();
virtual void brushOriginChanged();
virtual void opacityChanged();
virtual void compositionModeChanged();
virtual void renderHintsChanged();
virtual void transformChanged();
virtual void setState(QPainterState *s);
virtual void beginNativePainting();
virtual void endNativePainting();
virtual uint flags() const {return QPaintEngineEx::IsEmulationEngine | QPaintEngineEx::DoNotEmulate;}
inline QPainterState *state() { return (QPainterState *)QPaintEngine::state; }
inline const QPainterState *state() const { return (const QPainterState *)QPaintEngine::state; }
QPaintEngineEx *real_engine;
private:
void fillBGRect(const QRectF &r);
};
QT_END_NAMESPACE
#endif
|
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../lcms2-2.6/src/cmssm.c"
|
/***************************************************************************
* Copyright (c) 2008 Jürgen Riegel <juergen.riegel@web.de> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef START_PRECOMPILED_H
#define START_PRECOMPILED_H
#include <FCConfig.h>
// Exporting of App classes
#ifdef FC_OS_WIN32
# define AppStartExport __declspec(dllexport)
# define PartExport __declspec(dllimport)
# define MeshExport __declspec(dllimport)
#else // for Linux
# define AppStartExport
# define PartExport
# define MeshExport
#endif
#ifdef _PreComp_
// standard
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <Python.h>
#endif // _PreComp_
#endif
|
/* PR rtl-optimization/28243 */
/* Reported by Mike Frysinger <vapier@gentoo.org> */
/* { dg-do compile } */
/* { dg-options "-O2 -ftracer -fPIC" } */
struct displayfuncs {
void (*init) ();
} funcs;
struct gpsdisplay {
struct displayfuncs *funcs;
};
static void PSMyArc(double cx, double cy, double radx, double rady, double sa,
double ta)
{
double ea;
double temp;
ea = sa + ta;
while (sa < ea) {
temp = ((sa + 90) / 90) * 90;
PSDoArc(cx, sa, ea < temp ? ea : temp);
sa = temp;
}
}
static void PSDrawElipse()
{
float cx;
float cy;
float radx;
float rady;
if (radx != rady)
PSMyArc(cx, cy, radx, rady, 0, 360);
}
static void PSDrawFillCircle()
{
PSDrawElipse();
}
static struct displayfuncs psfuncs[] = {
PSDrawFillCircle
};
void _GPSDraw_CreateDisplay()
{
struct gpsdisplay *gdisp;
gdisp->funcs = (void *)&psfuncs;
}
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file sgi.h
*/
#ifndef SGI_IMAGE_H
#define SGI_IMAGE_H
typedef struct {
short magic;
char storage;
char bpc; /* pixel size: 1 = bytes, 2 = shorts */
unsigned short dimension; /* 1 = single row, 2 = B/W, 3 = RGB */
unsigned short xsize, /* width in pixels */
ysize, /* height in pixels */
zsize; /* # of channels; B/W=1, RGB=3, RGBA=4 */
long pixmin, pixmax; /* min/max pixel values */
char dummy1[4];
char name[80];
long colormap;
char dummy2[404];
} Header;
#define HeaderSize 512
#define SGI_MAGIC (short)474
#define STORAGE_VERBATIM 0
#define STORAGE_RLE 1
#define CMAP_NORMAL 0
#define CMAP_DITHERED 1 /* not supported */
#define CMAP_SCREEN 2 /* not supported */
#define CMAP_COLORMAP 3 /* not supported */
#endif
|
#include <asm/io.h>
#include <linux/string.h>
#include "smi_reg.h"
#include "mt_smi.h"
#include "smi_common.h"
#include "smi_configuration.h"
#include "smi_config_util.h"
int smi_bus_regs_setting(int profile, struct SMI_SETTING *settings)
{
int i = 0;
int j = 0;
if (!settings || profile < 0 || profile >= SMI_BWC_SCEN_CNT)
return -1;
if (settings->smi_common_reg_num == 0)
return -1;
/* set regs of common */
SMIMSG("Current Scen:%d", profile);
for (i = 0 ; i < settings->smi_common_reg_num ; ++i) {
M4U_WriteReg32(SMI_COMMON_EXT_BASE,
settings->smi_common_setting_vals[i].offset,
settings->smi_common_setting_vals[i].value);
}
/* set regs of larbs */
for (i = 0 ; i < SMI_LARB_NR ; ++i)
for (j = 0 ; j < settings->smi_larb_reg_num[i] ; ++j) {
M4U_WriteReg32(gLarbBaseAddr[i],
settings->smi_larb_setting_vals[i][j].offset,
settings->smi_larb_setting_vals[i][j].value);
}
return 0;
}
void save_default_common_val(int *is_default_value_saved, unsigned int *default_val_smi_array)
{
if (!*is_default_value_saved) {
int i = 0;
SMIMSG("Save default config:\n");
for (i = 0 ; i < SMI_LARB_NR ; ++i)
default_val_smi_array[i] = M4U_ReadReg32(SMI_COMMON_EXT_BASE, smi_common_l1arb_offset[i]);
*is_default_value_saved = 1;
}
}
|
/***************************************************************************
qgsslopefilter.h - description
--------------------------------
begin : August 7th, 2009
copyright : (C) 2009 by Marco Hugentobler
email : marco dot hugentobler at karto dot baug dot ethz 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. *
* *
***************************************************************************/
#ifndef QGSSLOPEFILTER_H
#define QGSSLOPEFILTER_H
#include "qgsderivativefilter.h"
/** Calculates slope values in a window of 3x3 cells based on first order derivatives in x- and y- directions*/
class ANALYSIS_EXPORT QgsSlopeFilter: public QgsDerivativeFilter
{
public:
QgsSlopeFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat );
~QgsSlopeFilter();
/** Calculates output value from nine input values. The input values and the output value can be equal to the
nodata value if not present or outside of the border. Must be implemented by subclasses*/
float processNineCellWindow( float* x11, float* x21, float* x31,
float* x12, float* x22, float* x32,
float* x13, float* x23, float* x33 ) override;
};
#endif // QGSSLOPEFILTER_H
|
/*
PIM for Quagga
Copyright (C) 2008 Everton da Silva Marques
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; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
$QuaggaId: $Format:%an, %ai, %h$ $
*/
#include <zebra.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "log.h"
#include "pim_str.h"
void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_size)
{
int save_errno = errno;
if (!inet_ntop(AF_INET, &addr, buf, buf_size)) {
int e = errno;
zlog_warn("pim_inet4_dump: inet_ntop(AF_INET,buf_size=%d): errno=%d: %s",
buf_size, e, safe_strerror(e));
if (onfail)
snprintf(buf, buf_size, "%s", onfail);
}
errno = save_errno;
}
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "platform/linux/RBP.h"
#include "EGL/egl.h"
#include <bcm_host.h>
#include "windowing/Resolution.h"
class DllBcmHost;
class CRPIUtils
{
public:
CRPIUtils();
virtual ~CRPIUtils();
virtual void DestroyDispmanxWindow();
virtual void SetVisible(bool enable);
virtual bool GetNativeResolution(RESOLUTION_INFO *res) const;
virtual bool SetNativeResolution(const RESOLUTION_INFO res, EGLSurface m_nativeWindow);
virtual bool ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions);
private:
DllBcmHost *m_DllBcmHost;
DISPMANX_ELEMENT_HANDLE_T m_dispman_display;
DISPMANX_ELEMENT_HANDLE_T m_dispman_element;
TV_GET_STATE_RESP_T m_tv_state;
sem_t m_tv_synced;
RESOLUTION_INFO m_desktopRes;
int m_width;
int m_height;
int m_screen_width;
int m_screen_height;
bool m_shown;
int m_initDesktopRes;
void GetSupportedModes(HDMI_RES_GROUP_T group, std::vector<RESOLUTION_INFO> &resolutions);
void TvServiceCallback(uint32_t reason, uint32_t param1, uint32_t param2);
static void CallbackTvServiceCallback(void *userdata, uint32_t reason, uint32_t param1, uint32_t param2);
int FindMatchingResolution(const RESOLUTION_INFO &res, const std::vector<RESOLUTION_INFO> &resolutions, bool desktop);
int AddUniqueResolution(RESOLUTION_INFO &res, std::vector<RESOLUTION_INFO> &resolutions, bool desktop = false);
};
|
/* Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <stdlib.h>
int
__nrand48_r (xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
long int *result;
{
/* Compute next state. */
if (__drand48_iterate (xsubi, buffer) < 0)
return -1;
/* Store the result. */
if (sizeof (unsigned short int) == 2)
*result = xsubi[2] << 15 | xsubi[1] >> 1;
else
*result = xsubi[2] >> 1;
return 0;
}
weak_alias (__nrand48_r, nrand48_r)
|
/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow <djbarrow@de.ibm.com>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _FENV_H
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
#endif
/* Define bits representing the exception. We use the bit positions
of the appropriate bits in the FPU control word. */
enum
{
FE_INVALID =
#define FE_INVALID 0x80
FE_INVALID,
FE_DIVBYZERO =
#define FE_DIVBYZERO 0x40
FE_DIVBYZERO,
FE_OVERFLOW =
#define FE_OVERFLOW 0x20
FE_OVERFLOW,
FE_UNDERFLOW =
#define FE_UNDERFLOW 0x10
FE_UNDERFLOW,
FE_INEXACT =
#define FE_INEXACT 0x08
FE_INEXACT
};
/* We dont use the y bit of the DXC in the floating point control register
as glibc has no FE encoding for fe inexact incremented
or fe inexact truncated.
We currently use the flag bits in the fpc
as these are sticky for feholdenv & feupdatenv as it is defined
in the HP Manpages. */
#define FE_ALL_EXCEPT \
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
enum
{
FE_TONEAREST =
#define FE_TONEAREST 0
FE_TONEAREST,
FE_DOWNWARD =
#define FE_DOWNWARD 0x3
FE_DOWNWARD,
FE_UPWARD =
#define FE_UPWARD 0x2
FE_UPWARD,
FE_TOWARDZERO =
#define FE_TOWARDZERO 0x1
FE_TOWARDZERO
};
/* Type representing exception flags. */
typedef unsigned int fexcept_t; /* size of fpc */
/* Type representing floating-point environment. This function corresponds
to the layout of the block written by the `fstenv'. */
typedef struct
{
fexcept_t __fpc;
void *__ieee_instruction_pointer;
/* failing instruction for ieee exceptions */
} fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1)
#ifdef __USE_GNU
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
|
/* Measure memccpy functions.
Copyright (C) 2013-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#define TEST_MAIN
#define TEST_NAME "memccpy"
#include "bench-string.h"
void *simple_memccpy (void *, const void *, int, size_t);
void *stupid_memccpy (void *, const void *, int, size_t);
IMPL (stupid_memccpy, 0)
IMPL (simple_memccpy, 0)
IMPL (memccpy, 1)
void *
simple_memccpy (void *dst, const void *src, int c, size_t n)
{
const char *s = src;
char *d = dst;
while (n-- > 0)
if ((*d++ = *s++) == (char) c)
return d;
return NULL;
}
void *
stupid_memccpy (void *dst, const void *src, int c, size_t n)
{
void *p = memchr (src, c, n);
if (p != NULL)
return mempcpy (dst, src, p - src + 1);
memcpy (dst, src, n);
return NULL;
}
typedef void *(*proto_t) (void *, const void *, int c, size_t);
static void
do_one_test (impl_t *impl, void *dst, const void *src, int c, size_t len,
size_t n)
{
void *expect = len > n ? NULL : (char *) dst + len;
size_t i, iters = INNER_LOOP_ITERS;
timing_t start, stop, cur;
if (CALL (impl, dst, src, c, n) != expect)
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
CALL (impl, dst, src, c, n), expect);
ret = 1;
return;
}
if (memcmp (dst, src, len > n ? n : len) != 0)
{
error (0, 0, "Wrong result in function %s", impl->name);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
{
CALL (impl, dst, src, c, n);
}
TIMING_NOW (stop);
TIMING_DIFF (cur, start, stop);
TIMING_PRINT_MEAN ((double) cur, (double) iters);
}
static void
do_test (size_t align1, size_t align2, int c, size_t len, size_t n,
int max_char)
{
size_t i;
char *s1, *s2;
align1 &= 7;
if (align1 + len >= page_size)
return;
align2 &= 7;
if (align2 + len >= page_size)
return;
s1 = (char *) (buf1 + align1);
s2 = (char *) (buf2 + align2);
for (i = 0; i < len - 1; ++i)
{
s1[i] = 32 + 23 * i % (max_char - 32);
if (s1[i] == (char) c)
--s1[i];
}
s1[len - 1] = c;
for (i = len; i + align1 < page_size && i < len + 64; ++i)
s1[i] = 32 + 32 * i % (max_char - 32);
printf ("Length %4zd, n %4zd, char %d, alignment %2zd/%2zd:", len, n, c, align1, align2);
FOR_EACH_IMPL (impl, 0)
do_one_test (impl, s2, s1, c, len, n);
putchar ('\n');
}
int
test_main (void)
{
size_t i;
test_init ();
printf ("%28s", "");
FOR_EACH_IMPL (impl, 0)
printf ("\t%s", impl->name);
putchar ('\n');
for (i = 1; i < 8; ++i)
{
do_test (i, i, 12, 16, 16, 127);
do_test (i, i, 23, 16, 16, 255);
do_test (i, 2 * i, 28, 16, 16, 127);
do_test (2 * i, i, 31, 16, 16, 255);
do_test (8 - i, 2 * i, 1, 1 << i, 2 << i, 127);
do_test (2 * i, 8 - i, 17, 2 << i, 1 << i, 127);
do_test (8 - i, 2 * i, 0, 1 << i, 2 << i, 255);
do_test (2 * i, 8 - i, i, 2 << i, 1 << i, 255);
}
for (i = 1; i < 8; ++i)
{
do_test (0, 0, i, 4 << i, 8 << i, 127);
do_test (0, 0, i, 16 << i, 8 << i, 127);
do_test (8 - i, 2 * i, i, 4 << i, 8 << i, 127);
do_test (8 - i, 2 * i, i, 16 << i, 8 << i, 127);
}
return ret;
}
#include "../test-skeleton.c"
|
/**
* \file sha256.h
*
* \brief SHA-224 and SHA-256 cryptographic hash function
*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
*/
#ifndef MBEDTLS_SHA256_H
#define MBEDTLS_SHA256_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
#include <stdint.h>
#if !defined(MBEDTLS_SHA256_ALT)
/* Regular implementation */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-256 context structure
*/
typedef struct
{
uint32_t total[2]; /*!< number of bytes processed */
uint32_t state[8]; /*!< intermediate digest state */
unsigned char buffer[64]; /*!< data block being processed */
int is224; /*!< 0 => SHA-256, else SHA-224 */
}
mbedtls_sha256_context;
/**
* \brief Initialize SHA-256 context
*
* \param ctx SHA-256 context to be initialized
*/
void mbedtls_sha256_init( mbedtls_sha256_context *ctx );
/**
* \brief Clear SHA-256 context
*
* \param ctx SHA-256 context to be cleared
*/
void mbedtls_sha256_free( mbedtls_sha256_context *ctx );
/**
* \brief Clone (the state of) a SHA-256 context
*
* \param dst The destination context
* \param src The context to be cloned
*/
void mbedtls_sha256_clone( mbedtls_sha256_context *dst,
const mbedtls_sha256_context *src );
/**
* \brief SHA-256 context setup
*
* \param ctx context to be initialized
* \param is224 0 = use SHA256, 1 = use SHA224
*/
void mbedtls_sha256_starts( mbedtls_sha256_context *ctx, int is224 );
/**
* \brief SHA-256 process buffer
*
* \param ctx SHA-256 context
* \param input buffer holding the data
* \param ilen length of the input data
*/
void mbedtls_sha256_update( mbedtls_sha256_context *ctx, const unsigned char *input,
size_t ilen );
/**
* \brief SHA-256 final digest
*
* \param ctx SHA-256 context
* \param output SHA-224/256 checksum result
*/
void mbedtls_sha256_finish( mbedtls_sha256_context *ctx, unsigned char output[32] );
/* Internal use */
void mbedtls_sha256_process( mbedtls_sha256_context *ctx, const unsigned char data[64] );
#ifdef __cplusplus
}
#endif
#else /* MBEDTLS_SHA256_ALT */
#include "sha256_alt.h"
#endif /* MBEDTLS_SHA256_ALT */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Output = SHA-256( input buffer )
*
* \param input buffer holding the data
* \param ilen length of the input data
* \param output SHA-224/256 checksum result
* \param is224 0 = use SHA256, 1 = use SHA224
*/
void mbedtls_sha256( const unsigned char *input, size_t ilen,
unsigned char output[32], int is224 );
/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*/
int mbedtls_sha256_self_test( int verbose );
#ifdef __cplusplus
}
#endif
#endif /* mbedtls_sha256.h */
|
/*
* Copyright (C) 2015 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @{
* @ingroup net_gnrc_netapi
* @file
* @brief This file contains a number of helper functions that provide
* some shortcuts for some always repeating code snippets when
* servicing the netapi interface
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @}
*/
#include "kernel.h"
#include "msg.h"
#include "net/gnrc/netreg.h"
#include "net/gnrc/pktbuf.h"
#include "net/gnrc/netapi.h"
/**
* @brief Unified function for getting and setting netapi options
*
* @param[in] pid PID of the targeted thread
* @param[in] type specify if option is to be set or get
* @param[in] opt option to set or get
* @param[in] data data to set or pointer to buffer for reading options
* @param[in] data_len size of the given buffer
*
* @return the value from the received ACK message
*/
static inline int _get_set(kernel_pid_t pid, uint16_t type,
netopt_t opt, uint16_t context,
void *data, size_t data_len)
{
msg_t cmd;
msg_t ack;
gnrc_netapi_opt_t o;
/* set ńetapi's option struct */
o.opt = opt;
o.context = context;
o.data = data;
o.data_len = data_len;
/* set outgoing message's fields */
cmd.type = type;
cmd.content.ptr = (void *)&o;
/* trigger the netapi */
msg_send_receive(&cmd, &ack, pid);
/* return the ACK message's value */
return (int)ack.content.value;
}
static inline int _snd_rcv(kernel_pid_t pid, uint16_t type, gnrc_pktsnip_t *pkt)
{
msg_t msg;
/* set the outgoing message's fields */
msg.type = type;
msg.content.ptr = (void *)pkt;
/* send message */
return msg_send(&msg, pid);
}
int gnrc_netapi_dispatch(gnrc_nettype_t type, uint32_t demux_ctx,
uint16_t cmd, gnrc_pktsnip_t *pkt)
{
int numof = gnrc_netreg_num(type, demux_ctx);
if (numof != 0) {
gnrc_netreg_entry_t *sendto = gnrc_netreg_lookup(type, demux_ctx);
gnrc_pktbuf_hold(pkt, numof - 1);
while (sendto) {
_snd_rcv(sendto->pid, cmd, pkt);
sendto = gnrc_netreg_getnext(sendto);
}
}
return numof;
}
int gnrc_netapi_send(kernel_pid_t pid, gnrc_pktsnip_t *pkt)
{
return _snd_rcv(pid, GNRC_NETAPI_MSG_TYPE_SND, pkt);
}
int gnrc_netapi_receive(kernel_pid_t pid, gnrc_pktsnip_t *pkt)
{
return _snd_rcv(pid, GNRC_NETAPI_MSG_TYPE_RCV, pkt);
}
int gnrc_netapi_get(kernel_pid_t pid, netopt_t opt, uint16_t context,
void *data, size_t data_len)
{
return _get_set(pid, GNRC_NETAPI_MSG_TYPE_GET, opt, context,
data, data_len);
}
int gnrc_netapi_set(kernel_pid_t pid, netopt_t opt, uint16_t context,
void *data, size_t data_len)
{
return _get_set(pid, GNRC_NETAPI_MSG_TYPE_SET, opt, context,
data, data_len);
}
|
/*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public License version 2.
*/
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/buffer_head.h>
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/gfs2_ondisk.h>
#include <linux/lm_interface.h>
#include <linux/freezer.h>
#include "gfs2.h"
#include "incore.h"
#include "daemon.h"
#include "glock.h"
#include "log.h"
#include "quota.h"
#include "recovery.h"
#include "super.h"
#include "util.h"
/* This uses schedule_timeout() instead of msleep() because it's good for
the daemons to wake up more often than the timeout when unmounting so
the user's unmount doesn't sit there forever.
The kthread functions used to start these daemons block and flush signals. */
/**
* gfs2_glockd - Reclaim unused glock structures
* @sdp: Pointer to GFS2 superblock
*
* One or more of these daemons run, reclaiming glocks on sd_reclaim_list.
* Number of daemons can be set by user, with num_glockd mount option.
*/
int gfs2_glockd(void *data)
{
struct gfs2_sbd *sdp = data;
while (!kthread_should_stop()) {
while (atomic_read(&sdp->sd_reclaim_count))
gfs2_reclaim_glock(sdp);
wait_event_interruptible(sdp->sd_reclaim_wq,
(atomic_read(&sdp->sd_reclaim_count) ||
kthread_should_stop()));
if (freezing(current))
refrigerator();
}
return 0;
}
/**
* gfs2_recoverd - Recover dead machine's journals
* @sdp: Pointer to GFS2 superblock
*
*/
int gfs2_recoverd(void *data)
{
struct gfs2_sbd *sdp = data;
unsigned long t;
while (!kthread_should_stop()) {
gfs2_check_journals(sdp);
t = gfs2_tune_get(sdp, gt_recoverd_secs) * HZ;
if (freezing(current))
refrigerator();
schedule_timeout_interruptible(t);
}
return 0;
}
/**
* gfs2_logd - Update log tail as Active Items get flushed to in-place blocks
* @sdp: Pointer to GFS2 superblock
*
* Also, periodically check to make sure that we're using the most recent
* journal index.
*/
int gfs2_logd(void *data)
{
struct gfs2_sbd *sdp = data;
struct gfs2_holder ji_gh;
unsigned long t;
int need_flush;
while (!kthread_should_stop()) {
/* Advance the log tail */
t = sdp->sd_log_flush_time +
gfs2_tune_get(sdp, gt_log_flush_secs) * HZ;
gfs2_ail1_empty(sdp, DIO_ALL);
gfs2_log_lock(sdp);
need_flush = sdp->sd_log_num_buf > gfs2_tune_get(sdp, gt_incore_log_blocks);
gfs2_log_unlock(sdp);
if (need_flush || time_after_eq(jiffies, t)) {
gfs2_log_flush(sdp, NULL);
sdp->sd_log_flush_time = jiffies;
}
/* Check for latest journal index */
t = sdp->sd_jindex_refresh_time +
gfs2_tune_get(sdp, gt_jindex_refresh_secs) * HZ;
if (time_after_eq(jiffies, t)) {
if (!gfs2_jindex_hold(sdp, &ji_gh))
gfs2_glock_dq_uninit(&ji_gh);
sdp->sd_jindex_refresh_time = jiffies;
}
t = gfs2_tune_get(sdp, gt_logd_secs) * HZ;
if (freezing(current))
refrigerator();
schedule_timeout_interruptible(t);
}
return 0;
}
/**
* gfs2_quotad - Write cached quota changes into the quota file
* @sdp: Pointer to GFS2 superblock
*
*/
int gfs2_quotad(void *data)
{
struct gfs2_sbd *sdp = data;
unsigned long t;
int error;
while (!kthread_should_stop()) {
/* Update the master statfs file */
t = sdp->sd_statfs_sync_time +
gfs2_tune_get(sdp, gt_statfs_quantum) * HZ;
if (time_after_eq(jiffies, t)) {
error = gfs2_statfs_sync(sdp);
if (error &&
error != -EROFS &&
!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
fs_err(sdp, "quotad: (1) error=%d\n", error);
sdp->sd_statfs_sync_time = jiffies;
}
/* Update quota file */
t = sdp->sd_quota_sync_time +
gfs2_tune_get(sdp, gt_quota_quantum) * HZ;
if (time_after_eq(jiffies, t)) {
error = gfs2_quota_sync(sdp);
if (error &&
error != -EROFS &&
!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
fs_err(sdp, "quotad: (2) error=%d\n", error);
sdp->sd_quota_sync_time = jiffies;
}
gfs2_quota_scan(sdp);
t = gfs2_tune_get(sdp, gt_quotad_secs) * HZ;
if (freezing(current))
refrigerator();
schedule_timeout_interruptible(t);
}
return 0;
}
|
/*
* Driver for Micronas DVB-T drx397xD demodulator
*
* Copyright (C) 2007 Henk vergonet <Henk.Vergonet@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
*/
#ifndef _DRX397XD_H_INCLUDED
#define _DRX397XD_H_INCLUDED
#include <linux/dvb/frontend.h>
#define DRX_F_STEPSIZE 166667
#define DRX_F_OFFSET 36000000
#define I2C_ADR_C0(x) \
( (u32)cpu_to_le32( \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \
(((u32)(x) & (u32)0x0fff0000UL) >> 8) | \
( (u32)0x00c00000UL) \
)) \
)
#define I2C_ADR_E0(x) \
( (u32)cpu_to_le32( \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \
(((u32)(x) & (u32)0x0fff0000UL) >> 8) | \
( (u32)0x00e00000UL) \
)) \
)
struct drx397xD_CfgRfAgc /* 0x7c */
{
int d00; /* 2 */
u16 w04;
u16 w06;
};
struct drx397xD_CfgIfAgc /* 0x68 */
{
int d00; /* 0 */
u16 w04; /* 0 */
u16 w06;
u16 w08;
u16 w0A;
u16 w0C;
};
struct drx397xD_s20 {
int d04;
u32 d18;
u32 d1C;
u32 d20;
u32 d14;
u32 d24;
u32 d0C;
u32 d08;
};
struct drx397xD_config
{
/* demodulator's I2C address */
u8 demod_address; /* 0x0f */
struct drx397xD_CfgIfAgc ifagc; /* 0x68 */
struct drx397xD_CfgRfAgc rfagc; /* 0x7c */
u32 s20d24;
/* HI_CfgCommand parameters */
u16 w50, w52, /* w54, */ w56;
int d5C;
int d60;
int d48;
int d28;
u32 f_if; /* d14: intermediate frequency [Hz] */
/* 36000000 on Cinergy 2400i DT */
/* 42800000 on Pinnacle Hybrid PRO 330e */
u16 f_osc; /* s66: 48000 oscillator frequency [kHz] */
u16 w92; /* 20000 */
u16 wA0;
u16 w98;
u16 w9A;
u16 w9C; /* 0xe0 */
u16 w9E; /* 0x00 */
/* used for signal strength calculations in
drx397x_read_signal_strength
*/
u16 ss78; // 2200
u16 ss7A; // 150
u16 ss76; // 820
};
#if defined(CONFIG_DVB_DRX397XD) || (defined(CONFIG_DVB_DRX397XD_MODULE) && defined(MODULE))
extern struct dvb_frontend* drx397xD_attach(const struct drx397xD_config *config,
struct i2c_adapter *i2c);
#else
static inline struct dvb_frontend* drx397xD_attach(const struct drx397xD_config *config,
struct i2c_adapter *i2c)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
return NULL;
}
#endif /* CONFIG_DVB_DRX397XD */
#endif /* _DRX397XD_H_INCLUDED */
|
/* Wrapper implementation for waitpid for GNU/Linux (LWP layer).
Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common-defs.h"
#ifdef GDBSERVER
/* FIXME: server.h is required for the definition of debug_threads
which is used in the gdbserver-specific debug printing in
linux_debug. This code should be made available to GDB also,
but the lack of a suitable flag to enable it prevents this. */
#include "server.h"
#endif
#include "linux-nat.h"
#include "linux-waitpid.h"
#include "gdb_wait.h"
/* Print debugging output based on the format string FORMAT and
its parameters. */
static inline void
linux_debug (const char *format, ...)
{
#ifdef GDBSERVER
if (debug_threads)
{
va_list args;
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
}
#endif
}
/* Convert wait status STATUS to a string. Used for printing debug
messages only. */
char *
status_to_str (int status)
{
static char buf[64];
if (WIFSTOPPED (status))
{
if (WSTOPSIG (status) == SYSCALL_SIGTRAP)
snprintf (buf, sizeof (buf), "%s (stopped at syscall)",
strsignal (SIGTRAP));
else
snprintf (buf, sizeof (buf), "%s (stopped)",
strsignal (WSTOPSIG (status)));
}
else if (WIFSIGNALED (status))
snprintf (buf, sizeof (buf), "%s (terminated)",
strsignal (WTERMSIG (status)));
else
snprintf (buf, sizeof (buf), "%d (exited)", WEXITSTATUS (status));
return buf;
}
/* Wrapper function for waitpid which handles EINTR, and emulates
__WALL for systems where that is not available. */
int
my_waitpid (int pid, int *status, int flags)
{
int ret, out_errno;
linux_debug ("my_waitpid (%d, 0x%x)\n", pid, flags);
if (flags & __WALL)
{
sigset_t block_mask, org_mask, wake_mask;
int wnohang;
wnohang = (flags & WNOHANG) != 0;
flags &= ~(__WALL | __WCLONE);
if (!wnohang)
{
flags |= WNOHANG;
/* Block all signals while here. This avoids knowing about
LinuxThread's signals. */
sigfillset (&block_mask);
sigprocmask (SIG_BLOCK, &block_mask, &org_mask);
/* ... except during the sigsuspend below. */
sigemptyset (&wake_mask);
}
while (1)
{
/* Since all signals are blocked, there's no need to check
for EINTR here. */
ret = waitpid (pid, status, flags);
out_errno = errno;
if (ret == -1 && out_errno != ECHILD)
break;
else if (ret > 0)
break;
if (flags & __WCLONE)
{
/* We've tried both flavors now. If WNOHANG is set,
there's nothing else to do, just bail out. */
if (wnohang)
break;
linux_debug ("blocking\n");
/* Block waiting for signals. */
sigsuspend (&wake_mask);
}
flags ^= __WCLONE;
}
if (!wnohang)
sigprocmask (SIG_SETMASK, &org_mask, NULL);
}
else
{
do
ret = waitpid (pid, status, flags);
while (ret == -1 && errno == EINTR);
out_errno = errno;
}
linux_debug ("my_waitpid (%d, 0x%x): status(%x), %d\n",
pid, flags, status ? *status : -1, ret);
errno = out_errno;
return ret;
}
|
/* Compute complex natural logarithm.
Copyright (C) 1997-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <complex.h>
#include <math.h>
#include <math_private.h>
#include <float.h>
/* To avoid spurious underflows, use this definition to treat IBM long
double as approximating an IEEE-style format. */
#if LDBL_MANT_DIG == 106
# undef LDBL_EPSILON
# define LDBL_EPSILON 0x1p-106L
#endif
__complex__ long double
__clogl (__complex__ long double x)
{
__complex__ long double result;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
__imag__ result = __copysignl (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsl (__real__ x);
}
else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
{
/* Neither real nor imaginary part is NaN. */
long double absx = fabsl (__real__ x), absy = fabsl (__imag__ x);
int scale = 0;
if (absx < absy)
{
long double t = absx;
absx = absy;
absy = t;
}
if (absx > LDBL_MAX / 2.0L)
{
scale = -1;
absx = __scalbnl (absx, scale);
absy = (absy >= LDBL_MIN * 2.0L ? __scalbnl (absy, scale) : 0.0L);
}
else if (absx < LDBL_MIN && absy < LDBL_MIN)
{
scale = LDBL_MANT_DIG;
absx = __scalbnl (absx, scale);
absy = __scalbnl (absy, scale);
}
if (absx == 1.0L && scale == 0)
{
long double absy2 = absy * absy;
if (absy2 <= LDBL_MIN * 2.0L)
{
long double force_underflow = absy2 * absy2;
__real__ result = absy2 / 2.0L;
math_force_eval (force_underflow);
}
else
__real__ result = __log1pl (absy2) / 2.0L;
}
else if (absx > 1.0L && absx < 2.0L && absy < 1.0L && scale == 0)
{
long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
if (absy >= LDBL_EPSILON)
d2m1 += absy * absy;
__real__ result = __log1pl (d2m1) / 2.0L;
}
else if (absx < 1.0L
&& absx >= 0.75L
&& absy < LDBL_EPSILON / 2.0L
&& scale == 0)
{
long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
__real__ result = __log1pl (d2m1) / 2.0L;
}
else if (absx < 1.0L && (absx >= 0.75L || absy >= 0.5L) && scale == 0)
{
long double d2m1 = __x2y2m1l (absx, absy);
__real__ result = __log1pl (d2m1) / 2.0L;
}
else
{
long double d = __ieee754_hypotl (absx, absy);
__real__ result = __ieee754_logl (d) - scale * M_LN2l;
}
__imag__ result = __ieee754_atan2l (__imag__ x, __real__ x);
}
else
{
__imag__ result = __nanl ("");
if (rcls == FP_INFINITE || icls == FP_INFINITE)
/* Real or imaginary part is infinite. */
__real__ result = HUGE_VALL;
else
__real__ result = __nanl ("");
}
return result;
}
weak_alias (__clogl, clogl)
|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "curl_setup.h"
#include <curl/curl.h>
#include "strcase.h"
/* Portable, consistent toupper (remember EBCDIC). Do not use toupper() because
its behavior is altered by the current locale. */
char Curl_raw_toupper(char in)
{
#if !defined(CURL_DOES_CONVERSIONS)
if(in >= 'a' && in <= 'z')
return (char)('A' + in - 'a');
#else
switch(in) {
case 'a':
return 'A';
case 'b':
return 'B';
case 'c':
return 'C';
case 'd':
return 'D';
case 'e':
return 'E';
case 'f':
return 'F';
case 'g':
return 'G';
case 'h':
return 'H';
case 'i':
return 'I';
case 'j':
return 'J';
case 'k':
return 'K';
case 'l':
return 'L';
case 'm':
return 'M';
case 'n':
return 'N';
case 'o':
return 'O';
case 'p':
return 'P';
case 'q':
return 'Q';
case 'r':
return 'R';
case 's':
return 'S';
case 't':
return 'T';
case 'u':
return 'U';
case 'v':
return 'V';
case 'w':
return 'W';
case 'x':
return 'X';
case 'y':
return 'Y';
case 'z':
return 'Z';
}
#endif
return in;
}
/*
* Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant
* to be locale independent and only compare strings we know are safe for
* this. See https://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/ for
* some further explanation to why this function is necessary.
*
* The function is capable of comparing a-z case insensitively even for
* non-ascii.
*
* @unittest: 1301
*/
int Curl_strcasecompare(const char *first, const char *second)
{
while(*first && *second) {
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
/* get out of the loop as soon as they don't match */
break;
first++;
second++;
}
/* we do the comparison here (possibly again), just to make sure that if the
loop above is skipped because one of the strings reached zero, we must not
return this as a successful match */
return (Curl_raw_toupper(*first) == Curl_raw_toupper(*second));
}
int Curl_safe_strcasecompare(const char *first, const char *second)
{
if(first && second)
/* both pointers point to something then compare them */
return Curl_strcasecompare(first, second);
/* if both pointers are NULL then treat them as equal */
return (NULL == first && NULL == second);
}
/*
* @unittest: 1301
*/
int Curl_strncasecompare(const char *first, const char *second, size_t max)
{
while(*first && *second && max) {
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) {
break;
}
max--;
first++;
second++;
}
if(0 == max)
return 1; /* they are equal this far */
return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
}
/* Copy an upper case version of the string from src to dest. The
* strings may overlap. No more than n characters of the string are copied
* (including any NUL) and the destination string will NOT be
* NUL-terminated if that limit is reached.
*/
void Curl_strntoupper(char *dest, const char *src, size_t n)
{
if(n < 1)
return;
do {
*dest++ = Curl_raw_toupper(*src);
} while(*src++ && --n);
}
/* --- public functions --- */
int curl_strequal(const char *first, const char *second)
{
return Curl_strcasecompare(first, second);
}
int curl_strnequal(const char *first, const char *second, size_t max)
{
return Curl_strncasecompare(first, second, max);
}
|
/*
Copyright © 2014-2015 by The qTox Project
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUPWIDGET_H
#define GROUPWIDGET_H
#include "genericchatroomwidget.h"
class GroupWidget final : public GenericChatroomWidget
{
Q_OBJECT
public:
GroupWidget(int GroupId, QString Name);
~GroupWidget();
virtual void setAsInactiveChatroom() final override;
virtual void setAsActiveChatroom() final override;
virtual void updateStatusLight() final override;
virtual bool chatFormIsSet(bool focus) const final override;
virtual void setChatForm(ContentLayout* contentLayout) override;
virtual void resetEventFlags() final override;
virtual QString getStatusString() const final override;
virtual Group* getGroup() const override;
void setName(const QString& name);
void onUserListChanged();
void editName();
signals:
void groupWidgetClicked(GroupWidget* widget);
void renameRequested(GroupWidget* widget, const QString& newName);
void removeGroup(int groupId);
protected:
void contextMenuEvent(QContextMenuEvent * event) final override;
void mousePressEvent(QMouseEvent* event) final override;
void mouseMoveEvent(QMouseEvent* event) final override;
void dragEnterEvent(QDragEnterEvent* ev) override;
void dragLeaveEvent(QDragLeaveEvent* ev) override;
void dropEvent(QDropEvent* ev) override;
private:
void retranslateUi();
public:
int groupId;
};
#endif // GROUPWIDGET_H
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "VectorIntegratedBC.h"
class VectorPenaltyDirichletBC : public VectorIntegratedBC
{
public:
static InputParameters validParams();
VectorPenaltyDirichletBC(const InputParameters & parameters);
protected:
Real _penalty;
virtual Real computeQpResidual();
virtual Real computeQpJacobian();
const Function & _exact_x;
const Function & _exact_y;
const Function & _exact_z;
const bool _linear;
};
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// AVFoundation API is only introduced in Mac OS X > 10.6, and there is only one
// build of Chromium, so the (potential) linking with AVFoundation has to happen
// in runtime. For this to be clean, an AVFoundationGlue class is defined to try
// and load these AVFoundation system libraries. If it succeeds, subsequent
// clients can use AVFoundation via the rest of the classes declared in this
// file.
#ifndef MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
#define MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
#if defined(__OBJC__)
#import <Foundation/Foundation.h>
#endif // defined(__OBJC__)
#include "base/basictypes.h"
#include "media/base/mac/coremedia_glue.h"
#include "media/base/media_export.h"
class MEDIA_EXPORT AVFoundationGlue {
public:
// Must be called on the UI thread prior to attempting to use any other
// AVFoundation methods.
static void InitializeAVFoundation();
// This method returns true if the OS version supports AVFoundation and the
// AVFoundation bundle could be loaded correctly, or false otherwise.
static bool IsAVFoundationSupported();
#if defined(__OBJC__)
static NSBundle const* AVFoundationBundle();
// Originally coming from AVCaptureDevice.h but in global namespace.
static NSString* AVCaptureDeviceWasConnectedNotification();
static NSString* AVCaptureDeviceWasDisconnectedNotification();
// Originally coming from AVMediaFormat.h but in global namespace.
static NSString* AVMediaTypeVideo();
static NSString* AVMediaTypeAudio();
static NSString* AVMediaTypeMuxed();
// Originally from AVCaptureSession.h but in global namespace.
static NSString* AVCaptureSessionRuntimeErrorNotification();
static NSString* AVCaptureSessionDidStopRunningNotification();
static NSString* AVCaptureSessionErrorKey();
// Originally from AVVideoSettings.h but in global namespace.
static NSString* AVVideoScalingModeKey();
static NSString* AVVideoScalingModeResizeAspectFill();
static Class AVCaptureSessionClass();
static Class AVCaptureVideoDataOutputClass();
#endif // defined(__OBJC__)
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue);
};
#if defined(__OBJC__)
// Originally AVCaptureDevice and coming from AVCaptureDevice.h
MEDIA_EXPORT
@interface CrAVCaptureDevice : NSObject
- (BOOL)hasMediaType:(NSString*)mediaType;
- (NSString*)uniqueID;
- (NSString*)localizedName;
- (BOOL)isSuspended;
- (NSArray*)formats;
- (int32_t)transportType;
@end
// Originally AVCaptureDeviceFormat and coming from AVCaptureDevice.h.
MEDIA_EXPORT
@interface CrAVCaptureDeviceFormat : NSObject
- (CoreMediaGlue::CMFormatDescriptionRef)formatDescription;
- (NSArray*)videoSupportedFrameRateRanges;
@end
// Originally AVFrameRateRange and coming from AVCaptureDevice.h.
MEDIA_EXPORT
@interface CrAVFrameRateRange : NSObject
- (Float64)maxFrameRate;
@end
MEDIA_EXPORT
@interface CrAVCaptureInput // Originally from AVCaptureInput.h.
@end
MEDIA_EXPORT
@interface CrAVCaptureOutput // Originally from AVCaptureOutput.h.
@end
// Originally AVCaptureSession and coming from AVCaptureSession.h.
MEDIA_EXPORT
@interface CrAVCaptureSession : NSObject
- (void)release;
- (void)addInput:(CrAVCaptureInput*)input;
- (void)removeInput:(CrAVCaptureInput*)input;
- (void)addOutput:(CrAVCaptureOutput*)output;
- (void)removeOutput:(CrAVCaptureOutput*)output;
- (BOOL)isRunning;
- (void)startRunning;
- (void)stopRunning;
@end
// Originally AVCaptureConnection and coming from AVCaptureSession.h.
MEDIA_EXPORT
@interface CrAVCaptureConnection : NSObject
- (BOOL)isVideoMinFrameDurationSupported;
- (void)setVideoMinFrameDuration:(CoreMediaGlue::CMTime)minFrameRate;
- (BOOL)isVideoMaxFrameDurationSupported;
- (void)setVideoMaxFrameDuration:(CoreMediaGlue::CMTime)maxFrameRate;
@end
// Originally AVCaptureDeviceInput and coming from AVCaptureInput.h.
MEDIA_EXPORT
@interface CrAVCaptureDeviceInput : CrAVCaptureInput
@end
// Originally AVCaptureVideoDataOutputSampleBufferDelegate from
// AVCaptureOutput.h.
@protocol CrAVCaptureVideoDataOutputSampleBufferDelegate <NSObject>
@optional
- (void)captureOutput:(CrAVCaptureOutput*)captureOutput
didOutputSampleBuffer:(CoreMediaGlue::CMSampleBufferRef)sampleBuffer
fromConnection:(CrAVCaptureConnection*)connection;
@end
// Originally AVCaptureVideoDataOutput and coming from AVCaptureOutput.h.
MEDIA_EXPORT
@interface CrAVCaptureVideoDataOutput : CrAVCaptureOutput
- (oneway void)release;
- (void)setSampleBufferDelegate:(id)sampleBufferDelegate
queue:(dispatch_queue_t)sampleBufferCallbackQueue;
- (void)setAlwaysDiscardsLateVideoFrames:(BOOL)flag;
- (void)setVideoSettings:(NSDictionary*)videoSettings;
- (NSDictionary*)videoSettings;
- (CrAVCaptureConnection*)connectionWithMediaType:(NSString*)mediaType;
@end
// Class to provide access to class methods of AVCaptureDevice.
MEDIA_EXPORT
@interface AVCaptureDeviceGlue : NSObject
+ (NSArray*)devices;
+ (CrAVCaptureDevice*)deviceWithUniqueID:(NSString*)deviceUniqueID;
@end
// Class to provide access to class methods of AVCaptureDeviceInput.
MEDIA_EXPORT
@interface AVCaptureDeviceInputGlue : NSObject
+ (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device
error:(NSError**)outError;
@end
#endif // defined(__OBJC__)
#endif // MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
|
/**
* \file
*
* \brief Chip-specific system clock manager configuration
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_CLOCK_H_INCLUDED
#define CONF_CLOCK_H_INCLUDED
//#define CONFIG_SYSCLK_INIT_CPUMASK (1 << SYSCLK_OCD)
//#define CONFIG_SYSCLK_INIT_PBAMASK (1 << SYSCLK_IISC)
//#define CONFIG_SYSCLK_INIT_PBBMASK (1 << SYSCLK_USBC_REGS)
//#define CONFIG_SYSCLK_INIT_PBCMASK (1 << SYSCLK_CHIPID)
//#define CONFIG_SYSCLK_INIT_PBDMASK (1 << SYSCLK_AST)
//#define CONFIG_SYSCLK_INIT_HSBMASK (1 << SYSCLK_PDCA_HSB)
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCSYS
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_OSC0
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL0
#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_DFLL
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC80M
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCFAST
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RC1M
/* RCFAST frequency selection: 0 for 4MHz, 1 for 8MHz and 2 for 12MHz */
//#define CONFIG_RCFAST_FRANGE 0
//#define CONFIG_RCFAST_FRANGE 1
//#define CONFIG_RCFAST_FRANGE 2
/* 0: disable PicoCache, 1: enable PicoCache */
#define CONFIG_HCACHE_ENABLE 1
/*
* To use low power mode for flash read mode (PS0, PS1), don't define it.
* To use high speed mode for flash read mode (PS2), define it.
*
* \note
* For early engineer samples, ONLY low power mode support for flash read mode.
*/
//#define CONFIG_FLASH_READ_MODE_HIGH_SPEED_ENABLE
/* Fbus = Fsys / (2 ^ BUS_div) */
#define CONFIG_SYSCLK_CPU_DIV 0
#define CONFIG_SYSCLK_PBA_DIV 0
#define CONFIG_SYSCLK_PBB_DIV 0
#define CONFIG_SYSCLK_PBC_DIV 0
#define CONFIG_SYSCLK_PBD_DIV 0
//#define CONFIG_USBCLK_SOURCE USBCLK_SRC_OSC0
//#define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL0
/* Fusb = Fsys / USB_div */
//#define CONFIG_USBCLK_DIV 1
//#define CONFIG_PLL0_SOURCE PLL_SRC_OSC0
/* Fpll0 = (Fclk * PLL_mul) / PLL_div */
//#define CONFIG_PLL0_MUL (48000000UL / BOARD_OSC0_HZ)
//#define CONFIG_PLL0_DIV 1
//#define CONFIG_DFLL0_SOURCE GENCLK_SRC_RCSYS
#define CONFIG_DFLL0_SOURCE GENCLK_SRC_OSC32K
//#define CONFIG_DFLL0_SOURCE GENCLK_SRC_RC32K
/* Fdfll = (Fclk * DFLL_mul) / DFLL_div */
#define CONFIG_DFLL0_FREQ 48000000UL
#define CONFIG_DFLL0_MUL (CONFIG_DFLL0_FREQ / BOARD_OSC32_HZ)
#define CONFIG_DFLL0_DIV 1
#endif /* CONF_CLOCK_H_INCLUDED */
|
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org
Copyright (c) Microsoft Open Technologies, Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __INPUT_EVENT__
#define __INPUT_EVENT__
#include "cocos2d.h"
#include "InputEventTypes.h"
#include <agile.h>
NS_CC_BEGIN
public delegate void Cocos2dEventDelegate(Cocos2dEvent event, Platform::String^ text);
public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text);
public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
public delegate void Cocos2dOpenURLDelegate(Platform::String^ url);
enum PointerEventType
{
PointerPressed,
PointerMoved,
PointerReleased,
};
class CC_DLL InputEvent
{
public:
InputEvent() {};
virtual ~InputEvent() {};
virtual void execute() = 0;
};
class CC_DLL AccelerometerEvent : public InputEvent
{
public:
AccelerometerEvent(const cocos2d::Acceleration& event);
virtual void execute();
private:
cocos2d::Acceleration m_event;
};
class CC_DLL PointerEvent : public InputEvent
{
public:
PointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
virtual void execute();
private:
PointerEventType m_type;
Platform::Agile<Windows::UI::Core::PointerEventArgs> m_args;
};
class CC_DLL KeyboardEvent : public InputEvent
{
public:
KeyboardEvent(Cocos2dKeyEvent type);
KeyboardEvent(Cocos2dKeyEvent type, Platform::String^ text);
virtual void execute();
private:
Cocos2dKeyEvent m_type;
Platform::Agile<Platform::String> m_text;
};
enum WinRTKeyboardEventType
{
KeyPressed,
KeyReleased,
};
class CC_DLL WinRTKeyboardEvent : public InputEvent
{
public:
WinRTKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args);
virtual void execute();
private:
WinRTKeyboardEventType m_type;
Platform::Agile<Windows::UI::Core::KeyEventArgs> m_key;
};
class CC_DLL BackButtonEvent : public InputEvent
{
public:
BackButtonEvent();
virtual void execute();
};
class CC_DLL CustomInputEvent : public InputEvent
{
public:
CustomInputEvent(const std::function<void()>&);
virtual void execute();
private:
std::function<void()> m_fun;
};
class UIEditBoxEvent : public cocos2d::InputEvent
{
public:
UIEditBoxEvent(Platform::Object^ sender, Platform::String^ text, Windows::Foundation::EventHandler<Platform::String^>^ handle);
virtual void execute();
private:
Platform::Agile<Platform::Object^> m_sender;
Platform::Agile<Platform::String^> m_text;
Platform::Agile<Windows::Foundation::EventHandler<Platform::String^>^> m_handler;
};
NS_CC_END
#endif // #ifndef __INPUT_EVENT__
|
/* Target-dependent code for DICOS running on x86-64's, for GDB.
Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "osabi.h"
#include "amd64-tdep.h"
#include "dicos-tdep.h"
static void
amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
amd64_init_abi (info, gdbarch);
dicos_init_abi (gdbarch);
}
static enum gdb_osabi
amd64_dicos_osabi_sniffer (bfd *abfd)
{
char *target_name = bfd_get_target (abfd);
/* On amd64-DICOS, the Load Module's "header" section is 72
bytes. */
if (strcmp (target_name, "elf64-x86-64") == 0
&& dicos_load_module_p (abfd, 72))
return GDB_OSABI_DICOS;
return GDB_OSABI_UNKNOWN;
}
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_amd64_dicos_tdep (void);
void
_initialize_amd64_dicos_tdep (void)
{
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
amd64_dicos_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_DICOS,
amd64_dicos_init_abi);
}
|
/*
* arch/arm/mach-tegra/board-enterprise-baseband.c
*
* Copyright (c) 2011-2012, NVIDIA CORPORATION. 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <linux/resource.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/err.h>
#include <linux/platform_data/tegra_usb.h>
#include <mach/tegra_usb_modem_power.h>
#include "devices.h"
#include "gpio-names.h"
/* Tegra3 BB GPIO */
#define MODEM_PWR_ON TEGRA_GPIO_PE0
#define MODEM_RESET TEGRA_GPIO_PE1
#define BB_RST_OUT TEGRA_GPIO_PV1
/* Icera modem handshaking GPIO */
#define AP2MDM_ACK TEGRA_GPIO_PE3
#define MDM2AP_ACK TEGRA_GPIO_PU5
#define AP2MDM_ACK2 TEGRA_GPIO_PE2
#define MDM2AP_ACK2 TEGRA_GPIO_PV0
static struct gpio modem_gpios[] = {
{MODEM_PWR_ON, GPIOF_OUT_INIT_LOW, "MODEM PWR ON"},
{MODEM_RESET, GPIOF_IN, "MODEM RESET"},
{AP2MDM_ACK2, GPIOF_OUT_INIT_HIGH, "AP2MDM ACK2"},
{AP2MDM_ACK, GPIOF_OUT_INIT_LOW, "AP2MDM ACK"},
};
static void baseband_post_phy_on(void);
static void baseband_pre_phy_off(void);
static struct tegra_usb_phy_platform_ops ulpi_null_plat_ops = {
.pre_phy_off = baseband_pre_phy_off,
.post_phy_on = baseband_post_phy_on,
};
static struct tegra_usb_platform_data tegra_ehci2_ulpi_null_pdata = {
.port_otg = false,
.has_hostpc = true,
.phy_intf = TEGRA_USB_PHY_INTF_ULPI_NULL,
.op_mode = TEGRA_USB_OPMODE_HOST,
.u_data.host = {
.vbus_gpio = -1,
.vbus_reg = NULL,
.hot_plug = true,
.remote_wakeup_supported = false,
.power_off_on_suspend = true,
},
.u_cfg.ulpi = {
.shadow_clk_delay = 10,
.clock_out_delay = 1,
.data_trimmer = 1,
.stpdirnxt_trimmer = 1,
.dir_trimmer = 1,
.clk = NULL,
.phy_restore_gpio = MDM2AP_ACK,
},
.ops = &ulpi_null_plat_ops,
};
static void baseband_post_phy_on(void)
{
/* set AP2MDM_ACK2 low */
gpio_set_value(AP2MDM_ACK2, 0);
}
static void baseband_pre_phy_off(void)
{
/* set AP2MDM_ACK2 high */
gpio_set_value(AP2MDM_ACK2, 1);
ap2mdm_ack_gpio_off = true;
}
static void baseband_start(void)
{
/*
* Leave baseband powered OFF.
* User-space daemons will take care of powering it up.
*/
pr_info("%s\n", __func__);
gpio_set_value(MODEM_PWR_ON, 0);
}
static void baseband_reset(void)
{
/* Initiate power cycle on baseband sub system */
pr_info("%s\n", __func__);
gpio_set_value(MODEM_PWR_ON, 0);
mdelay(200);
gpio_set_value(MODEM_PWR_ON, 1);
}
static int baseband_init(void)
{
int ret;
ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
if (ret)
return ret;
/* enable pull-up for ULPI STP */
tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_STP,
TEGRA_PUPD_PULL_UP);
/* enable pull-up for MDM2AP_ACK2 */
tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_GPIO_PV0,
TEGRA_PUPD_PULL_UP);
/* export GPIO for user space access through sysfs */
gpio_export(MODEM_PWR_ON, false);
return 0;
}
static const struct tegra_modem_operations baseband_operations = {
.init = baseband_init,
.start = baseband_start,
.reset = baseband_reset,
};
static struct tegra_usb_modem_power_platform_data baseband_pdata = {
.ops = &baseband_operations,
.wake_gpio = MDM2AP_ACK2,
.wake_irq_flags = IRQF_TRIGGER_FALLING,
.boot_gpio = BB_RST_OUT,
.boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
.autosuspend_delay = 2000,
.short_autosuspend_delay = 50,
.tegra_ehci_device = &tegra_ehci2_device,
.tegra_ehci_pdata = &tegra_ehci2_ulpi_null_pdata,
};
static struct platform_device icera_baseband_device = {
.name = "tegra_usb_modem_power",
.id = -1,
.dev = {
.platform_data = &baseband_pdata,
},
};
int __init enterprise_modem_init(void)
{
platform_device_register(&icera_baseband_device);
return 0;
}
|
void FooBar(struct wxString* s)
{
|
/*
* Raw Video Codec
* Copyright (c) 2001 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Raw Video Codec
*/
#include "avcodec.h"
#include "raw.h"
const PixelFormatTag ff_raw_pixelFormatTags[] = {
{ PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
{ PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },
{ PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },
{ PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },
{ PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') },
{ PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },
{ PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
{ PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') },
{ PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') },
{ PIX_FMT_GRAY8, MKTAG(' ', ' ', 'Y', '8') },
{ PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */
{ PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') },
{ PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') },
{ PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') },
{ PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') },
{ PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },
{ PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') },
{ PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') },
{ PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') },
{ PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') },
{ PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') },
{ PIX_FMT_UYVY422, MKTAG('A', 'V', 'R', 'n') }, /* Avid AVI Codec 1:1 */
{ PIX_FMT_UYVY422, MKTAG('A', 'V', '1', 'x') }, /* Avid 1:1x */
{ PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') },
{ PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */
{ PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') },
{ PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },
{ PIX_FMT_BGR555LE, MKTAG('B', 'G', 'R', 15) },
{ PIX_FMT_RGB565LE, MKTAG('R', 'G', 'B', 16) },
{ PIX_FMT_BGR565LE, MKTAG('B', 'G', 'R', 16) },
{ PIX_FMT_RGB565LE, MKTAG( 3 , 0 , 0 , 0) },
/* quicktime */
{ PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
{ PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') },
{ PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */
{ PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },
{ PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') },
{ PIX_FMT_PAL8, MKTAG('W', 'R', 'A', 'W') },
{ PIX_FMT_NONE, 0 },
};
unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt)
{
const PixelFormatTag * tags = ff_raw_pixelFormatTags;
while (tags->pix_fmt >= 0) {
if (tags->pix_fmt == fmt)
return tags->fourcc;
tags++;
}
return 0;
}
|
//===---- LatencyPriorityQueue.h - A latency-oriented priority queue ------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the LatencyPriorityQueue class, which is a
// SchedulingPriorityQueue that schedules using latency information to
// reduce the length of the critical path through the basic block.
//
//===----------------------------------------------------------------------===//
#ifndef LATENCY_PRIORITY_QUEUE_H
#define LATENCY_PRIORITY_QUEUE_H
#include "llvm/CodeGen/ScheduleDAG.h"
namespace llvm {
class LatencyPriorityQueue;
/// Sorting functions for the Available queue.
struct latency_sort : public std::binary_function<SUnit*, SUnit*, bool> {
LatencyPriorityQueue *PQ;
explicit latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {}
bool operator()(const SUnit* left, const SUnit* right) const;
};
class LatencyPriorityQueue : public SchedulingPriorityQueue {
// SUnits - The SUnits for the current graph.
std::vector<SUnit> *SUnits;
/// NumNodesSolelyBlocking - This vector contains, for every node in the
/// Queue, the number of nodes that the node is the sole unscheduled
/// predecessor for. This is used as a tie-breaker heuristic for better
/// mobility.
std::vector<unsigned> NumNodesSolelyBlocking;
/// Queue - The queue.
std::vector<SUnit*> Queue;
latency_sort Picker;
public:
LatencyPriorityQueue() : Picker(this) {
}
void initNodes(std::vector<SUnit> &sunits) {
SUnits = &sunits;
NumNodesSolelyBlocking.resize(SUnits->size(), 0);
}
void addNode(const SUnit *SU) {
NumNodesSolelyBlocking.resize(SUnits->size(), 0);
}
void updateNode(const SUnit *SU) {
}
void releaseState() {
SUnits = 0;
}
unsigned getLatency(unsigned NodeNum) const {
assert(NodeNum < (*SUnits).size());
return (*SUnits)[NodeNum].getHeight();
}
unsigned getNumSolelyBlockNodes(unsigned NodeNum) const {
assert(NodeNum < NumNodesSolelyBlocking.size());
return NumNodesSolelyBlocking[NodeNum];
}
bool empty() const { return Queue.empty(); }
virtual void push(SUnit *U);
virtual SUnit *pop();
virtual void remove(SUnit *SU);
// ScheduledNode - As nodes are scheduled, we look to see if there are any
// successor nodes that have a single unscheduled predecessor. If so, that
// single predecessor has a higher priority, since scheduling it will make
// the node available.
void ScheduledNode(SUnit *Node);
private:
void AdjustPriorityOfUnscheduledPreds(SUnit *SU);
SUnit *getSingleUnscheduledPred(SUnit *SU);
};
}
#endif
|
#ifndef SYSEMU_BT_H
#define SYSEMU_BT_H
/* BT HCI info */
struct HCIInfo {
int (*bdaddr_set)(struct HCIInfo *hci, const uint8_t *bd_addr);
void (*cmd_send)(struct HCIInfo *hci, const uint8_t *data, int len);
void (*sco_send)(struct HCIInfo *hci, const uint8_t *data, int len);
void (*acl_send)(struct HCIInfo *hci, const uint8_t *data, int len);
void *opaque;
void (*evt_recv)(void *opaque, const uint8_t *data, int len);
void (*acl_recv)(void *opaque, const uint8_t *data, int len);
};
/* bt-host.c */
struct HCIInfo *bt_host_hci(const char *id);
struct HCIInfo *qemu_next_hci(void);
#endif
|
#pragma once
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
/* Define some custom types to make the rest of our code easier to read */
// Define "PointCloud" to be a pcl::PointCloud of pcl::PointXYZRGB points
typedef pcl::PointXYZRGB PointT;
typedef pcl::PointCloud<PointT> PointCloud;
typedef pcl::PointCloud<PointT>::Ptr PointCloudPtr;
typedef pcl::PointCloud<PointT>::ConstPtr PointCloudConstPtr;
// Define "SurfaceNormals" to be a pcl::PointCloud of pcl::Normal points
typedef pcl::Normal NormalT;
typedef pcl::PointCloud<NormalT> SurfaceNormals;
typedef pcl::PointCloud<NormalT>::Ptr SurfaceNormalsPtr;
typedef pcl::PointCloud<NormalT>::ConstPtr SurfaceNormalsConstPtr;
// Define "LocalDescriptors" to be a pcl::PointCloud of pcl::FPFHSignature33 points
typedef pcl::FPFHSignature33 LocalDescriptorT;
typedef pcl::PointCloud<LocalDescriptorT> LocalDescriptors;
typedef pcl::PointCloud<LocalDescriptorT>::Ptr LocalDescriptorsPtr;
typedef pcl::PointCloud<LocalDescriptorT>::ConstPtr LocalDescriptorsConstPtr;
// Define "GlobalDescriptors" to be a pcl::PointCloud of pcl::VFHSignature308 points
typedef pcl::VFHSignature308 GlobalDescriptorT;
typedef pcl::PointCloud<GlobalDescriptorT> GlobalDescriptors;
typedef pcl::PointCloud<GlobalDescriptorT>::Ptr GlobalDescriptorsPtr;
typedef pcl::PointCloud<GlobalDescriptorT>::ConstPtr GlobalDescriptorsConstPtr;
|
// RUN: %clang_cc1 -triple x86_64-unknown-linux -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso \
// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK --check-prefix=CHECK-DIAG \
// RUN: --check-prefix=ITANIUM --check-prefix=ITANIUM-DIAG \
// RUN: %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso -fsanitize-trap=cfi-icall \
// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK \
// RUN: --check-prefix=ITANIUM --check-prefix=ITANIUM-TRAP \
// RUN: %s
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso \
// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK --check-prefix=CHECK-DIAG \
// RUN: --check-prefix=MS --check-prefix=MS-DIAG \
// RUN: %s
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso -fsanitize-trap=cfi-icall \
// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK \
// RUN: --check-prefix=MS --check-prefix=MS-TRAP \
// RUN: %s
// CHECK-DIAG: @[[SRC:.*]] = private unnamed_addr constant {{.*}}cfi-icall-cross-dso.c\00
// CHECK-DIAG: @[[TYPE:.*]] = private unnamed_addr constant { i16, i16, [{{.*}} x i8] } { i16 -1, i16 0, [{{.*}} x i8] c"'void ()'\00"
// CHECK-DIAG: @[[DATA:.*]] = private unnamed_addr global {{.*}}@[[SRC]]{{.*}}@[[TYPE]]
// ITANIUM: call i1 @llvm.type.test(i8* %{{.*}}, metadata !"_ZTSFvE"), !nosanitize
// ITANIUM-DIAG: call void @__cfi_slowpath_diag(i64 6588678392271548388, i8* %{{.*}}, {{.*}}@[[DATA]]{{.*}}) {{.*}}, !nosanitize
// ITANIUM-TRAP: call void @__cfi_slowpath(i64 6588678392271548388, i8* %{{.*}}) {{.*}}, !nosanitize
// MS: call i1 @llvm.type.test(i8* %{{.*}}, metadata !"?6AX@Z"), !nosanitize
// MS-DIAG: call void @__cfi_slowpath_diag(i64 4195979634929632483, i8* %{{.*}}, {{.*}}@[[DATA]]{{.*}}) {{.*}}, !nosanitize
// MS-TRAP: call void @__cfi_slowpath(i64 4195979634929632483, i8* %{{.*}}) {{.*}}, !nosanitize
// ITANIUM-DIAG: declare void @__cfi_slowpath_diag(
// ITANIUM-TRAP: declare void @__cfi_slowpath(
// MS-DIAG: declare dso_local void @__cfi_slowpath_diag(
// MS-TRAP: declare dso_local void @__cfi_slowpath(
void caller(void (*f)()) {
f();
}
// Check that we emit both string and hash based type entries for static void g(),
// and don't emit them for the declaration of h().
// CHECK: define internal void @g({{.*}} !type [[TVOID:![0-9]+]] !type [[TVOID_GENERALIZED:![0-9]+]] !type [[TVOID_ID:![0-9]+]]
static void g(void) {}
// CHECK: declare {{(dso_local )?}}void @h({{[^!]*$}}
void h(void);
typedef void (*Fn)(void);
Fn g1() {
return &g;
}
Fn h1() {
return &h;
}
// CHECK: define {{(dso_local )?}}void @bar({{.*}} !type [[TNOPROTO:![0-9]+]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID:![0-9]+]]
// ITANIUM: define available_externally void @foo({{[^!]*$}}
// MS: define linkonce_odr dso_local void @foo({{.*}} !type [[TNOPROTO]] !type [[TNOPROTO_GENERALIZED:![0-9]+]] !type [[TNOPROTO_ID]]
inline void foo() {}
void bar() { foo(); }
// ITANIUM: define weak void @__cfi_check
// MS: define weak dso_local void @__cfi_check
// CHECK: !{i32 4, !"Cross-DSO CFI", i32 1}
// Check that the type entries are correct.
// ITANIUM: [[TVOID]] = !{i64 0, !"_ZTSFvvE"}
// ITANIUM: [[TVOID_GENERALIZED]] = !{i64 0, !"_ZTSFvvE.generalized"}
// ITANIUM: [[TVOID_ID]] = !{i64 0, i64 9080559750644022485}
// ITANIUM: [[TNOPROTO]] = !{i64 0, !"_ZTSFvE"}
// ITANIUM: [[TNOPROTO_GENERALIZED]] = !{i64 0, !"_ZTSFvE.generalized"}
// ITANIUM: [[TNOPROTO_ID]] = !{i64 0, i64 6588678392271548388}
// MS: [[TVOID]] = !{i64 0, !"?6AXXZ"}
// MS: [[TVOID_GENERALIZED]] = !{i64 0, !"?6AXXZ.generalized"}
// MS: [[TVOID_ID]] = !{i64 0, i64 5113650790573562461}
// MS: [[TNOPROTO]] = !{i64 0, !"?6AX@Z"}
// MS: [[TNOPROTO_GENERALIZED]] = !{i64 0, !"?6AX@Z.generalized"}
// MS: [[TNOPROTO_ID]] = !{i64 0, i64 4195979634929632483}
|
/* include/linux/cm3629.h
*
* Copyright (C) 2010 HTC, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*
*/
#ifndef __LINUX_CM3629_H
#define __LINUX_CM3629_H
#define CM3629_I2C_NAME "CM3629"
/* Define Slave Address*/
/*
#define ALS_slave_address 0x30
#define ALS_slave_read 0x31
#define PS_slave_address 0x32
#define PS_slave_read 0x33
*/
/*Define ALS Command Code*/
#define ALS_config_cmd 0x00
#define ALS_high_thd 0x01
#define ALS_low_thd 0x02
/* Define PS Command Code*/
#define PS_config 0x03
#define PS_config_ms 0x04
#define PS_CANC 0x05
#define PS_1_thd 0x06
#define PS_2_thd 0x07
#define PS_data 0x08
#define ALS_data 0x09
#define WS_data 0x0A
#define INT_FLAG 0x0B
#define CH_ID 0x0C
/*Define Interrupt address*/
/*#define check_interrupt_add 0x18*/
#define ALS_CALIBRATED 0x6DA5
#define PS_CALIBRATED 0x5053
/*CM3629*/
/*for ALS command 00h_L*/
/*Engineer sample*/
#define CM3629_ALS_IT_50ms (0 << 6)
#define CM3629_ALS_IT_100ms (1 << 6)
#define CM3629_ALS_IT_200ms (2 << 6)
#define CM3629_ALS_IT_400ms (3 << 6)
/*MP sample*/
#define CM3629_ALS_IT_80ms (0 << 6)
#define CM3629_ALS_IT_160ms (1 << 6)
#define CM3629_ALS_IT_320ms (2 << 6)
#define CM3629_ALS_IT_640ms (3 << 6)
#define CM3629_ALS_AV_1 (0 << 4)
#define CM3629_ALS_AV_2 (1 << 4)
#define CM3629_ALS_AV_4 (2 << 4)
#define CM3629_ALS_AV_8 (3 << 4)
#define CM3629_ALS_PERS_1 (0 << 2) /* ALS persistence */
#define CM3629_ALS_PERS_2 (1 << 2)
#define CM3629_ALS_PERS_4 (2 << 2)
#define CM3629_ALS_PERS_8 (3 << 2)
#define CM3629_ALS_INT_EN (1 << 1) /* 1: Enable interrupt */
#define CM3629_ALS_SD (1 << 0) /* 1: Disable ALS */
/*for PS command 00h_H*/
#define CM3629_PS_63_STEPS (0 << 4)
#define CM3629_PS_120_STEPS (1 << 4)
#define CM3629_PS_191_STEPS (2 << 4)
#define CM3629_PS_255_STEPS (3 << 4)
/*for PS command 03h_L*/
#define CM3629_PS_DR_1_40 (0 << 6)
#define CM3629_PS_DR_1_80 (1 << 6)
#define CM3629_PS_DR_1_160 (2 << 6)
#define CM3629_PS_DR_1_320 (3 << 6)
#define CM3629_PS_IT_1T (0 << 4)
#define CM3629_PS_IT_1_3T (1 << 4)
#define CM3629_PS_IT_1_6T (2 << 4)
#define CM3629_PS_IT_2T (3 << 4)
#define CM3629_PS1_PERS_1 (0 << 2)
#define CM3629_PS1_PERS_2 (1 << 2)
#define CM3629_PS1_PERS_3 (2 << 2)
#define CM3629_PS1_PERS_4 (3 << 2)
#define CM3629_PS2_SD (1 << 1) /* 0: Enable PS2, 1: Disable PS2 */
#define CM3629_PS1_SD (1 << 0) /* 0: Enable PS1, 1: Disable PS1 */
/*for PS command 03h_H*/
#define CM3629_PS_ITB_1_2 (0 << 6)
#define CM3629_PS_ITB_1 (1 << 6)
#define CM3629_PS_ITB_2 (2 << 6)
#define CM3629_PS_ITB_4 (3 << 6)
#define CM3629_PS_ITR_1 (0 << 4)
#define CM3629_PS_ITR_1_2 (1 << 4)
#define CM3629_PS_ITR_1_4 (2 << 4)
#define CM3629_PS_ITR_1_8 (3 << 4)
#define CM3629_PS2_INT_DIS (0 << 2)
#define CM3629_PS2_INT_CLS (1 << 2)
#define CM3629_PS2_INT_AWY (2 << 2)
#define CM3629_PS2_INT_BOTH (3 << 2)
#define CM3629_PS1_INT_DIS (0 << 0)
#define CM3629_PS1_INT_CLS (1 << 0)
#define CM3629_PS1_INT_AWY (2 << 0)
#define CM3629_PS1_INT_BOTH (3 << 0)
/*for PS command 04h_L*/
#define CM3629_PS2_PROL_4 (0 << 6)
#define CM3629_PS2_PROL_8 (1 << 6)
#define CM3629_PS2_PROL_16 (2 << 6)
#define CM3629_PS2_PROL_32 (3 << 6)
#define CM3629_PS_INTT (1 << 5)
#define CM3629_PS_SMART_PRES (1 << 4)
#define CM3629_PS_PS_FOR (1 << 3)
#define CM3629_PS_PS_TRIG (1 << 2)
#define CM3629_PS2_PERS_1 (0 << 0)
#define CM3629_PS2_PERS_2 (1 << 0)
#define CM3629_PS2_PERS_3 (2 << 0)
#define CM3629_PS2_PERS_4 (3 << 0)
/*for PS command 04h_H*/
#define CM3629_PS_MS (1 << 5)
/*for Interrupt command 0Bh_H*/
#define CM3629_PS2_SPFLAG (1 << 7)
#define CM3629_PS1_SPFLAG (1 << 6)
#define CM3629_ALS_IF_L (1 << 5)
#define CM3629_ALS_IF_H (1 << 4)
#define CM3629_PS2_IF_CLOSE (1 << 3)
#define CM3629_PS2_IF_AWAY (1 << 2)
#define CM3629_PS1_IF_CLOSE (1 << 1)
#define CM3629_PS1_IF_AWAY (1 << 0)
extern unsigned int ps_kparam1;
extern unsigned int ps_kparam2;
extern unsigned int als_kadc;
extern unsigned int ws_kadc;
enum {
CAPELLA_CM36282,
CAPELLA_CM36292,
};
enum {
CM3629_PS_DISABLE,
CM3629_PS1_ONLY,
CM3629_PS2_ONLY,
CM3629_PS1_PS2_BOTH,
};
int get_lightsensoradc(void);
int get_lightsensorkadc(void);
struct cm3629_platform_data {
int model;
int intr;
uint16_t levels[10];
uint16_t correction[10];
uint16_t golden_adc;
int (*power)(int, uint8_t); /* power to the chip */
int (*lpm_power)(uint8_t); /* power to the chip */
uint16_t cm3629_slave_address;
uint8_t ps_select;
uint8_t ps1_thd_set;
uint8_t ps1_thh_diff;
uint8_t ps2_thd_set;
uint8_t inte_cancel_set;
/*command code 0x02, intelligent cancel level, for ps calibration*/
uint8_t ps_conf2_val; /* PS_CONF2 value */
uint8_t *mapping_table;
uint8_t mapping_size;
uint8_t ps_base_index;
uint8_t ps_calibration_rule;
uint8_t ps_conf1_val;
uint8_t ps_conf3_val;
uint8_t dynamical_threshold;
uint8_t ps1_thd_no_cal;
uint8_t ps1_thd_with_cal;
uint8_t ps2_thd_no_cal;
uint8_t ps2_thd_with_cal;
uint8_t ps_th_add;
uint8_t ls_cmd;
uint8_t ps1_adc_offset;
uint8_t ps2_adc_offset;
uint8_t ps_debounce;
uint16_t ps_delay_time;
unsigned int no_need_change_setting;
uint8_t dark_level;
uint16_t w_golden_adc;
};
#endif
|
/*=============================================================================
Library: CTK
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=============================================================================*/
#ifndef CTKPLUGINGENERATORUIPLUGIN_H
#define CTKPLUGINGENERATORUIPLUGIN_H
#include <ctkPluginActivator.h>
class ctkPluginGeneratorAbstractUiExtension;
class ctkPluginGeneratorUiPlugin : public QObject,
public ctkPluginActivator
{
Q_OBJECT
Q_INTERFACES(ctkPluginActivator)
#ifdef HAVE_QT5
Q_PLUGIN_METADATA(IID "org_commontk_plugingenerator_ui")
#endif
public:
void start(ctkPluginContext* context);
void stop(ctkPluginContext* context);
private:
ctkPluginGeneratorAbstractUiExtension* mainExtension;
};
#endif // CTKPLUGINGENERATORUIPLUGIN_H
|
//
// CryptoTransform.h
//
// $Id: //poco/1.4/Crypto/include/Poco/Crypto/CryptoTransform.h#2 $
//
// Library: Crypto
// Package: Cipher
// Module: CryptoTransform
//
// Definition of the CryptoTransform class.
//
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Crypto_CryptoTransform_INCLUDED
#define Crypto_CryptoTransform_INCLUDED
#include "Poco/Crypto/Crypto.h"
#include <ios>
namespace Poco {
namespace Crypto {
class Crypto_API CryptoTransform
/// This interface represents the basic operations for cryptographic
/// transformations to be used with a CryptoInputStream or a
/// CryptoOutputStream.
///
/// Implementations of this class are returned by the Cipher class to
/// perform encryption or decryption of data.
{
public:
CryptoTransform();
/// Creates a new CryptoTransform object.
virtual ~CryptoTransform();
/// Destroys the CryptoTransform.
virtual std::size_t blockSize() const = 0;
/// Returns the block size for this CryptoTransform.
virtual int setPadding(int padding);
/// Enables or disables padding. By default encryption operations are padded using standard block
/// padding and the padding is checked and removed when decrypting. If the padding parameter is zero then
/// no padding is performed, the total amount of data encrypted or decrypted must then be a multiple of
/// the block size or an error will occur.
virtual std::streamsize transform(
const unsigned char* input,
std::streamsize inputLength,
unsigned char* output,
std::streamsize outputLength) = 0;
/// Transforms a chunk of data. The inputLength is arbitrary and does not
/// need to be a multiple of the block size. The output buffer has a maximum
/// capacity of the given outputLength that must be at least
/// inputLength + blockSize() - 1
/// Returns the number of bytes written to the output buffer.
virtual std::streamsize finalize(unsigned char* output, std::streamsize length) = 0;
/// Finalizes the transformation. The output buffer must contain enough
/// space for at least two blocks, ie.
/// length >= 2*blockSize()
/// must be true. Returns the number of bytes written to the output
/// buffer.
};
} } // namespace Poco::Crypto
#endif // Crypto_CryptoTransform_INCLUDED
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_COMMON_INPUT_SYNTHETIC_SMOOTH_DRAG_GESTURE_PARAMS_H_
#define CONTENT_COMMON_INPUT_SYNTHETIC_SMOOTH_DRAG_GESTURE_PARAMS_H_
#include <vector>
#include "content/common/content_export.h"
#include "content/common/input/synthetic_gesture_params.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/vector2d.h"
namespace content {
struct CONTENT_EXPORT SyntheticSmoothDragGestureParams
: public SyntheticGestureParams {
public:
SyntheticSmoothDragGestureParams();
SyntheticSmoothDragGestureParams(
const SyntheticSmoothDragGestureParams& other);
~SyntheticSmoothDragGestureParams() override;
GestureType GetGestureType() const override;
gfx::PointF start_point;
std::vector<gfx::Vector2dF> distances;
float speed_in_pixels_s;
static const SyntheticSmoothDragGestureParams* Cast(
const SyntheticGestureParams* gesture_params);
};
} // namespace content
#endif // CONTENT_COMMON_INPUT_SYNTHETIC_SMOOTH_DRAG_GESTURE_PARAMS_H_
|
//===-- MipsSERegisterInfo.h - Mips32/64 Register Information ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the Mips32/64 implementation of the TargetRegisterInfo
// class.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_MIPS_MIPSSEREGISTERINFO_H
#define LLVM_LIB_TARGET_MIPS_MIPSSEREGISTERINFO_H
#include "MipsRegisterInfo.h"
namespace llvm {
class MipsSEInstrInfo;
class MipsSERegisterInfo : public MipsRegisterInfo {
public:
MipsSERegisterInfo(const MipsSubtarget &Subtarget);
bool requiresRegisterScavenging(const MachineFunction &MF) const override;
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override;
const TargetRegisterClass *intRegClass(unsigned Size) const override;
private:
void eliminateFI(MachineBasicBlock::iterator II, unsigned OpNo,
int FrameIndex, uint64_t StackSize,
int64_t SPOffset) const override;
};
} // end namespace llvm
#endif
|
/*************************************************
* Perl-Compatible Regular Expressions *
*************************************************/
/* PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2006 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the University of Cambridge nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/
/* This module contains global variables that are exported by the PCRE library.
PCRE is thread-clean and doesn't use any global variables in the normal sense.
However, it calls memory allocation and freeing functions via the four
indirections below, and it can optionally do callouts, using the fifth
indirection. These values can be changed by the caller, but are shared between
all threads. However, when compiling for Virtual Pascal, things are done
differently, and global variables are not used (see pcre.in). */
#include "pcre_internal.h"
#ifndef VPCOMPAT
#ifdef __cplusplus
extern "C" void *(*pcre_malloc)(size_t) = malloc;
extern "C" void (*pcre_free)(void *) = free;
extern "C" void *(*pcre_stack_malloc)(size_t) = malloc;
extern "C" void (*pcre_stack_free)(void *) = free;
extern "C" int (*pcre_callout)(pcre_callout_block *) = NULL;
#else
void *(*pcre_malloc)(size_t) = malloc;
void (*pcre_free)(void *) = free;
void *(*pcre_stack_malloc)(size_t) = malloc;
void (*pcre_stack_free)(void *) = free;
int (*pcre_callout)(pcre_callout_block *) = NULL;
#endif
#endif
/* End of pcre_globals.c */
|
#include <linux/linkage.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <asm/pmon.h>
#include <asm/titan_dep.h>
#include <asm/time.h>
#define LAUNCHSTACK_SIZE 256
static __cpuinitdata DEFINE_SPINLOCK(launch_lock);
static unsigned long secondary_sp __cpuinitdata;
static unsigned long secondary_gp __cpuinitdata;
static unsigned char launchstack[LAUNCHSTACK_SIZE] __initdata
__attribute__((aligned(2 * sizeof(long))));
static void __init prom_smp_bootstrap(void)
{
local_irq_disable();
while (spin_is_locked(&launch_lock));
__asm__ __volatile__(
" move $sp, %0 \n"
" move $gp, %1 \n"
" j smp_bootstrap \n"
:
: "r" (secondary_sp), "r" (secondary_gp));
}
/*
* PMON is a fragile beast. It'll blow up once the mappings it's littering
* right into the middle of KSEG3 are blown away so we have to grab the slave
* core early and keep it in a waiting loop.
*/
void __init prom_grab_secondary(void)
{
spin_lock(&launch_lock);
pmon_cpustart(1, &prom_smp_bootstrap,
launchstack + LAUNCHSTACK_SIZE, 0);
}
void titan_mailbox_irq(void)
{
int cpu = smp_processor_id();
unsigned long status;
switch (cpu) {
case 0:
status = OCD_READ(RM9000x2_OCD_INTP0STATUS3);
OCD_WRITE(RM9000x2_OCD_INTP0CLEAR3, status);
if (status & 0x2)
smp_call_function_interrupt();
break;
case 1:
status = OCD_READ(RM9000x2_OCD_INTP1STATUS3);
OCD_WRITE(RM9000x2_OCD_INTP1CLEAR3, status);
if (status & 0x2)
smp_call_function_interrupt();
break;
}
}
/*
* Send inter-processor interrupt
*/
static void yos_send_ipi_single(int cpu, unsigned int action)
{
/*
* Generate an INTMSG so that it can be sent over to the
* destination CPU. The INTMSG will put the STATUS bits
* based on the action desired. An alternative strategy
* is to write to the Interrupt Set register, read the
* Interrupt Status register and clear the Interrupt
* Clear register. The latter is preffered.
*/
switch (action) {
case SMP_RESCHEDULE_YOURSELF:
if (cpu == 1)
OCD_WRITE(RM9000x2_OCD_INTP1SET3, 4);
else
OCD_WRITE(RM9000x2_OCD_INTP0SET3, 4);
break;
case SMP_CALL_FUNCTION:
if (cpu == 1)
OCD_WRITE(RM9000x2_OCD_INTP1SET3, 2);
else
OCD_WRITE(RM9000x2_OCD_INTP0SET3, 2);
break;
}
}
static void yos_send_ipi_mask(cpumask_t mask, unsigned int action)
{
unsigned int i;
for_each_cpu_mask(i, mask)
yos_send_ipi_single(i, action);
}
/*
* After we've done initial boot, this function is called to allow the
* board code to clean up state, if needed
*/
static void __cpuinit yos_init_secondary(void)
{
set_c0_status(ST0_CO | ST0_IE | ST0_IM);
}
static void __cpuinit yos_smp_finish(void)
{
}
/* Hook for after all CPUs are online */
static void yos_cpus_done(void)
{
}
/*
* Firmware CPU startup hook
* Complicated by PMON's weird interface which tries to minimic the UNIX fork.
* It launches the next * available CPU and copies some information on the
* stack so the first thing we do is throw away that stuff and load useful
* values into the registers ...
*/
static void __cpuinit yos_boot_secondary(int cpu, struct task_struct *idle)
{
unsigned long gp = (unsigned long) task_thread_info(idle);
unsigned long sp = __KSTK_TOS(idle);
secondary_sp = sp;
secondary_gp = gp;
spin_unlock(&launch_lock);
}
/*
* Detect available CPUs, populate cpu_possible_map before smp_init
*
* We don't want to start the secondary CPU yet nor do we have a nice probing
* feature in PMON so we just assume presence of the secondary core.
*/
static void __init yos_smp_setup(void)
{
int i;
cpus_clear(cpu_possible_map);
for (i = 0; i < 2; i++) {
cpu_set(i, cpu_possible_map);
__cpu_number_map[i] = i;
__cpu_logical_map[i] = i;
}
}
static void __init yos_prepare_cpus(unsigned int max_cpus)
{
/*
* Be paranoid. Enable the IPI only if we're really about to go SMP.
*/
if (cpus_weight(cpu_possible_map))
set_c0_status(STATUSF_IP5);
}
struct plat_smp_ops yos_smp_ops = {
.send_ipi_single = yos_send_ipi_single,
.send_ipi_mask = yos_send_ipi_mask,
.init_secondary = yos_init_secondary,
.smp_finish = yos_smp_finish,
.cpus_done = yos_cpus_done,
.boot_secondary = yos_boot_secondary,
.smp_setup = yos_smp_setup,
.prepare_cpus = yos_prepare_cpus,
};
|
/***************************************************************
* Name: Thumbnail.h
* Purpose: Defines canvas thumbnail class
* Author: Michal Bližňák (michal.bliznak@tiscali.cz)
* Created: 2009-06-09
* Copyright: Michal Bližňák
* License: wxWidgets license (www.wxwidgets.org)
* Notes:
**************************************************************/
#ifndef _WXSFTHUMBNAIL_H
#define _WXSFTHUMBNAIL_H
#include <wx/wxsf/ShapeCanvas.h>
/**
* \brief Class encalpsulating a shape canvas' thumbnail. This GUI control derived from wxPanel can be associated with
* one shape canvas and can be used for previewing and manipulating of it.
*/
class WXDLLIMPEXP_SF wxSFThumbnail : public wxPanel
{
public:
/** \brief Internally used IDs */
enum IDS
{
ID_UPDATETIMER = wxID_HIGHEST + 1,
IDM_SHOWELEMENTS,
IDM_SHOWCONNECTIONS
};
/** \brief Thumbnail style */
enum THUMBSTYLE
{
/** \brief Show diagram elements (excluding connections) in the thumbnail. */
tsSHOW_ELEMENTS = 1,
/** \brief Show diagram connections in the thumbnail. */
tsSHOW_CONNECTIONS = 2
};
/**
* \brief Constructor.
* \param parent Pointer to parent window
*/
wxSFThumbnail(wxWindow *parent);
/** \brief Destructor. */
virtual ~wxSFThumbnail();
// public member data accessors
/**
* \brief Set the thumbnail style.
* \param style Style value composed of predefined flags
* \sa THUMBSTYLE
*/
void SetThumbStyle(int style) { m_nThumbStyle = style; }
/**
* \brief Get current thumbnail style.
* \return Style value composed of predefined flags
* \sa THUMBSTYLE
*/
int GetThumbStyle() { return m_nThumbStyle; }
// public functions
/**
* \brief Set canvas managed by the thumbnail.
* \param canvas Pointer to shape canvas
*/
void SetCanvas(wxSFShapeCanvas *canvas);
// public virtual functions
/**
* \brief Implementation of drawing of the thumbnail's content. This virtual function can be overrided
* by the user for customization of the thumbnail appearance.
* \param dc Reference to output device context
*/
virtual void DrawContent(wxDC &dc);
protected:
// protected data members
wxSFShapeCanvas *m_pCanvas; /** \brief Pointer to managed shape canvas. */
wxTimer m_UpdateTimer; /** \brief Timer user for the thumbnail's update */
wxPoint m_nPrevMousePos; /** \brief Auxiliary varialble */
double m_nScale; /** \brief Current thumbnail's scale */
int m_nThumbStyle; /** \brief Current thumbnail's style */
// protected event handlers
/** \brief Internally used event handler. */
void _OnPaint( wxPaintEvent &event );
// protected functions
/**
* \brief Get offset (view start) of managed shape canvas defined in pixels.
* \return Canvas offset in pixels
*/
wxSize GetCanvasOffset();
private:
// private event handlers
/** \brief Internally used event handler. */
void _OnEraseBackground( wxEraseEvent& event );
/** \brief Internally used event handler. */
void _OnMouseMove( wxMouseEvent &event );
/** \brief Internally used event handler. */
void _OnLeftDown( wxMouseEvent &event );
/** \brief Internally used event handler. */
void _OnRightDown( wxMouseEvent &event );
/** \brief Internally used event handler. */
void _OnTimer( wxTimerEvent &event );
/** \brief Internally used event handler. */
void _OnShowElements( wxCommandEvent &event );
/** \brief Internally used event handler. */
void _OnShowConnections( wxCommandEvent &event );
/** \brief Internally used event handler. */
void _OnUpdateShowElements( wxUpdateUIEvent &event );
/** \brief Internally used event handler. */
void _OnUpdateShowConnections( wxUpdateUIEvent &event );
DECLARE_EVENT_TABLE();
};
#endif //_WXSFTHUMBNAIL_H
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#import <Foundation/Foundation.h>
@class TiViewProxy;
/**
Layout queue utility class.
*/
@interface TiLayoutQueue : NSObject {
}
/**
Adds view proxy to the layout queue.
@param newViewProxy The view proxy to add.
*/
+(void)addViewProxy:(TiViewProxy*)newViewProxy;
/**
Forces view proxy refresh.
@param thisProxy The view proxy to layout.
*/
+(void)layoutProxy:(TiViewProxy*)thisProxy;
+(void)resetQueue;
@end
|
#ifndef MUPDF_FITZ_UNZIP_H
#define MUPDF_FITZ_UNZIP_H
#include "mupdf/fitz/system.h"
#include "mupdf/fitz/context.h"
#include "mupdf/fitz/buffer.h"
#include "mupdf/fitz/stream.h"
typedef struct fz_archive_s fz_archive;
fz_archive *fz_open_directory(fz_context *ctx, const char *dirname);
fz_archive *fz_open_archive(fz_context *ctx, const char *filename);
fz_archive *fz_open_archive_with_stream(fz_context *ctx, fz_stream *file);
int fz_has_archive_entry(fz_context *ctx, fz_archive *zip, const char *name);
fz_stream *fz_open_archive_entry(fz_context *ctx, fz_archive *zip, const char *entry);
fz_buffer *fz_read_archive_entry(fz_context *ctx, fz_archive *zip, const char *entry);
void fz_drop_archive(fz_context *ctx, fz_archive *ar);
int fz_count_archive_entries(fz_context *ctx, fz_archive *zip);
const char *fz_list_archive_entry(fz_context *ctx, fz_archive *zip, int idx);
#endif
|
/* Test AAPCS layout (VFP variant) */
/* { dg-do run { target arm_eabi } } */
/* { dg-require-effective-target arm_hard_vfp_ok } */
/* { dg-require-effective-target arm_fp16_hw } */
/* { dg-add-options arm_fp16_alternative } */
#ifndef IN_FRAMEWORK
#define VFP
#define TESTFILE "vfp24.c"
#define PCSATTR __attribute__((pcs("aapcs")))
#include "abitest.h"
#else
ARG (float, 1.0f, R0)
ARG (double, 2.0, R2)
ARG (float, 3.0f, STACK)
ARG (__fp16, 2.0f, STACK+4)
LAST_ARG (double, 4.0, STACK+8)
#endif
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QPIXMAPDATA_RASTER_P_H
#define QPIXMAPDATA_RASTER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtGui/private/qpixmapdata_p.h>
#include <QtGui/private/qpixmapdatafactory_p.h>
#ifdef Q_WS_WIN
# include "qt_windows.h"
#endif
QT_BEGIN_NAMESPACE
class Q_GUI_EXPORT QRasterPixmapData : public QPixmapData
{
public:
QRasterPixmapData(PixelType type);
~QRasterPixmapData();
QPixmapData *createCompatiblePixmapData() const;
void resize(int width, int height);
void fromFile(const QString &filename, Qt::ImageConversionFlags flags);
bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags);
void copy(const QPixmapData *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
void fill(const QColor &color);
void setMask(const QBitmap &mask);
bool hasAlphaChannel() const;
void setAlphaChannel(const QPixmap &alphaChannel);
QImage toImage() const;
QImage toImage(const QRect &rect) const;
QPaintEngine* paintEngine() const;
QImage* buffer();
protected:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
void createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace);
void setImage(const QImage &image);
QImage image;
private:
friend class QPixmap;
friend class QBitmap;
friend class QPixmapCacheEntry;
friend class QRasterPaintEngine;
};
QT_END_NAMESPACE
#endif // QPIXMAPDATA_RASTER_P_H
|
/*
* Copyright (C) 2007-2009 Luc Verhaegen <libv@skynet.be>
*
* 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* All IO necessary to poke VGA registers.
*/
#include <pc80/vga_io.h>
#include <arch/io.h>
#define VGA_CR_INDEX 0x3D4
#define VGA_CR_VALUE 0x3D5
#define VGA_SR_INDEX 0x3C4
#define VGA_SR_VALUE 0x3C5
#define VGA_GR_INDEX 0x3CE
#define VGA_GR_VALUE 0x3CF
#define VGA_AR_INDEX 0x3C0
#define VGA_AR_VALUE_READ 0x3C1
#define VGA_AR_VALUE_WRITE VGA_AR_INDEX
#define VGA_MISC_WRITE 0x3C2
#define VGA_MISC_READ 0x3CC
#define VGA_ENABLE 0x3C3
#define VGA_STAT1 0x3DA
#define VGA_DAC_MASK 0x3C6
#define VGA_DAC_READ_ADDRESS 0x3C7
#define VGA_DAC_WRITE_ADDRESS 0x3C8
#define VGA_DAC_DATA 0x3C9
/*
* VGA enable. Poke this to have the PCI IO enabled device accept VGA IO.
*/
unsigned char
vga_enable_read(void)
{
return inb(VGA_ENABLE);
}
void
vga_enable_write(unsigned char value)
{
outb(value, VGA_ENABLE);
}
void
vga_enable_mask(unsigned char value, unsigned char mask)
{
unsigned char tmp;
tmp = vga_enable_read();
tmp &= ~mask;
tmp |= (value & mask);
vga_enable_write(tmp);
}
/*
* Miscellaneous register.
*/
unsigned char
vga_misc_read(void)
{
return inb(VGA_MISC_READ);
}
void
vga_misc_write(unsigned char value)
{
outb(value, VGA_MISC_WRITE);
}
void
vga_misc_mask(unsigned char value, unsigned char mask)
{
unsigned char tmp;
tmp = vga_misc_read();
tmp &= ~mask;
tmp |= (value & mask);
vga_misc_write(tmp);
}
/*
* Sequencer registers.
*/
unsigned char
vga_sr_read(unsigned char index)
{
outb(index, VGA_SR_INDEX);
return (inb(VGA_SR_VALUE));
}
void
vga_sr_write(unsigned char index, unsigned char value)
{
outb(index, VGA_SR_INDEX);
outb(value, VGA_SR_VALUE);
}
void
vga_sr_mask(unsigned char index, unsigned char value, unsigned char mask)
{
unsigned char tmp;
tmp = vga_sr_read(index);
tmp &= ~mask;
tmp |= (value & mask);
vga_sr_write(index, tmp);
}
/*
* CRTC registers.
*/
unsigned char
vga_cr_read(unsigned char index)
{
outb(index, VGA_CR_INDEX);
return (inb(VGA_CR_VALUE));
}
void
vga_cr_write(unsigned char index, unsigned char value)
{
outb(index, VGA_CR_INDEX);
outb(value, VGA_CR_VALUE);
}
void
vga_cr_mask(unsigned char index, unsigned char value, unsigned char mask)
{
unsigned char tmp;
tmp = vga_cr_read(index);
tmp &= ~mask;
tmp |= (value & mask);
vga_cr_write(index, tmp);
}
/*
* Attribute registers.
*/
unsigned char
vga_ar_read(unsigned char index)
{
unsigned char ret;
(void) inb(VGA_STAT1);
outb(index, VGA_AR_INDEX);
ret = inb(VGA_AR_VALUE_READ);
(void) inb(VGA_STAT1);
return ret;
}
void
vga_ar_write(unsigned char index, unsigned char value)
{
(void) inb(VGA_STAT1);
outb(index, VGA_AR_INDEX);
outb(value, VGA_AR_VALUE_WRITE);
(void) inb(VGA_STAT1);
}
void
vga_ar_mask(unsigned char index, unsigned char value, unsigned char mask)
{
unsigned char tmp;
tmp = vga_ar_read(index);
tmp &= ~mask;
tmp |= (value & mask);
vga_ar_write(index, tmp);
}
/*
* Graphics registers.
*/
unsigned char
vga_gr_read(unsigned char index)
{
outb(index, VGA_GR_INDEX);
return (inb(VGA_GR_VALUE));
}
void
vga_gr_write(unsigned char index, unsigned char value)
{
outb(index, VGA_GR_INDEX);
outb(value, VGA_GR_VALUE);
}
void
vga_gr_mask(unsigned char index, unsigned char value, unsigned char mask)
{
unsigned char tmp;
tmp = vga_gr_read(index);
tmp &= ~mask;
tmp |= (value & mask);
vga_gr_write(index, tmp);
}
/*
* DAC functions.
*/
void
vga_palette_enable(void)
{
(void) inb(VGA_STAT1);
outb(0x00, VGA_AR_INDEX);
(void) inb(VGA_STAT1);
}
void
vga_palette_disable(void)
{
(void) inb(VGA_STAT1);
outb(0x20, VGA_AR_INDEX);
(void) inb(VGA_STAT1);
}
unsigned char
vga_dac_mask_read(void)
{
return inb(VGA_DAC_MASK);
}
void
vga_dac_mask_write(unsigned char mask)
{
outb(mask, VGA_DAC_MASK);
}
void
vga_dac_read_address(unsigned char address)
{
outb(address, VGA_DAC_READ_ADDRESS);
}
void
vga_dac_write_address(unsigned char address)
{
outb(address, VGA_DAC_WRITE_ADDRESS);
}
unsigned char
vga_dac_data_read(void)
{
return inb(VGA_DAC_DATA);
}
void
vga_dac_data_write(unsigned char data)
{
outb(data, VGA_DAC_DATA);
}
|
/*
* SPDX-License-Identifier: MIT
*
* Copyright © 2016 Intel Corporation
*/
#include "i915_scatterlist.h"
#include "huge_gem_object.h"
static void huge_free_pages(struct drm_i915_gem_object *obj,
struct sg_table *pages)
{
unsigned long nreal = obj->scratch / PAGE_SIZE;
struct sgt_iter sgt_iter;
struct page *page;
for_each_sgt_page(page, sgt_iter, pages) {
__free_page(page);
if (!--nreal)
break;
}
sg_free_table(pages);
kfree(pages);
}
static int huge_get_pages(struct drm_i915_gem_object *obj)
{
#define GFP (GFP_KERNEL | __GFP_NOWARN | __GFP_RETRY_MAYFAIL)
const unsigned long nreal = obj->scratch / PAGE_SIZE;
const unsigned long npages = obj->base.size / PAGE_SIZE;
struct scatterlist *sg, *src, *end;
struct sg_table *pages;
unsigned long n;
pages = kmalloc(sizeof(*pages), GFP);
if (!pages)
return -ENOMEM;
if (sg_alloc_table(pages, npages, GFP)) {
kfree(pages);
return -ENOMEM;
}
sg = pages->sgl;
for (n = 0; n < nreal; n++) {
struct page *page;
page = alloc_page(GFP | __GFP_HIGHMEM);
if (!page) {
sg_mark_end(sg);
goto err;
}
sg_set_page(sg, page, PAGE_SIZE, 0);
sg = __sg_next(sg);
}
if (nreal < npages) {
for (end = sg, src = pages->sgl; sg; sg = __sg_next(sg)) {
sg_set_page(sg, sg_page(src), PAGE_SIZE, 0);
src = __sg_next(src);
if (src == end)
src = pages->sgl;
}
}
if (i915_gem_gtt_prepare_pages(obj, pages))
goto err;
__i915_gem_object_set_pages(obj, pages, PAGE_SIZE);
return 0;
err:
huge_free_pages(obj, pages);
return -ENOMEM;
#undef GFP
}
static void huge_put_pages(struct drm_i915_gem_object *obj,
struct sg_table *pages)
{
i915_gem_gtt_finish_pages(obj, pages);
huge_free_pages(obj, pages);
obj->mm.dirty = false;
}
static const struct drm_i915_gem_object_ops huge_ops = {
.name = "huge-gem",
.flags = I915_GEM_OBJECT_HAS_STRUCT_PAGE,
.get_pages = huge_get_pages,
.put_pages = huge_put_pages,
};
struct drm_i915_gem_object *
huge_gem_object(struct drm_i915_private *i915,
phys_addr_t phys_size,
dma_addr_t dma_size)
{
static struct lock_class_key lock_class;
struct drm_i915_gem_object *obj;
unsigned int cache_level;
GEM_BUG_ON(!phys_size || phys_size > dma_size);
GEM_BUG_ON(!IS_ALIGNED(phys_size, PAGE_SIZE));
GEM_BUG_ON(!IS_ALIGNED(dma_size, I915_GTT_PAGE_SIZE));
if (overflows_type(dma_size, obj->base.size))
return ERR_PTR(-E2BIG);
obj = i915_gem_object_alloc();
if (!obj)
return ERR_PTR(-ENOMEM);
drm_gem_private_object_init(&i915->drm, &obj->base, dma_size);
i915_gem_object_init(obj, &huge_ops, &lock_class);
obj->read_domains = I915_GEM_DOMAIN_CPU;
obj->write_domain = I915_GEM_DOMAIN_CPU;
cache_level = HAS_LLC(i915) ? I915_CACHE_LLC : I915_CACHE_NONE;
i915_gem_object_set_cache_coherency(obj, cache_level);
obj->scratch = phys_size;
return obj;
}
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Shared descriptors for aead, skcipher algorithms
*
* Copyright 2016 NXP
*/
#ifndef _CAAMALG_DESC_H_
#define _CAAMALG_DESC_H_
/* length of descriptors text */
#define DESC_AEAD_BASE (4 * CAAM_CMD_SZ)
#define DESC_AEAD_ENC_LEN (DESC_AEAD_BASE + 11 * CAAM_CMD_SZ)
#define DESC_AEAD_DEC_LEN (DESC_AEAD_BASE + 15 * CAAM_CMD_SZ)
#define DESC_AEAD_GIVENC_LEN (DESC_AEAD_ENC_LEN + 7 * CAAM_CMD_SZ)
#define DESC_QI_AEAD_ENC_LEN (DESC_AEAD_ENC_LEN + 3 * CAAM_CMD_SZ)
#define DESC_QI_AEAD_DEC_LEN (DESC_AEAD_DEC_LEN + 3 * CAAM_CMD_SZ)
#define DESC_QI_AEAD_GIVENC_LEN (DESC_AEAD_GIVENC_LEN + 3 * CAAM_CMD_SZ)
/* Note: Nonce is counted in cdata.keylen */
#define DESC_AEAD_CTR_RFC3686_LEN (4 * CAAM_CMD_SZ)
#define DESC_AEAD_NULL_BASE (3 * CAAM_CMD_SZ)
#define DESC_AEAD_NULL_ENC_LEN (DESC_AEAD_NULL_BASE + 11 * CAAM_CMD_SZ)
#define DESC_AEAD_NULL_DEC_LEN (DESC_AEAD_NULL_BASE + 13 * CAAM_CMD_SZ)
#define DESC_GCM_BASE (3 * CAAM_CMD_SZ)
#define DESC_GCM_ENC_LEN (DESC_GCM_BASE + 16 * CAAM_CMD_SZ)
#define DESC_GCM_DEC_LEN (DESC_GCM_BASE + 12 * CAAM_CMD_SZ)
#define DESC_QI_GCM_ENC_LEN (DESC_GCM_ENC_LEN + 6 * CAAM_CMD_SZ)
#define DESC_QI_GCM_DEC_LEN (DESC_GCM_DEC_LEN + 3 * CAAM_CMD_SZ)
#define DESC_RFC4106_BASE (3 * CAAM_CMD_SZ)
#define DESC_RFC4106_ENC_LEN (DESC_RFC4106_BASE + 13 * CAAM_CMD_SZ)
#define DESC_RFC4106_DEC_LEN (DESC_RFC4106_BASE + 13 * CAAM_CMD_SZ)
#define DESC_QI_RFC4106_ENC_LEN (DESC_RFC4106_ENC_LEN + 5 * CAAM_CMD_SZ)
#define DESC_QI_RFC4106_DEC_LEN (DESC_RFC4106_DEC_LEN + 5 * CAAM_CMD_SZ)
#define DESC_RFC4543_BASE (3 * CAAM_CMD_SZ)
#define DESC_RFC4543_ENC_LEN (DESC_RFC4543_BASE + 11 * CAAM_CMD_SZ)
#define DESC_RFC4543_DEC_LEN (DESC_RFC4543_BASE + 12 * CAAM_CMD_SZ)
#define DESC_QI_RFC4543_ENC_LEN (DESC_RFC4543_ENC_LEN + 4 * CAAM_CMD_SZ)
#define DESC_QI_RFC4543_DEC_LEN (DESC_RFC4543_DEC_LEN + 4 * CAAM_CMD_SZ)
#define DESC_SKCIPHER_BASE (3 * CAAM_CMD_SZ)
#define DESC_SKCIPHER_ENC_LEN (DESC_SKCIPHER_BASE + \
21 * CAAM_CMD_SZ)
#define DESC_SKCIPHER_DEC_LEN (DESC_SKCIPHER_BASE + \
16 * CAAM_CMD_SZ)
void cnstr_shdsc_aead_null_encap(u32 * const desc, struct alginfo *adata,
unsigned int icvsize, int era);
void cnstr_shdsc_aead_null_decap(u32 * const desc, struct alginfo *adata,
unsigned int icvsize, int era);
void cnstr_shdsc_aead_encap(u32 * const desc, struct alginfo *cdata,
struct alginfo *adata, unsigned int ivsize,
unsigned int icvsize, const bool is_rfc3686,
u32 *nonce, const u32 ctx1_iv_off,
const bool is_qi, int era);
void cnstr_shdsc_aead_decap(u32 * const desc, struct alginfo *cdata,
struct alginfo *adata, unsigned int ivsize,
unsigned int icvsize, const bool geniv,
const bool is_rfc3686, u32 *nonce,
const u32 ctx1_iv_off, const bool is_qi, int era);
void cnstr_shdsc_aead_givencap(u32 * const desc, struct alginfo *cdata,
struct alginfo *adata, unsigned int ivsize,
unsigned int icvsize, const bool is_rfc3686,
u32 *nonce, const u32 ctx1_iv_off,
const bool is_qi, int era);
void cnstr_shdsc_gcm_encap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, unsigned int icvsize,
const bool is_qi);
void cnstr_shdsc_gcm_decap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, unsigned int icvsize,
const bool is_qi);
void cnstr_shdsc_rfc4106_encap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, unsigned int icvsize,
const bool is_qi);
void cnstr_shdsc_rfc4106_decap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, unsigned int icvsize,
const bool is_qi);
void cnstr_shdsc_rfc4543_encap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, unsigned int icvsize,
const bool is_qi);
void cnstr_shdsc_rfc4543_decap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, unsigned int icvsize,
const bool is_qi);
void cnstr_shdsc_chachapoly(u32 * const desc, struct alginfo *cdata,
struct alginfo *adata, unsigned int ivsize,
unsigned int icvsize, const bool encap,
const bool is_qi);
void cnstr_shdsc_skcipher_encap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, const bool is_rfc3686,
const u32 ctx1_iv_off);
void cnstr_shdsc_skcipher_decap(u32 * const desc, struct alginfo *cdata,
unsigned int ivsize, const bool is_rfc3686,
const u32 ctx1_iv_off);
void cnstr_shdsc_xts_skcipher_encap(u32 * const desc, struct alginfo *cdata);
void cnstr_shdsc_xts_skcipher_decap(u32 * const desc, struct alginfo *cdata);
#endif /* _CAAMALG_DESC_H_ */
|
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Derived from PCRE's pcreposix.h.
Copyright (c) 1997-2004 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the University of Cambridge nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/
/**
* @file ap_regex.h
* @brief Apache Regex defines
*/
#ifndef AP_REGEX_H
#define AP_REGEX_H
#include "apr.h"
/* Allow for C++ users */
#ifdef __cplusplus
extern "C" {
#endif
/* Options for ap_regexec: */
#define AP_REG_ICASE 0x01 /** use a case-insensitive match */
#define AP_REG_NEWLINE 0x02 /** don't match newlines against '.' etc */
#define AP_REG_NOTBOL 0x04 /** ^ will not match against start-of-string */
#define AP_REG_NOTEOL 0x08 /** $ will not match against end-of-string */
#define AP_REG_EXTENDED (0) /** unused */
#define AP_REG_NOSUB (0) /** unused */
/* Error values: */
enum {
AP_REG_ASSERT = 1, /** internal error ? */
AP_REG_ESPACE, /** failed to get memory */
AP_REG_INVARG, /** invalid argument */
AP_REG_NOMATCH /** match failed */
};
/* The structure representing a compiled regular expression. */
typedef struct {
void *re_pcre;
apr_size_t re_nsub;
apr_size_t re_erroffset;
} ap_regex_t;
/* The structure in which a captured offset is returned. */
typedef struct {
int rm_so;
int rm_eo;
} ap_regmatch_t;
/* The functions */
/**
* Compile a regular expression.
* @param preg Returned compiled regex
* @param regex The regular expression string
* @param cflags Bitwise OR of AP_REG_* flags (ICASE and NEWLINE supported,
* other flags are ignored)
* @return Zero on success or non-zero on error
*/
AP_DECLARE(int) ap_regcomp(ap_regex_t *preg, const char *regex, int cflags);
/**
* Match a NUL-terminated string against a pre-compiled regex.
* @param preg The pre-compiled regex
* @param string The string to match
* @param nmatch Provide information regarding the location of any matches
* @param pmatch Provide information regarding the location of any matches
* @param eflags Bitwise OR of AP_REG_* flags (NOTBOL and NOTEOL supported,
* other flags are ignored)
* @return 0 for successful match, AP_REG_NOMATCH otherwise
*/
AP_DECLARE(int) ap_regexec(const ap_regex_t *preg, const char *string,
apr_size_t nmatch, ap_regmatch_t *pmatch, int eflags);
/**
* Return the error code returned by regcomp or regexec into error messages
* @param errcode the error code returned by regexec or regcomp
* @param preg The precompiled regex
* @param errbuf A buffer to store the error in
* @param errbuf_size The size of the buffer
*/
AP_DECLARE(apr_size_t) ap_regerror(int errcode, const ap_regex_t *preg,
char *errbuf, apr_size_t errbuf_size);
/** Destroy a pre-compiled regex.
* @param preg The pre-compiled regex to free.
*/
AP_DECLARE(void) ap_regfree(ap_regex_t *preg);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* AP_REGEX_T */
|
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
#ifndef MAP_MAIL_H
#define MAP_MAIL_H
#include "common/hercules.h"
struct item;
struct mail_message;
struct map_session_data;
struct mail_interface {
void (*clear) (struct map_session_data *sd);
int (*removeitem) (struct map_session_data *sd, short flag);
int (*removezeny) (struct map_session_data *sd, short flag);
unsigned char (*setitem) (struct map_session_data *sd, int idx, int amount);
bool (*setattachment) (struct map_session_data *sd, struct mail_message *msg);
void (*getattachment) (struct map_session_data* sd, int zeny, struct item* item);
int (*openmail) (struct map_session_data *sd);
void (*deliveryfail) (struct map_session_data *sd, struct mail_message *msg);
bool (*invalid_operation) (struct map_session_data *sd);
};
#ifdef HERCULES_CORE
void mail_defaults(void);
#endif // HERCULES_CORE
HPShared struct mail_interface *mail;
#endif /* MAP_MAIL_H */
|
/*
* Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef InjectedBundleBackForwardListItem_h
#define InjectedBundleBackForwardListItem_h
#include "APIObject.h"
#include <WebCore/HistoryItem.h>
namespace WebKit {
class ImmutableArray;
class WebPageProxy;
class InjectedBundleBackForwardListItem : public APIObject {
public:
static const Type APIType = TypeBundleBackForwardListItem;
static PassRefPtr<InjectedBundleBackForwardListItem> create(PassRefPtr<WebCore::HistoryItem> item)
{
if (!item)
return 0;
return adoptRef(new InjectedBundleBackForwardListItem(item));
}
WebCore::HistoryItem* item() const { return m_item.get(); }
const String& originalURL() const { return m_item->originalURLString(); }
const String& url() const { return m_item->urlString(); }
const String& title() const { return m_item->title(); }
const String& target() const { return m_item->target(); }
bool isTargetItem() const { return m_item->isTargetItem(); }
PassRefPtr<ImmutableArray> children() const;
private:
InjectedBundleBackForwardListItem(PassRefPtr<WebCore::HistoryItem> item) : m_item(item) { }
virtual Type type() const { return APIType; }
RefPtr<WebCore::HistoryItem> m_item;
};
} // namespace WebKit
#endif // InjectedBundleBackForwardListItem_h
|
//
// AxisDemo.h
// Plot Gallery-Mac
//
#import "PlotItem.h"
@interface AxisDemo : PlotItem<CPTAxisDelegate>
{
}
@end
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
class GURL;
namespace content {
class EmbeddedWorkerInstance;
class EmbeddedWorkerRegistry;
class ServiceWorkerProviderHost;
class ServiceWorkerRegistration;
// This class corresponds to a specific version of a ServiceWorker
// script for a given pattern. When a script is upgraded, there may be
// more than one ServiceWorkerVersion "running" at a time, but only
// one of them is active. This class connects the actual script with a
// running worker.
// Instances of this class are in one of two install states:
// - Pending: The script is in the process of being installed. There
// may be another active script running.
// - Active: The script is the only worker handling requests for the
// registration's pattern.
//
// In addition, a version has a running state (this is a rough
// sketch). Since a service worker can be stopped and started at any
// time, it will transition among these states multiple times during
// its lifetime.
// - Stopped: The script is not running
// - Starting: A request to fire an event against the version has been
// queued, but the worker is not yet
// loaded/initialized/etc.
// - Started: The worker is ready to receive events
// - Stopping: The worker is returning to the stopped state.
//
// The worker can "run" in both the Pending and the Active
// install states above. During the Pending state, the worker is only
// started in order to fire the 'install' and 'activate'
// events. During the Active state, it can receive other events such
// as 'fetch'.
//
// And finally, is_shutdown_ is detects the live-ness of the object
// itself. If the object is shut down, then it is in the process of
// being deleted from memory. This happens when a version is replaced
// as well as at browser shutdown.
class CONTENT_EXPORT ServiceWorkerVersion
: NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>) {
public:
ServiceWorkerVersion(
ServiceWorkerRegistration* registration,
EmbeddedWorkerRegistry* worker_registry,
int64 version_id);
int64 version_id() const { return version_id_; }
void Shutdown();
bool is_shutdown() const { return is_shutdown_; }
// Starts and stops an embedded worker for this version.
void StartWorker();
void StopWorker();
// Called when this version is associated to a provider host.
// Non-null |provider_host| must be given.
void OnAssociateProvider(ServiceWorkerProviderHost* provider_host);
void OnUnassociateProvider(ServiceWorkerProviderHost* provider_host);
private:
friend class base::RefCounted<ServiceWorkerVersion>;
~ServiceWorkerVersion();
const int64 version_id_;
bool is_shutdown_;
scoped_refptr<ServiceWorkerRegistration> registration_;
scoped_ptr<EmbeddedWorkerInstance> embedded_worker_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
};
} // namespace content
#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
|
#include "nvcore/nvcore.h" // uint8
extern uint8 OMatch5[256][2];
extern uint8 OMatch6[256][2];
extern uint8 OMatchAlpha5[256][2];
extern uint8 OMatchAlpha6[256][2];
void initSingleColorLookup();
|
/*
****************************************************************
*
* Copyright (C) 2011, Red Bend Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU General Public License Version 2
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* #ident "@(#)nkern.h 1.1 07/10/18 Red Bend"
*
* Contributor(s):
* Guennadi Maslov (guennadi.maslov@redbend.com)
*
****************************************************************
*/
#ifndef __NK_NKERN_H
#define __NK_NKERN_H
#include <asm/nk/f_nk.h>
#define __NK_HARD_LOCK_IRQ_SAVE(x, flag) ((flag) = hw_local_irq_save())
#define __NK_HARD_UNLOCK_IRQ_RESTORE(x, flag) hw_local_irq_restore(flag)
#ifdef __ARMEB__
#define __VEX_IRQ_BYTE (3 - (NK_VEX_IRQ_BIT >> 3))
#else
#define __VEX_IRQ_BYTE (NK_VEX_IRQ_BIT >> 3)
#endif
#define __VEX_IRQ_BIT (NK_VEX_IRQ_BIT & 0x7)
#define __VEX_IRQ_FLAG (1 << __VEX_IRQ_BIT)
#define DOMAIN_NKVEC 15 /* domain used to map the NK vectors page */
#ifdef __ASSEMBLY__
#define __VEX_IRQ_CTX_PEN (ctx_pending_off + __VEX_IRQ_BYTE)
#define __VEX_IRQ_CTX_ENA (ctx_enabled_off + __VEX_IRQ_BYTE)
#define __VEX_IRQ_CTX_E2P (__VEX_IRQ_CTX_PEN - __VEX_IRQ_CTX_ENA)
#define __VEX_IRQ_CTX_P2E (__VEX_IRQ_CTX_ENA - __VEX_IRQ_CTX_PEN)
#endif
/*
* In the thread context, the pending irq bitmask is saved in
* unused bits of CPRS image (bits 16-23).
*/
#define NK_VPSR_SHIFT 23
#ifndef __ASSEMBLY__
#ifdef CONFIG_SMP
static inline NkOsCtx*
VCPU (void)
{
NkOsCtx* vcpu;
__asm__ __volatile__ (
"mrc p15, 0, %0, c13, c0, 4"
: "=r" (vcpu) :: "memory", "cc");
return vcpu;
}
#define os_ctx VCPU()
#define __irq_enabled (((nku8_f*)&(VCPU()->enabled)) + __VEX_IRQ_BYTE)
#else
extern NkOsCtx* os_ctx; /* pointer to OS context */
extern nku8_f* __irq_enabled; /* points to the enabled IRQ flag */
#define VCPU() os_ctx
#endif
#endif
#endif
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2015, The Linux Foundation. All rights reserved.
*/
#ifndef __MSM_DSI_CFG_H__
#define __MSM_DSI_CFG_H__
#include "dsi.h"
#define MSM_DSI_VER_MAJOR_V2 0x02
#define MSM_DSI_VER_MAJOR_6G 0x03
#define MSM_DSI_6G_VER_MINOR_V1_0 0x10000000
#define MSM_DSI_6G_VER_MINOR_V1_1 0x10010000
#define MSM_DSI_6G_VER_MINOR_V1_1_1 0x10010001
#define MSM_DSI_6G_VER_MINOR_V1_2 0x10020000
#define MSM_DSI_6G_VER_MINOR_V1_3 0x10030000
#define MSM_DSI_6G_VER_MINOR_V1_3_1 0x10030001
#define MSM_DSI_6G_VER_MINOR_V1_4_1 0x10040001
#define MSM_DSI_6G_VER_MINOR_V1_4_2 0x10040002
#define MSM_DSI_6G_VER_MINOR_V2_1_0 0x20010000
#define MSM_DSI_6G_VER_MINOR_V2_2_0 0x20000000
#define MSM_DSI_6G_VER_MINOR_V2_2_1 0x20020001
#define MSM_DSI_6G_VER_MINOR_V2_4_1 0x20040001
#define MSM_DSI_V2_VER_MINOR_8064 0x0
#define DSI_6G_REG_SHIFT 4
struct msm_dsi_config {
u32 io_offset;
struct dsi_reg_config reg_cfg;
const char * const *bus_clk_names;
const int num_bus_clks;
const resource_size_t io_start[DSI_MAX];
const int num_dsi;
};
struct msm_dsi_host_cfg_ops {
int (*link_clk_set_rate)(struct msm_dsi_host *msm_host);
int (*link_clk_enable)(struct msm_dsi_host *msm_host);
void (*link_clk_disable)(struct msm_dsi_host *msm_host);
int (*clk_init_ver)(struct msm_dsi_host *msm_host);
int (*tx_buf_alloc)(struct msm_dsi_host *msm_host, int size);
void* (*tx_buf_get)(struct msm_dsi_host *msm_host);
void (*tx_buf_put)(struct msm_dsi_host *msm_host);
int (*dma_base_get)(struct msm_dsi_host *msm_host, uint64_t *iova);
int (*calc_clk_rate)(struct msm_dsi_host *msm_host, bool is_dual_dsi);
};
struct msm_dsi_cfg_handler {
u32 major;
u32 minor;
const struct msm_dsi_config *cfg;
const struct msm_dsi_host_cfg_ops *ops;
};
const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor);
#endif /* __MSM_DSI_CFG_H__ */
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsBinaryStream_h___
#define nsBinaryStream_h___
#include "nsCOMPtr.h"
#include "nsAString.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
#include "nsIStreamBufferAccess.h"
#define NS_BINARYOUTPUTSTREAM_CID \
{ /* 86c37b9a-74e7-4672-844e-6e7dd83ba484 */ \
0x86c37b9a, \
0x74e7, \
0x4672, \
{0x84, 0x4e, 0x6e, 0x7d, 0xd8, 0x3b, 0xa4, 0x84} \
}
#define NS_BINARYOUTPUTSTREAM_CONTRACTID "@mozilla.org/binaryoutputstream;1"
#define NS_BINARYOUTPUTSTREAM_CLASSNAME "Binary Output Stream"
// Derive from nsIObjectOutputStream so this class can be used as a superclass
// by nsObjectOutputStream.
class nsBinaryOutputStream : public nsIObjectOutputStream
{
public:
nsBinaryOutputStream() {};
// virtual dtor since subclasses call our Release()
virtual ~nsBinaryOutputStream() {};
protected:
// nsISupports methods
NS_DECL_ISUPPORTS
// nsIOutputStream methods
NS_DECL_NSIOUTPUTSTREAM
// nsIBinaryOutputStream methods
NS_DECL_NSIBINARYOUTPUTSTREAM
// nsIObjectOutputStream methods
NS_DECL_NSIOBJECTOUTPUTSTREAM
// Call Write(), ensuring that all proffered data is written
nsresult WriteFully(const char *aBuf, PRUint32 aCount);
nsCOMPtr<nsIOutputStream> mOutputStream;
nsCOMPtr<nsIStreamBufferAccess> mBufferAccess;
};
#define NS_BINARYINPUTSTREAM_CID \
{ /* c521a612-2aad-46db-b6ab-3b821fb150b1 */ \
0xc521a612, \
0x2aad, \
0x46db, \
{0xb6, 0xab, 0x3b, 0x82, 0x1f, 0xb1, 0x50, 0xb1} \
}
#define NS_BINARYINPUTSTREAM_CONTRACTID "@mozilla.org/binaryinputstream;1"
#define NS_BINARYINPUTSTREAM_CLASSNAME "Binary Input Stream"
// Derive from nsIObjectInputStream so this class can be used as a superclass
// by nsObjectInputStream.
class nsBinaryInputStream : public nsIObjectInputStream
{
public:
nsBinaryInputStream() {};
// virtual dtor since subclasses call our Release()
virtual ~nsBinaryInputStream() {};
protected:
// nsISupports methods
NS_DECL_ISUPPORTS
// nsIInputStream methods
NS_DECL_NSIINPUTSTREAM
// nsIBinaryInputStream methods
NS_DECL_NSIBINARYINPUTSTREAM
// nsIObjectInputStream methods
NS_DECL_NSIOBJECTINPUTSTREAM
nsCOMPtr<nsIInputStream> mInputStream;
nsCOMPtr<nsIStreamBufferAccess> mBufferAccess;
};
#endif // nsBinaryStream_h___
|
/* tap-protocolinfo.c
* protohierstat 2002 Ronnie Sahlberg
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* 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.
*/
/* This module provides Protocol Column Info tap for tshark */
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "epan/epan_dissect.h"
#include "epan/column-utils.h"
#include <epan/tap.h>
#include <epan/stat_tap_ui.h>
void register_tap_listener_protocolinfo(void);
typedef struct _pci_t {
char *filter;
int hf_index;
} pci_t;
static int
protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_)
{
pci_t *rs = (pci_t *)prs;
GPtrArray *gp;
guint i;
char *str;
/*
* XXX - there needs to be a way for "protocolinfo_init()" to
* find out whether the columns are being generated and, if not,
* to report an error and exit, as the whole point of this tap
* is to modify the columns, and if the columns aren't being
* displayed, that makes this tap somewhat pointless.
*
* To prevent a crash, we check whether INFO column is writable
* and, if not, we report that error and exit.
*/
if (!col_get_writable(pinfo->cinfo)) {
fprintf(stderr, "tshark: the proto,colinfo tap doesn't work if the INFO column isn't being printed.\n");
exit(1);
}
gp = proto_get_finfo_ptr_array(edt->tree, rs->hf_index);
if (!gp) {
return 0;
}
for (i=0; i<gp->len; i++) {
str = (char *)proto_construct_match_selected_string((field_info *)gp->pdata[i], NULL);
if (str) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str);
wmem_free(NULL, str);
}
}
return 0;
}
static void
protocolinfo_init(const char *opt_arg, void *userdata _U_)
{
pci_t *rs;
const char *field = NULL;
const char *filter = NULL;
header_field_info *hfi;
GString *error_string;
if (!strncmp("proto,colinfo,", opt_arg, 14)) {
filter = opt_arg+14;
field = strchr(filter, ',');
if (field) {
field += 1; /* skip the ',' */
}
}
if (!field) {
fprintf(stderr, "tshark: invalid \"-z proto,colinfo,<filter>,<field>\" argument\n");
exit(1);
}
hfi = proto_registrar_get_byname(field);
if (!hfi) {
fprintf(stderr, "tshark: Field \"%s\" doesn't exist.\n", field);
exit(1);
}
rs = g_new(pci_t, 1);
rs->hf_index = hfi->id;
if ((field-filter) > 1) {
rs->filter = (char *)g_malloc(field-filter);
g_strlcpy(rs->filter, filter, (field-filter));
} else {
rs->filter = NULL;
}
error_string = register_tap_listener("frame", rs, rs->filter, TL_REQUIRES_PROTO_TREE, NULL, protocolinfo_packet, NULL);
if (error_string) {
/* error, we failed to attach to the tap. complain and clean up */
fprintf(stderr, "tshark: Couldn't register proto,colinfo tap: %s\n",
error_string->str);
g_string_free(error_string, TRUE);
g_free(rs->filter);
g_free(rs);
exit(1);
}
}
static stat_tap_ui protocolinfo_ui = {
REGISTER_STAT_GROUP_GENERIC,
NULL,
"proto,colinfo",
protocolinfo_init,
0,
NULL
};
void
register_tap_listener_protocolinfo(void)
{
register_stat_tap_ui(&protocolinfo_ui, NULL);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
|
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1994 - 2001, 2003 by Ralf Baechle
* Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
*/
#ifndef _ASM_PGALLOC_H
#define _ASM_PGALLOC_H
#include <linux/highmem.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */
static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
pte_t *pte)
{
set_pmd(pmd, __pmd((unsigned long)pte));
}
static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
pgtable_t pte)
{
set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
}
#define pmd_pgtable(pmd) pmd_page(pmd)
/*
* Initialize a new pmd table with invalid pointers.
*/
extern void pmd_init(unsigned long page, unsigned long pagetable);
#ifndef __PAGETABLE_PMD_FOLDED
static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
{
set_pud(pud, __pud((unsigned long)pmd));
}
#endif
/*
* Initialize a new pgd / pmd table with invalid pointers.
*/
extern void pgd_init(unsigned long page);
extern pgd_t *pgd_alloc(struct mm_struct *mm);
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
free_pages((unsigned long)pgd, PGD_ORDER);
}
#define __pte_free_tlb(tlb,pte,address) \
do { \
pgtable_pte_page_dtor(pte); \
tlb_remove_page((tlb), pte); \
} while (0)
#ifndef __PAGETABLE_PMD_FOLDED
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
{
pmd_t *pmd;
pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, PMD_ORDER);
if (pmd)
pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table);
return pmd;
}
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
{
free_pages((unsigned long)pmd, PMD_ORDER);
}
#define __pmd_free_tlb(tlb, x, addr) pmd_free((tlb)->mm, x)
#endif
#ifndef __PAGETABLE_PUD_FOLDED
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address)
{
pud_t *pud;
pud = (pud_t *) __get_free_pages(GFP_KERNEL, PUD_ORDER);
if (pud)
pud_init((unsigned long)pud, (unsigned long)invalid_pmd_table);
return pud;
}
static inline void pud_free(struct mm_struct *mm, pud_t *pud)
{
free_pages((unsigned long)pud, PUD_ORDER);
}
static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
{
set_pgd(pgd, __pgd((unsigned long)pud));
}
#define __pud_free_tlb(tlb, x, addr) pud_free((tlb)->mm, x)
#endif /* __PAGETABLE_PUD_FOLDED */
extern void pagetable_init(void);
#endif /* _ASM_PGALLOC_H */
|
// Copyright (C) 2008-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_VERTEX_BUFFER_H_INCLUDED__
#define __I_VERTEX_BUFFER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "S3DVertex.h"
namespace irr
{
namespace scene
{
class IVertexBuffer : public virtual IReferenceCounted
{
public:
virtual void* getData() =0;
virtual video::E_VERTEX_TYPE getType() const =0;
virtual void setType(video::E_VERTEX_TYPE vertexType) =0;
virtual u32 stride() const =0;
virtual u32 size() const =0;
virtual void push_back(const video::S3DVertex &element) =0;
virtual video::S3DVertex& operator [](const u32 index) const =0;
virtual video::S3DVertex& getLast() =0;
virtual void set_used(u32 usedNow) =0;
virtual void reallocate(u32 new_size) =0;
virtual u32 allocated_size() const =0;
virtual video::S3DVertex* pointer() =0;
//! get the current hardware mapping hint
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0;
//! set the hardware mapping hint, for driver
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0;
//! flags the meshbuffer as changed, reloads hardware buffers
virtual void setDirty() =0;
//! Get the currently used ID for identification of changes.
/** This shouldn't be used for anything outside the VideoDriver. */
virtual u32 getChangedID() const = 0;
};
} // end namespace scene
} // end namespace irr
#endif
|
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_I2C_API_H
#define MBED_I2C_API_H
#include "device.h"
#if DEVICE_I2C
#ifdef __cplusplus
extern "C" {
#endif
typedef struct i2c_s i2c_t;
enum {
I2C_ERROR_NO_SLAVE = -1,
I2C_ERROR_BUS_BUSY = -2
};
void i2c_init (i2c_t *obj, PinName sda, PinName scl);
void i2c_frequency (i2c_t *obj, int hz);
int i2c_start (i2c_t *obj);
int i2c_stop (i2c_t *obj);
int i2c_read (i2c_t *obj, int address, char *data, int length, int stop);
int i2c_write (i2c_t *obj, int address, const char *data, int length, int stop);
void i2c_reset (i2c_t *obj);
int i2c_byte_read (i2c_t *obj, int last);
int i2c_byte_write (i2c_t *obj, int data);
#if DEVICE_I2CSLAVE
void i2c_slave_mode (i2c_t *obj, int enable_slave);
int i2c_slave_receive(i2c_t *obj);
int i2c_slave_read (i2c_t *obj, char *data, int length);
int i2c_slave_write (i2c_t *obj, const char *data, int length);
void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask);
#endif
#ifdef __cplusplus
}
#endif
#endif
#endif
|
/*
* 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.
*
* Copyright (C) IBM Corporation, 2004
*
* Author: Max Asböck <amax@us.ibm.com>
*
*/
#include <linux/sched/signal.h>
#include "ibmasm.h"
#include "dot_command.h"
/*
* Reverse Heartbeat, i.e. heartbeats sent from the driver to the
* service processor.
* These heartbeats are initiated by user level programs.
*/
/* the reverse heartbeat dot command */
#pragma pack(1)
static struct {
struct dot_command_header header;
unsigned char command[3];
} rhb_dot_cmd = {
.header = {
.type = sp_read,
.command_size = 3,
.data_size = 0,
.status = 0
},
.command = { 4, 3, 6 }
};
#pragma pack()
void ibmasm_init_reverse_heartbeat(struct service_processor *sp, struct reverse_heartbeat *rhb)
{
init_waitqueue_head(&rhb->wait);
rhb->stopped = 0;
}
/**
* start_reverse_heartbeat
* Loop forever, sending a reverse heartbeat dot command to the service
* processor, then sleeping. The loop comes to an end if the service
* processor fails to respond 3 times or we were interrupted.
*/
int ibmasm_start_reverse_heartbeat(struct service_processor *sp, struct reverse_heartbeat *rhb)
{
struct command *cmd;
int times_failed = 0;
int result = 1;
cmd = ibmasm_new_command(sp, sizeof rhb_dot_cmd);
if (!cmd)
return -ENOMEM;
while (times_failed < 3) {
memcpy(cmd->buffer, (void *)&rhb_dot_cmd, sizeof rhb_dot_cmd);
cmd->status = IBMASM_CMD_PENDING;
ibmasm_exec_command(sp, cmd);
ibmasm_wait_for_response(cmd, IBMASM_CMD_TIMEOUT_NORMAL);
if (cmd->status != IBMASM_CMD_COMPLETE)
times_failed++;
wait_event_interruptible_timeout(rhb->wait,
rhb->stopped,
REVERSE_HEARTBEAT_TIMEOUT * HZ);
if (signal_pending(current) || rhb->stopped) {
result = -EINTR;
break;
}
}
command_put(cmd);
rhb->stopped = 0;
return result;
}
void ibmasm_stop_reverse_heartbeat(struct reverse_heartbeat *rhb)
{
rhb->stopped = 1;
wake_up_interruptible(&rhb->wait);
}
|
int var __attribute__((shared)) = 0; /* { dg-error "static initialization .* not supported" } */
|
/*
* Support for Intel Camera Imaging ISP subsystem.
*
* Copyright (c) 2010 - 2014 Intel Corporation. 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 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-1301, USA.
*
*/
#ifndef __ISP_PUBLIC_H_INCLUDED__
#define __ISP_PUBLIC_H_INCLUDED__
#ifdef __KERNEL__
#include <linux/types.h>
#else
#include <stddef.h> /* size_t */
#include <stdbool.h> /* bool */
#include <stdint.h> /* uint32_t */
#endif
#include "system_types.h"
/*! Enable or disable the program complete irq signal of ISP[ID]
\param ID[in] SP identifier
\param cnd[in] predicate
\return none, if(cnd) enable(ISP[ID].irq) else disable(ISP[ID].irq)
*/
extern void cnd_isp_irq_enable(
const isp_ID_t ID,
const bool cnd);
/*! Read the state of cell ISP[ID]
\param ID[in] ISP identifier
\param state[out] isp state structure
\param stall[out] isp stall conditions
\return none, state = ISP[ID].state, stall = ISP[ID].stall
*/
extern void isp_get_state(
const isp_ID_t ID,
isp_state_t *state,
isp_stall_t *stall);
/*! Write to the status and control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param value[in] The data to be written
\return none, ISP[ID].sc[reg] = value
*/
STORAGE_CLASS_ISP_H void isp_ctrl_store(
const isp_ID_t ID,
const unsigned int reg,
const hrt_data value);
/*! Read from the status and control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param value[in] The data to be written
\return ISP[ID].sc[reg]
*/
STORAGE_CLASS_ISP_H hrt_data isp_ctrl_load(
const isp_ID_t ID,
const unsigned int reg);
/*! Get the status of a bitfield in the control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param bit[in] The bit index to be checked
\return (ISP[ID].sc[reg] & (1<<bit)) != 0
*/
STORAGE_CLASS_ISP_H bool isp_ctrl_getbit(
const isp_ID_t ID,
const unsigned int reg,
const unsigned int bit);
/*! Set a bitfield in the control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param bit[in] The bit index to be set
\return none, ISP[ID].sc[reg] |= (1<<bit)
*/
STORAGE_CLASS_ISP_H void isp_ctrl_setbit(
const isp_ID_t ID,
const unsigned int reg,
const unsigned int bit);
/*! Clear a bitfield in the control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param bit[in] The bit index to be set
\return none, ISP[ID].sc[reg] &= ~(1<<bit)
*/
STORAGE_CLASS_ISP_H void isp_ctrl_clearbit(
const isp_ID_t ID,
const unsigned int reg,
const unsigned int bit);
/*! Write to the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be written
\param size[in] The size(in bytes) of the data to be written
\return none, ISP[ID].dmem[addr...addr+size-1] = data
*/
STORAGE_CLASS_ISP_H void isp_dmem_store(
const isp_ID_t ID,
unsigned int addr,
const void *data,
const size_t size);
/*! Read from the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be read
\param size[in] The size(in bytes) of the data to be read
\return none, data = ISP[ID].dmem[addr...addr+size-1]
*/
STORAGE_CLASS_ISP_H void isp_dmem_load(
const isp_ID_t ID,
const unsigned int addr,
void *data,
const size_t size);
/*! Write a 32-bit datum to the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be written
\param size[in] The size(in bytes) of the data to be written
\return none, ISP[ID].dmem[addr] = data
*/
STORAGE_CLASS_ISP_H void isp_dmem_store_uint32(
const isp_ID_t ID,
unsigned int addr,
const uint32_t data);
/*! Load a 32-bit datum from the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be read
\param size[in] The size(in bytes) of the data to be read
\return none, data = ISP[ID].dmem[addr]
*/
STORAGE_CLASS_ISP_H uint32_t isp_dmem_load_uint32(
const isp_ID_t ID,
const unsigned int addr);
/*! Concatenate the LSW and MSW into a double precision word
\param x0[in] Integer containing the LSW
\param x1[in] Integer containing the MSW
\return x0 | (x1 << bits_per_vector_element)
*/
STORAGE_CLASS_ISP_H uint32_t isp_2w_cat_1w(
const uint16_t x0,
const uint16_t x1);
#endif /* __ISP_PUBLIC_H_INCLUDED__ */
|
/*
Copyright (c) 2012-2013 Martin Sustrik All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
#ifndef NN_TRIE_INCLUDED
#define NN_TRIE_INCLUDED
#include "../../utils/int.h"
#include <stddef.h>
/* This class implements highly memory-efficient patricia trie. */
/* Maximum length of the prefix. */
#define NN_TRIE_PREFIX_MAX 10
/* Maximum number of children in the sparse mode. */
#define NN_TRIE_SPARSE_MAX 8
/* 'type' is set to this value when in the dense mode. */
#define NN_TRIE_DENSE_TYPE (NN_TRIE_SPARSE_MAX + 1)
/* This structure represents a node in patricia trie. It's a header to be
followed by the array of pointers to child nodes. Each node represents
the string composed of all the prefixes on the way from the trie root,
including the prefix in that node. */
struct nn_trie_node
{
/* Number of subscriptions to the given string. */
uint32_t refcount;
/* Number of elements is a sparse array, or NN_TRIE_DENSE_TYPE in case
the array of children is dense. */
uint8_t type;
/* The node adds more characters to the string, compared to the parent
node. If there is only a single character added, it's represented
directly in the child array. If there's more than one character added,
all but the last one are stored as a 'prefix'. */
uint8_t prefix_len;
uint8_t prefix [NN_TRIE_PREFIX_MAX];
/* The array of characters pointing to individual children of the node.
Actual pointers to child nodes are stored in the memory following
nn_trie_node structure. */
union {
/* Sparse array means that individual children are identified by
characters stored in 'children' array. The number of characters
in the array is specified in the 'type' field. */
struct {
uint8_t children [NN_TRIE_SPARSE_MAX];
} sparse;
/* Dense array means that the array of node pointers following the
structure corresponds to a continuous list of characters starting
by 'min' character and ending by 'max' character. The characters
in the range that have no corresponding child node are represented
by NULL pointers. 'nbr' is the count of child nodes. */
struct {
uint8_t min;
uint8_t max;
uint16_t nbr;
/* There are 4 bytes of padding here. */
} dense;
} u;
};
/* The structure is followed by the array of pointers to children. */
struct nn_trie {
/* The root node of the trie (representing the empty subscription). */
struct nn_trie_node *root;
};
/* Initialise an empty trie. */
void nn_trie_init (struct nn_trie *self);
/* Release all the resources associated with the trie. */
void nn_trie_term (struct nn_trie *self);
/* Add the string to the trie. If the string is not yet there, 1 is returned.
If it already exists in the trie, its reference count is incremented and
0 is returned. */
int nn_trie_subscribe (struct nn_trie *self, const uint8_t *data, size_t size);
/* Remove the string from the trie. If the string was actually removed,
1 is returned. If reference count was decremented without falling to zero,
0 is returned. */
int nn_trie_unsubscribe (struct nn_trie *self, const uint8_t *data,
size_t size);
/* Checks the supplied string. If it matches it returns 1, if it does not
it returns 0. */
int nn_trie_match (struct nn_trie *self, const uint8_t *data, size_t size);
/* Debugging interface. */
void nn_trie_dump (struct nn_trie *self);
#endif
|
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// 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.
//
// DESCRIPTION:
// Savegame I/O, archiving, persistence.
//
#ifndef __P_SAVEG__
#define __P_SAVEG__
#include <stdio.h>
// maximum size of a savegame description
#define SAVESTRINGSIZE 24
// temporary filename to use while saving.
char *P_TempSaveGameFile(void);
// filename to use for a savegame slot
char *P_SaveGameFile(int slot);
// Savegame file header read/write functions
boolean P_ReadSaveGameHeader(void);
void P_WriteSaveGameHeader(char *description);
// Savegame end-of-file read/write functions
boolean P_ReadSaveGameEOF(void);
void P_WriteSaveGameEOF(void);
// Persistent storage/archiving.
// These are the load / save game routines.
void P_ArchivePlayers (void);
void P_UnArchivePlayers (boolean userload);
void P_ArchiveWorld (void);
void P_UnArchiveWorld (void);
void P_ArchiveThinkers (void);
void P_UnArchiveThinkers (void);
void P_ArchiveSpecials (void);
void P_UnArchiveSpecials (void);
extern FILE *save_stream;
extern boolean savegame_error;
#endif
|
/*
Copyright (c) 2014, Christian Kroener
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct
{
signed char x_vector;
signed char y_vector;
short sad;
} INLINE_MOTION_VECTOR;
int main(int argc, const char **argv)
{
if(argc!=5)
{
printf("usage: %s data.imv mbx mby out.dat\n",argv[0]);
return 0;
}
int mbx=atoi(argv[2]);
int mby=atoi(argv[3]);
///////////////////////////////
// Read raw file to buffer //
///////////////////////////////
FILE *f = fopen(argv[1], "rb");
fseek(f, 0, SEEK_END);
long fsize = ftell(f);
fseek(f, 0, SEEK_SET);
char *buffer = malloc(fsize + 1);
fread(buffer, fsize, 1, f);
fclose(f);
buffer[fsize] = 0;
///////////////////
// Fill struct //
///////////////////
if(fsize<(mbx+1)*mby*4)
{
printf("File to short!\n");
return 0;
}
INLINE_MOTION_VECTOR *imv;
imv = malloc((mbx+1)*mby*sizeof(INLINE_MOTION_VECTOR));
memcpy ( &imv[0], &buffer[0], (mbx+1)*mby*sizeof(INLINE_MOTION_VECTOR) );
//////////////////////////
// Export to txt data //
//////////////////////////
FILE *out = fopen(argv[4], "w");
fprintf(out,"#x y u v sad\n");
int i,j;
for(j=0;j<mby; j++)
for(i=0;i<mbx; i++)
{
fprintf(out,"%g %g %d %d %d\n",(i+0.5)*16.,(mby-j-0.5)*16.,-imv[i+(mbx+1)*j].x_vector,imv[i+(mbx+1)*j].y_vector,imv[i+(mbx+1)*j].sad);
}
fclose(out);
return 0;
}
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#pragma mark -
//
// File: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService
// UUID: 22A0C230-CF1E-38F5-A947-5ACDAEEE0DB6
//
// Arch: x86_64
// Source version: 173.26.1.0.0
// Minimum Mac OS X version: 10.9.0
// SDK version: 10.9.0
//
//
// This file does not contain any Objective-C runtime information.
//
|
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2011 Siddharth Kherada
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
*/
#ifndef __LOSS_H_
#define __LOSS_H_
#include <shogun/lib/config.h>
#include <shogun/lib/common.h>
#include <shogun/io/SGIO.h>
//#include <shogun/mathematics/lapack.h>
//#include <shogun/base/SGObject.h>
//#include <shogun/base/Parallel.h>
// Available losses
#define HINGELOSS 1
#define SMOOTHHINGELOSS 2
#define SQUAREDHINGELOSS 3
#define LOGLOSS 10
#define LOGLOSSMARGIN 11
// Select loss
#define LOSS HINGELOSS
namespace shogun
{
/** @brief Class which collects generic mathematical functions
*/
class CLoss
{
public:
/**@name Constructor/Destructor.
*/
//@{
///Constructor - initializes log-table
CLoss();
///Destructor - frees logtable
virtual ~CLoss();
//@}
/** loss
* @param z
*/
static inline float64_t loss(float64_t z)
{
#if LOSS == LOGLOSS
if (z >= 0)
return log(1+exp(-z));
else
return -z + log(1+exp(z));
#elif LOSS == LOGLOSSMARGIN
if (z >= 1)
return log(1+exp(1-z));
else
return 1-z + log(1+exp(z-1));
#elif LOSS == SMOOTHHINGELOSS
if (z < 0)
return 0.5 - z;
if (z < 1)
return 0.5 * (1-z) * (1-z);
return 0;
#elif LOSS == SQUAREDHINGELOSS
if (z < 1)
return 0.5 * (1 - z) * (1 - z);
return 0;
#elif LOSS == HINGELOSS
if (z < 1)
return 1 - z;
return 0;
#else
# error "Undefined loss"
#endif
}
/** dloss
* @param z
*/
static inline float64_t dloss(float64_t z)
{
#if LOSS == LOGLOSS
if (z < 0)
return 1 / (exp(z) + 1);
float64_t ez = exp(-z);
return ez / (ez + 1);
#elif LOSS == LOGLOSSMARGIN
if (z < 1)
return 1 / (exp(z-1) + 1);
float64_t ez = exp(1-z);
return ez / (ez + 1);
#elif LOSS == SMOOTHHINGELOSS
if (z < 0)
return 1;
if (z < 1)
return 1-z;
return 0;
#elif LOSS == SQUAREDHINGELOSS
if (z < 1)
return (1 - z);
return 0;
#else
if (z < 1)
return 1;
return 0;
#endif
}
};
}
#endif
|
/*
* Copyright (c) 2012, Freescale Semiconductor, 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:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "sdk.h"
#include "lcdif/lcdif_common.h"
#include "registers/regspxp.h"
#include "registers/regsccm.h"
/*!
* @file pxp_drv.c
* @brief Main driver for the PXP controller. It initializes the controller
* and provide color space convertion functionality.
*
* @ingroup diag_lcdif
*/
/*!
* @brief Reset the PXP controller by software mode
*/
static int pxp_sw_reset(void)
{
/* clear register */
BW_PXP_CTRL_SFTRST(1);
hal_delay_us(1000);
BW_PXP_CTRL_CLKGATE(0);
BW_PXP_CTRL_SFTRST(0);
return 0;
}
/*!
* @brief Wait for PXP controller IRQ interrupt inside timeout time.
*/
static void pxp_proc_timeout(int time)
{
while (HW_PXP_STAT.B.IRQ == 0) {
time--;
if (time == 0)
break;
};
HW_PXP_STAT.B.IRQ = 0;
}
/*!
* @brief Enable pxp axi clock.
*/
static void pxp_clock_enable(void)
{
/* always on MX6SL */
HW_CCM_CCGR3.B.CG1 = 0x3;
}
/*!
* @brief Diable PXP after completing the single operation.
*/
void pxp_disable(void)
{
/* The ENABLE bit will be cleared once the current operation completes
* If the Repeat mode is open, disable it. */
if (HW_PXP_CTRL.B.EN_REPEAT)
HW_PXP_CTRL.B.EN_REPEAT = 0;
}
void pxp_csc_process(void)
{
pxp_clock_enable();
pxp_sw_reset();
/* Input and output buffer address */
HW_PXP_PS_BUF_WR(DDR_PXP_PS_BASE1);
HW_PXP_OUT_BUF_WR(DDR_LCD_BASE1);
/* Input and output pitch
* bytes between two vertically adj pixels */
HW_PXP_PS_PITCH.B.PITCH = VGA_FW * 2;
HW_PXP_OUT_PITCH.B.PITCH = FRAME_WIDTH * 2;
/* set output frame */
/* output frame size */
HW_PXP_OUT_LRC.B.X = FRAME_WIDTH - 1;
HW_PXP_OUT_LRC.B.Y = FRAME_HEIGHT - 1;
/* left upper corner (0, 0) */
HW_PXP_OUT_PS_ULC.B.X = 0;
HW_PXP_OUT_PS_ULC.B.Y = 0;
/* low right corner (input_width-1, input_height-1) */
HW_PXP_OUT_PS_LRC.B.X = VGA_FW - 1;
HW_PXP_OUT_PS_LRC.B.Y = VGA_FH - 1;
/* set backgroud as white */
HW_PXP_PS_BACKGROUND.B.COLOR = 0xFFFFFF;
/* 1:1 scale */
HW_PXP_PS_SCALE.B.XSCALE = 1 << 12;
HW_PXP_PS_SCALE.B.YSCALE = 1 << 12;
/* Input format U0Y0V0Y1 */
HW_PXP_PS_CTRL.B.FORMAT = 0x12;
/* Output format: RGB565 */
HW_PXP_OUT_CTRL.B.FORMAT = 0xE;
/* YCbCr->RGB coefficients */
HW_PXP_CSC1_COEF0_WR(0x84AB01F0);
HW_PXP_CSC1_COEF1_WR(0x01980204);
HW_PXP_CSC1_COEF2_WR(0x0730079C);
/* PXP run continuously */
HW_PXP_CTRL.B.EN_REPEAT = 1;
HW_PXP_CTRL.B.ENABLE = 1;
}
|
/*
* (C) Copyright 2010
* Stefano Babic, DENX Software Engineering, sbabic@denx.de.
*
* (C) Copyright 2009 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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 __MC13892_H__
#define __MC13892_H__
/* REG_CHARGE */
#define VCHRG0 (1 << 0)
#define VCHRG1 (1 << 1)
#define VCHRG2 (1 << 2)
#define ICHRG0 (1 << 3)
#define ICHRG1 (1 << 4)
#define ICHRG2 (1 << 5)
#define ICHRG3 (1 << 6)
#define TREN (1 << 7)
#define ACKLPB (1 << 8)
#define THCHKB (1 << 9)
#define FETOVRD (1 << 10)
#define FETCTRL (1 << 11)
#define RVRSMODE (1 << 13)
#define PLIM0 (1 << 15)
#define PLIM1 (1 << 16)
#define PLIMDIS (1 << 17)
#define CHRGLEDEN (1 << 18)
#define CHGTMRRST (1 << 19)
#define CHGRESTART (1 << 20)
#define CHGAUTOB (1 << 21)
#define CYCLB (1 << 22)
#define CHGAUTOVIB (1 << 23)
/* REG_SETTING_0/1 */
#define VO_1_20V 0
#define VO_1_30V 1
#define VO_1_50V 2
#define VO_1_80V 3
#define VO_1_10V 4
#define VO_2_00V 5
#define VO_2_77V 6
#define VO_2_40V 7
#define VIOL 2
#define VDIG 4
#define VGEN 6
/* SWxMode for Normal/Standby Mode */
#define SWMODE_OFF_OFF 0
#define SWMODE_PWM_OFF 1
#define SWMODE_PWMPS_OFF 2
#define SWMODE_PFM_OFF 3
#define SWMODE_AUTO_OFF 4
#define SWMODE_PWM_PWM 5
#define SWMODE_PWM_AUTO 6
#define SWMODE_AUTO_AUTO 8
#define SWMODE_PWM_PWMPS 9
#define SWMODE_PWMS_PWMPS 10
#define SWMODE_PWMS_AUTO 11
#define SWMODE_AUTO_PFM 12
#define SWMODE_PWM_PFM 13
#define SWMODE_PWMS_PFM 14
#define SWMODE_PFM_PFM 15
#define SWMODE_MASK 0x0F
#define SWMODE1_SHIFT 0
#define SWMODE2_SHIFT 10
#define SWMODE3_SHIFT 0
#define SWMODE4_SHIFT 8
/* Fields in REG_SETTING_1 */
#define VVIDEO_2_7 (0 << 2)
#define VVIDEO_2_775 (1 << 2)
#define VVIDEO_2_5 (2 << 2)
#define VVIDEO_2_6 (3 << 2)
#define VVIDEO_MASK (3 << 2)
#define VAUDIO_2_3 (0 << 4)
#define VAUDIO_2_5 (1 << 4)
#define VAUDIO_2_775 (2 << 4)
#define VAUDIO_3_0 (3 << 4)
#define VAUDIO_MASK (3 << 4)
#define VSD_1_8 (0 << 6)
#define VSD_2_0 (1 << 6)
#define VSD_2_6 (2 << 6)
#define VSD_2_7 (3 << 6)
#define VSD_2_8 (4 << 6)
#define VSD_2_9 (5 << 6)
#define VSD_3_0 (6 << 6)
#define VSD_3_15 (7 << 6)
#define VSD_MASK (7 << 6)
#define VGEN1_1_2 0
#define VGEN1_1_5 1
#define VGEN1_2_775 2
#define VGEN1_3_15 3
#define VGEN1_MASK 3
#define VGEN2_1_2 (0 << 6)
#define VGEN2_1_5 (1 << 6)
#define VGEN2_1_6 (2 << 6)
#define VGEN2_1_8 (3 << 6)
#define VGEN2_2_7 (4 << 6)
#define VGEN2_2_8 (5 << 6)
#define VGEN2_3_0 (6 << 6)
#define VGEN2_3_15 (7 << 6)
#define VGEN2_MASK (7 << 6)
/* Fields in REG_SETTING_1 */
#define VGEN3_1_8 (0 << 14)
#define VGEN3_2_9 (1 << 14)
#define VGEN3_MASK (1 << 14)
#define VDIG_1_05 (0 << 4)
#define VDIG_1_25 (1 << 4)
#define VDIG_1_65 (2 << 4)
#define VDIG_1_8 (3 << 4)
#define VDIG_MASK (3 << 4)
#define VCAM_2_5 (0 << 16)
#define VCAM_2_6 (1 << 16)
#define VCAM_2_75 (2 << 16)
#define VCAM_3_0 (3 << 16)
#define VCAM_MASK (3 << 16)
/* Reg Mode 1 */
#define VGEN3EN (1 << 0)
#define VGEN3STBY (1 << 1)
#define VGEN3MODE (1 << 2)
#define VGEN3CONFIG (1 << 3)
#define VCAMEN (1 << 6)
#define VCAMSTBY (1 << 7)
#define VCAMMODE (1 << 8)
#define VCAMCONFIG (1 << 9)
#define VVIDEOEN (1 << 12)
#define VIDEOSTBY (1 << 13)
#define VVIDEOMODE (1 << 14)
#define VAUDIOEN (1 << 15)
#define VAUDIOSTBY (1 << 16)
#define VSDEN (1 << 18)
#define VSDSTBY (1 << 19)
#define VSDMODE (1 << 20)
/* Reg Power Control 2*/
#define WDIRESET (1 << 12)
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.