text
stringlengths 4
6.14k
|
|---|
//
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 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, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef GNASH_OBJECTURI_H
#define GNASH_OBJECTURI_H
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h" // GNASH_STATS_OBJECT_URI_NOCASE
#endif
#include "string_table.h"
#include "namedStrings.h"
#include <string>
#include <sstream>
//#define GNASH_STATS_OBJECT_URI_NOCASE 1
#ifdef GNASH_STATS_OBJECT_URI_NOCASE
# include "Stats.h"
#endif
namespace gnash {
/// A URI for describing as_objects.
//
/// This is used as a unique identifier for any object member, especially
/// prototypes, class, constructors.
struct ObjectURI
{
/// Comparison taking case into account (or not).
class CaseLessThan;
/// Simple, case-sensitive less-than comparison for containers.
class LessThan;
/// Case-sensitive equality
class CaseEquals;
/// Log strings.
class Logger;
/// Default constructor.
//
/// This must be equivalent to an empty string.
ObjectURI()
:
name(0),
nameNoCase(0)
{}
/// Construct an ObjectURI from name
ObjectURI(NSV::NamedStrings name)
:
name(name),
nameNoCase(0)
{}
bool empty() const {
return (name == 0);
}
const std::string& toString(string_table& st) const {
return st.value(name);
}
string_table::key noCase(string_table& st) const {
if (!name) return 0;
if (!nameNoCase) {
nameNoCase = st.noCase(name);
#ifdef GNASH_STATS_OBJECT_URI_NOCASE
static stats::KeyLookup statNonSkip("ObjectURI::noCase non-skips",
st, 0, 0, 0);
statNonSkip.check(name);
#endif
}
#ifdef GNASH_STATS_OBJECT_URI_NOCASE
else {
static stats::KeyLookup stat("ObjectURI::noCase skips",
st, 0, 0, 0);
stat.check(name);
}
#endif
return nameNoCase;
}
string_table::key name;
private:
mutable string_table::key nameNoCase;
};
/// Get the name element of an ObjectURI
inline string_table::key
getName(const ObjectURI& o)
{
return o.name;
}
class ObjectURI::LessThan
{
public:
bool operator()(const ObjectURI& a, const ObjectURI& b) const {
return a.name < b.name;
}
};
class ObjectURI::CaseLessThan
{
public:
CaseLessThan(string_table& st, bool caseless = false)
:
_st(st),
_caseless(caseless)
{}
bool operator()(const ObjectURI& a, const ObjectURI& b) const {
if (_caseless) return a.noCase(_st) < b.noCase(_st);
return a.name < b.name;
}
private:
string_table& _st;
const bool _caseless;
};
class ObjectURI::CaseEquals
{
public:
CaseEquals(string_table& st, bool caseless = false)
:
_st(st),
_caseless(caseless)
{}
bool operator()(const ObjectURI& a, const ObjectURI& b) const {
if (_caseless) return a.noCase(_st) == b.noCase(_st);
return a.name == b.name;
}
private:
string_table& _st;
const bool _caseless;
};
class ObjectURI::Logger
{
public:
Logger(string_table& st) : _st(st) {}
std::string operator()(const ObjectURI& uri) const {
const string_table::key name = getName(uri);
return _st.value(name);
}
std::string debug(const ObjectURI& uri) const {
std::stringstream ss;
const string_table::key name = getName(uri);
const string_table::key nameNoCase = uri.noCase(_st);
ss << _st.value(name)
<< "(" << name << ")/"
<< _st.value(nameNoCase)
<< "(" << nameNoCase << ")";
return ss.str();
}
private:
string_table& _st;
};
} // namespace gnash
#endif
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
/*
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/>.
*/
/*
simple plane simulator class
*/
#pragma once
#include "SIM_Aircraft.h"
#include "SIM_Plane.h"
#include "SIM_Multicopter.h"
namespace SITL {
/*
a very simple quadplane simulator
*/
class QuadPlane : public Plane {
public:
QuadPlane(const char *home_str, const char *frame_str);
/* update model by one time step */
void update(const struct sitl_input &input) override;
/* static object creator */
static Aircraft *create(const char *home_str, const char *frame_str) {
return new QuadPlane(home_str, frame_str);
}
private:
Frame *frame;
bool tiltrotors;
};
} // namespace SITL
|
/****************************************************************
* *
* Copyright 2001 Sanchez Computer Associates, Inc. *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
#include "mdef.h"
#include "compiler.h"
oprtype put_mlab(mident *l)
{
oprtype a;
a.oprclass = MLAB_REF;
a.oprval.lab = get_mladdr(l);
return a;
}
|
///////////////////////////////////////////////////////////////////////////////
// Name: wx/univ/statusbr.h
// Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 14.10.01
// RCS-ID: $Id$
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UNIV_STATUSBR_H_
#define _WX_UNIV_STATUSBR_H_
#include "wx/univ/inpcons.h"
#include "wx/arrstr.h"
// ----------------------------------------------------------------------------
// wxStatusBarUniv: a window near the bottom of the frame used for status info
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxStatusBarUniv : public wxStatusBarBase
{
public:
wxStatusBarUniv() { Init(); }
wxStatusBarUniv(wxWindow *parent,
wxWindowID id = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxPanelNameStr)
{
Init();
(void)Create(parent, id, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
long style = wxSTB_DEFAULT_STYLE,
const wxString& name = wxPanelNameStr);
// implement base class methods
virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
virtual void SetStatusWidths(int n, const int widths[]);
virtual bool GetFieldRect(int i, wxRect& rect) const;
virtual void SetMinHeight(int height);
virtual int GetBorderX() const;
virtual int GetBorderY() const;
// wxInputConsumer pure virtual
virtual wxWindow *GetInputWindow() const
{ return const_cast<wxStatusBar*>(this); }
protected:
virtual void DoUpdateStatusText(int i);
// recalculate the field widths
void OnSize(wxSizeEvent& event);
// draw the statusbar
virtual void DoDraw(wxControlRenderer *renderer);
// tell them about our preferred height
virtual wxSize DoGetBestSize() const;
// override DoSetSize() to prevent the status bar height from changing
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
// get the (fixed) status bar height
wxCoord GetHeight() const;
// get the rectangle containing all the fields and the border between them
//
// also updates m_widthsAbs if necessary
wxRect GetTotalFieldRect(wxCoord *borderBetweenFields);
// get the rect for this field without ani side effects (see code)
wxRect DoGetFieldRect(int n) const;
// common part of all ctors
void Init();
private:
// the current status fields strings
//wxArrayString m_statusText;
// the absolute status fields widths
wxArrayInt m_widthsAbs;
DECLARE_DYNAMIC_CLASS(wxStatusBarUniv)
DECLARE_EVENT_TABLE()
WX_DECLARE_INPUT_CONSUMER()
};
#endif // _WX_UNIV_STATUSBR_H_
|
// Copyright (c) 2006 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Ron Wein <wein@post.tau.ac.il>
#ifndef CGAL_ENV_SURFACE_DATA_TRAITS_3_H
#define CGAL_ENV_SURFACE_DATA_TRAITS_3_H
/*! \file
* Definition of the env_surface_data_traits_3<> class template.
*/
#include <CGAL/Arr_geometry_traits/Curve_data_aux.h>
#include <list>
namespace CGAL {
/*! \class
* A generic traits class for maintaining the envelope of surfaces that have
* an extra data field. This traits class is templated with an ordinary traits
* class, which is also used as a based traits class to inherit from.
* It can attach data objects to Surface_3 and to Xy_monotone_surface_3 objects
* (possibly of two different types).
*/
template <class Traits_, class XyMonotoneSurfaceData_,
class SurfaceData_ = XyMonotoneSurfaceData_,
class Convert_ = _Default_convert_func<SurfaceData_,
XyMonotoneSurfaceData_> >
class Env_surface_data_traits_3 : public Traits_
{
public:
typedef Traits_ Base_traits_3;
typedef XyMonotoneSurfaceData_ Xy_monotone_surface_data;
typedef SurfaceData_ Surface_data;
typedef Convert_ Convert;
typedef typename Base_traits_3::Surface_3 Base_surface_3;
typedef typename Base_traits_3::Xy_monotone_surface_3
Base_xy_monotone_surface_3;
// Representation of a surface with an addtional data field:
typedef _Curve_data_ex<Base_surface_3, Surface_data> Surface_3;
// Representation of an xy-monotone surface with an addtional data field:
typedef _Curve_data_ex<Base_xy_monotone_surface_3,
Xy_monotone_surface_data> Xy_monotone_surface_3;
public:
/// \name Construction.
//@{
/*! Default constructor. */
Env_surface_data_traits_3 ()
{}
/*! Constructor from a base-traits class. */
Env_surface_data_traits_3 (const Base_traits_3 & traits) :
Base_traits_3 (traits)
{}
//@}
/// \name Overriden functors.
//@{
class Make_xy_monotone_3
{
private:
const Base_traits_3 * base;
public:
/*! Constructor. */
Make_xy_monotone_3 (const Base_traits_3 * _base) : base (_base)
{}
/*!
* Subdivide the given surface into xy-monotone surfaces and insert them
* to the given output iterator.
* \param S The surface.
* \param oi The output iterator,
* whose value-type is Xy_monotone_surface_2.
* \return The past-the-end iterator.
*/
template<class OutputIterator>
OutputIterator operator() (const Surface_3& S, bool is_lower,
OutputIterator oi) const
{
// Make the original surface xy-monotone.
std::list<Base_xy_monotone_surface_3> xy_surfaces;
typename std::list<Base_xy_monotone_surface_3>::iterator xys_it;
base->make_xy_monotone_3_object()
(S, is_lower, std::back_inserter (xy_surfaces));
// Attach the data to each of the resulting xy-monotone surfaces.
for (xys_it = xy_surfaces.begin(); xys_it != xy_surfaces.end(); ++xys_it)
{
*oi = Xy_monotone_surface_3 (*xys_it,
Convert() (S.data()));
++oi;
}
return (oi);
}
};
/*! Get a Make_xy_monotone_3 functor object. */
Make_xy_monotone_3 make_xy_monotone_3_object() const
{
return Make_xy_monotone_3 (this);
}
//@}
};
} //namespace CGAL
#endif
|
// Copyright 2010 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: jdtang@google.com (Jonathan Tang)
#include "vector.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "util.h"
struct GumboInternalParser;
const GumboVector kGumboEmptyVector = { NULL, 0, 0 };
void gumbo_vector_init(size_t initial_capacity, GumboVector* vector) {
vector->length = 0;
vector->capacity = initial_capacity;
vector->data = NULL;
if (initial_capacity)
vector->data = gumbo_malloc(sizeof(void*) * initial_capacity);
}
void gumbo_vector_destroy(GumboVector* vector) {
gumbo_free(vector->data);
}
static void enlarge_vector_if_full(GumboVector* vector, int space) {
unsigned int new_length = vector->length + space;
unsigned int new_capacity = vector->capacity;
if (!new_capacity)
new_capacity = 2;
while (new_capacity < new_length)
new_capacity *= 2;
if (new_capacity != vector->capacity) {
vector->capacity = new_capacity;
vector->data = gumbo_realloc(vector->data,
sizeof(void *) * vector->capacity);
}
}
void gumbo_vector_add(void* element, GumboVector* vector) {
enlarge_vector_if_full(vector, 1);
assert(vector->data);
assert(vector->length < vector->capacity);
vector->data[vector->length++] = element;
}
void* gumbo_vector_pop(GumboVector* vector) {
if (vector->length == 0) {
return NULL;
}
return vector->data[--vector->length];
}
int gumbo_vector_index_of(GumboVector* vector, const void* element) {
for (unsigned int i = 0; i < vector->length; ++i) {
if (vector->data[i] == element) {
return i;
}
}
return -1;
}
void gumbo_vector_insert_at(void* element, unsigned int index, GumboVector* vector) {
assert(index >= 0);
assert(index <= vector->length);
enlarge_vector_if_full(vector, 1);
++vector->length;
memmove(&vector->data[index + 1], &vector->data[index],
sizeof(void*) * (vector->length - index - 1));
vector->data[index] = element;
}
void gumbo_vector_splice(int where, int n_to_remove,
void **data, int n_to_insert,
GumboVector* vector) {
enlarge_vector_if_full(vector, n_to_insert - n_to_remove);
memmove(vector->data + where + n_to_insert,
vector->data + where + n_to_remove,
sizeof(void *) * (vector->length - where - n_to_remove));
memcpy(vector->data + where, data, sizeof(void *) * n_to_insert);
vector->length = vector->length + n_to_insert - n_to_remove;
}
void gumbo_vector_remove(const void* node, GumboVector* vector) {
int index = gumbo_vector_index_of(vector, node);
if (index == -1) {
return;
}
gumbo_vector_remove_at(index, vector);
}
void* gumbo_vector_remove_at(unsigned int index, GumboVector* vector) {
assert(index >= 0);
assert(index < vector->length);
void* result = vector->data[index];
memmove(&vector->data[index], &vector->data[index + 1],
sizeof(void*) * (vector->length - index - 1));
--vector->length;
return result;
}
|
/** @file
A brief file description
@section license License
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "api/include/experimental.h"
void UDPClientTestInit();
int UDPClient_handle_callbacks(INKCont cont, INKEvent event, void *e);
// int send_callbacks (INKCont cont, INKEvent event, void *e);
|
#ifndef _INCLUDED_ASW_OBJECTIVE_DUMMY_H
#define _INCLUDED_ASW_OBJECTIVE_DUMMY_H
#pragma once
#include "asw_objective.h"
// A dummy objective used to show some text on the objectives screen
class CASW_Objective_Dummy : public CASW_Objective
{
public:
DECLARE_CLASS( CASW_Objective_Dummy, CASW_Objective );
DECLARE_DATADESC();
CASW_Objective_Dummy();
virtual ~CASW_Objective_Dummy();
};
#endif /* _INCLUDED_ASW_OBJECTIVE_DUMMY_H */
|
#include <sgx/sys/select.h>
|
int foo(int a) {
return a;
}
|
/***************************************************************
*
* Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* 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 __FTGAHP_COMMON_H__
#define __FTGAHP_COMMON_H__
#include "gahp_common.h"
#define GAHP_REQUEST_PIPE 100
#define GAHP_RESULT_PIPE 101
#define GAHP_REQUEST_ACK_PIPE 102
int
parse_gahp_command (const char* raw, Gahp_Args* args);
#endif
|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2018, 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"
/***********************************************************************
* Only for IPv6-enabled builds
**********************************************************************/
#ifdef CURLRES_IPV6
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef __VMS
#include <in.h>
#include <inet.h>
#endif
#ifdef HAVE_PROCESS_H
#include <process.h>
#endif
#include "urldata.h"
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
#include "share.h"
#include "strerror.h"
#include "url.h"
#include "inet_pton.h"
#include "connect.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
/*
* Curl_ipv6works() returns TRUE if IPv6 seems to work.
*/
bool Curl_ipv6works(void)
{
/* the nature of most system is that IPv6 status doesn't come and go
during a program's lifetime so we only probe the first time and then we
have the info kept for fast re-use */
static int ipv6_works = -1;
if(-1 == ipv6_works) {
/* probe to see if we have a working IPv6 stack */
curl_socket_t s = socket(PF_INET6, SOCK_DGRAM, 0);
if(s == CURL_SOCKET_BAD)
/* an IPv6 address was requested but we can't get/use one */
ipv6_works = 0;
else {
ipv6_works = 1;
Curl_closesocket(NULL, s);
}
}
return (ipv6_works>0)?TRUE:FALSE;
}
/*
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
* been set and returns TRUE if they are OK.
*/
bool Curl_ipvalid(struct connectdata *conn)
{
if(conn->ip_version == CURL_IPRESOLVE_V6)
return Curl_ipv6works();
return TRUE;
}
#if defined(CURLRES_SYNCH)
#ifdef DEBUG_ADDRINFO
static void dump_addrinfo(struct connectdata *conn, const Curl_addrinfo *ai)
{
printf("dump_addrinfo:\n");
for(; ai; ai = ai->ai_next) {
char buf[INET6_ADDRSTRLEN];
printf(" fam %2d, CNAME %s, ",
ai->ai_family, ai->ai_canonname ? ai->ai_canonname : "<none>");
if(Curl_printable_address(ai, buf, sizeof(buf)))
printf("%s\n", buf);
else
printf("failed; %s\n", Curl_strerror(conn, SOCKERRNO));
}
}
#else
#define dump_addrinfo(x,y) Curl_nop_stmt
#endif
/*
* Curl_getaddrinfo() when built IPv6-enabled (non-threading and
* non-ares version).
*
* Returns name information about the given hostname and port number. If
* successful, the 'addrinfo' is returned and the forth argument will point to
* memory we need to free after use. That memory *MUST* be freed with
* Curl_freeaddrinfo(), nothing else.
*/
Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
const char *hostname,
int port,
int *waitp)
{
struct addrinfo hints;
Curl_addrinfo *res;
int error;
char sbuf[12];
char *sbufptr = NULL;
#ifndef USE_RESOLVE_ON_IPS
char addrbuf[128];
#endif
int pf;
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
struct Curl_easy *data = conn->data;
#endif
*waitp = 0; /* synchronous response only */
/* Check if a limited name resolve has been requested */
switch(conn->ip_version) {
case CURL_IPRESOLVE_V4:
pf = PF_INET;
break;
case CURL_IPRESOLVE_V6:
pf = PF_INET6;
break;
default:
pf = PF_UNSPEC;
break;
}
if((pf != PF_INET) && !Curl_ipv6works())
/* The stack seems to be a non-IPv6 one */
pf = PF_INET;
memset(&hints, 0, sizeof(hints));
hints.ai_family = pf;
hints.ai_socktype = conn->socktype;
#ifndef USE_RESOLVE_ON_IPS
/*
* The AI_NUMERICHOST must not be set to get synthesized IPv6 address from
* an IPv4 address on iOS and Mac OS X.
*/
if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) ||
(1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) {
/* the given address is numerical only, prevent a reverse lookup */
hints.ai_flags = AI_NUMERICHOST;
}
#endif
if(port) {
snprintf(sbuf, sizeof(sbuf), "%d", port);
sbufptr = sbuf;
}
error = Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &res);
if(error) {
infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port);
return NULL;
}
if(port) {
Curl_addrinfo_set_port(res, port);
}
dump_addrinfo(conn, res);
return res;
}
#endif /* CURLRES_SYNCH */
#endif /* CURLRES_IPV6 */
|
/*
Copyright (c) 2012 Martin Sustrik All rights reserved.
Copyright (c) 2013 GoPivotal, Inc. 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.
*/
#include "../src/nn.h"
#include "../src/bus.h"
#include "../src/pair.h"
#include "../src/pipeline.h"
#include "../src/inproc.h"
#include "testutil.h"
#include "../src/utils/attr.h"
#include "../src/utils/thread.c"
#define SOCKET_ADDRESS_A "inproc://a"
#define SOCKET_ADDRESS_B "inproc://b"
#define SOCKET_ADDRESS_C "inproc://c"
#define SOCKET_ADDRESS_D "inproc://d"
#define SOCKET_ADDRESS_E "inproc://e"
void device1 (NN_UNUSED void *arg)
{
int rc;
int deva;
int devb;
/* Intialise the device sockets. */
deva = test_socket (AF_SP_RAW, NN_PAIR);
test_bind (deva, SOCKET_ADDRESS_A);
devb = test_socket (AF_SP_RAW, NN_PAIR);
test_bind (devb, SOCKET_ADDRESS_B);
/* Run the device. */
rc = nn_device (deva, devb);
nn_assert (rc < 0 && (nn_errno () == ETERM || nn_errno () == EBADF));
/* Clean up. */
test_close (devb);
test_close (deva);
}
void device2 (NN_UNUSED void *arg)
{
int rc;
int devc;
int devd;
/* Intialise the device sockets. */
devc = test_socket (AF_SP_RAW, NN_PULL);
test_bind (devc, SOCKET_ADDRESS_C);
devd = test_socket (AF_SP_RAW, NN_PUSH);
test_bind (devd, SOCKET_ADDRESS_D);
/* Run the device. */
rc = nn_device (devc, devd);
nn_assert (rc < 0 && nn_errno () == ETERM);
/* Clean up. */
test_close (devd);
test_close (devc);
}
void device3 (NN_UNUSED void *arg)
{
int rc;
int deve;
/* Intialise the device socket. */
deve = test_socket (AF_SP_RAW, NN_BUS);
test_bind (deve, SOCKET_ADDRESS_E);
/* Run the device. */
rc = nn_device (deve, -1);
nn_assert (rc < 0 && nn_errno () == ETERM);
/* Clean up. */
test_close (deve);
}
int main ()
{
int enda;
int endb;
int endc;
int endd;
int ende1;
int ende2;
struct nn_thread thread1;
struct nn_thread thread2;
struct nn_thread thread3;
int timeo;
/* Test the bi-directional device. */
/* Start the device. */
nn_thread_init (&thread1, device1, NULL);
/* Create two sockets to connect to the device. */
enda = test_socket (AF_SP, NN_PAIR);
test_connect (enda, SOCKET_ADDRESS_A);
endb = test_socket (AF_SP, NN_PAIR);
test_connect (endb, SOCKET_ADDRESS_B);
/* Pass a pair of messages between endpoints. */
test_send (enda, "ABC");
test_recv (endb, "ABC");
test_send (endb, "ABC");
test_recv (enda, "ABC");
/* Clean up. */
test_close (endb);
test_close (enda);
/* Test the uni-directional device. */
/* Start the device. */
nn_thread_init (&thread2, device2, NULL);
/* Create two sockets to connect to the device. */
endc = test_socket (AF_SP, NN_PUSH);
test_connect (endc, SOCKET_ADDRESS_C);
endd = test_socket (AF_SP, NN_PULL);
test_connect (endd, SOCKET_ADDRESS_D);
/* Pass a message between endpoints. */
test_send (endc, "XYZ");
test_recv (endd, "XYZ");
/* Clean up. */
test_close (endd);
test_close (endc);
/* Test the loopback device. */
/* Start the device. */
nn_thread_init (&thread3, device3, NULL);
/* Create two sockets to connect to the device. */
ende1 = test_socket (AF_SP, NN_BUS);
test_connect (ende1, SOCKET_ADDRESS_E);
ende2 = test_socket (AF_SP, NN_BUS);
test_connect (ende2, SOCKET_ADDRESS_E);
/* BUS is unreliable so wait a bit for connections to be established. */
nn_sleep (100);
/* Pass a message to the bus. */
test_send (ende1, "KLM");
test_recv (ende2, "KLM");
/* Make sure that the message doesn't arrive at the socket it was
originally sent to. */
timeo = 100;
test_setsockopt (ende1, NN_SOL_SOCKET, NN_RCVTIMEO,
&timeo, sizeof (timeo));
test_drop (ende1, ETIMEDOUT);
/* Clean up. */
test_close (ende2);
test_close (ende1);
/* Shut down the devices. */
nn_term ();
nn_thread_term (&thread1);
nn_thread_term (&thread2);
nn_thread_term (&thread3);
return 0;
}
|
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
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.
*/
/**
* @file STM32F7xx/cmparams.h
* @brief ARM Cortex-M7 parameters for the STM32F4xx.
*
* @defgroup ARMCMx_STM32F7xx STM32F7xx Specific Parameters
* @ingroup ARMCMx_SPECIFIC
* @details This file contains the Cortex-M7 specific parameters for the
* STM32F7xx platform.
* @{
*/
#ifndef _CMPARAMS_H_
#define _CMPARAMS_H_
/**
* @brief Cortex core model.
*/
#define CORTEX_MODEL 7
/**
* @brief Floating Point unit presence.
*/
#define CORTEX_HAS_FPU 1
/**
* @brief Number of bits in priority masks.
*/
#define CORTEX_PRIORITY_BITS 4
/**
* @brief Number of interrupt vectors.
* @note This number does not include the 16 system vectors and must be
* rounded to a multiple of 8.
*/
#define CORTEX_NUM_VECTORS 112
/* The following code is not processed when the file is included from an
asm module.*/
#if !defined(_FROM_ASM_)
/* If the device type is not externally defined, for example from the Makefile,
then a file named board.h is included. This file must contain a device
definition compatible with the vendor include file.*/
#if !defined(STM32F745xx) && !defined(STM32F746xx) && !defined(STM32F756xx)
#include "board.h"
#endif
/* Including the device CMSIS header. Note, we are not using the definitions
from this header because we need this file to be usable also from
assembler source files. We verify that the info matches instead.*/
#include "stm32f7xx.h"
#if CORTEX_MODEL != __CORTEX_M
#error "CMSIS __CORTEX_M mismatch"
#endif
#if CORTEX_HAS_FPU != __FPU_PRESENT
#error "CMSIS __FPU_PRESENT mismatch"
#endif
#if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS
#error "CMSIS __NVIC_PRIO_BITS mismatch"
#endif
#endif /* !defined(_FROM_ASM_) */
#endif /* _CMPARAMS_H_ */
/** @} */
|
// balscm_versiontag.h -*-C++-*-
// ----------------------------------------------------------------------------
// NOTICE
//
// This component is not up to date with current BDE coding standards, and
// should not be used as an example for new development.
// ----------------------------------------------------------------------------
#ifndef INCLUDED_BALSCM_VERSIONTAG
#define INCLUDED_BALSCM_VERSIONTAG
#ifndef INCLUDED_BSLS_IDENT
#include <bsls_ident.h>
#endif
BSLS_IDENT("$Id: $")
//@PURPOSE: Provide versioning information for the 'bae' package group.
//
//@SEE_ALSO: balscm_version
//
//@DESCRIPTION: This component provides versioning information for the 'bae'
// package group. The 'BAL_VERSION' macro that is supplied can be used for
// conditional-compilation based on 'bae' version information. The following
// usage example illustrates this basic capability.
//
// Note that since 'bae' is always released in lock-step with 'bde', they
// share common versioning, and the 'BAL_VERSION' will always equal the
// 'BSL_VERSION'.
//
///Usage
///-----
// At compile time, the version of BAL can be used to select an older or newer
// way to accomplish a task, to enable new functionality, or to accommodate an
// interface change. For example, if the name of a function changes (a rare
// occurrence, but potentially disruptive when it does happen), the impact on
// affected code can be minimized by conditionally calling the function by its
// old or new name using conditional compilation. In the following, the '#if'
// preprocessor directive compares 'BAL_VERSION' (i.e., the latest BAL version,
// excluding the patch version) to a specified major and minor version composed
// using the 'BSL_MAKE_VERSION' macro:
//..
// #if BAL_VERSION > BSL_MAKE_VERSION(1, 3)
// // Call 'newFunction' for BAL versions later than 1.3.
// int result = newFunction();
// #else
// // Call 'oldFunction' for BAL version 1.3 or earlier.
// int result = oldFunction();
// #endif
//..
#ifndef INCLUDED_BSLSCM_VERSIONTAG
#include <bslscm_versiontag.h>
#endif
#define BAL_VERSION_MAJOR BSL_VERSION_MAJOR
// BAL release major version
#define BAL_VERSION_MINOR BSL_VERSION_MINOR
// BAL release major version
#define BAL_VERSION BSL_MAKE_VERSION(BAL_VERSION_MAJOR, \
BAL_VERSION_MINOR)
// Construct a composite version number in the range [ 0 .. 999900 ] from
// the specified 'BAL_VERSION_MAJOR' and 'BAL_VERSION_MINOR' numbers
// corresponding to the major and minor version numbers, respectively, of
// the current (latest) BAL release. Note that the patch version number is
// intentionally not included. For example, 'BAL_VERSION' produces 10300
// (decimal) for BAL version 1.3.1.
#endif
// ----------------------------------------------------------------------------
// Copyright 2015 Bloomberg Finance L.P.
//
// 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.
// ----------------------------- END-OF-FILE ----------------------------------
|
#ifndef DMA_CRC_H_INCLUDED
#define DMA_CRC_H_INCLUDED
#include <compiler.h>
#ifdef __cplusplus
extern "C" {
#endif
/** DMA channel n offset. */
#define DMA_CRC_CHANNEL_N_OFFSET 0x20
/** CRC Polynomial Type. */
enum crc_polynomial_type {
/** CRC16 (CRC-CCITT). */
CRC_TYPE_16,
/** CRC32 (IEEE 802.3). */
CRC_TYPE_32,
};
/** CRC Beat Type. */
enum crc_beat_size {
/** Byte bus access. */
CRC_BEAT_SIZE_BYTE,
/** Half-word bus access. */
CRC_BEAT_SIZE_HWORD,
/** Word bus access. */
CRC_BEAT_SIZE_WORD,
};
/** Configurations for CRC calculation. */
struct dma_crc_config {
/** CRC polynomial type. */
enum crc_polynomial_type type;
/** CRC beat size. */
enum crc_beat_size size;
};
/**
* \brief Get DMA CRC default configurations.
*
* The default configuration is as follows:
* \li Polynomial type is set to CRC-16(CRC-CCITT)
* \li CRC Beat size: BYTE
*
* \param[in] config default configurations
*/
static inline void dma_crc_get_config_defaults(struct dma_crc_config *config)
{
Assert(config);
config->type = CRC_TYPE_16;
config->size = CRC_BEAT_SIZE_BYTE;
}
/**
* \brief Enable DMA CRC module with an DMA channel.
*
* This function enables a CRC calculation with an allocated DMA channel. This channel ID
* can be gotten from a successful \ref dma_allocate.
*
* \param[in] channel_id DMA channel expected with CRC calculation
* \param[in] config CRC calculation configurations
*
* \return Status of the DMC CRC.
* \retval STATUS_OK Get the DMA CRC module
* \retval STATUS_BUSY DMA CRC module is already taken and not ready yet
*/
static inline enum status_code dma_crc_channel_enable(uint32_t channel_id,
struct dma_crc_config *config)
{
if (DMAC->CRCSTATUS.reg & DMAC_CRCSTATUS_CRCBUSY) {
return STATUS_BUSY;
}
DMAC->CRCCTRL.reg = DMAC_CRCCTRL_CRCBEATSIZE(config->size) |
DMAC_CRCCTRL_CRCPOLY(config->type) |
DMAC_CRCCTRL_CRCSRC(channel_id+DMA_CRC_CHANNEL_N_OFFSET);
DMAC->CTRL.reg |= DMAC_CTRL_CRCENABLE;
return STATUS_OK;
}
/**
* \brief Disable DMA CRC module.
*
*/
static inline void dma_crc_disable(void)
{
DMAC->CTRL.reg &= ~DMAC_CTRL_CRCENABLE;
DMAC->CRCCTRL.reg = 0;
}
/**
* \brief Get DMA CRC checksum value.
*
* \return Calculated CRC checksum.
*/
static inline uint32_t dma_crc_get_checksum(void)
{
if (DMAC->CRCCTRL.bit.CRCSRC == DMAC_CRCCTRL_CRCSRC_IO_Val) {
DMAC->CRCSTATUS.reg = DMAC_CRCSTATUS_CRCBUSY;
}
return DMAC->CRCCHKSUM.reg;
}
/**
* \brief Enable DMA CRC module with I/O.
*
* This function enables a CRC calculation with I/O mode.
*
* \param[in] config CRC calculation configurations.
*
* \return Status of the DMC CRC.
* \retval STATUS_OK Get the DMA CRC module
* \retval STATUS_BUSY DMA CRC module is already taken and not ready yet
*/
static inline enum status_code dma_crc_io_enable(
struct dma_crc_config *config)
{
if (DMAC->CRCSTATUS.reg & DMAC_CRCSTATUS_CRCBUSY) {
return STATUS_BUSY;
}
if (DMAC->CTRL.reg & DMAC_CTRL_CRCENABLE) {
return STATUS_BUSY;
}
DMAC->CRCCTRL.reg = DMAC_CRCCTRL_CRCBEATSIZE(config->size) |
DMAC_CRCCTRL_CRCPOLY(config->type) |
DMAC_CRCCTRL_CRCSRC_IO;
if (config->type == CRC_TYPE_32) {
DMAC->CRCCHKSUM.reg = 0xFFFFFFFF;
}
DMAC->CTRL.reg |= DMAC_CTRL_CRCENABLE;
return STATUS_OK;
}
/**
* \brief Calculate CRC with I/O.
*
* This function calculate the CRC of the input data buffer.
*
* \param[in] buffer CRC Pointer to calculation buffer
* \param[in] total_beat_size Total beat size to be calculated
*
* \return Calculated CRC checksum value.
*/
static inline void dma_crc_io_calculation(void *buffer,
uint32_t total_beat_size)
{
uint32_t counter = total_beat_size;
uint8_t *buffer_8;
uint16_t *buffer_16;
uint32_t *buffer_32;
for (counter=0; counter<total_beat_size; counter++) {
if (DMAC->CRCCTRL.bit.CRCBEATSIZE == CRC_BEAT_SIZE_BYTE) {
buffer_8 = buffer;
DMAC->CRCDATAIN.reg = buffer_8[counter];
} else if (DMAC->CRCCTRL.bit.CRCBEATSIZE == CRC_BEAT_SIZE_HWORD) {
buffer_16 = buffer;
DMAC->CRCDATAIN.reg = buffer_16[counter];
} else if (DMAC->CRCCTRL.bit.CRCBEATSIZE == CRC_BEAT_SIZE_WORD) {
buffer_32 = buffer;
DMAC->CRCDATAIN.reg = buffer_32[counter];
}
/* Wait several cycle to make sure CRC complete */
nop();
nop();
nop();
nop();
}
}
#ifdef __cplusplus
}
#endif
#endif /* DMA_CRC_H_INCLUDED */
|
/**
* @file
* @brief linux wrapper
*
* @date 22.04.10
* @author Nikolay Korotky
*/
#ifndef LINUX_ERRNO_H_
#define LINUX_ERRNO_H_
#include <errno.h>
#endif
|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_TABLE_LAYOUT_NG_TABLE_ROW_INTERFACE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_TABLE_LAYOUT_NG_TABLE_ROW_INTERFACE_H_
#include "third_party/blink/renderer/core/layout/ng/table/interface_casting.h"
namespace blink {
class LayoutObject;
class LayoutNGTableInterface;
class LayoutNGTableSectionInterface;
class LayoutNGTableCellInterface;
// Abstract class defining table row methods.
// Used for Legacy/NG interoperability.
class LayoutNGTableRowInterface {
public:
virtual const LayoutObject* ToLayoutObject() const = 0;
virtual LayoutNGTableInterface* TableInterface() const = 0;
virtual unsigned RowIndex() const = 0;
virtual LayoutNGTableSectionInterface* SectionInterface() const = 0;
virtual LayoutNGTableRowInterface* PreviousRowInterface() const = 0;
virtual LayoutNGTableRowInterface* NextRowInterface() const = 0;
virtual LayoutNGTableCellInterface* FirstCellInterface() const = 0;
virtual LayoutNGTableCellInterface* LastCellInterface() const = 0;
};
template <>
struct InterfaceDowncastTraits<LayoutNGTableRowInterface> {
static bool AllowFrom(const LayoutObject& object) {
return object.IsTableRow();
}
static const LayoutNGTableRowInterface& ConvertFrom(
const LayoutObject& object) {
return *object.ToLayoutNGTableRowInterface();
}
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_TABLE_LAYOUT_NG_TABLE_ROW_INTERFACE_H_
|
/*
* iterator/iter_hints.h - iterative resolver module stub and root hints.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* 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 NLNET LABS 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 REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of stub and root hints, and read those from config.
*/
#ifndef ITERATOR_ITER_HINTS_H
#define ITERATOR_ITER_HINTS_H
#include "util/storage/dnstree.h"
struct iter_env;
struct config_file;
struct delegpt;
/**
* Iterator hints structure
*/
struct iter_hints {
/**
* Hints are stored in this tree. Sort order is specially chosen.
* first sorted on qclass. Then on dname in nsec-like order, so that
* a lookup on class, name will return an exact match or the closest
* match which gives the ancestor needed.
* contents of type iter_hints_stub. The class IN root is in here.
* uses name_tree_node from dnstree.h.
*/
rbtree_t tree;
};
/**
* Iterator hints for a particular stub.
*/
struct iter_hints_stub {
/** tree sorted by name, class */
struct name_tree_node node;
/** delegation point with hint information for this stub. malloced. */
struct delegpt* dp;
/** does the stub need to forego priming (like on other ports) */
uint8_t noprime;
};
/**
* Create hints
* @return new hints or NULL on error.
*/
struct iter_hints* hints_create(void);
/**
* Delete hints.
* @param hints: to delete.
*/
void hints_delete(struct iter_hints* hints);
/**
* Process hints config. Sets default values for root hints if no config.
* @param hints: where to store.
* @param cfg: config options.
* @return 0 on error.
*/
int hints_apply_cfg(struct iter_hints* hints, struct config_file* cfg);
/**
* Find root hints for the given class.
* @param hints: hint storage.
* @param qclass: class for which root hints are requested. host order.
* @return: NULL if no hints, or a ptr to stored hints.
*/
struct delegpt* hints_lookup_root(struct iter_hints* hints, uint16_t qclass);
/**
* Find next root hints (to cycle through all root hints).
* @param hints: hint storage
* @param qclass: class for which root hints are sought.
* 0 means give the first available root hints class.
* x means, give class x or a higher class if any.
* returns the found class in this variable.
* @return true if a root hint class is found.
* false if not root hint class is found (qclass may have been changed).
*/
int hints_next_root(struct iter_hints* hints, uint16_t* qclass);
/**
* Given a qname/qclass combination, and the delegation point from the cache
* for this qname/qclass, determine if this combination indicates that a
* stub hint exists and must be primed.
*
* @param hints: hint storage.
* @param qname: The qname that generated the delegation point.
* @param qclass: The qclass that generated the delegation point.
* @param dp: The cache generated delegation point.
* @return: A priming delegation point if there is a stub hint that must
* be primed, otherwise null.
*/
struct iter_hints_stub* hints_lookup_stub(struct iter_hints* hints,
uint8_t* qname, uint16_t qclass, struct delegpt* dp);
/**
* Get memory in use by hints
* @param hints: hint storage.
* @return bytes in use
*/
size_t hints_get_mem(struct iter_hints* hints);
/**
* Add stub to hints structure. For external use since it recalcs
* the tree parents.
* @param hints: the hints data structure
* @param c: class of zone
* @param dp: delegation point with name and target nameservers for new
* hints stub. malloced.
* @param noprime: set noprime option to true or false on new hint stub.
* @return false on failure (out of memory);
*/
int hints_add_stub(struct iter_hints* hints, uint16_t c, struct delegpt* dp,
int noprime);
/**
* Remove stub from hints structure. For external use since it
* recalcs the tree parents.
* @param hints: the hints data structure
* @param c: class of stub zone
* @param nm: name of stub zone (in uncompressed wireformat).
*/
void hints_delete_stub(struct iter_hints* hints, uint16_t c, uint8_t* nm);
#endif /* ITERATOR_ITER_HINTS_H */
|
/*
https://github.com/waynezxcv/Gallop
Copyright (c) 2016 waynezxcv <liuweiself@126.com>
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.
*/
#import <Foundation/Foundation.h>
#import "LWTextStorage.h"
@interface LWTextParser : NSObject
/**
* 解析表情替代为相应的图片
* 格式:text:@“hello,world~![微笑]” ----> @"hello,world~!([UIImage imageNamed:@“[微笑]”])"
* @param textStorage 需要解析的LWTextStorage对象
*/
+ (void)parseEmojiWithTextStorage:(LWTextStorage *)textStorage;
/**
* 解析HTTP(s):// 并添加链接
*
* @param textStorage 需要解析的LWTextStorage对象
* @param linkColor 链接文本颜色
* @param higlightColor 链接点击时高亮颜色
*/
+ (void)parseHttpURLWithTextStorage:(LWTextStorage *)textStorage
linkColor:(UIColor *)linkColor
highlightColor:(UIColor *)higlightColor;
/**
* 解析 @用户 并添加链接
*
* @param textStorage 需要解析的LWTextStorage对象
* @param linkColor 链接文本颜色
* @param higlightColor 链接点击时高亮颜色
*/
+ (void)parseAccountWithTextStorage:(LWTextStorage *)textStorage
linkColor:(UIColor *)linkColor
highlightColor:(UIColor *)higlightColor;
/**
* 解析 #主题# 并添加链接
*
* @param textStorage 需要解析的LWTextStorage对象
* @param linkColor 链接文本颜色
* @param higlightColor 链接点击时高亮颜色
*/
+ (void)parseTopicWithLWTextStorage:(LWTextStorage *)textStorage
linkColor:(UIColor *)linkColor
highlightColor:(UIColor *)higlightColor;
/**
* 解析 手机号码 并添加链接
*
* @param textStorage 需要解析的LWTextStorage对象
* @param linkColor 链接文本颜色
* @param higlightColor 链接点击时高亮颜色
*/
+ (void)parseTelWithLWTextStorage:(LWTextStorage *)textStorage
linkColor:(UIColor *)linkColor
highlightColor:(UIColor *)higlightColor;
@end
|
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
//
// If the source code for the program is not available from the place from
// which you received this file, check
// http://ultravnc.sourceforge.net/
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the AUTHSSP_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// AUTHSSP_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef AUTHSSP_EXPORTS
#define AUTHSSP_API __declspec(dllexport)
#else
#define AUTHSSP_API __declspec(dllimport)
#endif
#include <windows.h>
#include <aclui.h>
#include <aclapi.h>
#include <stdio.h>
struct vncSecurityInfo : ISecurityInformation
{
long m_cRefs;
const wchar_t* const m_pszObjectName;
const wchar_t* const m_pszPageTitle;
vncSecurityInfo(const wchar_t* pszObjectName,
const wchar_t* pszPageTitle = 0 )
: m_cRefs(0),
m_pszObjectName(pszObjectName),
m_pszPageTitle(pszPageTitle) {}
STDMETHODIMP QueryInterface( REFIID iid, void** ppv );
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
STDMETHODIMP GetObjectInformation( SI_OBJECT_INFO* poi );
STDMETHODIMP GetSecurity(SECURITY_INFORMATION ri, PSECURITY_DESCRIPTOR * ppsd, BOOL bDefault);
STDMETHODIMP SetSecurity(SECURITY_INFORMATION ri, void* psd);
STDMETHODIMP PropertySheetPageCallback(HWND hwnd, UINT msg, SI_PAGE_TYPE pt);
STDMETHODIMP GetAccessRights(const GUID*,
DWORD dwFlags,
SI_ACCESS** ppAccess,
ULONG* pcAccesses,
ULONG* piDefaultAccess);
STDMETHODIMP MapGeneric(const GUID*, UCHAR* pAceFlags, ACCESS_MASK* pMask);
STDMETHODIMP GetInheritTypes(SI_INHERIT_TYPE** ppInheritTypes, ULONG* pcInheritTypes);
};
AUTHSSP_API void vncEditSecurity(HWND hwnd, HINSTANCE hInstance);
bool CheckAclUI();
extern TCHAR *AddToModuleDir(TCHAR *filename, int length);
|
/*
* c67x00-hcd.h: Cypress C67X00 USB HCD
*
* Copyright (C) 2006-2008 Barco N.V.
* Derived from the Cypress cy7c67200/300 ezusb linux driver and
* based on multiple host controller drivers inside the linux kernel.
*
* 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.
*/
#ifndef _USB_C67X00_HCD_H
#define _USB_C67X00_HCD_H
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include "c67x00.h"
/*
*/
/*
*/
#define TOTAL_FRAME_BW 12000
#define DEFAULT_EOT 2250
#define MAX_FRAME_BW_STD (TOTAL_FRAME_BW - DEFAULT_EOT)
#define MAX_FRAME_BW_ISO 2400
/*
*/
#define MAX_PERIODIC_BW(full_bw) full_bw
/* */
struct c67x00_hcd {
spinlock_t lock;
struct c67x00_sie *sie;
unsigned int low_speed_ports; /* */
unsigned int urb_count;
unsigned int urb_iso_count;
struct list_head list[4]; /* */
#if PIPE_BULK != 3
#error "Sanity check failed, this code presumes PIPE_... to range from 0 to 3"
#endif
/* */
int bandwidth_allocated;
/* */
int periodic_bw_allocated;
struct list_head td_list;
int max_frame_bw;
u16 td_base_addr;
u16 buf_base_addr;
u16 next_td_addr;
u16 next_buf_addr;
struct tasklet_struct tasklet;
struct completion endpoint_disable;
u16 current_frame;
u16 last_frame;
};
static inline struct c67x00_hcd *hcd_to_c67x00_hcd(struct usb_hcd *hcd)
{
return (struct c67x00_hcd *)(hcd->hcd_priv);
}
static inline struct usb_hcd *c67x00_hcd_to_hcd(struct c67x00_hcd *c67x00)
{
return container_of((void *)c67x00, struct usb_hcd, hcd_priv);
}
/*
*/
int c67x00_hcd_probe(struct c67x00_sie *sie);
void c67x00_hcd_remove(struct c67x00_sie *sie);
/*
*/
int c67x00_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
int c67x00_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
void c67x00_endpoint_disable(struct usb_hcd *hcd,
struct usb_host_endpoint *ep);
void c67x00_hcd_msg_received(struct c67x00_sie *sie, u16 msg);
void c67x00_sched_kick(struct c67x00_hcd *c67x00);
int c67x00_sched_start_scheduler(struct c67x00_hcd *c67x00);
void c67x00_sched_stop_scheduler(struct c67x00_hcd *c67x00);
#define c67x00_hcd_dev(x) (c67x00_hcd_to_hcd(x)->self.controller)
#endif /* */
|
/* linux/drivers/media/video/samsung/jpeg_v2/jpg_opr.h
*
* Copyright (c) 2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* Definition for Operation of Jpeg encoder/docoder
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __JPG_OPR_H__
#define __JPG_OPR_H__
#include <linux/interrupt.h>
/* debug macro */
#define JPG_DEBUG(fmt, ...) \
do { \
printk(KERN_DEBUG \
"%s: " fmt, __func__, ##__VA_ARGS__); \
} while(0)
#define JPG_WARN(fmt, ...) \
do { \
printk(KERN_WARNING \
fmt, ##__VA_ARGS__); \
} while (0)
#define JPG_ERROR(fmt, ...) \
do { \
printk(KERN_ERR \
"%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)
#ifdef CONFIG_VIDEO_JPEG_DEBUG
#define jpg_dbg(fmt, ...) JPG_DEBUG(fmt, ##__VA_ARGS__)
#else
#define jpg_dbg(fmt, ...)
#endif
#define jpg_warn(fmt, ...) JPG_WARN(fmt, ##__VA_ARGS__)
#define jpg_err(fmt, ...) JPG_ERROR(fmt, ##__VA_ARGS__)
extern wait_queue_head_t wait_queue_jpeg;
typedef enum {
JPG_FAIL,
JPG_SUCCESS,
OK_HD_PARSING,
ERR_HD_PARSING,
OK_ENC_OR_DEC,
ERR_ENC_OR_DEC,
ERR_UNKNOWN
} jpg_return_status;
typedef enum {
JPG_RGB16,
JPG_YCBYCR,
JPG_TYPE_UNKNOWN
} image_type_t;
typedef enum {
JPG_444,
JPG_422,
JPG_420,
JPG_400,
RESERVED1,
RESERVED2,
JPG_411,
JPG_SAMPLE_UNKNOWN
} sample_mode_t;
typedef enum {
YCBCR_422,
YCBCR_420,
YCBCR_SAMPLE_UNKNOWN
} out_mode_t;
typedef enum {
JPG_MODESEL_YCBCR = 1,
JPG_MODESEL_RGB,
JPG_MODESEL_UNKNOWN
} in_mode_t;
typedef enum {
JPG_MAIN,
JPG_THUMBNAIL
} encode_type_t;
typedef enum {
JPG_QUALITY_LEVEL_1 = 0, /*high quality*/
JPG_QUALITY_LEVEL_2,
JPG_QUALITY_LEVEL_3,
JPG_QUALITY_LEVEL_4 /*low quality*/
} image_quality_type_t;
typedef struct {
sample_mode_t sample_mode;
encode_type_t dec_type;
out_mode_t out_format;
UINT32 width;
UINT32 height;
UINT32 data_size;
UINT32 file_size;
} jpg_dec_proc_param;
typedef struct {
sample_mode_t sample_mode;
encode_type_t enc_type;
in_mode_t in_format;
image_quality_type_t quality;
UINT32 width;
UINT32 height;
UINT32 data_size;
UINT32 file_size;
//added for jpeg capture
UINT32 set_framebuf;
} jpg_enc_proc_param;
typedef struct {
char *in_buf;
char *phy_in_buf;
int in_buf_size;
char *out_buf;
char *phy_out_buf;
int out_buf_size;
char *in_thumb_buf;
char *phy_in_thumb_buf;
int in_thumb_buf_size;
char *out_thumb_buf;
char *phy_out_thumb_buf;
int out_thumb_buf_size;
char *mapped_addr;
jpg_dec_proc_param *dec_param;
jpg_enc_proc_param *enc_param;
jpg_enc_proc_param *thumb_enc_param;
} jpg_args;
void reset_jpg(sspc100_jpg_ctx *jpg_ctx);
jpg_return_status decode_jpg(sspc100_jpg_ctx *jpg_ctx, jpg_dec_proc_param *dec_param);
jpg_return_status encode_jpg(sspc100_jpg_ctx *jpg_ctx, jpg_enc_proc_param *enc_param);
jpg_return_status wait_for_interrupt(void);
sample_mode_t get_sample_type(sspc100_jpg_ctx *jpg_ctx);
void get_xy(sspc100_jpg_ctx *jpg_ctx, UINT32 *x, UINT32 *y);
UINT32 get_yuv_size(out_mode_t out_format, UINT32 width, UINT32 height);
#endif
|
/** @file mlan_11n_rxreorder.h
*
* @brief This file contains related macros, enum, and struct
* of 11n RxReordering functionalities
*
* Copyright (C) 2008-2015, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*/
/********************************************************
Change log:
11/10/2008: initial version
********************************************************/
#ifndef _MLAN_11N_RXREORDER_H_
#define _MLAN_11N_RXREORDER_H_
/** Max value a TID can take = 2^12 = 4096 */
#define MAX_TID_VALUE (2 << 11)
/** 2^11 = 2048 */
#define TWOPOW11 (2 << 10)
/** Tid Mask used for extracting TID from BlockAckParamSet */
#define BLOCKACKPARAM_TID_MASK 0x3C
/** Tid position in BlockAckParamSet */
#define BLOCKACKPARAM_TID_POS 2
/** WinSize Mask used for extracting WinSize from BlockAckParamSet */
#define BLOCKACKPARAM_WINSIZE_MASK 0xffc0
/** WinSize Mask used for extracting WinSize from BlockAckParamSet */
#define BLOCKACKPARAM_AMSDU_SUPP_MASK 0x1
/** WinSize position in BlockAckParamSet */
#define BLOCKACKPARAM_WINSIZE_POS 6
/** Position of TID in DelBA Param set */
#define DELBA_TID_POS 12
/** Position of INITIATOR in DelBA Param set */
#define DELBA_INITIATOR_POS 11
/** Reason code: Requested from peer STA as it does not want to
* use the mechanism */
#define REASON_CODE_STA_DONT_WANT 37
/** Reason code: Requested from peer STA due to timeout*/
#define REASON_CODE_STA_TIMEOUT 39
/** Type: send delba command */
#define TYPE_DELBA_SENT 1
/** Type: recieve delba command */
#define TYPE_DELBA_RECEIVE 2
/** Set Initiator Bit */
#define DELBA_INITIATOR(paramset) (paramset = (paramset | (1 << 11)))
/** Reset Initiator Bit for recipient */
#define DELBA_RECIPIENT(paramset) (paramset = (paramset & ~(1 << 11)))
/** Immediate block ack */
#define IMMEDIATE_BLOCK_ACK 0x2
/** The request has been declined */
#define ADDBA_RSP_STATUS_DECLINED 37
/** ADDBA response status : Reject */
#define ADDBA_RSP_STATUS_REJECT 1
/** ADDBA response status : Accept */
#define ADDBA_RSP_STATUS_ACCEPT 0
/** DEFAULT SEQ NUM */
#define DEFAULT_SEQ_NUM 0xffff
/** Indicate packet has been dropped in FW */
#define RX_PKT_DROPPED_IN_FW 0xffffffff
mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seqNum, t_u16 tid,
t_u8 *ta, t_u8 pkttype, void *payload);
void mlan_11n_delete_bastream_tbl(mlan_private *priv, int tid,
t_u8 *PeerMACAddr, t_u8 type, int initiator);
void wlan_11n_ba_stream_timeout(mlan_private *priv,
HostCmd_DS_11N_BATIMEOUT *event);
mlan_status wlan_ret_11n_addba_resp(mlan_private *priv,
HostCmd_DS_COMMAND *resp);
mlan_status wlan_cmd_11n_delba(mlan_private *priv, HostCmd_DS_COMMAND *cmd,
void *pdata_buf);
mlan_status wlan_cmd_11n_addba_rspgen(mlan_private *priv,
HostCmd_DS_COMMAND *cmd, void *pdata_buf);
mlan_status wlan_cmd_11n_addba_req(mlan_private *priv, HostCmd_DS_COMMAND *cmd,
void *pdata_buf);
void wlan_11n_cleanup_reorder_tbl(mlan_private *priv);
RxReorderTbl *wlan_11n_get_rxreorder_tbl(mlan_private *priv, int tid, t_u8 *ta);
void wlan_11n_rxba_sync_event(mlan_private *priv, t_u8 *event_buf, t_u16 len);
void wlan_update_rxreorder_tbl(pmlan_adapter pmadapter, t_u8 flag);
/** clean up reorder_tbl */
void wlan_cleanup_reorder_tbl(mlan_private *priv, t_u8 *ta);
#endif /* _MLAN_11N_RXREORDER_H_ */
|
#ifndef _XMALLOC_H
#define _XMALLOC_H
#include <stdlib.h> /* for size_t */
/*
* avoid possible collision with readline xmalloc functions
*/
#define xmalloc _xmalloc_xmalloc
#define xrealloc _xmalloc_xrealloc
void xmalloc_set_error_handler(void (*)(int));
void * xmalloc(size_t);
void * xmalloc0(size_t);
void * xmalloc_inc(size_t, size_t);
void * xmalloc0_inc(size_t, size_t);
void * xrealloc(void *, size_t);
void * xrealloc_inc(void *, size_t, size_t);
char * xstrdup(const char *s);
char * xstrndup(const char *s, size_t);
#define xfree(ptr) do { free(ptr); ptr = NULL; } while(0)
#endif
|
/* */
#ifndef __PERF_DEBUG_H
#define __PERF_DEBUG_H
#include <stdbool.h>
#include "event.h"
extern int verbose;
extern bool quiet, dump_trace;
int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void trace_event(union perf_event *event);
struct ui_progress;
#ifdef NO_NEWT_SUPPORT
static inline int ui_helpline__show_help(const char *format __used, va_list ap __used)
{
return 0;
}
static inline void ui_progress__update(u64 curr __used, u64 total __used,
const char *title __used) {}
#define ui__error(format, arg...) ui__warning(format, ##arg)
#else
extern char ui_helpline__last_msg[];
int ui_helpline__show_help(const char *format, va_list ap);
#include "ui/progress.h"
int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
#endif
int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
int ui__error_paranoid(void);
#endif /* */
|
/*
* collectd - src/utils_dns.h
* Copyright (C) 2006 Florian octo Forster
* Copyright (C) 2002 The Measurement Factory, 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.
* 3. Neither the name of The Measurement Factory 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.
*
* Authors:
* The Measurement Factory, Inc. <http://www.measurement-factory.com/>
* Florian octo Forster <octo at collectd.org>
*/
#ifndef COLLECTD_UTILS_DNS_H
#define COLLECTD_UTILS_DNS_H 1
#include "config.h"
#include <arpa/nameser.h>
#include <stdint.h>
#if HAVE_PCAP_H
# include <pcap.h>
#endif
#define DNS_MSG_HDR_SZ 12
#define T_MAX 65536
#define MAX_QNAME_SZ 512
struct rfc1035_header_s {
uint16_t id;
unsigned int qr:1;
unsigned int opcode:4;
unsigned int aa:1;
unsigned int tc:1;
unsigned int rd:1;
unsigned int ra:1;
unsigned int z:1;
unsigned int ad:1;
unsigned int cd:1;
unsigned int rcode:4;
uint16_t qdcount;
uint16_t ancount;
uint16_t nscount;
uint16_t arcount;
uint16_t qtype;
uint16_t qclass;
char qname[MAX_QNAME_SZ];
uint16_t length;
};
typedef struct rfc1035_header_s rfc1035_header_t;
#if HAVE_PCAP_H
void dnstop_set_pcap_obj (pcap_t *po);
#endif
void dnstop_set_callback (void (*cb) (const rfc1035_header_t *));
void ignore_list_add_name (const char *name);
#if HAVE_PCAP_H
void handle_pcap (u_char * udata, const struct pcap_pkthdr *hdr, const u_char * pkt);
#endif
const char *qtype_str(int t);
const char *opcode_str(int o);
const char *rcode_str (int r);
#endif /* !COLLECTD_UTILS_DNS_H */
|
#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 arch_spinlock_t launch_lock = __ARCH_SPIN_LOCK_UNLOCKED;
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 (arch_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));
}
/*
*/
void __init prom_grab_secondary(void)
{
arch_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();
if (status & 0x4)
scheduler_ipi();
break;
case 1:
status = OCD_READ(RM9000x2_OCD_INTP1STATUS3);
OCD_WRITE(RM9000x2_OCD_INTP1CLEAR3, status);
if (status & 0x2)
smp_call_function_interrupt();
if (status & 0x4)
scheduler_ipi();
break;
}
}
/*
*/
static void yos_send_ipi_single(int cpu, unsigned int action)
{
/*
*/
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(const struct cpumask *mask, unsigned int action)
{
unsigned int i;
for_each_cpu(i, mask)
yos_send_ipi_single(i, action);
}
/*
*/
static void __cpuinit yos_init_secondary(void)
{
set_c0_status(ST0_CO | ST0_IE | ST0_IM);
}
static void __cpuinit yos_smp_finish(void)
{
}
/* */
static void yos_cpus_done(void)
{
}
/*
*/
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;
arch_spin_unlock(&launch_lock);
}
/*
*/
static void __init yos_smp_setup(void)
{
int i;
init_cpu_possible(cpu_none_mask);
for (i = 0; i < 2; i++) {
set_cpu_possible(i, true);
__cpu_number_map[i] = i;
__cpu_logical_map[i] = i;
}
}
static void __init yos_prepare_cpus(unsigned int max_cpus)
{
/*
*/
if (num_possible_cpus())
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,
};
|
/* utf8.h
*
* $Id$
*
* Notice: This header file contains declarations of functions and types that
* are just used internally. All library functions and types that are supposed
* to be publicly accessable are defined in ./src/ming.h.
*/
#ifndef SWF_UTF8_H_INCLUDED
#define SWF_UTF8_H_INCLUDED
#include "ming.h"
int UTF8Length(const char *string);
unsigned short UTF8GetChar(const char** strptr);
int UTF8ExpandString(const char* string, unsigned short** outstr);
#endif /* SWF_UTF8_H_INCLUDED */
|
/* Low-level statistical profiling support function. Linux/SPARC version.
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <signal.h>
void
profil_counter (int signo, struct sigcontext *si)
{
profil_count ((void *) si->si_regs.pc);
}
|
/* radare - LGPL - Copyright 2010-2011 eloi<limited-entropy.com> */
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_util.h>
#include <r_asm.h>
#include "dis-asm.h"
static unsigned long Offset = 0;
static char *buf_global = NULL;
static unsigned char bytes[2];
static int sh_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info) {
//this is obviously wrong. but how can we read arbitrary data @ memaddr from here?
memcpy (myaddr, bytes, length);
return 0;
}
int print_insn_shl (bfd_vma memaddr, struct disassemble_info *info);
int print_insn_shb (bfd_vma memaddr, struct disassemble_info *info);
static int symbol_at_address(bfd_vma addr, struct disassemble_info * info) {
return 0;
}
static void memory_error_func(int status, bfd_vma memaddr, struct disassemble_info *info) {
//--
}
static void print_address(bfd_vma address, struct disassemble_info *info) {
char tmp[32];
if (!buf_global)
return;
sprintf (tmp, "0x%08"PFMT64x"", (ut64)address);
strcat (buf_global, tmp);
}
static int buf_fprintf(void *stream, const char *format, ...) {
va_list ap;
char *tmp;
int ret;
if (!buf_global)
return 0;
tmp = malloc (strlen (format)+strlen (buf_global)+2);
if (!tmp)
return 0;
va_start (ap, format);
sprintf (tmp, "%s%s", buf_global, format);
ret = vsprintf (buf_global, tmp, ap);
va_end (ap);
free (tmp);
return ret;
}
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
static struct disassemble_info disasm_obj;
if (len<2) return -1;
buf_global = op->buf_asm;
Offset = a->pc;
memcpy (bytes, buf, 2);
/* prepare disassembler */
memset (&disasm_obj,'\0', sizeof (struct disassemble_info));
disasm_obj.buffer = bytes;
disasm_obj.read_memory_func = &sh_buffer_read_memory;
disasm_obj.symbol_at_address_func = &symbol_at_address;
disasm_obj.memory_error_func = &memory_error_func;
disasm_obj.print_address_func = &print_address;
disasm_obj.endian = !a->big_endian;
disasm_obj.fprintf_func = &buf_fprintf;
disasm_obj.stream = stdout;
op->buf_asm[0] = '\0';
if (disasm_obj.endian == BFD_ENDIAN_BIG)
op->size = print_insn_shb ((bfd_vma)Offset, &disasm_obj);
else
op->size = print_insn_shl ((bfd_vma)Offset, &disasm_obj);
if (op->size == -1)
strncpy (op->buf_asm, " (data)", R_ASM_BUFSIZE);
return op->size;
}
RAsmPlugin r_asm_plugin_sh = {
.name = "sh",
.arch = "sh",
.license = "GPL3",
.bits = 32,
.endian = R_SYS_ENDIAN_LITTLE | R_SYS_ENDIAN_BIG,
.desc = "SuperH-4 CPU",
.disassemble = &disassemble
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_sh,
.version = R2_VERSION
};
#endif
|
/*
* Copyright (C) 2015, Simon Fuhrmann
* TU Darmstadt - Graphics, Capture and Massively Parallel Computing
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the LICENSE.txt file for details.
*/
#ifndef MVE_DEPTHMAP_HEADER
#define MVE_DEPTHMAP_HEADER
#include "math/vector.h"
#include "math/matrix.h"
#include "mve/defines.h"
#include "mve/camera.h"
#include "mve/image.h"
#include "mve/mesh.h"
MVE_NAMESPACE_BEGIN
MVE_IMAGE_NAMESPACE_BEGIN
/**
* Algorithm to clean small confident islands in the depth maps.
* Islands that are smaller than 'thres' pixels are removed.
* Zero depth values are considered unreconstructed.
*/
FloatImage::Ptr
depthmap_cleanup (FloatImage::ConstPtr dm, std::size_t thres);
/**
* Removes the backplane according to the confidence map IN-PLACE.
* Depth map values are reset to zero where confidence is leq 0.
*/
void
depthmap_confidence_clean (FloatImage::Ptr dm, FloatImage::ConstPtr cm);
/**
* Filters the given depthmap using a bilateral filter.
*
* The filter smoothes similar depth values but preserves depth
* discontinuities using gaussian weights for both, geometric
* closeness in image space and geometric closeness in world space.
*
* Geometric closeness in image space is controlled by 'gc_sigma'
* (useful values in [1, 20]). Photometric closeness is evaluated by
* calculating the pixel footprint multiplied with 'pc_factor' to
* detect depth discontinuities (useful values in [1, 20]).
*/
FloatImage::Ptr
depthmap_bilateral_filter (FloatImage::ConstPtr dm,
math::Matrix3f const& invproj, float gc_sigma, float pc_fator);
/**
* Converts between depth map conventions IN-PLACE. In one convention,
* a depth map with a constant value means a plane, in another convention,
* which is what MVE uses, a constant value creates a curved surface. The
* difference is whether only the z-value is considered, or the distance
* to the camera center is used (MVE).
*/
template <typename T>
void
depthmap_convert_conventions (typename Image<T>::Ptr dm,
math::Matrix3f const& invproj, bool to_mve);
MVE_IMAGE_NAMESPACE_END
MVE_NAMESPACE_END
/* ---------------------------------------------------------------- */
MVE_NAMESPACE_BEGIN
MVE_GEOM_NAMESPACE_BEGIN
/**
* Function that calculates the pixel footprint (pixel width)
* in 3D coordinates for pixel (x,y) and 'depth' for a depth map
* with inverse K matrix 'invproj'.
*/
float
pixel_footprint (std::size_t x, std::size_t y, float depth,
math::Matrix3f const& invproj);
/**
* Function that calculates the pixel 3D position in camera coordinates for
* pixel (x,y) and 'depth' for a depth map with inverse K matrix 'invproj'.
*/
math::Vec3f
pixel_3dpos (std::size_t x, std::size_t y, float depth,
math::Matrix3f const& invproj);
/**
* Algorithm to triangulate depth maps.
*
* A factor may be specified that guides depth discontinuity detection. A
* depth discontinuity between pixels is assumed if depth difference is
* larger than pixel footprint times 'dd_factor'. If 'dd_factor' is zero,
* no depth discontinuity detection is performed. The depthmap is
* triangulated in the local camera coordinate system.
*
* If 'vids' is not null, image content is replaced with vertex indices for
* each pixel that generated the vertex. Index MATH_MAX_UINT corresponds to
* a pixel that did not generate a vertex.
*/
TriangleMesh::Ptr
depthmap_triangulate (FloatImage::ConstPtr dm, math::Matrix3f const& invproj,
float dd_factor = 5.0f, mve::Image<unsigned int>* vids = nullptr);
/**
* A helper function that triangulates the given depth map with optional
* color image (which generates additional per-vertex colors) in local
* image coordinates.
*/
TriangleMesh::Ptr
depthmap_triangulate (FloatImage::ConstPtr dm, ByteImage::ConstPtr ci,
math::Matrix3f const& invproj, float dd_factor = 5.0f);
/**
* A helper function that triangulates the given depth map with optional
* color image (which generates additional per-vertex colors) and transforms
* the mesh into the global coordinate system.
*/
TriangleMesh::Ptr
depthmap_triangulate (FloatImage::ConstPtr dm, ByteImage::ConstPtr ci,
CameraInfo const& cam, float dd_factor = 5.0f);
/**
* Algorithm to triangulate range grids.
* Vertex positions are given in 'mesh' and a grid that contains vertex
* indices is specified. Four indices are taken at a time and triangulated
* with discontinuity detection. New triangles are added to the mesh.
*/
void
rangegrid_triangulate (Image<unsigned int> const& grid, TriangleMesh::Ptr mesh);
/**
* Algorithm to assign per-vertex confidence values to vertices of
* a triangulated depth map. Confidences are low near boundaries
* and small regions.
*/
void
depthmap_mesh_confidences (TriangleMesh::Ptr mesh, int iterations = 3);
/**
* Algorithm that peels away triangles at the mesh bounary of a
* triangulated depth map. The algorithm also works on other mesh
* data but is particularly useful for MVS depthmap where the edges
* of the real object are extended beyond their correct position.
*/
void
depthmap_mesh_peeling (TriangleMesh::Ptr mesh, int iterations = 1);
MVE_GEOM_NAMESPACE_END
MVE_NAMESPACE_END
/* ------------------------- Implementation ----------------------- */
MVE_NAMESPACE_BEGIN
MVE_IMAGE_NAMESPACE_BEGIN
template <typename T>
inline void
depthmap_convert_conventions (typename Image<T>::Ptr dm,
math::Matrix3f const& invproj, bool to_mve)
{
std::size_t w = dm->width();
std::size_t h = dm->height();
std::size_t pos = 0;
for (std::size_t y = 0; y < h; ++y)
for (std::size_t x = 0; x < w; ++x, ++pos)
{
// Construct viewing ray for that pixel
math::Vec3f px((float)x + 0.5f, (float)y + 0.5f, 1.0f);
px = invproj * px;
// Measure length of viewing ray
double len = px.norm();
// Either divide or multiply with the length
dm->at(pos) *= (to_mve ? len : 1.0 / len);
}
}
MVE_IMAGE_NAMESPACE_END
MVE_NAMESPACE_END
#endif /* MVE_DEPTHMAP_HEADER */
|
#ifdef __WXMAC_CLASSIC__
#include "wx/mac/classic/apptrait.h"
#else
#include "wx/mac/carbon/apptrait.h"
#endif
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia 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.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMOUSEDRIVERPLUGIN_QWS_H
#define QMOUSEDRIVERPLUGIN_QWS_H
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
#ifndef QT_NO_LIBRARY
class QWSMouseHandler;
struct Q_GUI_EXPORT QWSMouseHandlerFactoryInterface : public QFactoryInterface
{
virtual QWSMouseHandler* create(const QString &name, const QString &device) = 0;
};
#define QWSMouseHandlerFactoryInterface_iid "com.trolltech.Qt.QWSMouseHandlerFactoryInterface"
Q_DECLARE_INTERFACE(QWSMouseHandlerFactoryInterface, QWSMouseHandlerFactoryInterface_iid)
class Q_GUI_EXPORT QMouseDriverPlugin : public QObject, public QWSMouseHandlerFactoryInterface
{
Q_OBJECT
Q_INTERFACES(QWSMouseHandlerFactoryInterface:QFactoryInterface)
public:
explicit QMouseDriverPlugin(QObject *parent = 0);
~QMouseDriverPlugin();
virtual QStringList keys() const = 0;
virtual QWSMouseHandler* create(const QString& driver, const QString &device) = 0;
};
#endif // QT_NO_LIBRARY
QT_END_NAMESPACE
QT_END_HEADER
#endif // QMOUSEDRIVERPLUGIN_QWS_H
|
#define LOADER_ADDR 0x08D20000
#define HBL_ROOT "ms0:/PSP/SAVEDATA/NPEZ00056SLOT00/"
#define TH_ADDR_LIST { 0x09EF6C00, 0x09EFAC00, 0x09FFFE00, 0x09EFEC00, 0x09EFFC00 }
#define EV_ADDR_LIST { 0x089A2DAC }
#define SEMA_ADDR_LIST { 0x0907C6DC, 0x089FB7B0, 0x089FB130, 0x089B5A98, 0x089B5A88, 0x089B5A78, 0x089B5A70, 0x089B5A48, 0x089FB7A4 }
//#define GAME_FREEMEM_ADDR { 0x0899D5B8 }
|
#include <dsverifier.h>
digital_system controller = {
.b = { 11.9255 , -11.8089 },
.b_uncertainty = { 0 , 0 },
.b_size = 2,
.a = { 1 , -1.0729 },
.a_uncertainty = { 0 , 0 },
.a_size = 2,
.sample_time = 1.000000e-02
};
implementation impl = {
.int_bits = 24,
.frac_bits = 7,
.max = 1.000000,
.min = -1.000000
};
digital_system plant = {
.b = { 0 , 0.01 , -0.010101 },
.b_uncertainty = { 0 , 0 , 0 },
.b_size = 3,
.a = { 1 , -2.0103 , 1.0101 },
.a_size = 3,
.a_uncertainty = { 0 , 0 , 0 }
};
|
// 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 GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h"
namespace gpu {
namespace gles2 {
class GLES2Decoder;
} // namespace gles2.
// This class encapsulates the resources required to implement the
// GL_CHROMIUM_copy_texture extension. The copy operation is performed
// via a blit to a framebuffer object.
class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
public:
CopyTextureCHROMIUMResourceManager() : initialized_(false) {}
void Initialize(const gles2::GLES2Decoder* decoder);
void Destroy();
void DoCopyTexture(const gles2::GLES2Decoder* decoder, GLenum source_target,
GLenum dest_target, GLuint source_id, GLuint dest_id,
GLint level, GLsizei width, GLsizei height,
bool flip_y, bool premultiply_alpha,
bool unpremultiply_alpha);
// This will apply a transform on the source texture before copying to
// destination texture.
void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder,
GLenum source_target, GLenum dest_target,
GLuint source_id, GLuint dest_id, GLint level,
GLsizei width, GLsizei height, bool flip_y,
bool premultiply_alpha,
bool unpremultiply_alpha,
const GLfloat transform_matrix[16]);
// The attributes used during invocation of the extension.
static const GLuint kVertexPositionAttrib = 0;
private:
bool initialized_;
static const int kNumPrograms = 12;
GLuint programs_[kNumPrograms];
GLuint buffer_id_;
GLuint framebuffer_;
GLuint matrix_handle_[kNumPrograms];
GLuint sampler_locations_[kNumPrograms];
DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager);
};
} // namespace gpu.
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import <Foundation/Foundation.h>
@interface NSFileManager (DVTNSFileManagerAdditions)
+ (BOOL)dvt_isPathValidForFileManagerOperations:(id)arg1;
- (BOOL)dvt_unzipArchiveAtPath:(id)arg1 toPath:(id)arg2 withIntermediateDirectories:(BOOL)arg3;
- (BOOL)dvt_zipArchiveAtPath:(id)arg1 toPath:(id)arg2 error:(id *)arg3;
- (id)dvt_availableFilenameInDirectory:(id)arg1 desiredFilename:(id)arg2;
@end
|
/*
* Secret Labs' Regular Expression Engine
*
* regular expression matching engine
*
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
*
* See the _sre.c file for information on usage and redistribution.
*/
#ifndef SRE_INCLUDED
#define SRE_INCLUDED
#include "sre_constants.h"
/* size of a code word (must be unsigned short or larger, and
large enough to hold a UCS4 character) */
#define SRE_CODE Py_UCS4
#if SIZEOF_SIZE_T > 4
# define SRE_MAXREPEAT (~(SRE_CODE)0)
# define SRE_MAXGROUPS ((~(SRE_CODE)0) / 2)
#else
# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX)
# define SRE_MAXGROUPS ((SRE_CODE)PY_SSIZE_T_MAX / SIZEOF_SIZE_T / 2)
#endif
typedef struct {
PyObject_VAR_HEAD
Py_ssize_t groups; /* must be first! */
PyObject* groupindex;
PyObject* indexgroup;
/* compatibility */
PyObject* pattern; /* pattern source (or None) */
int flags; /* flags used when compiling pattern source */
PyObject *weakreflist; /* List of weak references */
int isbytes; /* pattern type (1 - bytes, 0 - string, -1 - None) */
/* pattern code */
Py_ssize_t codesize;
SRE_CODE code[1];
} PatternObject;
#define PatternObject_GetCode(o) (((PatternObject*)(o))->code)
typedef struct {
PyObject_VAR_HEAD
PyObject* string; /* link to the target string (must be first) */
PyObject* regs; /* cached list of matching spans */
PatternObject* pattern; /* link to the regex (pattern) object */
Py_ssize_t pos, endpos; /* current target slice */
Py_ssize_t lastindex; /* last index marker seen by the engine (-1 if none) */
Py_ssize_t groups; /* number of groups (start/end marks) */
Py_ssize_t mark[1];
} MatchObject;
typedef unsigned int (*SRE_TOLOWER_HOOK)(unsigned int ch);
typedef struct SRE_REPEAT_T {
Py_ssize_t count;
SRE_CODE* pattern; /* points to REPEAT operator arguments */
void* last_ptr; /* helper to check for infinite loops */
struct SRE_REPEAT_T *prev; /* points to previous repeat context */
} SRE_REPEAT;
typedef struct {
/* string pointers */
void* ptr; /* current position (also end of current slice) */
void* beginning; /* start of original string */
void* start; /* start of current slice */
void* end; /* end of original string */
/* attributes for the match object */
PyObject* string;
Py_ssize_t pos, endpos;
int isbytes;
int charsize; /* character size */
/* registers */
Py_ssize_t lastindex;
Py_ssize_t lastmark;
void** mark;
/* dynamically allocated stuff */
char* data_stack;
size_t data_stack_size;
size_t data_stack_base;
Py_buffer buffer;
/* current repeat context */
SRE_REPEAT *repeat;
/* hooks */
SRE_TOLOWER_HOOK lower, upper;
} SRE_STATE;
typedef struct {
PyObject_HEAD
PyObject* pattern;
SRE_STATE state;
} ScannerObject;
#endif
|
// Copyright (c) 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 COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
#define COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
namespace error_page {
// Network error page events. Used for UMA statistics and its values must be
// mirrored in NetErrorPageEvents in enums.xml.
enum NetworkErrorPageEvent {
NETWORK_ERROR_PAGE_SHOWN = 0, // Error pages shown.
NETWORK_ERROR_PAGE_RELOAD_BUTTON_SHOWN = 1, // Reload buttons shown.
NETWORK_ERROR_PAGE_RELOAD_BUTTON_CLICKED = 2, // Reload button clicked.
NETWORK_ERROR_PAGE_RELOAD_BUTTON_ERROR = 3, // Reload button clicked
// -> error.
// Obsolete values used for the "Show saved copy" button.
// NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_SHOWN = 4,
// NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_CLICKED = 5,
// NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_ERROR = 6,
NETWORK_ERROR_PAGE_MORE_BUTTON_CLICKED = 7, // More button clicked.
// Obsolete:
// NETWORK_ERROR_PAGE_BROWSER_INITIATED_RELOAD = 8, // Reload from browser.
// Obsolete values used for when "Show saved copy" and "Reload" buttons were
// both shown.
//
// NETWORK_ERROR_PAGE_BOTH_BUTTONS_SHOWN = 9,
// NETWORK_ERROR_PAGE_BOTH_BUTTONS_RELOAD_CLICKED = 10,
// NETWORK_ERROR_PAGE_BOTH_BUTTONS_SHOWN_SAVED_COPY_CLICKED = 11,
NETWORK_ERROR_EASTER_EGG_ACTIVATED = 12, // Easter egg activated.
// Obsolete. No longer experimenting with the label.
// NETWORK_ERROR_PAGE_CACHED_COPY_BUTTON_SHOWN = 13,
// NETWORK_ERROR_PAGE_CACHED_COPY_BUTTON_CLICKED = 14,
// NETWORK_ERROR_PAGE_CACHED_PAGE_BUTTON_SHOWN = 15,
// NETWORK_ERROR_PAGE_CACHED_PAGE_BUTTON_CLICKED = 16,
NETWORK_ERROR_DIAGNOSE_BUTTON_CLICKED = 17, // Diagnose button clicked.
// For the button to show all offline pages.
// Obsolete. No longer showing this.
// NETWORK_ERROR_PAGE_SHOW_OFFLINE_PAGES_BUTTON_SHOWN = 18,
// NETWORK_ERROR_PAGE_SHOW_OFFLINE_PAGES_BUTTON_CLICKED = 19,
// For the button to show offline copy.
// Obsolete. No longer showing this.
// NETWORK_ERROR_PAGE_SHOW_OFFLINE_COPY_BUTTON_SHOWN = 20,
// NETWORK_ERROR_PAGE_SHOW_OFFLINE_COPY_BUTTON_CLICKED = 21,
NETWORK_ERROR_PAGE_DOWNLOAD_BUTTON_SHOWN = 22,
NETWORK_ERROR_PAGE_DOWNLOAD_BUTTON_CLICKED = 23,
// Values for suggested content on the net-error page:
// A list containing at least one item of offline content suggestions was
// shown in the expanded/shown state.
NETWORK_ERROR_PAGE_OFFLINE_SUGGESTIONS_SHOWN = 24,
// An item from the offline content suggestions list was clicked.
NETWORK_ERROR_PAGE_OFFLINE_SUGGESTION_CLICKED = 25,
// A link that opens the downloads page was clicked.
NETWORK_ERROR_PAGE_OFFLINE_DOWNLOADS_PAGE_CLICKED = 26,
// A summary of available offline content was shown.
NETWORK_ERROR_PAGE_OFFLINE_CONTENT_SUMMARY_SHOWN = 27,
// A list containing at least one item of offline content suggestions was
// shown in the collapsed/hidden state.
NETWORK_ERROR_PAGE_OFFLINE_SUGGESTIONS_SHOWN_COLLAPSED = 28,
// The error page was shown because the device is offline (this is the dino
// page).
NETWORK_ERROR_PAGE_OFFLINE_ERROR_SHOWN = 29,
NETWORK_ERROR_PAGE_EVENT_MAX,
};
// The status of a DNS probe.
//
// The DNS_PROBE_FINISHED_* values are used in histograms, so:
// 1. FINISHED_UNKNOWN must remain the first FINISHED_* value.
// 2. FINISHED_* values must not be rearranged relative to FINISHED_UNKNOWN.
// 3. New FINISHED_* values must be inserted at the end.
// 4. New non-FINISHED_* values cannot be inserted.
enum DnsProbeStatus {
// A DNS probe may be run for this error page. (This status is only used on
// the renderer side before it's received a status update from the browser.)
DNS_PROBE_POSSIBLE,
// A DNS probe will not be run for this error page. (This happens if the
// user has the "Use web service to resolve navigation errors" preference
// turned off, or if probes are disabled by the field trial.)
DNS_PROBE_NOT_RUN,
// A DNS probe has been started for this error page. The renderer should
// expect to receive another IPC with one of the FINISHED statuses once the
// probe has finished (as long as the error page is still loaded).
DNS_PROBE_STARTED,
// A DNS probe has finished with one of the following results:
// The probe was inconclusive.
DNS_PROBE_FINISHED_INCONCLUSIVE,
// There's no internet connection.
DNS_PROBE_FINISHED_NO_INTERNET,
// The DNS configuration is wrong, or the servers are down or broken.
DNS_PROBE_FINISHED_BAD_CONFIG,
// The DNS servers are working fine, so the domain must not exist.
DNS_PROBE_FINISHED_NXDOMAIN,
// The secure DNS configuration is wrong, or the servers are down or broken.
DNS_PROBE_FINISHED_BAD_SECURE_CONFIG,
DNS_PROBE_MAX
};
// Returns a string representing |status|. It should be simply the name of
// the value as a string, but don't rely on that. This is presented to the
// user as part of the DNS error page (as the error code, at the bottom),
// and is also used in some verbose log messages.
//
// The function will NOTREACHED() and return an empty string if given an int
// that does not match a value in DnsProbeStatus (or if it is DNS_PROBE_MAX,
// which is not a real status).
const char* DnsProbeStatusToString(int status);
// Returns true if |status| is one of the DNS_PROBE_FINISHED_* statuses.
bool DnsProbeStatusIsFinished(DnsProbeStatus status);
// Record specific error page events.
void RecordEvent(NetworkErrorPageEvent event);
} // namespace error_page
#endif // COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
|
// Copyright 2021 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_BROWSER_UI_AUTOFILL_AUTOFILL_BUBBLE_BASE_H_
#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_BUBBLE_BASE_H_
namespace autofill {
// The cross-platform interface which displays the bubble for autofill bubbles.
// This object is responsible for its own lifetime.
class AutofillBubbleBase {
public:
// Called from controller to shut down the bubble and prevent any further
// action.
virtual void Hide() = 0;
};
} // namespace autofill
#endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_BUBBLE_BASE_H_
|
/* $NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $ */
/*
* Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
int opterr = 1, /* if error message should be printed */
optind = 1, /* index into parent argv vector */
optopt, /* character checked for validity */
optreset; /* reset getopt */
char *optarg; /* argument associated with option */
#define BADCH (int)'?'
#define BADARG (int)':'
#define EMSG ""
/*
* getopt --
* Parse argc/argv argument vector.
*/
int
getopt(int nargc, char * const nargv[], const char *ostr)
{
static char *place = EMSG; /* option letter processing */
char *oli; /* option letter list index */
if (optreset || *place == 0) { /* update scanning pointer */
optreset = 0;
place = nargv[optind];
if (optind >= nargc || *place++ != '-') {
/* Argument is absent or is not an option */
place = EMSG;
return (-1);
}
optopt = *place++;
if (optopt == '-' && *place == 0) {
/* "--" => end of options */
++optind;
place = EMSG;
return (-1);
}
if (optopt == 0) {
/* Solitary '-', treat as a '-' option
if the program (eg su) is looking for it. */
place = EMSG;
if (strchr(ostr, '-') == NULL)
return (-1);
optopt = '-';
}
} else
optopt = *place++;
/* See if option letter is one the caller wanted... */
if (optopt == ':' || (oli = strchr(ostr, optopt)) == NULL) {
if (*place == 0)
++optind;
if (opterr && *ostr != ':')
(void)fprintf(stderr,
"%s: illegal option -- %c\n", nargv[0],
optopt);
return (BADCH);
}
/* Does this option need an argument? */
if (oli[1] != ':') {
/* don't need argument */
optarg = NULL;
if (*place == 0)
++optind;
} else {
/* Option-argument is either the rest of this argument or the
entire next argument. */
if (*place)
optarg = place;
else if (nargc > ++optind)
optarg = nargv[optind];
else {
/* option-argument absent */
place = EMSG;
if (*ostr == ':')
return (BADARG);
if (opterr)
(void)fprintf(stderr,
"%s: option requires an argument -- %c\n",
nargv[0], optopt);
return (BADCH);
}
place = EMSG;
++optind;
}
return (optopt); /* return option letter */
}
|
/* include/linux/logger.h
*
* Copyright (C) 2007-2008 Google, Inc.
* Author: Robert Love <rlove@android.com>
*
* 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_LOGGER_H
#define _LINUX_LOGGER_H
#include <linux/types.h>
#include <linux/ioctl.h>
//---------------------------------------------------
// PS1 Team add
#define FEATURE_SKY_CP_ADB_LOG_FOR_VITAMIN
//--------------------------------------------------
/*
* The userspace structure for version 1 of the logger_entry ABI.
* This structure is returned to userspace unless the caller requests
* an upgrade to a newer ABI version.
*/
struct user_logger_entry_compat {
__u16 len; /* length of the payload */
__u16 __pad; /* no matter what, we get 2 bytes of padding */
__s32 pid; /* generating process's pid */
__s32 tid; /* generating process's tid */
__s32 sec; /* seconds since Epoch */
__s32 nsec; /* nanoseconds */
char msg[0]; /* the entry's payload */
};
/*
* The structure for version 2 of the logger_entry ABI.
* This structure is returned to userspace if ioctl(LOGGER_SET_VERSION)
* is called with version >= 2
*/
struct logger_entry {
__u16 len; /* length of the payload */
__u16 hdr_size; /* sizeof(struct logger_entry_v2) */
__s32 pid; /* generating process's pid */
__s32 tid; /* generating process's tid */
__s32 sec; /* seconds since Epoch */
__s32 nsec; /* nanoseconds */
uid_t euid; /* effective UID of logger */
char msg[0]; /* the entry's payload */
};
#define LOGGER_LOG_RADIO "log_radio" /* radio-related messages */
#define LOGGER_LOG_EVENTS "log_events" /* system/hardware events */
#define LOGGER_LOG_SYSTEM "log_system" /* system/framework messages */
#define LOGGER_LOG_MAIN "log_main" /* everything else */
#ifdef FEATURE_SKY_CP_ADB_LOG_FOR_VITAMIN
#define LOGGER_LOG_VITAMIN "log_vitamin" /* pantech exceptional debugging */
#endif
#define LOGGER_ENTRY_MAX_PAYLOAD 4076
#define __LOGGERIO 0xAE
#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */
#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */
#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */
#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */
#define LOGGER_GET_VERSION _IO(__LOGGERIO, 5) /* abi version */
#define LOGGER_SET_VERSION _IO(__LOGGERIO, 6) /* abi version */
#endif /* _LINUX_LOGGER_H */
|
/*
* $Id: nand_cp.c,v 1.1 2006/12/06 01:30:18 scsuh Exp $
*
* (C) Copyright 2006 Samsung Electronics
*
* 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
*/
/*
* You must make sure that all functions in this file are designed
* to load only U-Boot image.
*
* So, DO NOT USE in common read.
*
* By scsuh.
*/
#include <common.h>
#ifdef CONFIG_S3C24XX
#include <asm/io.h>
#include <linux/mtd/nand.h>
#include <regs.h>
/*
* address format
* 17 16 9 8 0
* --------------------------------------------
* | block(12bit) | page(5bit) | offset(9bit) |
* --------------------------------------------
*/
static int nandll_read_page (uchar *buf, ulong addr, int large_block)
{
int i;
int page_size = 512;
if (large_block)
page_size = 2048;
NAND_ENABLE_CE();
NFCMD_REG = NAND_CMD_READ0;
/* Write Address */
NFADDR_REG = 0;
if (large_block)
NFADDR_REG = 0;
NFADDR_REG = (addr) & 0xff;
NFADDR_REG = (addr >> 8) & 0xff;
NFADDR_REG = (addr >> 16) & 0xff;
if (large_block)
NFCMD_REG = NAND_CMD_READSTART;
NF_TRANSRnB();
/* for compatibility(2460). u32 cannot be used. by scsuh */
for(i=0; i < page_size; i++) {
*buf++ = NFDATA8_REG;
}
NAND_DISABLE_CE();
return 0;
}
/*
* Read data from NAND.
*/
static int nandll_read_blocks (ulong dst_addr, ulong size, int large_block)
{
uchar *buf = (uchar *)dst_addr;
int i;
uint page_shift = 9;
if (large_block)
page_shift = 11;
/* Read pages */
for (i = 0; i < (size>>page_shift); i++, buf+=(1<<page_shift)) {
nandll_read_page(buf, i, large_block);
}
return 0;
}
int copy_uboot_to_ram (void)
{
int large_block = 0;
int i;
vu_char id;
NAND_ENABLE_CE();
NFCMD_REG = NAND_CMD_READID;
NFADDR_REG = 0x00;
/* wait for a while */
for (i=0; i<200; i++);
id = NFDATA8_REG;
id = NFDATA8_REG;
if (id > 0x80)
large_block = 1;
/* read NAND Block.
* 128KB ->240KB because of U-Boot size increase. by scsuh
* So, read 0x3c000 bytes not 0x20000(128KB).
*/
return nandll_read_blocks(CFG_PHY_UBOOT_BASE, COPY_BL2_SIZE, large_block);
}
#if 0
//int NF8_ReadPage_Adv(unsigned int block,unsigned int page,unsigned char *buffer) // Advanced nand by MGR
#define NF8_ReadPage_Adv(a,b,c) (((int(*)(uint, uint, uchar*))(*((uint *)(0x40004000 + 0x4))))(a,b,c))
void nand_bl2_copy(void)
{
int block, page;
volatile unsigned int *base = 0x33e00000;
for (block = 0; block < 2; block++) {
for (page = 0; page < 64; page++) {
NF8_ReadPage_Adv(block, page, base);
base += 2048;
}
}
}
#endif
#endif
|
/*------------------------------------------------------------------------------ */
/* <copyright file="wlan_recv_beacon.c" company="Atheros"> */
/* Copyright (c) 2004-2008 Atheros 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; */
/* */
/* 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. */
/* */
/* */
/*------------------------------------------------------------------------------ */
/*============================================================================== */
/* IEEE 802.11 input handling. */
/* */
/* Author(s): ="Atheros" */
/*============================================================================== */
#include "a_config.h"
#include "athdefs.h"
#include "a_types.h"
#include "a_osapi.h"
#include <wmi.h>
#include <ieee80211.h>
#include <wlan_api.h>
#define IEEE80211_VERIFY_LENGTH(_len, _minlen) do { \
if ((_len) < (_minlen)) { \
return A_EINVAL; \
} \
} while (0)
#define IEEE80211_VERIFY_ELEMENT(__elem, __maxlen) do { \
if ((__elem) == NULL) { \
return A_EINVAL; \
} \
if ((__elem)[1] > (__maxlen)) { \
return A_EINVAL; \
} \
} while (0)
/* unaligned little endian access */
#define LE_READ_2(p) \
((A_UINT16) \
((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8)))
#define LE_READ_4(p) \
((A_UINT32) \
((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8) | \
(((A_UINT8 *)(p))[2] << 16) | (((A_UINT8 *)(p))[3] << 24)))
static int __inline
iswpaoui(const A_UINT8 *frm)
{
return frm[1] > 3 && LE_READ_4(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI);
}
static int __inline
iswmmoui(const A_UINT8 *frm)
{
return frm[1] > 3 && LE_READ_4(frm+2) == ((WMM_OUI_TYPE<<24)|WMM_OUI);
}
/* unused functions for now */
#if 0
static int __inline
iswmmparam(const A_UINT8 *frm)
{
return frm[1] > 5 && frm[6] == WMM_PARAM_OUI_SUBTYPE;
}
static int __inline
iswmminfo(const A_UINT8 *frm)
{
return frm[1] > 5 && frm[6] == WMM_INFO_OUI_SUBTYPE;
}
#endif
static int __inline
isatherosoui(const A_UINT8 *frm)
{
return frm[1] > 3 && LE_READ_4(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI);
}
static int __inline
iswscoui(const A_UINT8 *frm)
{
return frm[1] > 3 && LE_READ_4(frm+2) == ((0x04<<24)|WPA_OUI);
}
#ifdef PYXIS_ADHOC
static int __inline
ispyxisoui(const A_UINT8 *frm)
{
return frm[1] > 3 && LE_READ_4(frm+2) == ((PYXIS_OUI_TYPE<<24)|PYXIS_OUI);
}
#endif
A_STATUS
wlan_parse_beacon(A_UINT8 *buf, int framelen, struct ieee80211_common_ie *cie)
{
A_UINT8 *frm, *efrm;
A_UINT8 elemid_ssid = FALSE;
frm = buf;
efrm = (A_UINT8 *) (frm + framelen);
/*
* beacon/probe response frame format
* [8] time stamp
* [2] beacon interval
* [2] capability information
* [tlv] ssid
* [tlv] supported rates
* [tlv] country information
* [tlv] parameter set (FH/DS)
* [tlv] erp information
* [tlv] extended supported rates
* [tlv] WMM
* [tlv] WPA or RSN
* [tlv] Atheros Advanced Capabilities
*/
IEEE80211_VERIFY_LENGTH(efrm - frm, 12);
A_MEMZERO(cie, sizeof(*cie));
cie->ie_tstamp = frm; frm += 8;
cie->ie_beaconInt = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2;
cie->ie_capInfo = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2;
cie->ie_chan = 0;
while (frm < efrm) {
switch (*frm) {
case IEEE80211_ELEMID_SSID:
if (!elemid_ssid) {
cie->ie_ssid = frm;
elemid_ssid = TRUE;
}
break;
case IEEE80211_ELEMID_RATES:
cie->ie_rates = frm;
break;
case IEEE80211_ELEMID_COUNTRY:
cie->ie_country = frm;
break;
case IEEE80211_ELEMID_FHPARMS:
break;
case IEEE80211_ELEMID_DSPARMS:
cie->ie_chan = frm[2];
break;
case IEEE80211_ELEMID_TIM:
cie->ie_tim = frm;
break;
case IEEE80211_ELEMID_IBSSPARMS:
break;
case IEEE80211_ELEMID_XRATES:
cie->ie_xrates = frm;
break;
case IEEE80211_ELEMID_ERP:
if (frm[1] != 1) {
/*A_PRINTF("Discarding ERP Element - Bad Len\n"); */
return A_EINVAL;
}
cie->ie_erp = frm[2];
break;
case IEEE80211_ELEMID_RSN:
cie->ie_rsn = frm;
break;
case IEEE80211_ELEMID_VENDOR:
if (iswpaoui(frm)) {
cie->ie_wpa = frm;
} else if (iswmmoui(frm)) {
cie->ie_wmm = frm;
} else if (isatherosoui(frm)) {
cie->ie_ath = frm;
} else if(iswscoui(frm)) {
cie->ie_wsc = frm;
}
#ifdef PYXIS_ADHOC
else if(ispyxisoui(frm)) {
cie->ie_pyxis= frm;
}
#endif
break;
default:
break;
}
frm += frm[1] + 2;
}
IEEE80211_VERIFY_ELEMENT(cie->ie_rates, IEEE80211_RATE_MAXSIZE);
IEEE80211_VERIFY_ELEMENT(cie->ie_ssid, IEEE80211_NWID_LEN);
return A_OK;
}
|
#pragma once
namespace ai
{
class PassTroughStrategy : public Strategy
{
public:
PassTroughStrategy(PlayerbotAI* ai, float relevance = 100.0f) : Strategy(ai), relevance(relevance) {}
virtual void InitTriggers(std::list<TriggerNode*> &triggers)
{
for (list<string>::iterator i = supported.begin(); i != supported.end(); i++)
{
string s = i->c_str();
triggers.push_back(new TriggerNode(
s,
NextAction::array(0, new NextAction(s, relevance), NULL)));
}
}
protected:
list<string> supported;
float relevance;
};
}
|
/* lzo1c_d1.c -- LZO1C decompression
This file is part of the LZO real-time data compression library.
Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO 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 2 of
the License, or (at your option) any later version.
The LZO 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 a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#include "config1c.h"
#undef LZO_TEST_OVERRUN
#define DO_DECOMPRESS lzo1c_decompress
#include "lzo1b_d.ch"
|
/*
* Cryptographic API.
*
* s390 implementation of the SHA256 Secure Hash Algorithm.
*
* s390 Version:
* Copyright (C) 2005 IBM Deutschland GmbH, IBM Corporation
* Author(s): Jan Glauber (jang@de.ibm.com)
*
* Derived from "crypto/sha256.c"
* and "arch/s390/crypto/sha1_s390.c"
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/crypto.h>
#include "crypt_s390.h"
#define SHA256_DIGEST_SIZE 32
#define SHA256_BLOCK_SIZE 64
struct s390_sha256_ctx {
u64 count;
u32 state[8];
u8 buf[2 * SHA256_BLOCK_SIZE];
};
static void sha256_init(struct crypto_tfm *tfm)
{
struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
sctx->state[0] = 0x6a09e667;
sctx->state[1] = 0xbb67ae85;
sctx->state[2] = 0x3c6ef372;
sctx->state[3] = 0xa54ff53a;
sctx->state[4] = 0x510e527f;
sctx->state[5] = 0x9b05688c;
sctx->state[6] = 0x1f83d9ab;
sctx->state[7] = 0x5be0cd19;
sctx->count = 0;
}
static void sha256_update(struct crypto_tfm *tfm, const u8 *data,
unsigned int len)
{
struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
unsigned int index;
int ret;
/* how much is already in the buffer? */
index = sctx->count / 8 & 0x3f;
/* update message bit length */
sctx->count += len * 8;
if ((index + len) < SHA256_BLOCK_SIZE)
goto store;
/* process one stored block */
if (index) {
memcpy(sctx->buf + index, data, SHA256_BLOCK_SIZE - index);
ret = crypt_s390_kimd(KIMD_SHA_256, sctx->state, sctx->buf,
SHA256_BLOCK_SIZE);
BUG_ON(ret != SHA256_BLOCK_SIZE);
data += SHA256_BLOCK_SIZE - index;
len -= SHA256_BLOCK_SIZE - index;
}
/* process as many blocks as possible */
if (len >= SHA256_BLOCK_SIZE) {
ret = crypt_s390_kimd(KIMD_SHA_256, sctx->state, data,
len & ~(SHA256_BLOCK_SIZE - 1));
BUG_ON(ret != (len & ~(SHA256_BLOCK_SIZE - 1)));
data += ret;
len -= ret;
}
store:
/* anything left? */
if (len)
memcpy(sctx->buf + index , data, len);
}
static void pad_message(struct s390_sha256_ctx* sctx)
{
int index, end;
index = sctx->count / 8 & 0x3f;
end = index < 56 ? SHA256_BLOCK_SIZE : 2 * SHA256_BLOCK_SIZE;
/* start pad with 1 */
sctx->buf[index] = 0x80;
/* pad with zeros */
index++;
memset(sctx->buf + index, 0x00, end - index - 8);
/* append message length */
memcpy(sctx->buf + end - 8, &sctx->count, sizeof sctx->count);
sctx->count = end * 8;
}
/* Add padding and return the message digest */
static void sha256_final(struct crypto_tfm *tfm, u8 *out)
{
struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
/* must perform manual padding */
pad_message(sctx);
crypt_s390_kimd(KIMD_SHA_256, sctx->state, sctx->buf,
sctx->count / 8);
/* copy digest to out */
memcpy(out, sctx->state, SHA256_DIGEST_SIZE);
/* wipe context */
memset(sctx, 0, sizeof *sctx);
}
static struct crypto_alg alg = {
.cra_name = "sha256",
.cra_flags = CRYPTO_ALG_TYPE_DIGEST,
.cra_blocksize = SHA256_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct s390_sha256_ctx),
.cra_module = THIS_MODULE,
.cra_list = LIST_HEAD_INIT(alg.cra_list),
.cra_u = { .digest = {
.dia_digestsize = SHA256_DIGEST_SIZE,
.dia_init = sha256_init,
.dia_update = sha256_update,
.dia_final = sha256_final } }
};
static int init(void)
{
int ret;
if (!crypt_s390_func_available(KIMD_SHA_256))
return -ENOSYS;
ret = crypto_register_alg(&alg);
if (ret != 0)
printk(KERN_INFO "crypt_s390: sha256_s390 couldn't be loaded.");
return ret;
}
static void __exit fini(void)
{
crypto_unregister_alg(&alg);
}
module_init(init);
module_exit(fini);
MODULE_ALIAS("sha256");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm");
|
/*
* Copyright (C) 2013-2014 Alexander Shiyan <shc_work@mail.ru>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
#include <init.h>
#include <common.h>
#include <malloc.h>
#include <linux/err.h>
#include <linux/basic_mmio_gpio.h>
static int clps711x_gpio_probe(struct device_d *dev)
{
int err, id = dev->id;
void __iomem *dat, *dir = NULL, *dir_inv = NULL;
struct bgpio_chip *bgc;
if (dev->device_node)
id = of_alias_get_id(dev->device_node, "gpio");
if (id < 0 || id > 4)
return -ENODEV;
dat = dev_request_mem_region(dev, 0);
if (IS_ERR(dat))
return PTR_ERR(dat);
switch (id) {
case 3:
dir_inv = dev_request_mem_region(dev, 1);
if (IS_ERR(dir_inv))
return PTR_ERR(dir_inv);
break;
default:
dir = dev_request_mem_region(dev, 1);
if (IS_ERR(dir))
return PTR_ERR(dir);
break;
}
bgc = xzalloc(sizeof(struct bgpio_chip));
if (!bgc)
return -ENOMEM;
err = bgpio_init(bgc, dev, 1, dat, NULL, NULL, dir, dir_inv, 0);
if (err)
goto out_err;
bgc->gc.base = id * 8;
switch (id) {
case 4:
bgc->gc.ngpio = 3;
break;
default:
break;
}
err = gpiochip_add(&bgc->gc);
out_err:
if (err)
free(bgc);
return err;
}
static struct of_device_id __maybe_unused clps711x_gpio_dt_ids[] = {
{ .compatible = "cirrus,clps711x-gpio", },
};
static struct driver_d clps711x_gpio_driver = {
.name = "clps711x-gpio",
.probe = clps711x_gpio_probe,
.of_compatible = DRV_OF_COMPAT(clps711x_gpio_dt_ids),
};
static __init int clps711x_gpio_register(void)
{
return platform_driver_register(&clps711x_gpio_driver);
}
coredevice_initcall(clps711x_gpio_register);
|
/*
This file is part of the CVD Library.
Copyright (C) 2005 The Authors
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef CVD_IMAGE_CONVERT_FWD_H
#define CVD_IMAGE_CONVERT_FWD_H
#include <cvd/image.h>
#include <map>
namespace CVD
{
//Forward declarations for convert_image
//template<class D, class C, class Conv> Image<D> convert_image(const BasicImage<C>& from, Conv& cv);
//template<class D, class E, class F> std::pair<Image<D>, Image<E> >convert_image(const BasicImage<F>& from);
//template<class D, class C> Image<D> convert_image(const BasicImage<C>& from);
}
#endif
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins 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 QEGLPLATFORMCURSOR_H
#define QEGLPLATFORMCURSOR_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 <qpa/qplatformcursor.h>
#include <qpa/qplatformscreen.h>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/private/qinputdevicemanager_p.h>
QT_BEGIN_NAMESPACE
class QOpenGLShaderProgram;
class QEGLPlatformCursor;
class QEGLPlatformScreen;
class QEGLPlatformCursorDeviceListener : public QObject
{
Q_OBJECT
public:
QEGLPlatformCursorDeviceListener(QEGLPlatformCursor *cursor) : m_cursor(cursor) { }
bool hasMouse() const;
public slots:
void onDeviceListChanged(QInputDeviceManager::DeviceType type);
private:
QEGLPlatformCursor *m_cursor;
};
class QEGLPlatformCursor : public QPlatformCursor, protected QOpenGLFunctions
{
Q_OBJECT
public:
QEGLPlatformCursor(QPlatformScreen *screen);
~QEGLPlatformCursor();
#ifndef QT_NO_CURSOR
void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE;
#endif
void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE;
QPoint pos() const Q_DECL_OVERRIDE;
void setPos(const QPoint &pos) Q_DECL_OVERRIDE;
QRect cursorRect() const;
void paintOnScreen();
void resetResources();
void updateMouseStatus();
private:
bool event(QEvent *e) Q_DECL_OVERRIDE;
#ifndef QT_NO_CURSOR
bool setCurrentCursor(QCursor *cursor);
#endif
void draw(const QRectF &rect);
void update(const QRegion ®ion);
void createShaderPrograms();
void createCursorTexture(uint *texture, const QImage &image);
void initCursorAtlas();
// current cursor information
struct Cursor {
Cursor() : texture(0), shape(Qt::BlankCursor), customCursorTexture(0), customCursorPending(false) { }
uint texture; // a texture from 'image' or the atlas
Qt::CursorShape shape;
QRectF textureRect; // normalized rect inside texture
QSize size; // size of the cursor
QPoint hotSpot;
QImage customCursorImage;
QPoint pos; // current cursor position
uint customCursorTexture;
bool customCursorPending;
} m_cursor;
// cursor atlas information
struct CursorAtlas {
CursorAtlas() : cursorsPerRow(0), texture(0), cursorWidth(0), cursorHeight(0) { }
int cursorsPerRow;
uint texture;
int width, height; // width and height of the atlas
int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
QList<QPoint> hotSpots;
QImage image; // valid until it's uploaded
} m_cursorAtlas;
bool m_visible;
QEGLPlatformScreen *m_screen;
QOpenGLShaderProgram *m_program;
int m_vertexCoordEntry;
int m_textureCoordEntry;
int m_textureEntry;
QEGLPlatformCursorDeviceListener *m_deviceListener;
bool m_updateRequested;
};
QT_END_NAMESPACE
#endif // QEGLPLATFORMCURSOR_H
|
/************************************************************************************
* arch/arm/src/sam34/sam_mpuinit.h
*
* Copyright (C) 2009-2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX 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.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_SAM34_SAM_MPUINIT_H
#define __ARCH_ARM_SRC_SAM34_SAM_MPUINIT_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
/************************************************************************************
* Definitions
************************************************************************************/
/************************************************************************************
* Public Types
************************************************************************************/
/************************************************************************************
* Inline Functions
************************************************************************************/
#ifndef __ASSEMBLY__
/************************************************************************************
* Public Data
************************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
/****************************************************************************
* Name: sam_mpuinitialize
*
* Description:
* Configure the MPU to permit user-space access to only unrestricted SAM3/4
* resources.
*
****************************************************************************/
#ifdef CONFIG_BUILD_PROTECTED
void sam_mpuinitialize(void);
#else
# define sam_mpuinitialize()
#endif
/****************************************************************************
* Name: sam_mpu_uheap
*
* Description:
* Map the user heap region.
*
****************************************************************************/
#ifdef CONFIG_BUILD_PROTECTED
void sam_mpu_uheap(uintptr_t start, size_t size);
#else
# define sam_mpu_uheap(start,size)
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_ARM_SRC_SAM34_SAM_MPUINIT_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 "MooseApp.h"
class VerificationTutorialApp : public MooseApp
{
public:
static InputParameters validParams();
VerificationTutorialApp(InputParameters parameters);
virtual ~VerificationTutorialApp();
static void registerApps();
static void registerAll(Factory & f, ActionFactory & af, Syntax & s);
};
|
//===--- DocFormat.h - The internals of swiftdoc files ----------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
///
/// \file Contains various constants and helper types to deal with serialized
/// documentation info (swiftdoc files).
///
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SERIALIZATION_DOCFORMAT_H
#define SWIFT_SERIALIZATION_DOCFORMAT_H
#include "llvm/Bitcode/BitcodeConvenience.h"
namespace swift {
namespace serialization {
using llvm::BCArray;
using llvm::BCBlob;
using llvm::BCFixed;
using llvm::BCGenericRecordLayout;
using llvm::BCRecordLayout;
using llvm::BCVBR;
/// Magic number for serialized documentation files.
const unsigned char SWIFTDOC_SIGNATURE[] = { 0xE2, 0x9C, 0xA8, 0x07 };
/// Serialized swiftdoc format major version number.
///
/// Increment this value when making a backwards-incompatible change, i.e. where
/// an \e old compiler will \e not be able to read the new format. This should
/// be rare. When incrementing this value, reset SWIFTDOC_VERSION_MINOR to 0.
///
/// See docs/StableBitcode.md for information on how to make
/// backwards-compatible changes using the LLVM bitcode format.
const uint16_t SWIFTDOC_VERSION_MAJOR = 1;
/// Serialized swiftdoc format minor version number.
///
/// Increment this value when making a backwards-compatible change that might be
/// interesting to test for. A backwards-compatible change is one where an \e
/// old compiler can read the new format without any problems (usually by
/// ignoring new information).
///
/// If the \e new compiler can treat the new and old format identically, or if
/// the presence of a new record, block, or field is sufficient to indicate that
/// the swiftdoc file is using a new format, it is okay not to increment this
/// value. However, it may be interesting for a new compiler to treat the \e
/// absence of information differently for the old and new formats; in this
/// case, the difference in minor version number can distinguish the two.
///
/// The minor version number does not need to be changed simply to track which
/// compiler generated a swiftdoc file; the full compiler version is already
/// stored as text and can be checked by running the \c strings command-line
/// tool on a swiftdoc file.
///
/// To ensure that two separate changes don't silently get merged into one in
/// source control, you should also update the comment to briefly describe what
/// change you made. The content of this comment isn't important; it just
/// ensures a conflict if two people change the module format. Don't worry about
/// adhering to the 80-column limit for this line.
const uint16_t SWIFTDOC_VERSION_MINOR = 1; // Last change: skipping 0 for testing purposes
/// The hash seed used for the string hashes in a Swift 5.1 swiftdoc file.
///
/// 0 is not a good seed for llvm::djbHash, but swiftdoc files use a stable
/// format, so we can't change the hash seed without a version bump. Any new
/// hashed strings should use a new stable hash seed constant. (No such constant
/// has been defined at the time this doc comment was last updated because there
/// are no other strings to hash.)
const uint32_t SWIFTDOC_HASH_SEED_5_1 = 0;
/// The record types within the comment block.
///
/// Be very careful when changing this block; it must remain
/// backwards-compatible. Adding new records is okay---they will be ignored---
/// but modifying existing ones must be done carefully. You may need to update
/// the version when you do so. See docs/StableBitcode.md for information on how
/// to make backwards-compatible changes using the LLVM bitcode format.
///
/// \sa COMMENT_BLOCK_ID
namespace comment_block {
enum RecordKind {
DECL_COMMENTS = 1,
GROUP_NAMES = 2,
};
using DeclCommentListLayout = BCRecordLayout<
DECL_COMMENTS, // record ID
BCVBR<16>, // table offset within the blob (an llvm::OnDiskHashTable)
BCBlob // map from Decl USRs to comments
>;
using GroupNamesLayout = BCRecordLayout<
GROUP_NAMES, // record ID
BCBlob // actual names
>;
} // namespace comment_block
} // end namespace serialization
} // end namespace swift
#endif
|
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
*/
#include <rtthread.h>
#if defined(RT_USING_DFS)
#include <dfs_file.h>
#include <dfs_posix.h>
#endif
#define BSP_FLASH_MOUNT_PATH "/mnt/flash"
#define BSP_SDCARD_MOUNT_PATH "/mnt/sd"
int mnt_init(void)
{
#if defined(BSP_USING_SPIFLASH)
if(dfs_mount("flash0", BSP_FLASH_MOUNT_PATH, "elm", 0, 0) != 0)
{
rt_kprintf("spi flash mount '%s' failed.\n", BSP_FLASH_MOUNT_PATH);
}
#endif
#if defined(BSP_USING_SDCARD)
if(dfs_mount("sd0", BSP_SDCARD_MOUNT_PATH, "elm", 0, 0) != 0)
{
rt_kprintf("sdcard mount '%s' failed.\n", BSP_SDCARD_MOUNT_PATH);
}
#endif
return 0;
}
INIT_APP_EXPORT(mnt_init);
|
//
// VKCounters.h
//
// Copyright (c) 2014 VK.com
//
// 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 suabstantial 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.
#import "VKApiObject.h"
@interface VKCounters : VKApiObject
@property (nonatomic, strong) NSNumber *friends;
@property (nonatomic, strong) NSNumber *messages;
@property (nonatomic, strong) NSNumber *photos;
@property (nonatomic, strong) NSNumber *videos;
@property (nonatomic, strong) NSNumber *notifications;
@property (nonatomic, strong) NSNumber *groups;
@property (nonatomic, strong) NSNumber *gifts;
@property (nonatomic, strong) NSNumber *events;
@property (nonatomic, strong) NSNumber *albums;
@property (nonatomic, strong) NSNumber *audios;
@property (nonatomic, strong) NSNumber *online_friends;
@property (nonatomic, strong) NSNumber *mutual_friends;
@property (nonatomic, strong) NSNumber *user_videos;
@property (nonatomic, strong) NSNumber *followers;
@property (nonatomic, strong) NSNumber *user_photos;
@property (nonatomic, strong) NSNumber *subscriptions;
@property (nonatomic, strong) NSNumber *documents;
@property (nonatomic, strong) NSNumber *topics;
@property (nonatomic, strong) NSNumber *pages;
@end
|
/* Copyright (C) 1991, 1993, 1995, 1997, 1999, 2001, 2006
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/>. */
#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
/* Write formatted output to stdout according to the
format string FORMAT, using the argument list in ARG. */
int
__vwprintf (const wchar_t *format, __gnuc_va_list arg)
{
return __vfwprintf (stdout, format, arg);
}
ldbl_strong_alias (__vwprintf, vwprintf)
|
/*
* This file is a part of the open source stm32plus library.
* Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk>
* Please see website for licensing terms.
*/
#pragma once
namespace stm32plus {
/**
* Advanced control timers are TIM1, TIM8
* @tparam TTimer The timer class type (Timer1, Timer2...)
* @tparam TPeripheralName the peripheral class for the clocks
*/
template<class TTimer,PeripheralName TPeripheralName>
class AdvancedControlTimer : public TimerPeripheral<TTimer,TPeripheralName> {
protected:
AdvancedControlTimer(TIM_TypeDef *peripheralAddress);
public:
void initialiseTimeBaseWithRepeat(uint16_t period,uint16_t prescaler,uint16_t clockDivision,uint16_t counterMode,uint8_t repeatCount);
void setTimeBaseByFrequencyWithRepeat(uint32_t frequency,uint16_t arr,uint16_t counterMode,uint8_t repeatCount);
};
/**
* Constructor
*/
template<class TTimer,PeripheralName TPeripheralName>
inline AdvancedControlTimer<TTimer,TPeripheralName>::AdvancedControlTimer(TIM_TypeDef *peripheralAddress)
: TimerPeripheral<TTimer,TPeripheralName>(peripheralAddress) {
}
/**
* Initialise the time base for this timer
* @param period Configures the period value to be loaded into the active Auto-Reload Register at the next update event.
* @param prescaler Configures the prescaler value used to divide the TIM clock.
* @param clockDivision TIM_CKD_DIV1/2/4
* @param counterMode TIM_CounterMode_Up/Down
* @param repeatCount The number of times that a counter must repeat its end-to-end cycle before generating Update.
*/
template<class TTimer,PeripheralName TPeripheralName>
inline void AdvancedControlTimer<TTimer,TPeripheralName>::initialiseTimeBaseWithRepeat(uint16_t period,uint16_t prescaler,uint16_t clockDivision,uint16_t counterMode,uint8_t repeatCount) {
// repeat count is unique to the advanced control timers. Set the value and call the
// base to complete the init.
this->_timeBase.TIM_RepetitionCounter=repeatCount;
Timer::initialiseTimeBase(period,prescaler,clockDivision,counterMode);
}
/**
* Convenience function to set the timer clock (TIMxCLK) to the desired frequency. The counter will
* be an up counter (by default) with a period equal to the arr (auto-reload) value. The lowest
* frequency that can be set is TIMxCLK / 65536. For a 72Mhz core clock this is 1098 Hz.
* @param frequency The frequency in Hz.
* @param arr The auto reload value (0..65535). The timer counter reverses/resets at this value.
* @param counterMode TIM_CounterMode_* value
* @param repeatCount The number of times that a counter must repeat its end-to-end cycle before generating Update.
*/
template<class TTimer,PeripheralName TPeripheralName>
inline void AdvancedControlTimer<TTimer,TPeripheralName>::setTimeBaseByFrequencyWithRepeat(uint32_t frequency,uint16_t arr,uint16_t counterMode,uint8_t repeatCount) {
this->_timeBase.TIM_RepetitionCounter=repeatCount;
Timer::initialiseTimeBase(arr,(this->_clock/frequency)-1,0,counterMode);
}
}
|
#ifndef AliAnalysisTaskJetQ_H
#define AliAnalysisTaskJetQ_H
#define C_PI_HALF 1.5707963
#define C_PI_TH 4.7123890
#define C_TWOPI 6.2831853
#include "TH3D.h"
#include "TH2D.h"
#include "TH1D.h"
#include "TList.h"
#include "AliAnalysisTaskSE.h"
#include "AliEventCuts.h"
#include "AliAODTrack.h"
#include "AliAnalysisTask.h"
#include "AliAnalysisManager.h"
#include "AliAODEvent.h"
#include "AliMultSelection.h"
#include "AliAODInputHandler.h"
#include "AliMCEvent.h"
#include "AliMultSelection.h"
#include "AliVEvent.h"
#include "TList.h"
#include "TMath.h"
#include "AliEventPoolManager.h"
#include "AliBasicParticle.h"
#include "TAxis.h"
using namespace std;
class AliAnalysisTaskJetQ : public AliAnalysisTaskSE
{
public:
AliAnalysisTaskJetQ();
AliAnalysisTaskJetQ(const char *name);
virtual ~AliAnalysisTaskJetQ();
virtual void UserCreateOutputObjects();
virtual void UserExec(Option_t* option);
virtual void Terminate(Option_t* option);
void SetCentralityBins(Int_t nBins, Double_t *bins) {setupAxis(nBins,bins,fCentBins,fCentAxis); };
void SetVtxZBins(Int_t nBins, Double_t *bins) {setupAxis(nBins,bins,fVzBins,fVzAxis); };
void SetPtBins(Int_t nBins, Double_t *bins) {setupAxis(nBins,bins,fPtBins,fPtAxis); };
void SetEventMixingCapacity(Int_t nTotEv, Int_t nTotTr, Int_t frReady, Int_t nMinEv) { fEvMixPars[0]=nTotEv; fEvMixPars[1]=nTotTr; fEvMixPars[2]=frReady; fEvMixPars[3]=nMinEv; }; //Fraction is given in %, so should be an integer number!
private:
AliAnalysisTaskJetQ(const AliAnalysisTaskJetQ&); // not implemented
AliAnalysisTaskJetQ& operator=(const AliAnalysisTaskJetQ&); // not implemented
Bool_t CheckTrigger(Double_t);
Bool_t AcceptAOD(AliAODEvent*, Double_t lvtxXYZ[3]);
Int_t FindGivenPt(const Double_t &ptMin, const Double_t &ptMax);
Int_t FillCorrelations(Int_t &triggerIndex, const Double_t &ptAsMin, const Double_t &ptAsMax);
Int_t FillMixedEvent(Int_t &triggerIndex, AliEventPool *inpool);
void fill2DHist(TH1 *&inh, Double_t &xval, Double_t &yval) { ((TH2*)inh)->Fill(xval,yval); };
void fill3DHist(TH1 *&inh, Double_t &xval, Double_t &yval, Double_t &zval) { ((TH3*)inh)->Fill(xval,yval,zval); };
void fixPhi(Double_t &inPhi) { if(inPhi<-C_PI_HALF) inPhi+=C_TWOPI; else if(inPhi>C_PI_TH) inPhi-=C_TWOPI; };
void setupAxis(Int_t &nBins, Double_t *&bins, vector<Double_t> &binCont, TAxis *&ax) {if(binCont.size()>0) binCont.clear(); for(Int_t i=0;i<=nBins;i++) binCont.push_back(bins[i]); if(ax) delete ax; ax = new TAxis(nBins, bins); };
AliAODEvent *fAOD; //! do not store
AliMCEvent *fMCEvent; //! do not store
AliEventPoolManager *fPoolMgr; //! do not store
TObjArray *fPoolTrackArray; //! do not store
UInt_t fTriggerType;
TList *fOutList;
TAxis *fCentAxis;
TAxis *fVzAxis;
TAxis *fPtAxis;
TH2D *fNormCounter; //!
TH1 *fCorrPlot; //!
TH1 *fMixCorrPlot; //!
vector<Double_t> fCentBins;
vector<Double_t> fVzBins;
vector<Double_t> fPtBins;
Bool_t fPtDif;
AliEventCuts fEventCuts;
Int_t fEvMixPars[4];
ClassDef(AliAnalysisTaskJetQ, 1);
};
#endif
|
/*
* Copyright (C) 2007, 2008 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 COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ProgressEvent_h
#define ProgressEvent_h
#include "core/events/Event.h"
namespace blink {
struct ProgressEventInit : public EventInit {
ProgressEventInit();
bool lengthComputable;
unsigned long long loaded;
unsigned long long total;
};
class ProgressEvent : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<ProgressEvent> create()
{
return adoptRefWillBeNoop(new ProgressEvent);
}
static PassRefPtrWillBeRawPtr<ProgressEvent> create(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
{
return adoptRefWillBeNoop(new ProgressEvent(type, lengthComputable, loaded, total));
}
static PassRefPtrWillBeRawPtr<ProgressEvent> create(const AtomicString& type, const ProgressEventInit& initializer)
{
return adoptRefWillBeNoop(new ProgressEvent(type, initializer));
}
bool lengthComputable() const { return m_lengthComputable; }
unsigned long long loaded() const { return m_loaded; }
unsigned long long total() const { return m_total; }
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual void trace(Visitor*) OVERRIDE;
protected:
ProgressEvent();
ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total);
ProgressEvent(const AtomicString&, const ProgressEventInit&);
private:
bool m_lengthComputable;
unsigned long long m_loaded;
unsigned long long m_total;
};
} // namespace blink
#endif // ProgressEvent_h
|
// Copyright 2018 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 THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_ADAPTERS_ICE_TRANSPORT_ADAPTER_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_ADAPTERS_ICE_TRANSPORT_ADAPTER_IMPL_H_
#include <memory>
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/renderer/modules/peerconnection/adapters/ice_transport_adapter.h"
#include "third_party/webrtc/api/ice_transport_interface.h"
namespace blink {
// IceTransportAdapter implementation backed by the WebRTC PortAllocator /
// P2PTransportChannel.
class IceTransportAdapterImpl final : public IceTransportAdapter,
public sigslot::has_slots<> {
public:
// Must be constructed on the WebRTC worker thread.
// |delegate| must outlive the IceTransportAdapter.
IceTransportAdapterImpl(
Delegate* delegate,
std::unique_ptr<cricket::PortAllocator> port_allocator,
std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory);
// Create an IceTransportAdapter for an existing |ice_transport_channel|
// object. In this case, |port_allocator_|, |async_resolver_factory_| is not
// used (and null).
IceTransportAdapterImpl(
Delegate* delegate,
rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport_channel);
~IceTransportAdapterImpl() override;
// IceTransportAdapter overrides.
void StartGathering(const cricket::IceParameters& local_parameters,
const cricket::ServerAddresses& stun_servers,
const WebVector<cricket::RelayServerConfig>& turn_servers,
IceTransportPolicy policy) override;
void Start(
const cricket::IceParameters& remote_parameters,
cricket::IceRole role,
const Vector<cricket::Candidate>& initial_remote_candidates) override;
void HandleRemoteRestart(
const cricket::IceParameters& new_remote_parameters) override;
void AddRemoteCandidate(const cricket::Candidate& candidate) override;
private:
cricket::IceTransportInternal* ice_transport_channel() {
return ice_transport_channel_->internal();
}
void SetupIceTransportChannel();
// Callbacks from P2PTransportChannel.
void OnGatheringStateChanged(cricket::IceTransportInternal* transport);
void OnCandidateGathered(cricket::IceTransportInternal* transport,
const cricket::Candidate& candidate);
void OnStateChanged(cricket::IceTransportInternal* transport);
void OnNetworkRouteChanged(
absl::optional<rtc::NetworkRoute> new_network_route);
void OnRoleConflict(cricket::IceTransportInternal* transport);
Delegate* const delegate_;
std::unique_ptr<cricket::PortAllocator> port_allocator_;
std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory_;
rtc::scoped_refptr<webrtc::IceTransportInterface> ice_transport_channel_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_ADAPTERS_ICE_TRANSPORT_ADAPTER_IMPL_H_
|
/* Copyright (c) 2008-2009 Christopher J. W. Lloyd
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. */
#import <CoreFoundation/CFBase.h>
typedef struct CFBinaryHeap *CFBinaryHeapRef;
typedef const void *(*CFBinaryHeapRetainCallBack)(CFAllocatorRef allocator, const void *value);
typedef void (*CFBinaryHeapReleaseCallBack)(CFAllocatorRef allocator, const void *value);
typedef CFAllocatorCopyDescriptionCallBack CFBinaryHeapCopyDescriptionCallBack;
typedef CFComparisonResult (*CFBinaryHeapCompareCallBack)(const void *value, const void *other, void *info);
typedef struct {
CFIndex version;
CFBinaryHeapRetainCallBack retain;
CFBinaryHeapReleaseCallBack release;
CFBinaryHeapCopyDescriptionCallBack copyDescription;
CFBinaryHeapCompareCallBack compare;
} CFBinaryHeapCallBacks;
typedef struct {
CFIndex version;
void *info;
CFAllocatorRetainCallBack retain;
CFAllocatorReleaseCallBack release;
CFAllocatorCopyDescriptionCallBack copyDescription;
} CFBinaryHeapCompareContext;
typedef void (*CFBinaryHeapApplierFunction)(const void *value, void *context);
COREFOUNDATION_EXPORT const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks;
COREFOUNDATION_EXPORT CFTypeID CFBinaryHeapGetTypeID(void);
COREFOUNDATION_EXPORT void CFBinaryHeapAddValue(CFBinaryHeapRef self, const void *value);
COREFOUNDATION_EXPORT void CFBinaryHeapApplyFunction(CFBinaryHeapRef self, CFBinaryHeapApplierFunction function, void *context);
COREFOUNDATION_EXPORT Boolean CFBinaryHeapContainsValue(CFBinaryHeapRef self, const void *value);
COREFOUNDATION_EXPORT CFBinaryHeapRef CFBinaryHeapCreate(CFAllocatorRef allocator, CFIndex capacity, const CFBinaryHeapCallBacks *callbacks, const CFBinaryHeapCompareContext *context);
COREFOUNDATION_EXPORT CFBinaryHeapRef CFBinaryHeapCreateCopy(CFAllocatorRef allocator, CFIndex capacity, CFBinaryHeapRef self);
COREFOUNDATION_EXPORT CFIndex CFBinaryHeapGetCount(CFBinaryHeapRef self);
COREFOUNDATION_EXPORT CFIndex CFBinaryHeapGetCountOfValue(CFBinaryHeapRef self, const void *value);
COREFOUNDATION_EXPORT const void *CFBinaryHeapGetMinimum(CFBinaryHeapRef self);
COREFOUNDATION_EXPORT Boolean CFBinaryHeapGetMinimumIfPresent(CFBinaryHeapRef self, const void **valuep);
COREFOUNDATION_EXPORT void CFBinaryHeapGetValues(CFBinaryHeapRef self, const void **values);
COREFOUNDATION_EXPORT void CFBinaryHeapRemoveAllValues(CFBinaryHeapRef self);
COREFOUNDATION_EXPORT void CFBinaryHeapRemoveMinimumValue(CFBinaryHeapRef self);
|
/*
* This is splited from hw/i386/kvm/pci-assign.c
*/
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "hw/loader.h"
#include "hw/pci/pci.h"
#include "xen_pt.h"
/*
* Scan the assigned devices for the devices that have an option ROM, and then
* load the corresponding ROM data to RAM. If an error occurs while loading an
* option ROM, we just ignore that option ROM and continue with the next one.
*/
void *pci_assign_dev_load_option_rom(PCIDevice *dev,
int *size, unsigned int domain,
unsigned int bus, unsigned int slot,
unsigned int function)
{
char name[32], rom_file[64];
FILE *fp;
uint8_t val;
struct stat st;
void *ptr = NULL;
Object *owner = OBJECT(dev);
/* If loading ROM from file, pci handles it */
if (dev->romfile || !dev->rom_bar) {
return NULL;
}
snprintf(rom_file, sizeof(rom_file),
"/sys/bus/pci/devices/%04x:%02x:%02x.%01x/rom",
domain, bus, slot, function);
/* Write "1" to the ROM file to enable it */
fp = fopen(rom_file, "r+");
if (fp == NULL) {
if (errno != ENOENT) {
error_report("pci-assign: Cannot open %s: %s", rom_file, strerror(errno));
}
return NULL;
}
if (fstat(fileno(fp), &st) == -1) {
error_report("pci-assign: Cannot stat %s: %s", rom_file, strerror(errno));
goto close_rom;
}
val = 1;
if (fwrite(&val, 1, 1, fp) != 1) {
goto close_rom;
}
fseek(fp, 0, SEEK_SET);
snprintf(name, sizeof(name), "%s.rom", object_get_typename(owner));
memory_region_init_ram(&dev->rom, owner, name, st.st_size, &error_abort);
ptr = memory_region_get_ram_ptr(&dev->rom);
memset(ptr, 0xff, st.st_size);
if (!fread(ptr, 1, st.st_size, fp)) {
error_report("pci-assign: Cannot read from host %s", rom_file);
error_printf("Device option ROM contents are probably invalid "
"(check dmesg).\nSkip option ROM probe with rombar=0, "
"or load from file with romfile=\n");
goto close_rom;
}
pci_register_bar(dev, PCI_ROM_SLOT, 0, &dev->rom);
dev->has_rom = true;
*size = st.st_size;
close_rom:
/* Write "0" to disable ROM */
fseek(fp, 0, SEEK_SET);
val = 0;
if (!fwrite(&val, 1, 1, fp)) {
XEN_PT_WARN(dev, "%s\n", "Failed to disable pci-sysfs rom file");
}
fclose(fp);
return ptr;
}
|
#ifndef PERLQT_H
#define PERLQT_H
#include "marshall.h"
struct smokeperl_object {
bool allocated;
Smoke *smoke;
int classId;
void *ptr;
};
struct TypeHandler {
const char *name;
Marshall::HandlerFn fn;
};
extern int do_debug; // evil
extern SV *sv_qapp;
extern int object_count;
// keep this enum in sync with lib/Qt/debug.pm
enum QtDebugChannel {
qtdb_none = 0x00,
qtdb_ambiguous = 0x01,
qtdb_autoload = 0x02,
qtdb_calls = 0x04,
qtdb_gc = 0x08,
qtdb_virtual = 0x10,
qtdb_verbose = 0x20
};
void unmapPointer(smokeperl_object *, Smoke::Index, void*);
SV *getPointerObject(void *ptr);
void mapPointer(SV *, smokeperl_object *, HV *, Smoke::Index, void *);
extern struct mgvtbl vtbl_smoke;
inline smokeperl_object *sv_obj_info(SV *sv) { // ptr on success, null on fail
if(!sv || !SvROK(sv) || SvTYPE(SvRV(sv)) != SVt_PVHV)
return 0;
SV *obj = SvRV(sv);
MAGIC *mg = mg_find(obj, '~');
if(!mg || mg->mg_virtual != &vtbl_smoke) {
// FIXME: die or something?
return 0;
}
smokeperl_object *o = (smokeperl_object*)mg->mg_ptr;
return o;
}
#endif // PERLQT_H
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2004 Tyan Computer
* Written by Yinghai Lu <yhlu@tyan.com> for Tyan Computer.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc.
*/
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <arch/acpi.h>
#include "chip.h"
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
unsigned long acpi_fill_mcfg(unsigned long current)
{
device_t dev;
unsigned long mcfg_base;
dev = dev_find_slot(0x0, PCI_DEVFN(0x0,0));
if (!dev)
return current;
mcfg_base = pci_read_config16(dev, 0x90);
if ((mcfg_base & 0x1000) == 0)
return current;
mcfg_base = (mcfg_base & 0xf) << 28;
printk(BIOS_INFO, "mcfg_base %lx.\n", mcfg_base);
current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *)
current, mcfg_base, 0x0, 0x0, 0xff);
return current;
}
#endif
static void ht_init(struct device *dev)
{
u32 htmsi;
/* Enable HT MSI Mapping in capability register */
htmsi = pci_read_config32(dev, 0xe0);
htmsi |= (1 << 16);
pci_write_config32(dev, 0xe0, htmsi);
}
static struct device_operations ht_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = ht_init,
.scan_bus = 0,
.ops_pci = &ck804_pci_ops,
};
static const struct pci_driver ht_driver __pci_driver = {
.ops = &ht_ops,
.vendor = PCI_VENDOR_ID_NVIDIA,
.device = PCI_DEVICE_ID_NVIDIA_CK804_HT,
};
|
/*
* drivers/video/tegra/host/gr3d/gr3d.c
*
* Tegra Graphics Host 3D
*
* Copyright (c) 2011 NVIDIA Corporation.
*
* 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.
*/
/*** restore ***/
#include <mach/nvmap.h>
#include <linux/slab.h>
#include "t20/t20.h"
#include "t20/hardware_t20.h"
#include "t20/syncpt_t20.h"
#include "nvhost_hwctx.h"
#include "dev.h"
#include "gr3d.h"
unsigned int nvhost_3dctx_restore_size;
unsigned int nvhost_3dctx_restore_incrs;
struct nvmap_handle_ref *nvhost_3dctx_save_buf;
unsigned int nvhost_3dctx_save_incrs;
unsigned int nvhost_3dctx_save_thresh;
unsigned int nvhost_3dctx_save_slots;
void nvhost_3dctx_restore_begin(u32 *ptr)
{
/* set class to host */
ptr[0] = nvhost_opcode_setclass(NV_HOST1X_CLASS_ID,
NV_CLASS_HOST_INCR_SYNCPT_BASE, 1);
/* increment sync point base */
ptr[1] = nvhost_class_host_incr_syncpt_base(NVWAITBASE_3D,
nvhost_3dctx_restore_incrs);
/* set class to 3D */
ptr[2] = nvhost_opcode_setclass(NV_GRAPHICS_3D_CLASS_ID, 0, 0);
/* program PSEQ_QUAD_ID */
ptr[3] = nvhost_opcode_imm(AR3D_PSEQ_QUAD_ID, 0);
}
void nvhost_3dctx_restore_direct(u32 *ptr, u32 start_reg, u32 count)
{
ptr[0] = nvhost_opcode_incr(start_reg, count);
}
void nvhost_3dctx_restore_indirect(u32 *ptr, u32 offset_reg, u32 offset,
u32 data_reg, u32 count)
{
ptr[0] = nvhost_opcode_imm(offset_reg, offset);
ptr[1] = nvhost_opcode_nonincr(data_reg, count);
}
void nvhost_3dctx_restore_end(u32 *ptr)
{
/* syncpt increment to track restore gather. */
ptr[0] = nvhost_opcode_imm_incr_syncpt(
NV_SYNCPT_OP_DONE, NVSYNCPT_3D);
}
/*** ctx3d ***/
struct nvhost_hwctx *nvhost_3dctx_alloc_common(struct nvhost_channel *ch,
bool map_restore)
{
struct nvmap_client *nvmap = ch->dev->nvmap;
struct nvhost_hwctx *ctx;
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return NULL;
ctx->restore = nvmap_alloc(nvmap, nvhost_3dctx_restore_size * 4, 32,
map_restore ? NVMAP_HANDLE_WRITE_COMBINE
: NVMAP_HANDLE_UNCACHEABLE);
if (IS_ERR_OR_NULL(ctx->restore))
goto fail;
if (map_restore) {
ctx->restore_virt = nvmap_mmap(ctx->restore);
if (!ctx->restore_virt)
goto fail;
} else
ctx->restore_virt = NULL;
kref_init(&ctx->ref);
ctx->channel = ch;
ctx->valid = false;
ctx->save = nvhost_3dctx_save_buf;
ctx->save_incrs = nvhost_3dctx_save_incrs;
ctx->save_thresh = nvhost_3dctx_save_thresh;
ctx->save_slots = nvhost_3dctx_save_slots;
ctx->restore_phys = nvmap_pin(nvmap, ctx->restore);
if (IS_ERR_VALUE(ctx->restore_phys))
goto fail;
ctx->restore_size = nvhost_3dctx_restore_size;
ctx->restore_incrs = nvhost_3dctx_restore_incrs;
return ctx;
fail:
if (map_restore && ctx->restore_virt) {
nvmap_munmap(ctx->restore, ctx->restore_virt);
ctx->restore_virt = NULL;
}
nvmap_free(nvmap, ctx->restore);
ctx->restore = NULL;
kfree(ctx);
return NULL;
}
void nvhost_3dctx_get(struct nvhost_hwctx *ctx)
{
kref_get(&ctx->ref);
}
void nvhost_3dctx_free(struct kref *ref)
{
struct nvhost_hwctx *ctx = container_of(ref, struct nvhost_hwctx, ref);
struct nvmap_client *nvmap = ctx->channel->dev->nvmap;
if (ctx->restore_virt) {
nvmap_munmap(ctx->restore, ctx->restore_virt);
ctx->restore_virt = NULL;
}
nvmap_unpin(nvmap, ctx->restore);
ctx->restore_phys = 0;
nvmap_free(nvmap, ctx->restore);
ctx->restore = NULL;
kfree(ctx);
}
void nvhost_3dctx_put(struct nvhost_hwctx *ctx)
{
kref_put(&ctx->ref, nvhost_3dctx_free);
}
int nvhost_gr3d_prepare_power_off(struct nvhost_module *mod)
{
return nvhost_t20_save_context(mod, NVSYNCPT_3D);
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include <sys/socket.h>
#include "assert.h"
#include "common.h"
#include "ezp-lib.h"
#include "ezp.h"
enum con_type{
CH341=0
};
enum {
W_ENABLE = 0,
W_COUNTDOWN,
P_ENABLE,
P_COUNTDOWN,
};
static struct variable power_variables[] = {
{longname: "Wireless Auto Disable", argv:ARGV("0", "1"), nullok: FALSE},
{longname: "Wireless Auto Disable interval", argv:ARGV("10", "60"), nullok: FALSE},
{longname: "System Auto Turn off", argv:ARGV("0", "1"), nullok: FALSE},
{longname: "System Auto Turn off interval", argv:ARGV("10", "60", "120"), nullok: FALSE},
};
int
valid_power(webs_t wp, char *value, struct variable *v)
{
char tmp[TMP_LEN];
char *val;
#ifndef EZP_SUB_BRAND_SONY
/* Wireless Auto Disable */
snprintf(tmp, sizeof(tmp), "w_enable");
val = websGetVar(wp, tmp, "");
if (valid_choice(wp, val, &power_variables[W_ENABLE]) == FALSE) {
return FALSE;
}
/* Wireless interval */
snprintf(tmp, sizeof(tmp), "w_countdown");
val = websGetVar(wp, tmp, "");
if (valid_choice(wp, val, &power_variables[W_COUNTDOWN]) == FALSE) {
return FALSE;
}
#endif
/* System Auto Turn off */
snprintf(tmp, sizeof(tmp), "p_enable");
val = websGetVar(wp, tmp, "");
if (valid_choice(wp, val, &power_variables[P_ENABLE]) == FALSE) {
return FALSE;
}
/* System interval */
snprintf(tmp, sizeof(tmp), "p_countdown");
val = websGetVar(wp, tmp, "");
if (valid_choice(wp, val, &power_variables[P_COUNTDOWN]) == FALSE) {
return FALSE;
}
return TRUE;
}
int
save_power(webs_t wp, char *value, struct variable *v,
struct service *s)
{
char tmp[TMP_LEN], buf[TMP_LEN];
char *w_enable, *w_countdown, *p_enable, *p_countdown;
int idx = atoi(value), len, change = 0;
#ifndef EZP_SUB_BRAND_SONY
/* Wireless Auto Disable */
snprintf(tmp, sizeof(tmp), "w_enable");
w_enable = websGetVar(wp, tmp, "");
/* Wireless interval */
snprintf(tmp, sizeof(tmp), "w_countdown");
w_countdown = websGetVar(wp, tmp, "");
#else
char tmp_w_enable[TMP_LEN], tmp_w_countdown[TMP_LEN];
ezplib_get_attr_val("countdown_rule", 0, "w_enable", tmp_w_enable, sizeof(tmp_w_enable), EZPLIB_USE_CLI);
w_enable=tmp_w_enable;
ezplib_get_attr_val("countdown_rule", 0, "w_countdown", tmp_w_countdown, sizeof(tmp_w_countdown), EZPLIB_USE_CLI);
w_countdown=tmp_w_countdown;
#endif
/* System Auto Turn off */
snprintf(tmp, sizeof(tmp), "p_enable");
p_enable = websGetVar(wp, tmp, "");
/* System interval */
snprintf(tmp, sizeof(tmp), "p_countdown");
p_countdown = websGetVar(wp, tmp, "");
len = snprintf(tmp, TMP_LEN, "%s^%s^%s^%s^%s^%s", w_enable, w_countdown, w_countdown, p_enable, p_countdown, p_countdown);
ezplib_get_rule("countdown_rule", idx, buf, TMP_LEN);
if (strcmp(buf, tmp)) {
ezplib_replace_rule("countdown_rule", idx, tmp);
change = 1;
}
return change;
}
int
valid_togopower(webs_t wp, char *value, struct variable *v)
{
return TRUE;
}
int
save_togopower(webs_t wp, char *value, struct variable *v, struct service *s)
{
int fd = socket(AF_INET,SOCK_DGRAM,0);
struct sockaddr_in addr={};
char *type, *id, *togo_action;
char contype;
char tmp[LONG_BUF_LEN], output[LONG_BUF_LEN];
unsigned char checksum;
addr.sin_family = AF_INET;
addr.sin_port = htons(6666);
addr.sin_addr.s_addr=inet_addr("127.0.0.1");
snprintf(tmp, sizeof(tmp), "type");
type = websGetVar(wp, tmp, "");
snprintf(tmp, sizeof(tmp), "id");
id = websGetVar(wp, tmp, "");
snprintf(tmp, sizeof(tmp), "togo_action");
togo_action = websGetVar(wp, tmp, "");
checksum=atoi(togo_action)+0xa6;
if (!strcmp(type,"ch341")) contype=CH341;
snprintf(output, sizeof(output), "type=%d,id=%s,action=%2s,checksum=%2X,", contype, id, togo_action, checksum);
sendto(fd,&output,strlen(output)+1,0,(struct sockaddr*)&addr,sizeof(addr));
close(fd);
return 0;
}
|
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <stdbool.h>
#include <stdint.h>
struct hciemu;
enum hciemu_type {
HCIEMU_TYPE_BREDRLE,
HCIEMU_TYPE_BREDR,
HCIEMU_TYPE_LE,
HCIEMU_TYPE_LEGACY,
};
enum hciemu_hook_type {
HCIEMU_HOOK_PRE_CMD,
HCIEMU_HOOK_POST_CMD,
HCIEMU_HOOK_PRE_EVT,
HCIEMU_HOOK_POST_EVT,
};
struct hciemu *hciemu_new(enum hciemu_type type);
struct hciemu *hciemu_ref(struct hciemu *hciemu);
void hciemu_unref(struct hciemu *hciemu);
struct bthost *hciemu_client_get_host(struct hciemu *hciemu);
const char *hciemu_get_address(struct hciemu *hciemu);
uint8_t *hciemu_get_features(struct hciemu *hciemu);
const uint8_t *hciemu_get_master_bdaddr(struct hciemu *hciemu);
const uint8_t *hciemu_get_client_bdaddr(struct hciemu *hciemu);
uint8_t hciemu_get_master_scan_enable(struct hciemu *hciemu);
uint8_t hciemu_get_master_le_scan_enable(struct hciemu *hciemu);
typedef void (*hciemu_command_func_t)(uint16_t opcode, const void *data,
uint8_t len, void *user_data);
typedef bool (*hciemu_hook_func_t)(const void *data, uint16_t len,
void *user_data);
bool hciemu_add_master_post_command_hook(struct hciemu *hciemu,
hciemu_command_func_t function, void *user_data);
int hciemu_add_hook(struct hciemu *hciemu, enum hciemu_hook_type type,
uint16_t opcode, hciemu_hook_func_t function,
void *user_data);
bool hciemu_del_hook(struct hciemu *hciemu, enum hciemu_hook_type type,
uint16_t opcode);
|
/**
* \file
* <!--
* This file is part of BeRTOS.
*
* Bertos 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
*
* As a special exception, you may use this file as part of a free software
* library without restriction. Specifically, if other files instantiate
* templates or use macros or inline functions from this file, or you compile
* this file and link it with other files to produce an executable, this
* file does not by itself cause the resulting executable to be covered by
* the GNU General Public License. This exception does not however
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
* Copyright 2010 Develer S.r.l. (http://www.develer.com/)
*
* -->
*
* \brief Low-level Clock module for ARM Cortex-m3 (interface).
*
* \author Daniele Basile <asterix@develer.com>
*
*/
#include <cpu/detect.h>
#if CPU_CM3_LM3S
#include "clock_lm3s.h"
#elif CPU_CM3_STM32
#include "clock_stm32.h"
#elif CPU_CM3_SAM3
#include "clock_sam3.h"
/*#elif Add other Cortex-M3 CPUs here */
#else
#error Unknown CPU
#endif
|
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ----------------------------------------------------------------------------
* Wrapper for heatshrink encode/decode
* ----------------------------------------------------------------------------
*/
/** gets data from array, writes to callback */
void heatshrink_encode(unsigned char *data, size_t dataLen, void (*callback)(unsigned char ch, uint32_t *cbdata), uint32_t *cbdata);
/** gets data from callback, writes it into array */
void heatshrink_decode(int (*callback)(uint32_t *cbdata), uint32_t *cbdata, unsigned char *data);
|
#ifndef __CR_EXTERNAL_H__
#define __CR_EXTERNAL_H__
struct external {
struct list_head node;
char *id;
void *data;
};
extern int add_external(char *key);
extern bool external_lookup_id(char *id);
extern char *external_lookup_by_key(char *id);
extern void *external_lookup_data(char *id);
extern int external_for_each_type(char *type, int (*cb)(struct external *, void *), void *arg);
static inline char *external_val(struct external *e)
{
char *aux;
aux = strchr(e->id, '[');
if (aux) {
aux = strchr(aux + 1, ']');
if (aux && aux[1] == ':')
return aux + 2;
}
return NULL;
}
#endif
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtQml 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 QPACKETPROTOCOL_H
#define QPACKETPROTOCOL_H
#include <QtCore/qobject.h>
#include <QtCore/qdatastream.h>
QT_BEGIN_NAMESPACE
class QIODevice;
class QBuffer;
class QPacket;
class QPacketAutoSend;
class QPacketProtocolPrivate;
class QPacketProtocol : public QObject
{
Q_OBJECT
public:
explicit QPacketProtocol(QIODevice *dev, QObject *parent = 0);
virtual ~QPacketProtocol();
qint32 maximumPacketSize() const;
qint32 setMaximumPacketSize(qint32);
QPacketAutoSend send();
void send(const QPacket &);
qint64 packetsAvailable() const;
QPacket read();
bool waitForReadyRead(int msecs = 3000);
void clear();
QIODevice *device();
Q_SIGNALS:
void readyRead();
void invalidPacket();
void packetWritten();
private:
QPacketProtocolPrivate *d;
};
class QPacket : public QDataStream
{
public:
QPacket();
QPacket(const QPacket &);
virtual ~QPacket();
void clear();
bool isEmpty() const;
QByteArray data() const;
protected:
friend class QPacketProtocol;
QPacket(const QByteArray &ba);
QByteArray b;
QBuffer *buf;
};
class QPacketAutoSend : public QPacket
{
public:
virtual ~QPacketAutoSend();
private:
friend class QPacketProtocol;
QPacketAutoSend(QPacketProtocol *);
QPacketProtocol *p;
};
QT_END_NAMESPACE
#endif
|
/*----------------------------------------------------------------------------
* File: ooaofooa_TE_IF_class.h
*
* Class: OAL if (TE_IF)
* Component: ooaofooa
*
* your copyright statement can go here (from te_copyright.body)
*--------------------------------------------------------------------------*/
#ifndef OOAOFOOA_TE_IF_CLASS_H
#define OOAOFOOA_TE_IF_CLASS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structural representation of application analysis class:
* OAL if (TE_IF)
*/
struct ooaofooa_TE_IF {
/* application analysis class attributes */
c_t * condition;
Escher_UniqueID_t Statement_ID;
/* relationship storage */
ooaofooa_TE_SMT * TE_SMT_R2069;
};
void ooaofooa_TE_IF_instancedumper( Escher_iHandle_t );
Escher_iHandle_t ooaofooa_TE_IF_instanceloader( Escher_iHandle_t, const c_t * [] );
void ooaofooa_TE_IF_batch_relate( Escher_iHandle_t );
void ooaofooa_TE_IF_R2069_Link( ooaofooa_TE_SMT *, ooaofooa_TE_IF * );
void ooaofooa_TE_IF_R2069_Unlink( ooaofooa_TE_SMT *, ooaofooa_TE_IF * );
#define ooaofooa_TE_IF_MAX_EXTENT_SIZE 10
extern Escher_Extent_t pG_ooaofooa_TE_IF_extent;
#ifdef __cplusplus
}
#endif
#endif /* OOAOFOOA_TE_IF_CLASS_H */
|
/*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_SURFACE_CALL_H
#define GRPC_CORE_LIB_SURFACE_CALL_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/surface/api_trace.h"
#include <grpc/grpc.h>
#include <grpc/impl/codegen/compression_types.h>
typedef void (*grpc_ioreq_completion_func)(grpc_call* call, int success,
void* user_data);
typedef struct grpc_call_create_args {
grpc_channel* channel;
grpc_server* server;
grpc_call* parent;
uint32_t propagation_mask;
grpc_completion_queue* cq;
/* if not NULL, it'll be used in lieu of cq */
grpc_pollset_set* pollset_set_alternative;
const void* server_transport_data;
grpc_mdelem* add_initial_metadata;
size_t add_initial_metadata_count;
grpc_millis send_deadline;
} grpc_call_create_args;
/* Create a new call based on \a args.
Regardless of success or failure, always returns a valid new call into *call
*/
grpc_error* grpc_call_create(const grpc_call_create_args* args,
grpc_call** call);
void grpc_call_set_completion_queue(grpc_call* call, grpc_completion_queue* cq);
#ifndef NDEBUG
void grpc_call_internal_ref(grpc_call* call, const char* reason);
void grpc_call_internal_unref(grpc_call* call, const char* reason);
#define GRPC_CALL_INTERNAL_REF(call, reason) \
grpc_call_internal_ref(call, reason)
#define GRPC_CALL_INTERNAL_UNREF(call, reason) \
grpc_call_internal_unref(call, reason)
#else
void grpc_call_internal_ref(grpc_call* call);
void grpc_call_internal_unref(grpc_call* call);
#define GRPC_CALL_INTERNAL_REF(call, reason) grpc_call_internal_ref(call)
#define GRPC_CALL_INTERNAL_UNREF(call, reason) grpc_call_internal_unref(call)
#endif
gpr_arena* grpc_call_get_arena(grpc_call* call);
grpc_call_stack* grpc_call_get_call_stack(grpc_call* call);
grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
const grpc_op* ops,
size_t nops,
grpc_closure* closure);
/* gRPC core internal version of grpc_call_cancel that does not create
* exec_ctx. */
void grpc_call_cancel_internal(grpc_call* call);
/* Given the top call_element, get the call object. */
grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element);
void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity,
grpc_call* call, const grpc_op* ops, size_t nops,
void* tag);
/* Set a context pointer.
No thread safety guarantees are made wrt this value. */
/* TODO(#9731): add exec_ctx to destroy */
void grpc_call_context_set(grpc_call* call, grpc_context_index elem,
void* value, void (*destroy)(void* value));
/* Get a context pointer. */
void* grpc_call_context_get(grpc_call* call, grpc_context_index elem);
#define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \
if (grpc_api_trace.enabled()) grpc_call_log_batch(sev, call, ops, nops, tag)
uint8_t grpc_call_is_client(grpc_call* call);
/* Get the estimated memory size for a call BESIDES the call stack. Combined
* with the size of the call stack, it helps estimate the arena size for the
* initial call. */
size_t grpc_call_get_initial_size_estimate();
/* Return an appropriate compression algorithm for the requested compression \a
* level in the context of \a call. */
grpc_compression_algorithm grpc_call_compression_for_level(
grpc_call* call, grpc_compression_level level);
extern grpc_core::TraceFlag grpc_call_error_trace;
extern grpc_core::TraceFlag grpc_compression_trace;
#endif /* GRPC_CORE_LIB_SURFACE_CALL_H */
|
// Copyright (c) 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 CHROME_BROWSER_UI_ANDROID_WEBSITE_SETTINGS_POPUP_ANDROID_H_
#define CHROME_BROWSER_UI_ANDROID_WEBSITE_SETTINGS_POPUP_ANDROID_H_
#include <jni.h>
#include "base/android/scoped_java_ref.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/website_settings/website_settings_ui.h"
namespace content {
class WebContents;
}
// A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser
enum PageInfoConnectionType {
CONNECTION_UNKNOWN,
CONNECTION_ENCRYPTED,
CONNECTION_MIXED_CONTENT,
CONNECTION_UNENCRYPTED,
CONNECTION_ENCRYPTED_ERROR,
CONNECTION_INTERNAL_PAGE,
};
// Android implementation of the website settings UI.
class WebsiteSettingsPopupAndroid : public WebsiteSettingsUI {
public:
WebsiteSettingsPopupAndroid(JNIEnv* env,
jobject java_website_settings,
content::WebContents* web_contents);
~WebsiteSettingsPopupAndroid() override;
void Destroy(JNIEnv* env, jobject obj);
void OnPermissionSettingChanged(JNIEnv* env,
jobject obj,
jint type,
jint setting);
// WebsiteSettingsUI implementations.
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
void SetPermissionInfo(
const PermissionInfoList& permission_info_list) override;
void SetIdentityInfo(const IdentityInfo& identity_info) override;
void SetFirstVisit(const base::string16& first_visit) override;
void SetSelectedTab(WebsiteSettingsUI::TabId tab_id) override;
static bool RegisterWebsiteSettingsPopupAndroid(JNIEnv* env);
private:
// The presenter that controlls the Website Settings UI.
scoped_ptr<WebsiteSettings> presenter_;
// The java prompt implementation.
base::android::ScopedJavaGlobalRef<jobject> popup_jobject_;
GURL url_;
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupAndroid);
};
#endif // CHROME_BROWSER_UI_ANDROID_WEBSITE_SETTINGS_POPUP_ANDROID_H_
|
/*
* vim:ts=4:sw=4:expandtab
*
* i3bar - an xcb-based status- and ws-bar for i3
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
*
* ipc.c: Communicating with i3
*
*/
#ifndef IPC_H_
#define IPC_H_
#include <stdint.h>
/*
* Initiate a connection to i3.
* socket-path must be a valid path to the ipc_socket of i3
*
*/
int init_connection(const char *socket_path);
/*
* Destroy the connection to i3.
*
*/
void destroy_connection(void);
/*
* Sends a Message to i3.
* type must be a valid I3_IPC_MESSAGE_TYPE (see i3/ipc.h for further information)
*
*/
int i3_send_msg(uint32_t type, const char* payload);
/*
* Subscribe to all the i3-events, we need
*
*/
void subscribe_events(void);
#endif
|
// Copyright 2014 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_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_
#define SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_
#include <stddef.h>
#include <stdint.h>
#include <vector>
#include "base/macros.h"
#include "sync/engine/commit_contribution.h"
#include "sync/protocol/sync.pb.h"
namespace syncer_v2 {
class ModelTypeWorker;
// A non-blocking sync type's contribution to an outgoing commit message.
//
// Helps build a commit message and process its response. It collaborates
// closely with the ModelTypeWorker.
class NonBlockingTypeCommitContribution : public syncer::CommitContribution {
public:
NonBlockingTypeCommitContribution(
const sync_pb::DataTypeContext& context,
const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities,
const std::vector<int64_t>& sequence_numbers,
ModelTypeWorker* worker);
~NonBlockingTypeCommitContribution() override;
// Implementation of CommitContribution
void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) override;
syncer::SyncerError ProcessCommitResponse(
const sync_pb::ClientToServerResponse& response,
syncer::sessions::StatusController* status) override;
void CleanUp() override;
size_t GetNumEntries() const override;
private:
// A non-owned pointer back to the object that created this contribution.
ModelTypeWorker* const worker_;
// The type-global context information.
const sync_pb::DataTypeContext context_;
// The set of entities to be committed, serialized as SyncEntities.
const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> entities_;
// The sequence numbers associated with the pending commits. These match up
// with the entities_ vector.
const std::vector<int64_t> sequence_numbers_;
// The index in the commit message where this contribution's entities are
// added. Used to correlate per-item requests with per-item responses.
size_t entries_start_index_;
// A flag used to ensure this object's contract is respected. Helps to check
// that CleanUp() is called before the object is destructed.
bool cleaned_up_;
DISALLOW_COPY_AND_ASSIGN(NonBlockingTypeCommitContribution);
};
} // namespace syncer_v2
#endif // SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_
|
//===-- NVPTXTargetObjectFile.h - NVPTX Object Info -------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TARGET_NVPTX_TARGETOBJECTFILE_H
#define LLVM_TARGET_NVPTX_TARGETOBJECTFILE_H
#include "NVPTXSection.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include <string>
namespace llvm {
class GlobalVariable;
class Module;
class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
public:
NVPTXTargetObjectFile() {
TextSection = 0;
DataSection = 0;
BSSSection = 0;
ReadOnlySection = 0;
StaticCtorSection = 0;
StaticDtorSection = 0;
LSDASection = 0;
EHFrameSection = 0;
DwarfAbbrevSection = 0;
DwarfInfoSection = 0;
DwarfLineSection = 0;
DwarfFrameSection = 0;
DwarfPubTypesSection = 0;
DwarfDebugInlineSection = 0;
DwarfStrSection = 0;
DwarfLocSection = 0;
DwarfARangesSection = 0;
DwarfRangesSection = 0;
DwarfMacroInfoSection = 0;
}
virtual ~NVPTXTargetObjectFile();
virtual void Initialize(MCContext &ctx, const TargetMachine &TM) {
TargetLoweringObjectFile::Initialize(ctx, TM);
TextSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getText());
DataSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getDataRel());
BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS());
ReadOnlySection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly());
StaticCtorSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
StaticDtorSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
LSDASection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
EHFrameSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfAbbrevSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfInfoSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfLineSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfFrameSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfPubTypesSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfDebugInlineSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfStrSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfLocSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfARangesSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfRangesSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
DwarfMacroInfoSection =
new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
}
virtual const MCSection *getSectionForConstant(SectionKind Kind) const {
return ReadOnlySection;
}
virtual const MCSection *
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const {
return DataSection;
}
};
} // end namespace llvm
#endif
|
//
// ______ _ _ _ _____ _____ _ __
// | ____| | | (_) | | / ____| __ \| |/ /
// | |__ ___| |_ _ _ __ ___ ___ | |_ ___ | (___ | | | | ' /
// | __| / __| __| | '_ ` _ \ / _ \| __/ _ \ \___ \| | | | <
// | |____\__ \ |_| | | | | | | (_) | || __/ ____) | |__| | . \
// |______|___/\__|_|_| |_| |_|\___/ \__\___| |_____/|_____/|_|\_\
//
//
// Version: 3.3.1
// Copyright (c) 2015 Estimote. All rights reserved.
#import "ESTNearableRule.h"
/**
* The `ESTProximityRule` class defines single rule related to proximity from the Estimote nearable device.
*/
@interface ESTProximityRule : ESTNearableRule
@property (nonatomic, assign) BOOL inRange;
+ (instancetype)inRangeOfNearableIdentifier:(NSString *)identifier;
+ (instancetype)inRangeOfNearableType:(ESTNearableType)type;
+ (instancetype)outsideRangeOfNearableIdentifier:(NSString *)identifier;
+ (instancetype)outsideRangeOfNearableType:(ESTNearableType)type;
@end
|
/*
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
* Copyright (C) 2009-2011 MaNGOSZero <https://github.com/mangos/zero>
* Copyright (C) 2011-2016 Nostalrius <https://nostalrius.org>
* Copyright (C) 2016-2017 Elysium Project <https://github.com/elysium-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 _HOSTILEREFMANAGER
#define _HOSTILEREFMANAGER
#include "Common.h"
#include "Utilities/LinkedReference/RefManager.h"
class Unit;
class ThreatManager;
class HostileReference;
class SpellEntry;
//=================================================
class HostileRefManager : public RefManager<Unit, ThreatManager>
{
public:
explicit HostileRefManager(Unit *pOwner);
~HostileRefManager();
Unit* getOwner() { return iOwner; }
// send threat to all my hateres for the pVictim
// The pVictim is hated than by them as well
// use for buffs and healing threat functionality
void threatAssist(Unit *pVictim, float threat, SpellEntry const *threatSpell = 0, bool pSingleTarget=false);
// Nostalrius
void addTempThreat(float threat, bool apply);
void addThreatPercent(int32 pValue);
// The references are not needed anymore
// tell the source to remove them from the list and free the mem
void deleteReferences();
// Remove specific faction references
void deleteReferencesForFaction(uint32 faction);
HostileReference* getFirst() { return ((HostileReference* ) RefManager<Unit, ThreatManager>::getFirst()); }
void updateThreatTables();
void setOnlineOfflineState(bool pIsOnline);
// set state for one reference, defined by Unit
void setOnlineOfflineState(Unit *pCreature,bool pIsOnline);
// delete one reference, defined by Unit
void deleteReference(Unit *pCreature);
private:
Unit* iOwner; // owner of manager variable, back ref. to it, always exist
};
//=================================================
#endif
|
/*
* AMLOGIC Audio/Video streaming port driver.
*
* 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 named License,
* or 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
*
* Author: Tim Yao <timyao@amlogic.com>
*
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <mach/am_regs.h>
#include "../vdec_reg.h"
#include "../amports_config.h"
#include "../vdec.h"
#include "../vdec_clk.h"
/*
HHI_VDEC_CLK_CNTL..
bits,9~11:
0x106d[11:9] :
0 for fclk_div2, 1GHz
1 for fclk_div3, 2G/3Hz
2 for fclk_div5, 2G/5Hz
3 for fclk_div7, 2G/7HZ
4 for mp1_clk_out
5 for ddr_pll_clk
bit0~6: div N=bit[0-7]+1
bit8: vdec.gate
*/
#define VDEC1_166M() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, (0 << 9) | (1 << 8) | (5), 0, 16)
#define VDEC2_166M() WRITE_MPEG_REG(HHI_VDEC2_CLK_CNTL, (0 << 9) | (1 << 8) | (5))
#define VDEC1_200M() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, (0 << 9) | (1 << 8) | (4), 0, 16)
#define VDEC2_200M() WRITE_MPEG_REG(HHI_VDEC2_CLK_CNTL, (0 << 9) | (1 << 8) | (4))
#define VDEC1_250M() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, (0 << 9) | (1 << 8) | (3), 0, 16)
#define VDEC2_250M() WRITE_MPEG_REG(HHI_VDEC2_CLK_CNTL, (0 << 9) | (1 << 8) | (3))
#define HCODEC_250M() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, (0 << 9) | (1 << 8) | (3), 16, 16)
#define VDEC1_333M() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, (0 << 9) | (1 << 8) | (2), 0, 16)
#define VDEC2_333M() WRITE_MPEG_REG(HHI_VDEC2_CLK_CNTL, (0 << 9) | (1 << 8) | (2))
#define VDEC1_CLOCK_ON() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, 1, 8, 1); \
WRITE_VREG_BITS(DOS_GCLK_EN0, 0x3ff, 0, 10)
#define VDEC2_CLOCK_ON() WRITE_MPEG_REG_BITS(HHI_VDEC2_CLK_CNTL, 1, 8, 1); \
WRITE_VREG(DOS_GCLK_EN1, 0x3ff)
#define HCODEC_CLOCK_ON() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, 1, 24, 1); \
WRITE_VREG_BITS(DOS_GCLK_EN0, 0x7fff, 12, 15)
#define VDEC1_CLOCK_OFF() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, 0, 8, 1)
#define VDEC2_CLOCK_OFF() WRITE_MPEG_REG_BITS(HHI_VDEC2_CLK_CNTL, 0, 8, 1)
#define HCODEC_CLOCK_OFF() WRITE_MPEG_REG_BITS(HHI_VDEC_CLK_CNTL, 0, 24, 1)
static int clock_level[VDEC_MAX+1];
void vdec_clock_enable(void)
{
VDEC1_CLOCK_OFF();
VDEC1_250M();
VDEC1_CLOCK_ON();
clock_level[VDEC_1] = 0;
}
void vdec_clock_hi_enable(void)
{
VDEC1_CLOCK_OFF();
VDEC1_250M();
VDEC1_CLOCK_ON();
clock_level[VDEC_1] = 1;
}
void vdec_clock_on(void)
{
VDEC1_CLOCK_ON();
}
void vdec_clock_off(void)
{
VDEC1_CLOCK_OFF();
}
void vdec2_clock_enable(void)
{
VDEC2_CLOCK_OFF();
VDEC2_250M();
VDEC2_CLOCK_ON();
clock_level[VDEC_2] = 0;
}
void vdec2_clock_hi_enable(void)
{
VDEC2_CLOCK_OFF();
VDEC2_250M();
VDEC2_CLOCK_ON();
clock_level[VDEC_2] = 1;
}
void vdec2_clock_on(void)
{
VDEC2_CLOCK_ON();
}
void vdec2_clock_off(void)
{
VDEC2_CLOCK_OFF();
}
void hcodec_clock_enable(void)
{
HCODEC_CLOCK_OFF();
HCODEC_250M();
HCODEC_CLOCK_ON();
}
void hcodec_clock_on(void)
{
HCODEC_CLOCK_ON();
}
void hcodec_clock_off(void)
{
HCODEC_CLOCK_OFF();
}
int vdec_clock_level(vdec_type_t core)
{
if (core >= VDEC_MAX)
return 0;
return clock_level[core];
}
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* (C) Copyright 2009 SAMSUNG Electronics
* Minkyu Kang <mk7.kang@samsung.com>
*/
#ifndef __ASM_ARCH_MMC_H_
#define __ASM_ARCH_MMC_H_
#define S5P_MMC_DEV_OFFSET 0x100000
#define SDHCI_CONTROL2 0x80
#define SDHCI_CONTROL3 0x84
#define SDHCI_CONTROL4 0x8C
#define SDHCI_CTRL2_ENSTAASYNCCLR (1 << 31)
#define SDHCI_CTRL2_ENCMDCNFMSK (1 << 30)
#define SDHCI_CTRL2_CDINVRXD3 (1 << 29)
#define SDHCI_CTRL2_SLCARDOUT (1 << 28)
#define SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24)
#define SDHCI_CTRL2_FLTCLKSEL_SHIFT (24)
#define SDHCI_CTRL2_FLTCLKSEL(_x) ((_x) << 24)
#define SDHCI_CTRL2_LVLDAT_MASK (0xff << 16)
#define SDHCI_CTRL2_LVLDAT_SHIFT (16)
#define SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16)
#define SDHCI_CTRL2_ENFBCLKTX (1 << 15)
#define SDHCI_CTRL2_ENFBCLKRX (1 << 14)
#define SDHCI_CTRL2_SDCDSEL (1 << 13)
#define SDHCI_CTRL2_SDSIGPC (1 << 12)
#define SDHCI_CTRL2_ENBUSYCHKTXSTART (1 << 11)
#define SDHCI_CTRL2_DFCNT_MASK(_x) ((_x) << 9)
#define SDHCI_CTRL2_DFCNT_SHIFT (9)
#define SDHCI_CTRL2_ENCLKOUTHOLD (1 << 8)
#define SDHCI_CTRL2_RWAITMODE (1 << 7)
#define SDHCI_CTRL2_DISBUFRD (1 << 6)
#define SDHCI_CTRL2_SELBASECLK_MASK(_x) ((_x) << 4)
#define SDHCI_CTRL2_SELBASECLK_SHIFT (4)
#define SDHCI_CTRL2_PWRSYNC (1 << 3)
#define SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1)
#define SDHCI_CTRL2_HWINITFIN (1 << 0)
#define SDHCI_CTRL3_FCSEL3 (1 << 31)
#define SDHCI_CTRL3_FCSEL2 (1 << 23)
#define SDHCI_CTRL3_FCSEL1 (1 << 15)
#define SDHCI_CTRL3_FCSEL0 (1 << 7)
#define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16)
#define SDHCI_CTRL4_DRIVE_SHIFT (16)
int s5p_sdhci_init(u32 regbase, int index, int bus_width);
static inline int s5p_mmc_init(int index, int bus_width)
{
unsigned int base = samsung_get_base_mmc() +
(S5P_MMC_DEV_OFFSET * index);
return s5p_sdhci_init(base, index, bus_width);
}
#endif
|
/* arch/arm/mach-msm/touch-satsuma.c
*
* Copyright (C) [2010-2011] Sony Ericsson Mobile Communications AB.
* Adapted for SEMC 2011 devices by Michael Bestas (mikeioannina@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*/
#include <linux/input.h>
#include <linux/input/cyttsp_semc.h>
#include "touch-semc.h"
struct cyttsp_platform_data cyttsp_data = {
.wakeup = cyttsp_wakeup,
.init = cyttsp_init,
.mt_sync = input_mt_sync,
.cust_spec = cyttsp_key_rpc_callback,
/* TODO: max values should be retrieved from the firmware */
.maxx = 319,
.maxy = 479,
.maxz = 255,
.flags = 0,
.gen = CY_GEN3,
.use_st = 0,
.use_mt = 1,
.use_trk_id = 0,
.use_hndshk = 0,
.use_timer = 0,
.use_sleep = 1,
.use_gestures = 0,
.use_load_file = 1,
.use_force_fw_update = 0,
/* activate up groups */
.gest_set = CY_GEST_KEEP_ASIS,
/* set active distance */
.act_dist = CY_ACT_DIST_01,
/* change act_intrvl to customize the Active power state
* scanning/processing refresh interval for Operating mode
*/
.act_intrvl = 0,
/* change tch_tmout to customize the touch timeout for the
* Active power state for Operating mode
*/
.tch_tmout = CY_TCH_TMOUT_DFLT,
/* change lp_intrvl to customize the Low Power power state
* scanning/processing refresh interval for Operating mode
*/
.lp_intrvl = CY_LP_INTRVL_DFLT,
.name = CY_SPI_NAME,
.irq_gpio = 42,
.reset = cyttsp_xres,
.idac_gain = 0,
};
|
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Giuseppe Piro <g.piro@poliba.it>
*/
#ifndef RLC_ENTITY_H
#define RLC_ENTITY_H
#include "ns3/object.h"
#include <list>
namespace ns3 {
class Packet;
class LteNetDevice;
class RadioBearerInstance;
/**
* This class implements the RLC entity
*/
class RlcEntity : public Object
{
public:
static TypeId GetTypeId (void);
RlcEntity (void);
/**
* \brief Create the RLC entity
* \param d the device where the RLC entity is created
*/
RlcEntity (Ptr<LteNetDevice> d);
virtual ~RlcEntity (void);
virtual void DoDispose (void);
/**
* \brief Set the device where the RLC entity is attached
* \param d the device
*/
void SetDevice (Ptr<LteNetDevice> d);
/**
* \brief Get the device where the RLC entity is attached
* \return the pointer to the device
*/
Ptr<LteNetDevice> GetDevice ();
/**
* \brief Get A packet form the queue
* \return a pointer to the packet
*/
Ptr<Packet> Dequeue ();
/**
* \brief Set the bearer where the rlc entity is attached
* \param b the radio bearer
*/
void SetRadioBearer (Ptr<RadioBearerInstance> b);
/**
* \brief Get the bearer where the rlc entity is attached
* \return the pointer to the radio bearer
*/
Ptr<RadioBearerInstance> GetRadioBearer (void);
private:
Ptr<LteNetDevice> m_device;
Ptr<RadioBearerInstance> m_bearer;
};
} // namespace ns3
#endif /* RLC_ENTITY_H */
|
/*
** backtrace.c -
**
** See Copyright Notice in mruby.h
*/
#include "mruby.h"
#include "mruby/variable.h"
#include "mruby/proc.h"
#include "mruby/array.h"
#include "mruby/string.h"
#include "mruby/class.h"
#include "mruby/debug.h"
#include "mruby/error.h"
#include "mruby/numeric.h"
struct backtrace_location {
int i;
int lineno;
const char *filename;
const char *method;
const char *sep;
const char *class_name;
};
typedef void (*output_stream_func)(mrb_state*, struct backtrace_location*, void*);
#ifdef ENABLE_STDIO
struct print_backtrace_args {
FILE *stream;
int tracehead;
};
static void
print_backtrace_i(mrb_state *mrb, struct backtrace_location *loc, void *data)
{
struct print_backtrace_args *args;
args = (struct print_backtrace_args*)data;
if (args->tracehead) {
fprintf(args->stream, "trace:\n");
args->tracehead = FALSE;
}
fprintf(args->stream, "\t[%d] %s:%d", loc->i, loc->filename, loc->lineno);
if (loc->method) {
if (loc->class_name) {
fprintf(args->stream, ":in %s%s%s", loc->class_name, loc->sep, loc->method);
}
else {
fprintf(args->stream, ":in %s", loc->method);
}
}
fprintf(args->stream, "\n");
}
#endif
static void
get_backtrace_i(mrb_state *mrb, struct backtrace_location *loc, void *data)
{
mrb_value ary, str;
int ai;
ai = mrb_gc_arena_save(mrb);
ary = mrb_obj_value((struct RArray*)data);
str = mrb_str_new_cstr(mrb, loc->filename);
mrb_str_cat_lit(mrb, str, ":");
mrb_str_concat(mrb, str, mrb_fixnum_to_str(mrb, mrb_fixnum_value(loc->lineno), 10));
if (loc->method) {
mrb_str_cat_lit(mrb, str, ":in ");
if (loc->class_name) {
mrb_str_cat_cstr(mrb, str, loc->class_name);
mrb_str_cat_cstr(mrb, str, loc->sep);
}
mrb_str_cat_cstr(mrb, str, loc->method);
}
mrb_ary_push(mrb, ary, str);
mrb_gc_arena_restore(mrb, ai);
}
static void
output_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, output_stream_func func, void *data)
{
int i;
if (ciidx >= mrb->c->ciend - mrb->c->cibase)
ciidx = 10; /* ciidx is broken... */
for (i = ciidx; i >= 0; i--) {
struct backtrace_location loc;
mrb_callinfo *ci;
mrb_irep *irep;
mrb_code *pc;
ci = &mrb->c->cibase[i];
if (!ci->proc) continue;
if (MRB_PROC_CFUNC_P(ci->proc)) continue;
irep = ci->proc->body.irep;
if (mrb->c->cibase[i].err) {
pc = mrb->c->cibase[i].err;
}
else if (i+1 <= ciidx) {
pc = mrb->c->cibase[i+1].pc - 1;
}
else {
pc = pc0;
}
loc.filename = mrb_debug_get_filename(irep, (uint32_t)(pc - irep->iseq));
loc.lineno = mrb_debug_get_line(irep, (uint32_t)(pc - irep->iseq));
if (loc.lineno == -1) continue;
if (ci->target_class == ci->proc->target_class) {
loc.sep = ".";
}
else {
loc.sep = "#";
}
if (!loc.filename) {
loc.filename = "(unknown)";
}
loc.method = mrb_sym2name(mrb, ci->mid);
loc.class_name = mrb_class_name(mrb, ci->proc->target_class);
loc.i = i;
func(mrb, &loc, data);
}
}
static void
exc_output_backtrace(mrb_state *mrb, struct RObject *exc, output_stream_func func, void *stream)
{
mrb_value lastpc;
mrb_code *code;
lastpc = mrb_obj_iv_get(mrb, exc, mrb_intern_lit(mrb, "lastpc"));
if (mrb_nil_p(lastpc)) {
code = NULL;
} else {
code = (mrb_code*)mrb_cptr(lastpc);
}
output_backtrace(mrb, mrb_fixnum(mrb_obj_iv_get(mrb, exc, mrb_intern_lit(mrb, "ciidx"))),
code, func, stream);
}
/* mrb_print_backtrace/mrb_get_backtrace:
function to retrieve backtrace information from the exception.
note that if you call method after the exception, call stack will be
overwritten. So invoke these functions just after detecting exceptions.
*/
#ifdef ENABLE_STDIO
MRB_API void
mrb_print_backtrace(mrb_state *mrb)
{
struct print_backtrace_args args;
if (!mrb->exc || mrb_obj_is_kind_of(mrb, mrb_obj_value(mrb->exc), E_SYSSTACK_ERROR)) {
return;
}
args.stream = stderr;
args.tracehead = TRUE;
exc_output_backtrace(mrb, mrb->exc, print_backtrace_i, (void*)&args);
}
#else
MRB_API void
mrb_print_backtrace(mrb_state *mrb)
{
}
#endif
MRB_API mrb_value
mrb_exc_backtrace(mrb_state *mrb, mrb_value self)
{
mrb_value ary;
ary = mrb_ary_new(mrb);
exc_output_backtrace(mrb, mrb_obj_ptr(self), get_backtrace_i, (void*)mrb_ary_ptr(ary));
return ary;
}
MRB_API mrb_value
mrb_get_backtrace(mrb_state *mrb)
{
mrb_value ary;
mrb_callinfo *ci = mrb->c->ci;
mrb_code *pc = ci->pc;
mrb_int ciidx = (mrb_int)(ci - mrb->c->cibase - 1);
if (ciidx < 0) ciidx = 0;
ary = mrb_ary_new(mrb);
output_backtrace(mrb, ciidx, pc, get_backtrace_i, (void*)mrb_ary_ptr(ary));
return ary;
}
|
#ifndef _ROS_pcl_msgs_Vertices_h
#define _ROS_pcl_msgs_Vertices_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
namespace pcl_msgs
{
class Vertices : public ros::Msg
{
public:
uint8_t vertices_length;
uint32_t st_vertices;
uint32_t * vertices;
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
*(outbuffer + offset++) = vertices_length;
*(outbuffer + offset++) = 0;
*(outbuffer + offset++) = 0;
*(outbuffer + offset++) = 0;
for( uint8_t i = 0; i < vertices_length; i++){
*(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF;
offset += sizeof(this->vertices[i]);
}
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
uint8_t vertices_lengthT = *(inbuffer + offset++);
if(vertices_lengthT > vertices_length)
this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t));
offset += 3;
vertices_length = vertices_lengthT;
for( uint8_t i = 0; i < vertices_length; i++){
this->st_vertices = ((uint32_t) (*(inbuffer + offset)));
this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
offset += sizeof(this->st_vertices);
memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t));
}
return offset;
}
const char * getType(){ return "pcl_msgs/Vertices"; };
const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; };
};
}
#endif
|
/*
* Copyright (C) 2013 Google 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 Google 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
* 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.
*/
#ifndef AnimatableNeutral_h
#define AnimatableNeutral_h
#include "core/animation/animatable/AnimatableValue.h"
namespace blink {
class AnimatableNeutral FINAL : public AnimatableValue {
public:
virtual ~AnimatableNeutral() { }
virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
protected:
static PassRefPtrWillBeRawPtr<AnimatableNeutral> create() { return adoptRefWillBeNoop(new AnimatableNeutral()); }
virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue* value, double fraction) const OVERRIDE
{
ASSERT_NOT_REACHED();
return nullptr;
}
private:
friend class AnimatableValue;
virtual AnimatableType type() const OVERRIDE { return TypeNeutral; }
virtual bool equalTo(const AnimatableValue* value) const OVERRIDE
{
ASSERT_NOT_REACHED();
return true;
}
};
} // namespace blink
#endif // AnimatableNeutral_h
|
/* Copyright (c) 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GTLSQLAdminBackupRun.h
//
// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
// Cloud SQL Administration API (sqladmin/v1beta3)
// Description:
// API for Cloud SQL database instance management.
// Documentation:
// https://developers.google.com/cloud-sql/docs/admin-api/
// Classes:
// GTLSQLAdminBackupRun (0 custom class methods, 9 custom properties)
#if GTL_BUILT_AS_FRAMEWORK
#import "GTL/GTLObject.h"
#else
#import "GTLObject.h"
#endif
@class GTLSQLAdminOperationError;
// ----------------------------------------------------------------------------
//
// GTLSQLAdminBackupRun
//
// A database instance backup run resource.
@interface GTLSQLAdminBackupRun : GTLObject
// Backup Configuration identifier.
@property (copy) NSString *backupConfiguration;
// The due time of this run in UTC timezone in RFC 3339 format, for example
// 2012-11-15T16:19:00.094Z.
@property (retain) GTLDateTime *dueTime;
// The time the backup operation completed in UTC timezone in RFC 3339 format,
// for example 2012-11-15T16:19:00.094Z.
@property (retain) GTLDateTime *endTime;
// The time the run was enqueued in UTC timezone in RFC 3339 format, for example
// 2012-11-15T16:19:00.094Z.
@property (retain) GTLDateTime *enqueuedTime;
// Information about why the backup operation failed. This is only present if
// the run has the FAILED status.
@property (retain) GTLSQLAdminOperationError *error;
// Name of the database instance.
@property (copy) NSString *instance;
// This is always sql#backupRun.
@property (copy) NSString *kind;
// The time the backup operation actually started in UTC timezone in RFC 3339
// format, for example 2012-11-15T16:19:00.094Z.
@property (retain) GTLDateTime *startTime;
// The status of this run.
@property (copy) NSString *status;
@end
|
/*
* Copyright (c) 2013-2016 TRUSTONIC LIMITED
* 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.
*/
#ifndef _GP_TCI_H_
#define _GP_TCI_H_
struct tee_value {
u32 a;
u32 b;
};
struct _teec_memory_reference_internal {
u32 sva;
u32 len;
u32 output_size;
};
union _teec_parameter_internal {
struct tee_value value;
struct _teec_memory_reference_internal memref;
};
enum _teec_tci_type {
_TA_OPERATION_OPEN_SESSION = 1,
_TA_OPERATION_INVOKE_COMMAND = 2,
_TA_OPERATION_CLOSE_SESSION = 3,
};
struct _teec_operation_internal {
enum _teec_tci_type type;
u32 command_id;
u32 param_types;
union _teec_parameter_internal params[4];
bool is_cancelled;
u8 rfu_padding[3];
};
struct _teec_tci {
char header[8];
struct teec_uuid destination;
struct _teec_operation_internal operation;
u32 ready;
u32 return_origin;
u32 return_status;
};
/**
* Termination codes
*/
#define TA_EXIT_CODE_PANIC 300
#define TA_EXIT_CODE_TCI 301
#define TA_EXIT_CODE_PARAMS 302
#define TA_EXIT_CODE_FINISHED 303
#define TA_EXIT_CODE_SESSIONSTATE 304
#define TA_EXIT_CODE_CREATEFAILED 305
#endif /* _GP_TCI_H_ */
|
/*
Bluefruit Protocol for TMK firmware
Author: Benjamin Gould, 2013
Based on code Copyright 2011 Jun Wako <wakojun@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, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include "host.h"
#include "report.h"
#include "print.h"
#include "debug.h"
#include "host_driver.h"
#include "serial.h"
#include "bluefruit.h"
#define BLUEFRUIT_TRACE_SERIAL 1
static uint8_t bluefruit_keyboard_leds = 0;
static void bluefruit_serial_send(uint8_t);
void bluefruit_keyboard_print_report(report_keyboard_t *report) {
if (!debug_keyboard) return;
dprintf("keys: ");
for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
debug_hex8(report->keys[i]);
dprintf(" ");
}
dprintf(" mods: ");
debug_hex8(report->mods);
dprintf(" reserved: ");
debug_hex8(report->reserved);
dprintf("\n");
}
#ifdef BLUEFRUIT_TRACE_SERIAL
static void bluefruit_trace_header() {
dprintf("+------------------------------------+\n");
dprintf("| HID report to Bluefruit via serial |\n");
dprintf("+------------------------------------+\n|");
}
static void bluefruit_trace_footer() { dprintf("|\n+------------------------------------+\n\n"); }
#endif
static void bluefruit_serial_send(uint8_t data) {
#ifdef BLUEFRUIT_TRACE_SERIAL
dprintf(" ");
debug_hex8(data);
dprintf(" ");
#endif
serial_send(data);
}
/*------------------------------------------------------------------*
* Host driver
*------------------------------------------------------------------*/
static uint8_t keyboard_leds(void);
static void send_keyboard(report_keyboard_t *report);
static void send_mouse(report_mouse_t *report);
static void send_system(uint16_t data);
static void send_consumer(uint16_t data);
void sendString(char string[], int length) {
for (int i = 0; i < length; i++) {
serial_send(string[i]);
}
}
static host_driver_t driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer};
host_driver_t *bluefruit_driver(void) { return &driver; }
static uint8_t keyboard_leds(void) { return bluefruit_keyboard_leds; }
static void send_keyboard(report_keyboard_t *report) {
#ifdef BLUEFRUIT_TRACE_SERIAL
bluefruit_trace_header();
#endif
bluefruit_serial_send(0xFD);
for (uint8_t i = 0; i < KEYBOARD_REPORT_SIZE; i++) {
bluefruit_serial_send(report->raw[i]);
}
#ifdef BLUEFRUIT_TRACE_SERIAL
bluefruit_trace_footer();
#endif
}
static void send_mouse(report_mouse_t *report) {
#ifdef BLUEFRUIT_TRACE_SERIAL
bluefruit_trace_header();
#endif
bluefruit_serial_send(0xFD);
bluefruit_serial_send(0x00);
bluefruit_serial_send(0x03);
bluefruit_serial_send(report->buttons);
bluefruit_serial_send(report->x);
bluefruit_serial_send(report->y);
bluefruit_serial_send(report->v); // should try sending the wheel v here
bluefruit_serial_send(report->h); // should try sending the wheel h here
bluefruit_serial_send(0x00);
#ifdef BLUEFRUIT_TRACE_SERIAL
bluefruit_trace_footer();
#endif
}
static void send_system(uint16_t data) {}
/*
+-----------------+-------------------+-------+
| Consumer Key | Bit Map | Hex |
+-----------------+-------------------+-------+
| Home | 00000001 00000000 | 01 00 |
| KeyboardLayout | 00000010 00000000 | 02 00 |
| Search | 00000100 00000000 | 04 00 |
| Snapshot | 00001000 00000000 | 08 00 |
| VolumeUp | 00010000 00000000 | 10 00 |
| VolumeDown | 00100000 00000000 | 20 00 |
| Play/Pause | 01000000 00000000 | 40 00 |
| Fast Forward | 10000000 00000000 | 80 00 |
| Rewind | 00000000 00000001 | 00 01 |
| Scan Next Track | 00000000 00000010 | 00 02 |
| Scan Prev Track | 00000000 00000100 | 00 04 |
| Random Play | 00000000 00001000 | 00 08 |
| Stop | 00000000 00010000 | 00 10 |
+-------------------------------------+-------+
*/
#define CONSUMER2BLUEFRUIT(usage) (usage == AUDIO_MUTE ? 0x0000 : (usage == AUDIO_VOL_UP ? 0x1000 : (usage == AUDIO_VOL_DOWN ? 0x2000 : (usage == TRANSPORT_NEXT_TRACK ? 0x0002 : (usage == TRANSPORT_PREV_TRACK ? 0x0004 : (usage == TRANSPORT_STOP ? 0x0010 : (usage == TRANSPORT_STOP_EJECT ? 0x0000 : (usage == TRANSPORT_PLAY_PAUSE ? 0x4000 : (usage == AL_CC_CONFIG ? 0x0000 : (usage == AL_EMAIL ? 0x0000 : (usage == AL_CALCULATOR ? 0x0000 : (usage == AL_LOCAL_BROWSER ? 0x0000 : (usage == AC_SEARCH ? 0x0400 : (usage == AC_HOME ? 0x0100 : (usage == AC_BACK ? 0x0000 : (usage == AC_FORWARD ? 0x0000 : (usage == AC_STOP ? 0x0000 : (usage == AC_REFRESH ? 0x0000 : (usage == AC_BOOKMARKS ? 0x0000 : 0)))))))))))))))))))
static void send_consumer(uint16_t data) {
static uint16_t last_data = 0;
if (data == last_data) return;
last_data = data;
uint16_t bitmap = CONSUMER2BLUEFRUIT(data);
#ifdef BLUEFRUIT_TRACE_SERIAL
dprintf("\nData: ");
debug_hex16(data);
dprintf("; bitmap: ");
debug_hex16(bitmap);
dprintf("\n");
bluefruit_trace_header();
#endif
bluefruit_serial_send(0xFD);
bluefruit_serial_send(0x00);
bluefruit_serial_send(0x02);
bluefruit_serial_send((bitmap >> 8) & 0xFF);
bluefruit_serial_send(bitmap & 0xFF);
bluefruit_serial_send(0x00);
bluefruit_serial_send(0x00);
bluefruit_serial_send(0x00);
bluefruit_serial_send(0x00);
#ifdef BLUEFRUIT_TRACE_SERIAL
bluefruit_trace_footer();
#endif
}
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#ifndef AP_Compass_AK8963_H
#define AP_Compass_AK8963_H
#include <AP_HAL/AP_HAL.h>
#include <AP_Common/AP_Common.h>
#include <AP_Math/AP_Math.h>
#include "Compass.h"
#include "AP_Compass_Backend.h"
class AP_AK8963_SerialBus
{
public:
struct PACKED raw_value {
int16_t val[3];
uint8_t st2;
};
virtual ~AP_AK8963_SerialBus() { }
virtual void register_read(uint8_t reg, uint8_t *value, uint8_t count) = 0;
uint8_t register_read(uint8_t reg) {
uint8_t value;
register_read(reg, &value, 1);
return value;
}
virtual void register_write(uint8_t reg, uint8_t value) = 0;
virtual AP_HAL::Semaphore* get_semaphore() = 0;
virtual bool configure() = 0;
virtual bool start_measurements() = 0;
virtual void read_raw(struct raw_value *rv) = 0;
virtual uint32_t get_dev_id() = 0;
};
class AP_Compass_AK8963 : public AP_Compass_Backend
{
public:
static AP_Compass_Backend *detect_mpu9250(Compass &compass, AP_HAL::SPIDeviceDriver *spi);
static AP_Compass_Backend *detect_i2c(Compass &compass,
AP_HAL::I2CDriver *i2c,
uint8_t addr);
AP_Compass_AK8963(Compass &compass, AP_AK8963_SerialBus *bus);
~AP_Compass_AK8963();
bool init(void);
void read(void);
void accumulate(void);
private:
static AP_Compass_Backend *_detect(Compass &compass, AP_AK8963_SerialBus *bus);
void _make_factory_sensitivity_adjustment(Vector3f& field) const;
void _make_adc_sensitivity_adjustment(Vector3f& field) const;
Vector3f _get_filtered_field() const;
void _reset_filter();
bool _reset();
bool _setup_mode();
bool _check_id();
bool _calibrate();
void _update();
void _dump_registers();
bool _sem_take_blocking();
bool _sem_take_nonblocking();
bool _sem_give();
float _magnetometer_ASA[3] {0, 0, 0};
uint8_t _compass_instance;
float _mag_x_accum;
float _mag_y_accum;
float _mag_z_accum;
uint32_t _accum_count;
bool _initialized;
uint32_t _last_update_timestamp;
uint32_t _last_accum_time;
AP_AK8963_SerialBus *_bus = nullptr;
AP_HAL::Semaphore *_bus_sem;
};
class AP_AK8963_SerialBus_MPU9250: public AP_AK8963_SerialBus
{
public:
AP_AK8963_SerialBus_MPU9250(AP_HAL::SPIDeviceDriver *spi);
void register_read(uint8_t reg, uint8_t *value, uint8_t count);
void register_write(uint8_t reg, uint8_t value);
AP_HAL::Semaphore* get_semaphore();
bool configure();
bool start_measurements();
void read_raw(struct raw_value *rv);
uint32_t get_dev_id();
private:
void _read(uint8_t reg, uint8_t *value, uint32_t count);
void _write(uint8_t reg, const uint8_t *value, uint32_t count);
void _write(uint8_t reg, const uint8_t value) {
_write(reg, &value, 1);
}
AP_HAL::SPIDeviceDriver *_spi;
};
class AP_AK8963_SerialBus_I2C: public AP_AK8963_SerialBus
{
public:
AP_AK8963_SerialBus_I2C(AP_HAL::I2CDriver *i2c, uint8_t addr);
void register_read(uint8_t reg, uint8_t *value, uint8_t count);
void register_write(uint8_t reg, uint8_t value);
AP_HAL::Semaphore* get_semaphore();
bool configure(){ return true; }
bool start_measurements() { return true; }
void read_raw(struct raw_value *rv);
uint32_t get_dev_id();
private:
void _read(uint8_t reg, uint8_t *value, uint32_t count);
void _write(uint8_t reg, const uint8_t *value, uint32_t count);
void _write(uint8_t reg, const uint8_t value) {
_write(reg, &value, 1);
}
AP_HAL::I2CDriver *_i2c;
uint8_t _addr;
};
#endif
|
/****************************************************************************
*
* The MIT License (MIT)
*
* Copyright (c) 2014 Vivante Corporation
*
* 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.
*
*****************************************************************************
*
* The GPL License (GPL)
*
* Copyright (C) 2014 Vivante Corporation
*
* 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.
*
*****************************************************************************
*
* Note: This software is released under dual MIT and GPL licenses. A
* recipient may use this file under the terms of either the MIT license or
* GPL License. If you wish to use only one license not the other, you can
* indicate your decision by deleting one of the above license notices in your
* version of this file.
*
*****************************************************************************/
#ifndef __gc_hal_dump_h_
#define __gc_hal_dump_h_
#ifdef __cplusplus
extern "C" {
#endif
/*
** FILE LAYOUT:
**
** gcsDUMP_FILE structure
**
** gcsDUMP_DATA frame
** gcsDUMP_DATA or gcDUMP_DATA_SIZE records rendingring the frame
** gctUINT8 data[length]
*/
#define gcvDUMP_FILE_SIGNATURE gcmCC('g','c','D','B')
typedef struct _gcsDUMP_FILE
{
gctUINT32 signature; /* File signature */
gctSIZE_T length; /* Length of file */
gctUINT32 frames; /* Number of frames in file */
}
gcsDUMP_FILE;
typedef enum _gceDUMP_TAG
{
gcvTAG_SURFACE = gcmCC('s','u','r','f'),
gcvTAG_FRAME = gcmCC('f','r','m',' '),
gcvTAG_COMMAND = gcmCC('c','m','d',' '),
gcvTAG_INDEX = gcmCC('i','n','d','x'),
gcvTAG_STREAM = gcmCC('s','t','r','m'),
gcvTAG_TEXTURE = gcmCC('t','e','x','t'),
gcvTAG_RENDER_TARGET = gcmCC('r','n','d','r'),
gcvTAG_DEPTH = gcmCC('z','b','u','f'),
gcvTAG_RESOLVE = gcmCC('r','s','l','v'),
gcvTAG_DELETE = gcmCC('d','e','l',' '),
gcvTAG_BUFOBJ = gcmCC('b','u','f','o'),
}
gceDUMP_TAG;
typedef struct _gcsDUMP_SURFACE
{
gceDUMP_TAG type; /* Type of record. */
gctUINT32 address; /* Address of the surface. */
gctINT16 width; /* Width of surface. */
gctINT16 height; /* Height of surface. */
gceSURF_FORMAT format; /* Surface pixel format. */
gctSIZE_T length; /* Number of bytes inside the surface. */
}
gcsDUMP_SURFACE;
typedef struct _gcsDUMP_DATA
{
gceDUMP_TAG type; /* Type of record. */
gctSIZE_T length; /* Number of bytes of data. */
gctUINT32 address; /* Address for the data. */
}
gcsDUMP_DATA;
#ifdef __cplusplus
}
#endif
#endif /* __gc_hal_dump_h_ */
|
/* Generated from ../../../git/cloog/test/isl/mod3.cloog by CLooG 0.14.0-325-g62da9f7 gmp bits in 0.02s. */
for (i=max(0,32*h0-1991);i<=min(999,32*h0+31);i++) {
if ((63*i+32*h0+31)%64 <= 62) {
for (j=0;j<=999;j++) {
S1(i,j);
}
}
}
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <React/RCTEventEmitter.h>
@interface RCTKeyboardObserver : RCTEventEmitter
@end
|
// 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 CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
#include "base/compiler_specific.h"
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/window/non_client_view.h"
class BrowserView;
class GlassBrowserFrameView : public BrowserNonClientFrameView,
public views::ButtonListener,
public content::NotificationObserver {
public:
// Constructs a non-client view for an BrowserFrame.
GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view);
virtual ~GlassBrowserFrameView();
// BrowserNonClientFrameView:
virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override;
virtual int GetTopInset() const override;
virtual int GetThemeBackgroundXInset() const override;
virtual void UpdateThrobber(bool running) override;
virtual gfx::Size GetMinimumSize() const override;
// views::NonClientFrameView:
virtual gfx::Rect GetBoundsForClientView() const override;
virtual gfx::Rect GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const override;
virtual int NonClientHitTest(const gfx::Point& point) override;
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask)
override {}
virtual void ResetWindowControls() override {}
virtual void UpdateWindowIcon() override {}
virtual void UpdateWindowTitle() override {}
virtual void SizeConstraintsChanged() override {}
protected:
// views::View:
virtual void OnPaint(gfx::Canvas* canvas) override;
virtual void Layout() override;
// views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
private:
// views::NonClientFrameView:
virtual bool DoesIntersectRect(const views::View* target,
const gfx::Rect& rect) const override;
// Returns the thickness of the border that makes up the window frame edges.
// This does not include any client edge.
int FrameBorderThickness() const;
// Returns the thickness of the entire nonclient left, right, and bottom
// borders, including both the window frame and any client edge.
int NonClientBorderThickness() const;
// Returns the height of the entire nonclient top border, including the window
// frame, any title area, and any connected client edge.
int NonClientTopBorderHeight() const;
// Paint various sub-components of this view.
void PaintToolbarBackground(gfx::Canvas* canvas);
void PaintRestoredClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutAvatar();
void LayoutNewStyleAvatar();
void LayoutClientView();
// Returns the insets of the client area.
gfx::Insets GetClientAreaInsets() const;
// Returns the bounds of the client area for the specified view size.
gfx::Rect CalculateClientAreaBounds(int width, int height) const;
// Starts/Stops the window throbber running.
void StartThrobber();
void StopThrobber();
// Displays the next throbber frame.
void DisplayNextThrobberFrame();
// content::NotificationObserver implementation:
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
// The layout rect of the avatar icon, if visible.
gfx::Rect avatar_bounds_;
// The bounds of the ClientView.
gfx::Rect client_view_bounds_;
// Whether or not the window throbber is currently animating.
bool throbber_running_;
// The index of the current frame of the throbber animation.
int throbber_frame_;
content::NotificationRegistrar registrar_;
static const int kThrobberIconCount = 24;
static HICON throbber_icons_[kThrobberIconCount];
static void InitThrobberIcons();
DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView);
};
#endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
|
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// fxc /nologo /E PS_FtoF_UM_RGBA_4444_2D /T ps_4_0 /Fh
// compiled\multiplyalpha_ftof_um_rgba_4444_2d_ps.h MultiplyAlpha.hlsl
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Sampler sampler NA NA 0 1
// TextureF texture float4 2d 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_POSITION 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
lt r1.x, l(0.000000), r0.w
div r1.yzw, r0.xxyz, r0.wwww
movc r0.xyz, r1.xxxx, r1.yzwy, r0.xyzx
mul r0.xyzw, r0.xyzw, l(15.000000, 15.000000, 15.000000, 15.000000)
round_ne r0.xyzw, r0.xyzw
mul o0.xyzw, r0.xyzw, l(0.066667, 0.066667, 0.066667, 0.066667)
ret
// Approximately 8 instruction slots used
#endif
const BYTE g_PS_FtoF_UM_RGBA_4444_2D[] = {
68, 88, 66, 67, 222, 241, 125, 211, 53, 8, 171, 225, 195, 188, 22, 118, 155, 53, 136,
73, 1, 0, 0, 0, 24, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 156, 2, 0, 0, 82, 68, 69, 70, 160,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0,
0, 4, 255, 255, 0, 1, 0, 0, 109, 0, 0, 0, 92, 0, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 100, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4,
0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0,
83, 97, 109, 112, 108, 101, 114, 0, 84, 101, 120, 116, 117, 114, 101, 70, 0, 77, 105,
99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104,
97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 57, 46, 50, 57, 46,
57, 53, 50, 46, 51, 49, 49, 49, 0, 171, 171, 73, 83, 71, 78, 80, 0, 0, 0,
2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83,
86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68,
0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0,
0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
72, 68, 82, 44, 1, 0, 0, 64, 0, 0, 0, 75, 0, 0, 0, 90, 0, 0, 3,
0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0,
0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 2, 0, 0, 0, 69,
0, 0, 9, 242, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0,
70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 49, 0, 0,
7, 18, 0, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0, 14, 0, 0, 7, 226, 0, 16, 0, 1, 0, 0, 0, 6,
9, 16, 0, 0, 0, 0, 0, 246, 15, 16, 0, 0, 0, 0, 0, 55, 0, 0, 9,
114, 0, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0, 0, 0, 150, 7, 16,
0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 242, 0,
16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0,
0, 112, 65, 0, 0, 112, 65, 0, 0, 112, 65, 0, 0, 112, 65, 64, 0, 0, 5,
242, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 56, 0, 0,
10, 242, 32, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 2, 64,
0, 0, 137, 136, 136, 61, 137, 136, 136, 61, 137, 136, 136, 61, 137, 136, 136, 61, 62,
0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
//
// NSObject+abc.h
// dummy
//
// Created by Mark Larsen on 5/9/14.
// Copyright (c) 2014 marklarr. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (abc)
@end
|
/* Copyright (c) 2008-2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT 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.
*
*/
/*
* SPI driver for Qualcomm QSD platforms.
*/
struct msm_spi_platform_data {
u32 max_clock_speed;
int (*gpio_config)(void);
void (*gpio_release)(void);
};
|
/*
* Copyright (c) Huawei Technologies Co., Ltd., 2015
* 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.
*/
/*
* Verify that:
* If a user ID has no mapping inside the namespace, user ID and group
* ID will be the value defined in the file /proc/sys/kernel/overflowuid(65534)
* and /proc/sys/kernel/overflowgid(65534). A child process has a full set
* of permitted and effective capabilities, even though the program was
* run from an unprivileged account.
*/
#define _GNU_SOURCE
#include <sys/wait.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "test.h"
#include "libclone.h"
#include "userns_helper.h"
#include "config.h"
#if HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
#endif
#define OVERFLOWUIDPATH "/proc/sys/kernel/overflowuid"
#define OVERFLOWGIDPATH "/proc/sys/kernel/overflowgid"
char *TCID = "user_namespace1";
int TST_TOTAL = 1;
static long overflowuid;
static long overflowgid;
/*
* child_fn1() - Inside a new user namespace
*/
static int child_fn1(void *arg LTP_ATTRIBUTE_UNUSED)
{
int exit_val = 0;
int uid, gid;
#ifdef HAVE_LIBCAP
cap_t caps;
int i, last_cap;
cap_flag_value_t flag_val;
#endif
uid = geteuid();
gid = getegid();
tst_resm(TINFO, "USERNS test is running in a new user namespace.");
if (uid != overflowuid || gid != overflowgid) {
printf("Got unexpected result of uid=%d gid=%d\n", uid, gid);
exit_val = 1;
}
#ifdef HAVE_LIBCAP
caps = cap_get_proc();
SAFE_FILE_SCANF(NULL, "/proc/sys/kernel/cap_last_cap", "%d", &last_cap);
for (i = 0; i <= last_cap; i++) {
cap_get_flag(caps, i, CAP_EFFECTIVE, &flag_val);
if (flag_val == 0)
break;
cap_get_flag(caps, i, CAP_PERMITTED, &flag_val);
if (flag_val == 0)
break;
}
if (flag_val == 0) {
printf("unexpected effective/permitted caps at %d\n", i);
exit_val = 1;
}
#else
printf("System is missing libcap.\n");
#endif
return exit_val;
}
static void setup(void)
{
check_newuser();
SAFE_FILE_SCANF(NULL, OVERFLOWUIDPATH, "%ld", &overflowuid);
SAFE_FILE_SCANF(NULL, OVERFLOWGIDPATH, "%ld", &overflowgid);
}
int main(int argc, char *argv[])
{
int lc;
tst_parse_opts(argc, argv, NULL, NULL);
setup();
for (lc = 0; TEST_LOOPING(lc); lc++) {
TEST(do_clone_unshare_test(T_CLONE, CLONE_NEWUSER,
child_fn1, NULL));
if (TEST_RETURN == -1)
tst_brkm(TFAIL | TTERRNO, NULL, "clone failed");
tst_record_childstatus(NULL, -1);
}
tst_exit();
}
|
/*
* Copyright (C) 2007 Oracle. 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 v2 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., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/
#ifndef __PRINT_TREE_
#define __PRINT_TREE_
void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l);
void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *t, int follow);
void btrfs_print_key(struct btrfs_disk_key *disk_key);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.