text stringlengths 4 6.14k |
|---|
//
// XHNewsDetailViewController.h
// XHNewsFramework
//
// Created by 曾 宪华 on 14-1-29.
// Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved.
//
#import <UIKit/UIKit.h>
#import "XHNewsDetail.h"
@interface XHNewsDetailViewController : UIViewController
@property (nonatomic, strong) XHNewsDetail *newsDetail;
@end
|
@class SBAwayBulletinListItem;
@protocol SBLockScreenNotificationModel
- (SBAwayBulletinListItem *)listItemAtIndexPath:(NSIndexPath *)indexPath;
@end
|
#import "FSSwitchPanel.h"
#import "FSSwitchDataSource.h"
|
//
// firfilt_crcf_example.c
//
// Complex finite impulse response filter example. Demonstrates the
// functionality of firfilt by designing a low-order prototype and using it
// to filter a noisy signal. The filter coefficients are real, but the
// input and output arrays are complex. The filter order and cutoff
// frequency are specified at the beginning.
//
#include <stdio.h>
#include <math.h>
#include <complex.h>
#include "liquid.h"
#define OUTPUT_FILENAME "firfilt_crcf_example.m"
int main() {
// options
unsigned int h_len=65; // filter length
float fc=0.1f; // cutoff frequency
float As=60.0f; // stop-band attenuation
unsigned int n=240; // number of samples
// design filter from prototype and scale to bandwidth
firfilt_crcf q = firfilt_crcf_create_kaiser(h_len, fc, As, 0.0f);
firfilt_crcf_set_scale(q, 2.0f*fc);
firfilt_crcf_print(q);
unsigned int i;
// allocate memory for data arrays
float complex x[n];
float complex y[n];
// generate input signal (sine wave with decaying amplitude)
unsigned int wlen = (unsigned int)roundf(0.75*n);
for (i=0; i<n; i++) {
// generate input signal
x[i] = 0.7f*cexpf(2*M_PI*0.057f*_Complex_I*i) +
0.3f*cexpf(2*M_PI*0.357f*_Complex_I*i);
// apply window
x[i] *= i < wlen ? hamming(i,wlen) : 0;
// run filter
firfilt_crcf_push(q, x[i]);
firfilt_crcf_execute(q, &y[i]);
}
// compute response
unsigned int nfft = 1024;
float complex H[nfft];
for (i=0; i<nfft; i++) {
float freq = ((float)i - 0.5f*(float)nfft) / (float)nfft;
firfilt_crcf_freqresponse(q, freq, &H[i]);
}
// destroy filter object
firfilt_crcf_destroy(q);
//
// plot results to output file
//
FILE * fid = fopen(OUTPUT_FILENAME,"w");
fprintf(fid,"%% %s : auto-generated file\n", OUTPUT_FILENAME);
fprintf(fid,"clear all;\n");
fprintf(fid,"close all;\n");
fprintf(fid,"\n");
fprintf(fid,"h_len=%u;\n", h_len);
fprintf(fid,"n=%u;\n",n);
fprintf(fid,"nfft=%u;\n",nfft);
fprintf(fid,"x=zeros(1,n);\n");
fprintf(fid,"y=zeros(1,n);\n");
fprintf(fid,"H=zeros(1,nfft);\n");
for (i=0; i<n; i++) {
//printf("%4u : %12.8f + j*%12.8f\n", i, crealf(y), cimagf(y));
fprintf(fid,"x(%4u) = %12.4e + j*%12.4e;\n", i+1, crealf(x[i]), cimagf(x[i]));
fprintf(fid,"y(%4u) = %12.4e + j*%12.4e;\n", i+1, crealf(y[i]), cimagf(y[i]));
}
for (i=0; i<nfft; i++)
fprintf(fid,"H(%4u) = %12.8f + j*%12.8f;\n", i+1, crealf(H[i]), cimagf(H[i]));
// plot output
fprintf(fid,"tx=0:(n-1);\n");
fprintf(fid,"ty=tx - (h_len-1)/2;\n");
fprintf(fid,"figure;\n");
fprintf(fid,"subplot(2,1,1);\n");
fprintf(fid," plot(tx,real(x),'-','Color',[1 1 1]*0.5,'LineWidth',1,...\n");
fprintf(fid," ty,real(y),'-','Color',[0 0.5 0.25],'LineWidth',2);\n");
fprintf(fid," xlabel('time');\n");
fprintf(fid," ylabel('real');\n");
fprintf(fid," legend('input','filtered output','location','northeast');\n");
fprintf(fid," grid on;\n");
fprintf(fid,"subplot(2,1,2);\n");
fprintf(fid," plot(tx,imag(x),'-','Color',[1 1 1]*0.5,'LineWidth',1,...\n");
fprintf(fid," ty,imag(y),'-','Color',[0 0.25 0.5],'LineWidth',2);\n");
fprintf(fid," xlabel('time');\n");
fprintf(fid," ylabel('imag');\n");
fprintf(fid," legend('input','filtered output','location','northeast');\n");
fprintf(fid," grid on;\n");
// plot frequency response
fprintf(fid,"f = [0:(nfft-1)]/nfft - 0.5;\n");
fprintf(fid,"g = 1/sum(abs(x));\n");
fprintf(fid,"X = 20*log10(abs(fftshift(fft(x*g,nfft))));\n");
fprintf(fid,"Y = 20*log10(abs(fftshift(fft(y*g,nfft))));\n");
fprintf(fid,"figure;\n");
fprintf(fid,"plot(f,X,'Color',[1 1 1]*0.5,'LineWidth',1,...\n");
fprintf(fid," f,Y,'Color',[0 0.5 0.25],'LineWidth',2,...\n");
fprintf(fid," f,20*log10(abs(H)),'Color',[0 0.25 0.5],'LineWidth',1);\n");
fprintf(fid,"axis([-0.5 0.5 -120 20]);\n");
fprintf(fid,"grid on;\n");
fprintf(fid,"xlabel('Normalized Frequency [f/F_s]');\n");
fprintf(fid,"ylabel('Power Spectral Density [dB]');\n");
fprintf(fid,"legend('input','output','filter','location','northeast');\n");
fclose(fid);
printf("results written to %s.\n", OUTPUT_FILENAME);
printf("done.\n");
return 0;
}
|
#import "SentryDefines.h"
#import <Foundation/Foundation.h>
@class SentryStacktrace, SentryFrameRemover, SentryCrashStackEntryMapper;
NS_ASSUME_NONNULL_BEGIN
/** Uses SentryCrash internally to retrieve the stacktrace.
*/
@interface SentryStacktraceBuilder : NSObject
SENTRY_NO_INIT
- (id)initWithCrashStackEntryMapper:(SentryCrashStackEntryMapper *)crashStackEntryMapper;
/**
* Builds the stacktrace for the current thread removing frames from the SentrySDK until frames from
* a different package are found. When including Sentry via the Swift Package Manager the package is
* the same as the application that includes Sentry. In this case the full stacktrace is returned
* without skipping frames.
*/
- (SentryStacktrace *)buildStacktraceForCurrentThread;
@end
NS_ASSUME_NONNULL_END
|
/* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern float strtof(char const *str , char const *endptr ) ;
extern void signal(int sig , void *func ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned short input[1] , unsigned short output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
void megaInit(void)
{
{
}
}
int main(int argc , char *argv[] )
{
unsigned short input[1] ;
unsigned short output[1] ;
int randomFuns_i5 ;
unsigned short randomFuns_value6 ;
int randomFuns_main_i7 ;
{
megaInit();
if (argc != 2) {
printf("Call this program with %i arguments\n", 1);
exit(-1);
} else {
}
randomFuns_i5 = 0;
while (randomFuns_i5 < 1) {
randomFuns_value6 = (unsigned short )strtoul(argv[randomFuns_i5 + 1], 0, 10);
input[randomFuns_i5] = randomFuns_value6;
randomFuns_i5 ++;
}
RandomFunc(input, output);
if (output[0] == (unsigned short)31026) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
void RandomFunc(unsigned short input[1] , unsigned short output[1] )
{
unsigned short state[1] ;
unsigned short local1 ;
char copy11 ;
char copy12 ;
{
state[0UL] = (input[0UL] - 51238316UL) - (unsigned short)47038;
local1 = 0UL;
while (local1 < input[1UL]) {
if (state[0UL] > local1) {
if (state[0UL] <= local1) {
copy11 = *((char *)(& state[local1]) + 1);
*((char *)(& state[local1]) + 1) = *((char *)(& state[local1]) + 0);
*((char *)(& state[local1]) + 0) = copy11;
copy11 = *((char *)(& state[local1]) + 0);
*((char *)(& state[local1]) + 0) = *((char *)(& state[local1]) + 1);
*((char *)(& state[local1]) + 1) = copy11;
copy12 = *((char *)(& state[local1]) + 0);
*((char *)(& state[local1]) + 0) = *((char *)(& state[local1]) + 1);
*((char *)(& state[local1]) + 1) = copy12;
} else {
state[local1] += state[local1];
state[local1] |= ((state[local1] + state[0UL]) & (unsigned short)15) << 2UL;
}
} else {
state[local1] |= (state[local1] * state[local1] & (unsigned short)63) << 4UL;
}
local1 ++;
}
output[0UL] = state[0UL] * 1062470260UL;
}
}
|
/*++
/* NAME
/* postscreen_haproxy 3
/* SUMMARY
/* haproxy protocol adapter
/* SYNOPSIS
/* #include <postscreen_haproxy.h>
/*
/* void psc_endpt_haproxy_lookup(smtp_client_stream, lookup_done)
/* VSTRING *smtp_client_stream;
/* void (*lookup_done)(status, smtp_client_stream,
/* smtp_client_addr, smtp_client_port,
/* smtp_server_addr, smtp_server_port)
/* int status;
/* MAI_HOSTADDR_STR *smtp_client_addr;
/* MAI_SERVPORT_STR *smtp_client_port;
/* MAI_HOSTADDR_STR *smtp_server_addr;
/* MAI_SERVPORT_STR *smtp_server_port;
/* DESCRIPTION
/* psc_endpt_haproxy_lookup() looks up connection endpoint
/* information via the haproxy protocol. Arguments and results
/* conform to the postscreen_endpt(3) API.
/* LICENSE
/* .ad
/* .fi
/* The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/* Wietse Venema
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*--*/
/* System library. */
#include <sys_defs.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
/* Utility library. */
#include <msg.h>
#include <mymalloc.h>
#include <events.h>
#include <myaddrinfo.h>
#include <vstream.h>
#include <vstring.h>
#include <stringops.h>
/* Global library. */
#include <haproxy_srvr.h>
#include <mail_params.h>
/* Application-specific. */
#include <postscreen.h>
#include <postscreen_haproxy.h>
/*
* Per-session state.
*/
typedef struct {
VSTREAM *stream;
PSC_ENDPT_LOOKUP_FN notify;
VSTRING *buffer;
} PSC_HAPROXY_STATE;
/* psc_endpt_haproxy_event - read or time event */
static void psc_endpt_haproxy_event(int event, void *context)
{
const char *myname = "psc_endpt_haproxy_event";
PSC_HAPROXY_STATE *state = (PSC_HAPROXY_STATE *) context;
int status = 0;
MAI_HOSTADDR_STR smtp_client_addr;
MAI_SERVPORT_STR smtp_client_port;
MAI_HOSTADDR_STR smtp_server_addr;
MAI_SERVPORT_STR smtp_server_port;
int last_char = 0;
const char *err;
VSTRING *escape_buf;
char read_buf[HAPROXY_MAX_LEN];
ssize_t read_len;
char *cp;
/*
* We must not read(2) past the <CR><LF> that terminates the haproxy
* line. For efficiency reasons we read the entire haproxy line in one
* read(2) call when we know that the line is unfragmented. In the rare
* case that the line is fragmented, we fall back and read(2) it one
* character at a time.
*/
switch (event) {
case EVENT_TIME:
msg_warn("haproxy read: time limit exceeded");
status = -1;
break;
case EVENT_READ:
/* Determine the initial VSTREAM read(2) buffer size. */
if (VSTRING_LEN(state->buffer) == 0) {
if ((read_len = recv(vstream_fileno(state->stream),
read_buf, sizeof(read_buf) - 1, MSG_PEEK)) > 0
&& ((cp = memchr(read_buf, '\n', read_len)) != 0)) {
read_len = cp - read_buf + 1;
} else {
read_len = 1;
}
vstream_control(state->stream, CA_VSTREAM_CTL_BUFSIZE(read_len),
CA_VSTREAM_CTL_END);
}
/* Drain the VSTREAM buffer, otherwise this pseudo-thread will hang. */
do {
if ((last_char = VSTREAM_GETC(state->stream)) == VSTREAM_EOF) {
if (vstream_ferror(state->stream))
msg_warn("haproxy read: %m");
else
msg_warn("haproxy read: lost connection");
status = -1;
break;
}
if (VSTRING_LEN(state->buffer) >= HAPROXY_MAX_LEN) {
msg_warn("haproxy read: line too long");
status = -1;
break;
}
VSTRING_ADDCH(state->buffer, last_char);
} while (vstream_peek(state->stream) > 0);
break;
}
/*
* Parse the haproxy line. Note: the haproxy_srvr_parse() routine
* performs address protocol checks, address and port syntax checks, and
* converts IPv4-in-IPv6 address string syntax (:ffff::1.2.3.4) to IPv4
* syntax where permitted by the main.cf:inet_protocols setting.
*/
if (status == 0 && last_char == '\n') {
VSTRING_TERMINATE(state->buffer);
if ((err = haproxy_srvr_parse(vstring_str(state->buffer),
&smtp_client_addr, &smtp_client_port,
&smtp_server_addr, &smtp_server_port)) != 0) {
escape_buf = vstring_alloc(HAPROXY_MAX_LEN + 2);
escape(escape_buf, vstring_str(state->buffer),
VSTRING_LEN(state->buffer));
msg_warn("haproxy read: %s: %s", err, vstring_str(escape_buf));
status = -1;
vstring_free(escape_buf);
}
}
/*
* Are we done yet?
*/
if (status < 0 || last_char == '\n') {
PSC_CLEAR_EVENT_REQUEST(vstream_fileno(state->stream),
psc_endpt_haproxy_event, context);
vstream_control(state->stream,
CA_VSTREAM_CTL_BUFSIZE(VSTREAM_BUFSIZE),
CA_VSTREAM_CTL_END);
state->notify(status, state->stream,
&smtp_client_addr, &smtp_client_port,
&smtp_server_addr, &smtp_server_port);
/* Note: the stream may be closed at this point. */
vstring_free(state->buffer);
myfree((void *) state);
}
}
/* psc_endpt_haproxy_lookup - event-driven haproxy client */
void psc_endpt_haproxy_lookup(VSTREAM *stream,
PSC_ENDPT_LOOKUP_FN notify)
{
const char *myname = "psc_endpt_haproxy_lookup";
PSC_HAPROXY_STATE *state;
/*
* Prepare the per-session state. XXX To improve overload behavior,
* maintain a pool of these so that we can reduce memory allocator
* activity.
*/
state = (PSC_HAPROXY_STATE *) mymalloc(sizeof(*state));
state->stream = stream;
state->notify = notify;
state->buffer = vstring_alloc(100);
/*
* Read the haproxy line.
*/
PSC_READ_EVENT_REQUEST(vstream_fileno(stream), psc_endpt_haproxy_event,
(void *) state, var_psc_uproxy_tmout);
}
|
/* @(#)s_isnan.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/*
* isnan(x) returns 1 is x is nan, else 0;
* no branching!
*/
#include "math.h"
#include "math_private.h"
#undef __isnan
#ifdef __STDC__
int __isnan(double x)
#else
int __isnan(x)
double x;
#endif
{
int64_t hx;
EXTRACT_WORDS64(hx,x);
hx &= UINT64_C(0x7fffffffffffffff);
hx = UINT64_C(0x7ff0000000000000) - hx;
return (int)(((uint64_t)hx)>>63);
}
hidden_def (__isnan)
weak_alias (__isnan, isnan)
#ifdef NO_LONG_DOUBLE
strong_alias (__isnan, __isnanl)
weak_alias (__isnan, isnanl)
#endif
|
/******************************************************************************
* Wormux is a convivial mass murder game.
* Copyright (C) 2001-2007 Wormux Team.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
******************************************************************************
* Network client layer for Wormux.
*****************************************************************************/
#ifndef NETWORK_CLIENT_H
#define NETWORK_CLIENT_H
//-----------------------------------------------------------------------------
#include "network.h"
//-----------------------------------------------------------------------------
class NetworkClient : public Network
{
protected:
virtual void HandleAction(Action* a, DistantComputer* sender);
virtual void WaitActionSleep() {};
public:
NetworkClient();
~NetworkClient();
//virtual const bool IsConnected() const { return true; }
virtual const bool IsClient() const { return true; }
virtual void SendChatMessage(const std::string& txt);
std::list<DistantComputer*>::iterator CloseConnection(std::list<DistantComputer*>::iterator);
// Client specific methods
const connection_state_t ClientConnect(const std::string &host,
const std::string& port);
};
//-----------------------------------------------------------------------------
#endif
|
/**
* Copyright 2013 Albert Vaca <albertvaka@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) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef LINKPROVIDER_H
#define LINKPROVIDER_H
#include <QObject>
#include <QVector>
#include <QNetworkSession>
#include "../networkpackage.h"
class DeviceLink;
class LinkProvider
: public QObject
{
Q_OBJECT
public:
const static int PRIORITY_LOW = 0; //eg: 3g
const static int PRIORITY_MEDIUM = 50; //eg: internet
const static int PRIORITY_HIGH = 100; //eg: lan
LinkProvider();
virtual ~LinkProvider() { }
virtual QString name() = 0;
virtual int priority() = 0;
public Q_SLOTS:
virtual void onStart() = 0;
virtual void onStop() = 0;
virtual void onNetworkChange(QNetworkSession::State state) = 0;
Q_SIGNALS:
//NOTE: The provider will to destroy the DeviceLink when it's no longer accessible,
// and every user should listen to the destroyed signal to remove its references.
// That's the reason because there is no "onConnectionLost".
void onConnectionReceived(const NetworkPackage& identityPackage, DeviceLink*) const;
};
#endif
|
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * 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.
*
* 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.
*/
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <time.h>
int __rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo, const struct timespec *uts, size_t sigsetsize);
/* ok, this is really subtle: <asm/signal.h> defines sigset_t differently
* when you're in the kernel or in the C library.
*
* in the kernel, this is an array of 2 32-bit unsigned longs
* in the C library, this is a single 32-bit unsigned long
*
* moreover, the kernel implementation of rt_sigtimedwait doesn't
* accept anything except kernel-sized signal sets (probably a bug !)
*
* we thus need to create a fake kernel sigset !!
*/
int sigwait(const sigset_t *set, int *sig)
{
int ret;
#ifdef __mips__
/* use a union to get rid of aliasing warnings. On MIPS sigset_t is 128 bits */
union {
sigset_t kernel_sigset;
sigset_t dummy_sigset;
} u;
u.dummy_sigset = *set;
#else
/* use a union to get rid of aliasing warnings */
union {
unsigned long kernel_sigset[2];
sigset_t dummy_sigset;
} u;
u.kernel_sigset[0] = *set;
u.kernel_sigset[1] = 0; /* no real-time signals supported ? */
#endif
for (;;)
{
/* __rt_sigtimedwait can return EAGAIN or EINTR, we need to loop
* around them since sigwait is only allowed to return EINVAL
*/
ret = __rt_sigtimedwait ( &u.dummy_sigset, NULL, NULL, sizeof(u.kernel_sigset));
if (ret >= 0)
break;
if (errno != EAGAIN && errno != EINTR)
return errno;
}
*sig = ret;
return 0;
}
|
/***************************************************************************
qgsstatisticalsummarydockwidget.h
---------------------------------
begin : May 2015
copyright : (C) 2015 by Nyall Dawson
email : nyall dot dawson at gmail dot 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. *
* *
***************************************************************************/
#ifndef QGSSTATISTICALSUMMARYDOCKWIDGET_H
#define QGSSTATISTICALSUMMARYDOCKWIDGET_H
#include <QMap>
#include "ui_qgsstatisticalsummarybase.h"
#include "qgsstatisticalsummary.h"
#include "qgsstringstatisticalsummary.h"
#include "qgsdatetimestatisticalsummary.h"
#include "qgsdockwidget.h"
#include "qgsfeatureiterator.h"
#include "qgstaskmanager.h"
#include "qgsexpressioncontextgenerator.h"
#include "qgis_app.h"
class QMenu;
class QgsBrowserModel;
class QModelIndex;
class QgsDockBrowserTreeView;
class QgsLayerItem;
class QgsDataItem;
class QgsVectorLayer;
/**
* \class QgsStatisticsValueGatherer
* Calculated raster stats for paletted renderer in a thread
*/
class QgsStatisticsValueGatherer : public QgsTask
{
Q_OBJECT
public:
QgsStatisticsValueGatherer( QgsVectorLayer *layer, const QgsFeatureIterator &fit, long featureCount, const QString &sourceFieldExp );
bool run() override;
QList<QVariant> values() const { return mValues; }
private:
QgsFeatureIterator mFeatureIterator;
long mFeatureCount = 0;
QString mFieldExpression;
int mFieldIndex = -1;
QList<QVariant> mValues;
std::unique_ptr<QgsExpression> mExpression;
QgsExpressionContext mContext;
};
/**
* A dock widget which displays a statistical summary of the values in a field or expression
*/
class APP_EXPORT QgsStatisticalSummaryDockWidget : public QgsDockWidget, private Ui::QgsStatisticalSummaryWidgetBase, private QgsExpressionContextGenerator
{
Q_OBJECT
public:
QgsStatisticalSummaryDockWidget( QWidget *parent = nullptr );
~QgsStatisticalSummaryDockWidget() override;
/**
* Returns the currently active layer for the widget
* \since QGIS 2.12
*/
QgsVectorLayer *layer() const { return mLayer; }
public slots:
/**
* Copy the displayed statistics to the clipboard
*/
void copyStatistics();
/**
* Recalculates the displayed statistics
*/
void refreshStatistics();
private slots:
void layerChanged( QgsMapLayer *layer );
void fieldChanged();
void statActionTriggered( bool checked );
void layersRemoved( const QStringList &layers );
void layerSelectionChanged();
void gathererFinished();
private:
//! Enumeration of supported statistics types
enum DataType
{
Numeric, //!< Numeric fields: int, double, etc
String, //!< String fields
DateTime //!< Date and DateTime fields
};
QgsVectorLayer *mLayer = nullptr;
QMap< int, QAction * > mStatsActions;
static QList< QgsStatisticalSummary::Statistic > sDisplayStats;
static QList< QgsStringStatisticalSummary::Statistic > sDisplayStringStats;
static QList< QgsDateTimeStatisticalSummary::Statistic > sDisplayDateTimeStats;
void updateNumericStatistics();
void updateStringStatistics();
void updateDateTimeStatistics();
void addRow( int row, const QString &name, const QString &value, bool showValue );
QgsExpressionContext createExpressionContext() const override;
void refreshStatisticsMenu();
DataType fieldType( const QString &fieldName );
QMenu *mStatisticsMenu = nullptr;
DataType mFieldType;
DataType mPreviousFieldType;
QString mExpression;
QgsStatisticsValueGatherer *mGatherer = nullptr;
};
#endif // QGSSTATISTICALSUMMARYDOCKWIDGET_H
|
/* Arm Custom Datapath Extension (CDE) intrinsics include file.
Copyright (C) 2020-2021 Free Software Foundation, Inc.
Contributed by Arm Ltd.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#ifndef _GCC_ARM_CDE_H
#define _GCC_ARM_CDE_H 1
#include <stdint.h>
#if defined (__ARM_FEATURE_CDE)
#define __arm_cx1(coproc, imm) \
__builtin_arm_cx1si(coproc, imm)
#define __arm_cx1a(coproc, acc, imm) \
__builtin_arm_cx1asi(coproc, acc, imm)
#define __arm_cx2(coproc, n, imm) \
__builtin_arm_cx2si(coproc, n, imm)
#define __arm_cx2a(coproc, acc, n, imm) \
__builtin_arm_cx2asi(coproc, acc, n, imm)
#define __arm_cx3(coproc, n, m, imm) \
__builtin_arm_cx3si(coproc, n, m, imm)
#define __arm_cx3a(coproc, acc, n, m, imm) \
__builtin_arm_cx3asi(coproc, acc, n, m, imm)
#define __arm_cx1d(coproc, imm) \
__builtin_arm_cx1di(coproc, imm)
#define __arm_cx1da(coproc, acc, imm) \
__builtin_arm_cx1adi(coproc, acc, imm)
#define __arm_cx2d(coproc, n, imm) \
__builtin_arm_cx2di(coproc, n, imm)
#define __arm_cx2da(coproc, acc, n, imm) \
__builtin_arm_cx2adi(coproc, acc, n, imm)
#define __arm_cx3d(coproc, n, m, imm) \
__builtin_arm_cx3di(coproc, n, m, imm)
#define __arm_cx3da(coproc, acc, n, m, imm) \
__builtin_arm_cx3adi(coproc, acc, n, m, imm)
#if defined (__ARM_FP) || defined (__ARM_FEATURE_MVE)
/* CDE builtins using FPU/MVE registers. */
/* uint32_t
__arm_vcx1_u32(int coproc, uint32_t imm); */
#define __arm_vcx1_u32(coproc, imm) \
__builtin_arm_vcx1si(coproc, imm)
/* uint32_t
__arm_vcx1a_u32(int coproc, uint32_t acc, uint32_t imm); */
#define __arm_vcx1a_u32(coproc, acc, imm) \
__builtin_arm_vcx1asi(coproc, acc, imm)
/* uint32_t
__arm_vcx2_u32(int coproc, uint32_t n, uint32_t imm); */
#define __arm_vcx2_u32(coproc, n, imm) \
__builtin_arm_vcx2si(coproc, n, imm)
/* uint32_t
__arm_vcx2a_u32(int coproc, uint32_t acc, uint32_t n, uint32_t imm); */
#define __arm_vcx2a_u32(coproc, acc, n, imm) \
__builtin_arm_vcx2asi(coproc, acc, n, imm)
/* uint32_t
__arm_vcx3_u32(int coproc, uint32_t n, uint32_t m, uint32_t imm); */
#define __arm_vcx3_u32(coproc, n, m, imm) \
__builtin_arm_vcx3si(coproc, n, m, imm)
/* uint32_t
__arm_vcx3a_u32(int coproc, uint32_t acc, uint32_t n, uint32_t m,
uint32_t imm); */
#define __arm_vcx3a_u32(coproc, acc, n, m, imm) \
__builtin_arm_vcx3asi(coproc, acc, n, m, imm)
/* uint64_t
__arm_vcx1d_u64(int coproc, uint32_t imm); */
#define __arm_vcx1d_u64(coproc, imm) \
__builtin_arm_vcx1di(coproc, imm)
/* uint64_t
__arm_vcx1da_u64(int coproc, uint64_t acc, uint32_t imm); */
#define __arm_vcx1da_u64(coproc, acc, imm) \
__builtin_arm_vcx1adi(coproc, acc, imm)
/* uint64_t
__arm_vcx2d_u64(int coproc, uint64_t m, uint32_t imm); */
#define __arm_vcx2d_u64(coproc, m, imm) \
__builtin_arm_vcx2di(coproc, m, imm)
/* uint64_t
__arm_vcx2da_u64(int coproc, uint64_t acc, uint64_t m, uint32_t imm); */
#define __arm_vcx2da_u64(coproc, acc, m, imm) \
__builtin_arm_vcx2adi(coproc, acc, m, imm)
/* uint64_t
__arm_vcx3d_u64(int coproc, uint64_t n, uint64_t m, uint32_t imm); */
#define __arm_vcx3d_u64(coproc, n, m, imm) \
__builtin_arm_vcx3di(coproc, n, m, imm)
/* uint64_t
__arm_vcx3da_u64(int coproc, uint64_t acc, uint64_t n, uint64_t m,
uint32_t imm); */
#define __arm_vcx3da_u64(coproc, acc, n, m, imm) \
__builtin_arm_vcx3adi(coproc, acc, n, m, imm)
#endif /* __ARM_FP || __ARM_FEATURE_MVE. */
#endif /* __ARM_FEATURE_CDE. */
#if __ARM_FEATURE_MVE
#include "arm_mve_types.h"
#define __arm_vcx1q_u8(coproc, imm) \
(uint8x16_t)__builtin_arm_vcx1qv16qi(coproc, imm)
#define __arm_vcx1qa(coproc, acc, imm) \
__builtin_arm_vcx1qav16qi(coproc, acc, imm)
#define __arm_vcx2q(coproc, n, imm) \
__builtin_arm_vcx2qv16qi(coproc, n, imm)
#define __arm_vcx2q_u8(coproc, n, imm) \
(uint8x16_t)__builtin_arm_vcx2qv16qi(coproc, n, imm)
#define __arm_vcx2qa(coproc, acc, n, imm) \
__builtin_arm_vcx2qav16qi(coproc, acc, n, imm)
#define __arm_vcx3q(coproc, n, m, imm) \
__builtin_arm_vcx3qv16qi(coproc, n, m, imm)
#define __arm_vcx3q_u8(coproc, n, m, imm) \
(uint8x16_t)__builtin_arm_vcx3qv16qi(coproc, n, m, imm)
#define __arm_vcx3qa(coproc, acc, n, m, imm) \
__builtin_arm_vcx3qav16qi(coproc, acc, n, m, imm)
#define __arm_vcx1q_m(coproc, inactive, imm, pred) \
__builtin_arm_vcx1q_p_v16qi(coproc, inactive, imm, pred)
#define __arm_vcx1qa_m(coproc, acc, imm, pred) \
__builtin_arm_vcx1qa_p_v16qi(coproc, acc, imm, pred)
#define __arm_vcx2q_m(coproc, inactive, n, imm, pred) \
__builtin_arm_vcx2q_p_v16qi(coproc, inactive, n, imm, pred)
#define __arm_vcx2qa_m(coproc, acc, n, imm, pred) \
__builtin_arm_vcx2qa_p_v16qi(coproc, acc, n, imm, pred)
#define __arm_vcx3q_m(coproc, inactive, n, m, imm, pred) \
__builtin_arm_vcx3q_p_v16qi(coproc, inactive, n, m, imm, pred)
#define __arm_vcx3qa_m(coproc, acc, n, m, imm, pred) \
__builtin_arm_vcx3qa_p_v16qi(coproc, acc, n, m, imm, pred)
#endif
#endif
|
/*
Copyright (c) 2014, Inverse 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 the Inverse 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 <COPYRIGHT HOLDER> 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 __SOGOSYNCCACHEOBJECT_H__
#define __SOGOSYNCCACHEOBJECT_H__
#import <Foundation/NSObject.h>
@class NSNull;
@interface SOGoSyncCacheObject : NSObject
{
@public
id _uid;
id _sequence;
}
+ (id) syncCacheObjectWithUID: (id) theUID sequence: (id) theSequence;
- (id) uid;
- (void) setUID: (id) theUID;
- (id) sequence;
- (void) setSequence: (id) theSequence;
- (NSComparisonResult) compareUID: (SOGoSyncCacheObject *) theSyncCacheObject;
- (NSComparisonResult) compareSequence: (SOGoSyncCacheObject *) theSyncCacheObject;
@end
#endif
|
/*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __FUSION__CALL_H__
#define __FUSION__CALL_H__
#include <fusion/types.h>
typedef enum {
FCHR_RETURN,
FCHR_RETAIN
} FusionCallHandlerResult;
typedef FusionCallHandlerResult (*FusionCallHandler) (int caller, /* fusion id of the caller */
int call_arg, /* optional call parameter */
void *call_ptr, /* optional call parameter */
void *ctx, /* optional handler context */
unsigned int serial,
int *ret_val );
typedef struct {
FusionWorldShared *shared;
int call_id;
FusionID fusion_id;
FusionCallHandler handler;
void *ctx;
} FusionCall;
DirectResult fusion_call_init ( FusionCall *call,
FusionCallHandler handler,
void *ctx,
const FusionWorld *world );
DirectResult fusion_call_execute( FusionCall *call,
FusionCallExecFlags flags,
int call_arg,
void *call_ptr,
int *ret_val );
DirectResult fusion_call_return ( FusionCall *call,
unsigned int serial,
int val );
DirectResult fusion_call_destroy( FusionCall *call );
#endif
|
/************************************************************
*
* Copyright (C), 1988-1999, Huawei Tech. Co., Ltd.
* FileName: switch_usb.h
* Author: lixiuna(00213837) Version : 0.1 Date: 2013-11-07
*
* 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.
*
* Description: .h file for switch chip
* Version:
* Function List:
* History:
* <author> <time> <version > <desc>
***********************************************************/
#ifndef __LINUX_SWITCH_USB_H__
#define __LINUX_SWITCH_USB_H__
#define GPIO_HI 1
#define GPIO_LOW 0
#define USE_NOTIFY_CHAIN 0
enum USB_SWITCH_STATE
{
USB_TO_AP = 0,
USB_TO_MODEM1 = 1,
USB_TO_MODEM2 = 2,
USB_TO_MODEM1_DOWNLOAD = 3,
USB_TO_MODEM2_DOWNLOAD = 4,
USB_TO_MHL = 5,
USB_OFF = 6,
};
struct usb_switch_platform_data {
unsigned long irq_flags;
};
struct switch_usb_dev {
const char *name;
struct device *dev;
int state;
int irq1;
struct work_struct work;
struct usb_switch_platform_data *pdata;
};
#if USE_NOTIFY_CHAIN
extern int switch_usb_register_notifier(struct notifier_block *nb);
extern int switch_usb_unregister_notifier(struct notifier_block *nb);
#endif
#endif /* __LINUX_SWITCH_USB_H__ */
|
/* Data structure for communication from the run-time dynamic linker for
loaded ELF shared objects.
Copyright (C) 1995-1999, 2000, 2001, 2004 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, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _LINK_H
#define _LINK_H 1
#include <features.h>
#include <elf.h>
#include <dlfcn.h>
#include <sys/types.h>
/* We use this macro to refer to ELF types independent of the native wordsize.
`ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
#define _ElfW_1(e,w,t) e##w##t
#include <bits/elfclass.h> /* Defines __ELF_NATIVE_CLASS. */
/* Rendezvous structure used by the run-time dynamic linker to communicate
details of shared object loading to the debugger. If the executable's
dynamic section has a DT_DEBUG element, the run-time linker sets that
element's value to the address where this structure can be found. */
struct r_debug
{
int r_version; /* Version number for this protocol. */
struct link_map *r_map; /* Head of the chain of loaded objects. */
/* This is the address of a function internal to the run-time linker,
that will always be called when the linker begins to map in a
library or unmap it, and again when the mapping change is complete.
The debugger can set a breakpoint at this address if it wants to
notice shared object mapping changes. */
ElfW(Addr) r_brk;
enum
{
/* This state value describes the mapping change taking place when
the `r_brk' address is called. */
RT_CONSISTENT, /* Mapping change is complete. */
RT_ADD, /* Beginning to add a new object. */
RT_DELETE /* Beginning to remove an object mapping. */
} r_state;
ElfW(Addr) r_ldbase; /* Base address the linker is loaded at. */
};
/* This is the instance of that structure used by the dynamic linker. */
extern struct r_debug _r_debug;
/* This symbol refers to the "dynamic structure" in the `.dynamic' section
of whatever module refers to `_DYNAMIC'. So, to find its own
`struct r_debug', a program could do:
for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
if (dyn->d_tag == DT_DEBUG)
r_debug = (struct r_debug *) dyn->d_un.d_ptr;
*/
extern ElfW(Dyn) _DYNAMIC[];
#ifdef __FRV_FDPIC__
# include <bits/elf-fdpic.h>
#endif
/* Structure describing a loaded shared object. The `l_next' and `l_prev'
members form a chain of all the shared objects loaded at startup.
These data structures exist in space used by the run-time dynamic linker;
modifying them may have disastrous results. */
struct link_map
{
/* These first few members are part of the protocol with the debugger.
This is the same format used in SVR4. */
#ifdef __FRV_FDPIC__
struct elf32_fdpic_loadaddr l_addr;
#else
ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
#endif
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
};
#ifdef __USE_GNU
struct dl_phdr_info
{
#ifdef __FRV_FDPIC__
struct elf32_fdpic_loadaddr dlpi_addr;
#else
ElfW(Addr) dlpi_addr;
#endif
const char *dlpi_name;
const ElfW(Phdr) *dlpi_phdr;
ElfW(Half) dlpi_phnum;
};
__BEGIN_DECLS
extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
size_t size, void *data),
void *data) __THROW;
__END_DECLS
#endif
#endif /* link.h */
|
/*
Copyright (C) 2016 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file LICENSE for details.
*/
#include "window.h"
#include "memory.h"
#include "window_manager.h"
#define CHARACTER_W 8
#define CHARACTER_H 8
static inline void window_clear_bounds(struct window *win) {
win->bounds_x_1 = 0;
win->bounds_x_2 = 0;
win->bounds_y_1 = 0;
win->bounds_y_2 = 0;
}
static inline void window_set_bounds(struct window *win, int x, int y, int w, int h) {
// check if bounds_x_1 ... y_2 are -1.
// if so, do calculation. otherwise, do nothing
win->bounds_x_1 = x < 0 ? 0 : x;
win->bounds_x_2 = x + w >= graphics_width() ? graphics_width() - 1 : x + w;
win->bounds_y_1 = y < 0 ? 0 : y;
win->bounds_y_2 = y + h >= graphics_height() ? graphics_height() - 1 : y + h;
}
// This function prepares to draw in a window by setting up its boundary
// restrictions.
// THIS FUNCTION SHOULD ALWAYS BE CALLED WHEN MAKING A WINDOW
// OR MOVING A WINDOW
static inline void window_init_draw(struct window *w) {
int x = w->x;
int y = w->y;
struct window *init = w;
int width = w->width;
int height = w->height;
while (w->parent) {
w = w->parent;
x += w->x;
y += w->y;
if(w->width - x < width)
width = w->width - x;
if(w->height - y < height)
height = w->height - y;
}
// Account for the offset of the top-level window
height += w->y;
width += w->x;
init->x_offset = x;
init->y_offset = y;
window_set_bounds(init, x, y, width, height);
}
struct window *window_create(int x, int y, int width, int height, struct window *parent) {
struct window *w = kmalloc(sizeof(*w));
w->x = x;
w->y = y;
w->width = width;
w->height = height;
w->parent = parent;
struct list l = {0, 0};
w->event_queue = l;
w->x_offset = 0;
w->y_offset = 0;
w->bounds_x_1 = 0;
w->bounds_x_2 = 0;
w->bounds_y_1 = 0;
w->bounds_y_2 = 0;
window_init_draw(w);
// Draw the border
struct graphics_color border_color = {128,128,128};
struct graphics_color background_color = {0,0,0};
w->background_color = background_color;
window_set_border_color(w, border_color);
active_window = w;
return w;
}
void window_set_border_color(struct window *w, struct graphics_color border_color) {
w->border_color = border_color;
// Draw the new border
window_draw_line(w, 0, 0, 0, w->height, border_color);
window_draw_line(w, 0, 0, w->width, 0, border_color);
window_draw_line(w, 0, w->height, w->width, w->height, border_color);
window_draw_line(w, w->width, 0, w->width, w->height, border_color);
}
void window_draw_line(struct window *w, int x1, int y1, int x2, int y2, struct graphics_color color) {
x1 += w->x_offset;
y1 += w->y_offset;
x2 += w->x_offset;
y2 += w->y_offset;
graphics_line(x1, y1, x2, y2, color, 0);
}
void window_draw_arc(struct window *w, int x, int y, double r, double start_theta, double end_theta, struct graphics_color color) {
graphics_arc(x + w->x, y + w->y, r, start_theta, end_theta, color);
}
void window_draw_circle(struct window *w, int x, int y, double r, struct graphics_color color) {
graphics_circle(x + w->x, y + w->y, r, color);
}
void window_draw_char(struct window *w, int x, int y, char ch, struct graphics_color fgcolor,
struct graphics_color bgcolor) {
x += w->x_offset;
y += w->y_offset;
graphics_char(x, y, ch, fgcolor, bgcolor);
}
void window_draw_string(struct window *w, int x, int y, const char *str, struct graphics_color fgcolor,
struct graphics_color bgcolor) {
int pos_h = 0;
int pos_w = 0;
while (*str) {
if (*str == '\n') {
pos_h += CHARACTER_H;
pos_w = 0;
str++;
continue;
}
window_draw_char(w, x + pos_w, y + pos_h, *str, fgcolor, bgcolor);
pos_w += CHARACTER_W;
str++;
}
}
void window_draw_bitmap(struct window *w, int x, int y, int width, int height, uint8_t * data,
struct graphics_color fgcolor,
struct graphics_color bgcolor) {
graphics_bitmap(x + w->x, y + w->y, width, height, data, fgcolor, bgcolor);
}
void window_clear(struct window *w) {
// Don't want to erase the border
graphics_rect(w->x + 1, w->y + 1, w->width - 1, w->height - 1, w->background_color);
}
|
/*
* psicontactlist.h - general abstraction of the psi-specific contact list
* Copyright (C) 2006 Michail Pishchagin
*
* 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef PSICONTACTLIST_H
#define PSICONTACTLIST_H
#include <QList>
#include "profiles.h"
using namespace XMPP;
class PsiCon;
class PsiAccount;
class PsiContact;
namespace XMPP { class Jid; }
class PsiContactList : public QObject
{
Q_OBJECT
public:
PsiContactList(PsiCon* psi);
~PsiContactList();
PsiCon* psi() const;
bool showAgents() const;
bool showHidden() const;
bool showSelf() const;
bool showOffline() const;
QString contactSortStyle() const;
bool accountsLoaded() const;
PsiAccount* getAccount(const QString& id) const;
PsiAccount* getAccountByJid(const XMPP::Jid& jid) const;
const QList<PsiAccount*>& accounts() const;
const QList<PsiAccount*>& enabledAccounts() const;
bool haveActiveAccounts() const;
bool haveAvailableAccounts() const;
bool haveEnabledAccounts() const;
bool haveConnectingAccounts() const;
PsiAccount *defaultAccount() const;
UserAccountList getUserAccountList() const;
PsiAccount* createAccount(const QString& name, const Jid& j = "", const QString& pass = "", bool opt_host = false, const QString& host = "", int port = 5222, bool legacy_ssl_probe = true, UserAccount::SSLFlag ssl = UserAccount::SSL_Auto, QString proxyID = "", const QString &tlsOverrideDomain="", const QByteArray &tlsOverrideCert=QByteArray());
void createAccount(const UserAccount&);
void removeAccount(PsiAccount*);
void setAccountEnabled(PsiAccount*, bool enabled = true);
int queueCount() const;
PsiAccount *queueLowestEventId();
void loadAccounts(const UserAccountList &);
void link(PsiAccount*);
void unlink(PsiAccount*);
const QList<PsiContact*>& contacts() const;
public slots:
void setShowAgents(bool);
void setShowHidden(bool);
void setShowSelf(bool);
void setShowOffline(bool);
void setContactSortStyle(QString);
signals:
void showAgentsChanged(bool);
void showHiddenChanged(bool);
void showSelfChanged(bool);
void showOfflineChanged(bool);
void contactSortStyleChanged(QString);
signals:
void addedContact(PsiContact*);
void removedContact(PsiContact*);
void beginBulkContactUpdate();
void endBulkContactUpdate();
void rosterRequestFinished();
/**
* This signal is emitted when account is loaded from disk or created
* anew.
*/
void accountAdded(PsiAccount*);
/**
* This signal is emitted when account is completely removed from the
* program, i.e. deleted.
*/
void accountRemoved(PsiAccount*);
/**
* This signal is emitted when number of accounts managed by
* PsiContactList changes.
*/
void accountCountChanged();
/**
* This signal is emitted when one of the accounts emits
* updatedActivity() signal.
*/
void accountActivityChanged();
/**
* This signal is emitted when the features of one of the accounts change.
*/
void accountFeaturesChanged();
/**
* This signal is emitted when either new account was added, or
* existing one was removed altogether.
*/
void saveAccounts();
/**
* This signal is emitted when event queue of one account was changed
* by adding or removing an event.
*/
void queueChanged();
/**
* This signal is emitted at the end of loadAccounts() call, when all
* the accounts are initialized.
*/
void loadedAccounts();
/**
* This signal is emitted when PsiContactList enters its final steps before
* total destruction, and all accounts are still accessible for last
* minute processing.
*/
void destroying();
private slots:
void accountEnabledChanged();
void accountAddedContact(PsiContact*);
void accountRemovedContact(PsiContact*);
private:
PsiAccount *loadAccount(const UserAccount &);
PsiAccount *tryQueueLowestEventId(bool includeDND);
PsiCon *psi_;
QList<PsiAccount *> accounts_, enabledAccounts_;
QList<PsiContact *> contacts_;
bool showAgents_;
bool showHidden_;
bool showSelf_;
bool showOffline_;
bool accountsLoaded_;
QString contactSortStyle_;
void addEnabledAccount(PsiAccount* account);
void removeEnabledAccount(PsiAccount* account);
};
#endif
|
/* fm-icon-container.h - the container widget for file manager icons
Copyright (C) 2002 Sun Microsystems, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
see <http://www.gnu.org/licenses/>.
Author: Michael Meeks <michael@ximian.com>
*/
#ifndef NAUTILUS_CANVAS_VIEW_CONTAINER_H
#define NAUTILUS_CANVAS_VIEW_CONTAINER_H
#include "nautilus-canvas-view.h"
#include "nautilus-canvas-container.h"
typedef struct NautilusCanvasViewContainer NautilusCanvasViewContainer;
typedef struct NautilusCanvasViewContainerClass NautilusCanvasViewContainerClass;
#define NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER nautilus_canvas_view_container_get_type()
#define NAUTILUS_CANVAS_VIEW_CONTAINER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER, NautilusCanvasViewContainer))
#define NAUTILUS_CANVAS_VIEW_CONTAINER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER, NautilusCanvasViewContainerClass))
#define NAUTILUS_IS_CANVAS_VIEW_CONTAINER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER))
#define NAUTILUS_IS_CANVAS_VIEW_CONTAINER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER))
#define NAUTILUS_CANVAS_VIEW_CONTAINER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER, NautilusCanvasViewContainerClass))
G_DEFINE_AUTOPTR_CLEANUP_FUNC(NautilusCanvasViewContainer, g_object_unref)
typedef struct NautilusCanvasViewContainerDetails NautilusCanvasViewContainerDetails;
struct NautilusCanvasViewContainer {
NautilusCanvasContainer parent;
NautilusCanvasView *view;
};
struct NautilusCanvasViewContainerClass {
NautilusCanvasContainerClass parent_class;
};
GType nautilus_canvas_view_container_get_type (void);
NautilusCanvasContainer *nautilus_canvas_view_container_construct (NautilusCanvasViewContainer *canvas_container,
NautilusCanvasView *view);
NautilusCanvasContainer *nautilus_canvas_view_container_new (NautilusCanvasView *view);
#endif /* NAUTILUS_CANVAS_VIEW_CONTAINER_H */
|
/* Examine __jmp_buf for unwinding frames. HPPA version.
Copyright (C) 2006-2017 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 <setjmp.h>
#include <jmpbuf-offsets.h>
/* Test if longjmp to JMPBUF would unwind the frame containing a local
variable at ADDRESS. */
#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \
((void *) (_address) > \
(void *) _demangle ((((unsigned long *) _jmpbuf)[JB_SP])))
|
/* Copyright (C) 2004 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 <errno.h>
#include <mqueue.h>
/* Receive the oldest from highest priority messages in message queue
MQDES, stop waiting if ABS_TIMEOUT expires. */
ssize_t
mq_timedreceive (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len,
unsigned int *__restrict msg_prio,
const struct timespec *__restrict abs_timeout)
{
__set_errno (ENOSYS);
return -1;
}
hidden_def (mq_timedreceive)
stub_warning (mq_timedreceive)
|
/*
* kernel/ve/vzdev.c
*
* Copyright (C) 2000-2005 SWsoft
* All rights reserved.
*
* Licensing governed by "linux/COPYING.SWsoft" file.
*
*/
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/vzctl.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <uapi/linux/vzcalluser.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <linux/device.h>
#define VZCTL_MAJOR 126
#define VZCTL_NAME "vzctl"
MODULE_AUTHOR("SWsoft <info@sw-soft.com>");
MODULE_DESCRIPTION("Virtuozzo Interface");
MODULE_LICENSE("GPL v2");
static LIST_HEAD(ioctls);
static DEFINE_SPINLOCK(ioctl_lock);
static struct vzioctlinfo *vzctl_get_handler(unsigned int cmd)
{
struct vzioctlinfo *h;
spin_lock(&ioctl_lock);
list_for_each_entry(h, &ioctls, list) {
if (h->type == _IOC_TYPE(cmd))
goto found;
}
h = NULL;
found:
if (h && !try_module_get(h->owner))
h = NULL;
spin_unlock(&ioctl_lock);
return h;
}
static void vzctl_put_handler(struct vzioctlinfo *h)
{
if (!h)
return;
module_put(h->owner);
}
long vzctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct vzioctlinfo *h;
int err;
err = -ENOTTY;
h = vzctl_get_handler(cmd);
if (h && h->ioctl)
err = (*h->ioctl)(file, cmd, arg);
vzctl_put_handler(h);
return err;
}
long compat_vzctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct vzioctlinfo *h;
int err;
err = -ENOIOCTLCMD;
h = vzctl_get_handler(cmd);
if (h && h->compat_ioctl)
err = (*h->compat_ioctl)(file, cmd, arg);
vzctl_put_handler(h);
return err;
}
void vzioctl_register(struct vzioctlinfo *inf)
{
spin_lock(&ioctl_lock);
list_add(&inf->list, &ioctls);
spin_unlock(&ioctl_lock);
}
EXPORT_SYMBOL(vzioctl_register);
void vzioctl_unregister(struct vzioctlinfo *inf)
{
spin_lock(&ioctl_lock);
list_del_init(&inf->list);
spin_unlock(&ioctl_lock);
}
EXPORT_SYMBOL(vzioctl_unregister);
/*
* Init/exit stuff.
*/
static struct file_operations vzctl_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = vzctl_ioctl,
.compat_ioctl = compat_vzctl_ioctl,
};
static struct class *vzctl_class;
static void __exit vzctl_exit(void)
{
device_destroy(vzctl_class, MKDEV(VZCTL_MAJOR, 0));
class_destroy(vzctl_class);
unregister_chrdev(VZCTL_MAJOR, VZCTL_NAME);
}
static int __init vzctl_init(void)
{
int ret;
struct device *class_err;
ret = register_chrdev(VZCTL_MAJOR, VZCTL_NAME, &vzctl_fops);
if (ret < 0)
goto out;
vzctl_class = class_create(THIS_MODULE, "vzctl");
if (IS_ERR(vzctl_class)) {
ret = PTR_ERR(vzctl_class);
goto out_cleandev;
}
class_err = device_create(vzctl_class, NULL,
MKDEV(VZCTL_MAJOR, 0), NULL, VZCTL_NAME);
if (IS_ERR(class_err)) {
ret = PTR_ERR(class_err);
goto out_rmclass;
}
goto out;
out_rmclass:
class_destroy(vzctl_class);
out_cleandev:
unregister_chrdev(VZCTL_MAJOR, VZCTL_NAME);
out:
return ret;
}
module_init(vzctl_init)
module_exit(vzctl_exit);
|
/* poly/companion.c
*
* Copyright (C) 1996, 1997, 1998, 1999, 2000 Brian Gough
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
static void set_companion_matrix (const double *a, size_t n, double *m);
static void
set_companion_matrix (const double *a, size_t nc, double *m)
{
size_t i, j;
for (i = 0; i < nc; i++)
for (j = 0; j < nc; j++)
MAT (m, i, j, nc) = 0.0;
for (i = 1; i < nc; i++)
MAT (m, i, i - 1, nc) = 1.0;
for (i = 0; i < nc; i++)
MAT (m, i, nc - 1, nc) = -a[i] / a[nc];
}
|
/*
* Seven Kingdoms: Ancient Adversaries
*
* Copyright 1997,1998 Enlight Software Ltd.
*
* 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/>.
*
*/
// Filename : CRC.H
// Description : header of assembly function crc.asm
#ifndef __CRC_H
#define __CRC_H
#include <asmfun.h>
typedef unsigned char CRC_TYPE;
const unsigned int CRC_LEN = sizeof(CRC_TYPE);
extern "C"
{
CRC_TYPE IMGcall crc8(unsigned char *, int);
}
#endif
|
#include "Ve_profile.h"
#ifdef CONFIG_RTK_VOIP_DRIVERS_SLIC_ZARLINK_ON_NEW_ARCH
#include "snd_define.h"
#else
#include "Slic_api.h"
#endif
/************** User defined Cadence_Definitions **************/
#ifdef CONFIG_RTK_VOIP_SLIC_ZARLINK_880_SERIES
VpProfileDataType LE880_RING_CAD_USER_DEF[] =
{
/* Cadence Profile */
0x00, 0x08, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0A, 0x01, 0x07, 0x21, 0x90,
0x01, 0x05, 0x23, 0x20, 0x40, 0x00
};
#endif
#ifdef CONFIG_RTK_VOIP_SLIC_ZARLINK_890_SERIES
VpProfileDataType LE890_RING_CAD_USER_DEF[] =
{
/* Cadence Profile */
0x00, 0x08, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0A, 0x01, 0x07, 0x21, 0x90,
0x01, 0x05, 0x23, 0x20, 0x40, 0x00
};
#endif
|
// Copyright 2015, VIXL authors
// 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 ARM Limited 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 CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---------------------------------------------------------------------
// This file is auto generated using tools/generate_simulator_traces.py.
//
// PLEASE DO NOT EDIT.
// ---------------------------------------------------------------------
#ifndef VIXL_SIM_CMGT_8H_2OPIMM_TRACE_AARCH64_H_
#define VIXL_SIM_CMGT_8H_2OPIMM_TRACE_AARCH64_H_
const uint16_t kExpected_NEON_cmgt_8H_2OPIMM[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000,
0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000,
0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
const unsigned kExpectedCount_NEON_cmgt_8H_2OPIMM = 24;
#endif // VIXL_SIM_CMGT_8H_2OPIMM_TRACE_AARCH64_H_
|
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
#include <string>
#include "Common/IniFile.h"
enum Hotkey
{
HK_OPEN,
HK_CHANGE_DISC,
HK_REFRESH_LIST,
HK_PLAY_PAUSE,
HK_STOP,
HK_RESET,
HK_FRAME_ADVANCE,
HK_START_RECORDING,
HK_PLAY_RECORDING,
HK_EXPORT_RECORDING,
HK_READ_ONLY_MODE,
HK_FULLSCREEN,
HK_SCREENSHOT,
HK_EXIT,
HK_WIIMOTE1_CONNECT,
HK_WIIMOTE2_CONNECT,
HK_WIIMOTE3_CONNECT,
HK_WIIMOTE4_CONNECT,
HK_BALANCEBOARD_CONNECT,
HK_TOGGLE_IR,
HK_TOGGLE_AR,
HK_TOGGLE_EFBCOPIES,
HK_TOGGLE_FOG,
HK_TOGGLE_THROTTLE,
HK_INCREASE_FRAME_LIMIT,
HK_DECREASE_FRAME_LIMIT,
HK_LOAD_STATE_SLOT_1,
HK_LOAD_STATE_SLOT_2,
HK_LOAD_STATE_SLOT_3,
HK_LOAD_STATE_SLOT_4,
HK_LOAD_STATE_SLOT_5,
HK_LOAD_STATE_SLOT_6,
HK_LOAD_STATE_SLOT_7,
HK_LOAD_STATE_SLOT_8,
HK_LOAD_STATE_SLOT_9,
HK_LOAD_STATE_SLOT_10,
HK_SAVE_STATE_SLOT_1,
HK_SAVE_STATE_SLOT_2,
HK_SAVE_STATE_SLOT_3,
HK_SAVE_STATE_SLOT_4,
HK_SAVE_STATE_SLOT_5,
HK_SAVE_STATE_SLOT_6,
HK_SAVE_STATE_SLOT_7,
HK_SAVE_STATE_SLOT_8,
HK_SAVE_STATE_SLOT_9,
HK_SAVE_STATE_SLOT_10,
HK_LOAD_LAST_STATE_1,
HK_LOAD_LAST_STATE_2,
HK_LOAD_LAST_STATE_3,
HK_LOAD_LAST_STATE_4,
HK_LOAD_LAST_STATE_5,
HK_LOAD_LAST_STATE_6,
HK_LOAD_LAST_STATE_7,
HK_LOAD_LAST_STATE_8,
HK_SAVE_FIRST_STATE,
HK_UNDO_LOAD_STATE,
HK_UNDO_SAVE_STATE,
HK_SAVE_STATE_FILE,
HK_LOAD_STATE_FILE,
NUM_HOTKEYS,
};
struct SCoreStartupParameter
{
// Settings
bool bEnableDebugging;
#ifdef USE_GDBSTUB
int iGDBPort;
#endif
bool bAutomaticStart;
bool bBootToPause;
// 0 = Interpreter
// 1 = Jit
// 2 = JitIL
// 3 = JIT ARM
int iCPUCore;
// JIT (shared between JIT and JITIL)
bool bJITNoBlockCache, bJITBlockLinking;
bool bJITOff;
bool bJITLoadStoreOff, bJITLoadStorelXzOff, bJITLoadStorelwzOff, bJITLoadStorelbzxOff;
bool bJITLoadStoreFloatingOff;
bool bJITLoadStorePairedOff;
bool bJITFloatingPointOff;
bool bJITIntegerOff;
bool bJITPairedOff;
bool bJITSystemRegistersOff;
bool bJITBranchOff;
bool bJITILTimeProfiling;
bool bJITILOutputIR;
bool bFastmem;
bool bEnableFPRF;
bool bCPUThread;
bool bDSPThread;
bool bDSPHLE;
bool bSkipIdle;
bool bNTSC;
bool bForceNTSCJ;
bool bHLE_BS2;
bool bEnableCheats;
bool bMergeBlocks;
bool bEnableMemcardSaving;
bool bDPL2Decoder;
int iLatency;
bool bRunCompareServer;
bool bRunCompareClient;
bool bMMU;
bool bDCBZOFF;
bool bTLBHack;
int iBBDumpPort;
bool bVBeamSpeedHack;
bool bSyncGPU;
bool bFastDiscSpeed;
int SelectedLanguage;
bool bWii;
// Interface settings
bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers, bOnScreenDisplayMessages;
std::string theme_name;
// Hotkeys
int iHotkey[NUM_HOTKEYS];
int iHotkeyModifier[NUM_HOTKEYS];
// Display settings
std::string strFullscreenResolution;
int iRenderWindowXPos, iRenderWindowYPos;
int iRenderWindowWidth, iRenderWindowHeight;
bool bRenderWindowAutoSize, bKeepWindowOnTop;
bool bFullscreen, bRenderToMain;
bool bProgressive, bDisableScreenSaver;
int iPosX, iPosY, iWidth, iHeight;
// Fifo Player related settings
bool bLoopFifoReplay;
enum EBootBS2
{
BOOT_DEFAULT,
BOOT_BS2_JAP,
BOOT_BS2_USA,
BOOT_BS2_EUR,
};
enum EBootType
{
BOOT_ISO,
BOOT_ELF,
BOOT_DOL,
BOOT_WII_NAND,
BOOT_BS2,
BOOT_DFF
};
EBootType m_BootType;
std::string m_strVideoBackend;
// files
std::string m_strFilename;
std::string m_strBootROM;
std::string m_strSRAM;
std::string m_strDefaultGCM;
std::string m_strDVDRoot;
std::string m_strApploader;
std::string m_strUniqueID;
std::string m_strRevisionSpecificUniqueID;
std::string m_strName;
std::string m_strGameIniDefault;
std::string m_strGameIniDefaultRevisionSpecific;
std::string m_strGameIniLocal;
// Constructor just calls LoadDefaults
SCoreStartupParameter();
void LoadDefaults();
bool AutoSetup(EBootBS2 _BootBS2);
const std::string &GetUniqueID() const { return m_strUniqueID; }
void CheckMemcardPath(std::string& memcardPath, std::string Region, bool isSlotA);
IniFile LoadDefaultGameIni() const;
IniFile LoadLocalGameIni() const;
IniFile LoadGameIni() const;
};
|
#pragma once
#include <string>
#include <vector>
#include "Utilities/StrUtil.h"
enum class FUNCTION {
FUNCTION_DP2,
FUNCTION_DP2A,
FUNCTION_DP3,
FUNCTION_DP4,
FUNCTION_DPH,
FUNCTION_SFL, // Set zero
FUNCTION_STR, // Set One
FUNCTION_FRACT,
FUNCTION_DFDX,
FUNCTION_DFDY,
FUNCTION_REFL,
FUNCTION_TEXTURE_SAMPLE1D,
FUNCTION_TEXTURE_SAMPLE1D_PROJ,
FUNCTION_TEXTURE_SAMPLE1D_LOD,
FUNCTION_TEXTURE_SAMPLE1D_GRAD,
FUNCTION_TEXTURE_SAMPLE2D,
FUNCTION_TEXTURE_SAMPLE2D_PROJ,
FUNCTION_TEXTURE_SAMPLE2D_LOD,
FUNCTION_TEXTURE_SAMPLE2D_GRAD,
FUNCTION_TEXTURE_SAMPLECUBE,
FUNCTION_TEXTURE_SAMPLECUBE_PROJ,
FUNCTION_TEXTURE_SAMPLECUBE_LOD,
FUNCTION_TEXTURE_SAMPLECUBE_GRAD,
FUNCTION_TEXTURE_SAMPLE3D,
FUNCTION_TEXTURE_SAMPLE3D_PROJ,
FUNCTION_TEXTURE_SAMPLE3D_LOD,
FUNCTION_TEXTURE_SAMPLE3D_GRAD,
FUNCTION_VERTEX_TEXTURE_FETCH1D,
FUNCTION_VERTEX_TEXTURE_FETCH2D,
FUNCTION_VERTEX_TEXTURE_FETCH3D,
FUNCTION_VERTEX_TEXTURE_FETCHCUBE,
FUNCTION_TEXTURE_SAMPLE2D_DEPTH_RGBA
};
enum class COMPARE {
FUNCTION_SEQ,
FUNCTION_SGE,
FUNCTION_SGT,
FUNCTION_SLE,
FUNCTION_SLT,
FUNCTION_SNE,
};
enum ParamFlag
{
PF_PARAM_IN,
PF_PARAM_OUT,
PF_PARAM_UNIFORM,
PF_PARAM_CONST,
PF_PARAM_NONE,
PF_PARAM_COUNT,
};
struct ParamItem
{
std::string name;
std::string value;
int location;
ParamItem(const std::string& _name, int _location, const std::string& _value = "")
: name(_name)
, value(_value),
location(_location)
{ }
};
struct ParamType
{
const ParamFlag flag;
std::string type;
std::vector<ParamItem> items;
ParamType(const ParamFlag _flag, const std::string& _type)
: flag(_flag)
, type(_type)
{
}
bool SearchName(const std::string& name)
{
for (u32 i = 0; i<items.size(); ++i)
{
if (items[i].name.compare(name) == 0) return true;
}
return false;
}
};
struct ParamArray
{
std::vector<ParamType> params[PF_PARAM_COUNT];
ParamType* SearchParam(const ParamFlag &flag, const std::string& type)
{
for (u32 i = 0; i<params[flag].size(); ++i)
{
if (params[flag][i].type.compare(type) == 0)
return ¶ms[flag][i];
}
return nullptr;
}
bool HasParam(const ParamFlag flag, std::string type, const std::string& name)
{
ParamType* t = SearchParam(flag, type);
return t && t->SearchName(name);
}
std::string AddParam(const ParamFlag flag, std::string type, const std::string& name, const std::string& value)
{
ParamType* t = SearchParam(flag, type);
if (t)
{
if (!t->SearchName(name)) t->items.emplace_back(name, -1, value);
}
else
{
params[flag].emplace_back(flag, type);
params[flag].back().items.emplace_back(name, -1, value);
}
return name;
}
std::string AddParam(const ParamFlag flag, std::string type, const std::string& name, int location = -1)
{
ParamType* t = SearchParam(flag, type);
if (t)
{
if (!t->SearchName(name)) t->items.emplace_back(name, location);
}
else
{
params[flag].emplace_back(flag, type);
params[flag].back().items.emplace_back(name, location);
}
return name;
}
};
class ShaderVariable
{
public:
std::string name;
std::vector<std::string> swizzles;
ShaderVariable() = default;
ShaderVariable(const std::string& var)
{
auto var_blocks = fmt::split(var, { "." });
verify(HERE), (var_blocks.size() != 0);
name = var_blocks[0];
if (var_blocks.size() == 1)
{
swizzles.push_back("xyzw");
}
else
{
swizzles = std::vector<std::string>(var_blocks.begin() + 1, var_blocks.end());
}
}
size_t get_vector_size() const
{
return swizzles[swizzles.size() - 1].length();
}
ShaderVariable& symplify()
{
std::unordered_map<char, char> swizzle;
static std::unordered_map<int, char> pos_to_swizzle =
{
{ 0, 'x' },
{ 1, 'y' },
{ 2, 'z' },
{ 3, 'w' }
};
for (auto &i : pos_to_swizzle)
{
swizzle[i.second] = swizzles[0].length() > i.first ? swizzles[0][i.first] : 0;
}
for (int i = 1; i < swizzles.size(); ++i)
{
std::unordered_map<char, char> new_swizzle;
for (auto &sw : pos_to_swizzle)
{
new_swizzle[sw.second] = swizzle[swizzles[i].length() <= sw.first ? '\0' : swizzles[i][sw.first]];
}
swizzle = new_swizzle;
}
swizzles.clear();
std::string new_swizzle;
for (auto &i : pos_to_swizzle)
{
if (swizzle[i.second] != '\0')
new_swizzle += swizzle[i.second];
}
swizzles.push_back(new_swizzle);
return *this;
}
std::string get() const
{
if (swizzles.size() == 1 && swizzles[0] == "xyzw")
{
return name;
}
return name + "." + fmt::merge({ swizzles }, ".");
}
};
|
/***************************************************************************
HalfEdge.h - description
-------------------
copyright : (C) 2004 by Marco Hugentobler
email : mhugent@geo.unizh.ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef HALFEDGE_H
#define HALFEDGE_H
/** \ingroup analysis
* \class HalfEdge
*/
class ANALYSIS_EXPORT HalfEdge
{
protected:
/** Number of the dual HalfEdge*/
int mDual;
/** Number of the next HalfEdge*/
int mNext;
/** Number of the point at which this HalfEdge points*/
int mPoint;
/** True, if the HalfEdge belongs to a break line, false otherwise*/
bool mBreak;
/** True, if the HalfEdge belongs to a constrained edge, false otherwise*/
bool mForced;
public:
/** Default constructor. Values for mDual, mNext, mPoint are set to -10 which means that they are undefined*/
HalfEdge();
HalfEdge( int dual, int next, int point, bool mbreak, bool forced );
~HalfEdge();
/** Returns the number of the dual HalfEdge*/
int getDual() const;
/** Returns the number of the next HalfEdge*/
int getNext() const;
/** Returns the number of the point at which this HalfEdge points*/
int getPoint() const;
/** Returns, whether the HalfEdge belongs to a break line or not*/
bool getBreak() const;
/** Returns, whether the HalfEdge belongs to a constrained edge or not*/
bool getForced() const;
/** Sets the number of the dual HalfEdge*/
void setDual( int d );
/** Sets the number of the next HalfEdge*/
void setNext( int n );
/** Sets the number of point at which this HalfEdge points*/
void setPoint( int p );
/** Sets the break flag*/
void setBreak( bool b );
/** Sets the forced flag*/
void setForced( bool f );
};
inline HalfEdge::HalfEdge(): mDual( -10 ), mNext( -10 ), mPoint( -10 ), mBreak( false ), mForced( false )
{
}
inline HalfEdge::HalfEdge( int dual, int next, int point, bool mbreak, bool forced ): mDual( dual ), mNext( next ), mPoint( point ), mBreak( mbreak ), mForced( forced )
{
}
inline HalfEdge::~HalfEdge()
{
}
inline int HalfEdge::getDual() const
{
return mDual;
}
inline int HalfEdge::getNext() const
{
return mNext;
}
inline int HalfEdge::getPoint() const
{
return mPoint;
}
inline bool HalfEdge::getBreak() const
{
return mBreak;
}
inline bool HalfEdge::getForced() const
{
return mForced;
}
inline void HalfEdge::setDual( int d )
{
mDual = d;
}
inline void HalfEdge::setNext( int n )
{
mNext = n;
}
inline void HalfEdge::setPoint( int p )
{
mPoint = p;
}
inline void HalfEdge::setBreak( bool b )
{
mBreak = b;
}
inline void HalfEdge::setForced( bool f )
{
mForced = f;
}
#endif
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
// clang-format off
FixStyle(wall/colloid,FixWallColloid);
// clang-format on
#else
#ifndef LMP_FIX_WALL_COLLOID_H
#define LMP_FIX_WALL_COLLOID_H
#include "fix_wall.h"
namespace LAMMPS_NS {
class FixWallColloid : public FixWall {
public:
FixWallColloid(class LAMMPS *, int, char **);
void init() override;
void precompute(int) override;
void wall_particle(int, int, double) override;
private:
double coeff1[6], coeff2[6], coeff3[6], coeff4[6];
};
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
E: Fix wall/colloid requires atom style sphere
Self-explanatory.
E: Fix wall/colloid requires extended particles
One of the particles has radius 0.0.
E: Particle on or inside fix wall surface
Particles must be "exterior" to the wall in order for energy/force to
be calculated.
*/
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "fixed_grammar.asn"
* `asn1c -gen-PER`
*/
#include "MBMSCountingRequest-r10.h"
static ber_tlv_tag_t asn_DEF_nonCriticalExtension_tags_4[] = {
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SEQUENCE_specifics_t asn_SPC_nonCriticalExtension_specs_4 = {
sizeof(struct MBMSCountingRequest_r10__nonCriticalExtension),
offsetof(struct MBMSCountingRequest_r10__nonCriticalExtension, _asn_ctx),
0, /* No top level tags */
0, /* No tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_nonCriticalExtension_4 = {
"nonCriticalExtension",
"nonCriticalExtension",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
SEQUENCE_decode_aper,
SEQUENCE_encode_aper,
0, /* Use generic outmost tag fetcher */
asn_DEF_nonCriticalExtension_tags_4,
sizeof(asn_DEF_nonCriticalExtension_tags_4)
/sizeof(asn_DEF_nonCriticalExtension_tags_4[0]) - 1, /* 1 */
asn_DEF_nonCriticalExtension_tags_4, /* Same as above */
sizeof(asn_DEF_nonCriticalExtension_tags_4)
/sizeof(asn_DEF_nonCriticalExtension_tags_4[0]), /* 2 */
0, /* No PER visible constraints */
0, 0, /* No members */
&asn_SPC_nonCriticalExtension_specs_4 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_MBMSCountingRequest_r10_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct MBMSCountingRequest_r10, countingRequestList_r10),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CountingRequestList_r10,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"countingRequestList-r10"
},
{ ATF_POINTER, 2, offsetof(struct MBMSCountingRequest_r10, lateNonCriticalExtension),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_OCTET_STRING,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"lateNonCriticalExtension"
},
{ ATF_POINTER, 1, offsetof(struct MBMSCountingRequest_r10, nonCriticalExtension),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
0,
&asn_DEF_nonCriticalExtension_4,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"nonCriticalExtension"
},
};
static int asn_MAP_MBMSCountingRequest_r10_oms_1[] = { 1, 2 };
static ber_tlv_tag_t asn_DEF_MBMSCountingRequest_r10_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_MBMSCountingRequest_r10_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* countingRequestList-r10 at 356 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* lateNonCriticalExtension at 357 */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* nonCriticalExtension at 358 */
};
static asn_SEQUENCE_specifics_t asn_SPC_MBMSCountingRequest_r10_specs_1 = {
sizeof(struct MBMSCountingRequest_r10),
offsetof(struct MBMSCountingRequest_r10, _asn_ctx),
asn_MAP_MBMSCountingRequest_r10_tag2el_1,
3, /* Count of tags in the map */
asn_MAP_MBMSCountingRequest_r10_oms_1, /* Optional members */
2, 0, /* Root/Additions */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_MBMSCountingRequest_r10 = {
"MBMSCountingRequest-r10",
"MBMSCountingRequest-r10",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
SEQUENCE_decode_aper,
SEQUENCE_encode_aper,
0, /* Use generic outmost tag fetcher */
asn_DEF_MBMSCountingRequest_r10_tags_1,
sizeof(asn_DEF_MBMSCountingRequest_r10_tags_1)
/sizeof(asn_DEF_MBMSCountingRequest_r10_tags_1[0]), /* 1 */
asn_DEF_MBMSCountingRequest_r10_tags_1, /* Same as above */
sizeof(asn_DEF_MBMSCountingRequest_r10_tags_1)
/sizeof(asn_DEF_MBMSCountingRequest_r10_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_MBMSCountingRequest_r10_1,
3, /* Elements count */
&asn_SPC_MBMSCountingRequest_r10_specs_1 /* Additional specs */
};
|
#ifndef ELIPSEBRUSH_H_
#define ELIPSEBRUSH_H_
#include <cmath>
#include "Brush.h"
class EllipseBrush: public Brush
{
bool perfectCircle;
public:
EllipseBrush(ui::Point size, bool perfectCircle = true):
Brush(size)
{
this->perfectCircle = perfectCircle;
SetRadius(size);
}
void GenerateBitmap() override
{
delete[] bitmap;
bitmap = new unsigned char[size.X*size.Y];
int rx = radius.X;
int ry = radius.Y;
if (!rx)
{
for (int j = 0; j <= 2*ry; j++)
{
bitmap[j*(size.X)+rx] = 255;
}
}
else
{
int yTop = ry+1, yBottom, i;
for (i = 0; i <= rx; i++)
{
if (perfectCircle)
{
while (pow(i - rx, 2.0) * pow(ry - 0.5, 2.0) + pow(yTop - ry, 2.0) * pow(rx - 0.5, 2.0) <= pow(rx, 2.0) * pow(ry, 2.0))
yTop++;
}
else
{
while (pow(i - rx, 2.0) * pow(ry, 2.0) + pow(yTop - ry, 2.0) * pow(rx, 2.0) <= pow(rx, 2.0) * pow(ry, 2.0))
yTop++;
}
yBottom = 2*ry - yTop;
for (int j = 0; j <= ry*2; j++)
{
if (j > yBottom && j < yTop)
{
bitmap[j*(size.X)+i] = 255;
bitmap[j*(size.X)+2*rx-i] = 255;
}
else
{
bitmap[j*(size.X)+i] = 0;
bitmap[j*(size.X)+2*rx-i] = 0;
}
}
}
bitmap[size.X/2] = 255;
bitmap[size.X*size.Y-size.X/2-1] = 255;
}
}
};
#endif /* ELIPSEBRUSH_H_ */
|
// hid_liber custom
// ANSI layout with FN key instead of APP button
// Layer 1 has mediakeys on the nav cluster and keypad numbers for alt-codes
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 0: Default ANSI
*
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
* `---' `---------------' `---------------' `---------------' `-----------'
* ,-----------------------------------------------------------. ,-----------.
* |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU|
* |-----------------------------------------------------------| |-----------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD|
* |-----------------------------------------------------------| `-----------'
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------| ,---.
* |Shft|iso| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up |
* |-----------------------------------------------------------| ,-----------.
* |Ctl|Gui|Alt| Space |Alt|Gui|FN1|Ctl| |Lef|Dow|Rig|
* `-----------------------------------------------------------' `-----------'
*/
KEYMAP(\
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, BRK, \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, PGUP, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, END, PGDN, \
CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \
LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \
LCTL, LGUI, LALT, SPC, RALT, RGUI, FN1, RCTL, LEFT, DOWN, RGHT),
/*
* Layer 1: Media Keys
* Keypad numbers instead of normal numbers
*
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
* `---' `---------------' `---------------' `---------------' `-----------'
* ,-----------------------------------------------------------. ,-----------.
* |~ |KP1|KP2|KP3|KP4|KP5|KP6|KP7|KP8|KP9|KP0| -| =|Backsp | |Ins|Med|Vl+|
* |-----------------------------------------------------------| |-----------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|Mut|Vl-|
* |-----------------------------------------------------------| `-----------'
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------| ,---.
* |Shft|iso| Z| X| C| V| B| N| M| ,| .| /|Shift | |Ply|
* |-----------------------------------------------------------| ,-----------.
* |Ctl|Gui|Alt| Space |Alt|Gui|FN1|Ctl| |Prv|Stp|Nxt|
* `-----------------------------------------------------------' `-----------'
*/
KEYMAP(\
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
TRNS, P1, P2, P3, P4, P5, P6, P7, P8, P9, P0, TRNS, TRNS, TRNS, TRNS, MSEL, VOLU, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MUTE, VOLD, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPLY, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, TRNS, MPRV, MSTP, MNXT),
};
static const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_MOMENTARY(1), // activate layer 1 when FN1 pressed
};
|
//#define DEBUG
#ifdef DEBUG
#define LOGSETUP() Serial.begin(115200)
#define LOGINL(x) Serial.print (x)
#define LOGDEC(x) Serial.print (x, DEC)
#define LOGF(x, y) Serial.printf (x, y)
#define LOGF2(x, y1, y2) Serial.printf (x, y1, y2)
#define LOGF4(x, y1, y2, y3, y4) Serial.printf (x, y1, y2, y3, y4)
#define LOG(x) Serial.println (x)
#else
#define LOGSETUP()
#define LOGINL(x)
#define LOGDEC(x)
#define LOGF(x, y)
#define LOGF2(x, y1, y2)
#define LOGF4(x, y1, y2, y3, y4)
#define LOG(x)
#endif
|
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/iio/buffer.h>
#include <linux/iio/consumer.h>
struct iio_cb_buffer {
struct iio_buffer buffer;
int (*cb)(const void *data, void *private);
void *private;
struct iio_channel *channels;
};
static struct iio_cb_buffer *buffer_to_cb_buffer(struct iio_buffer *buffer)
{
return container_of(buffer, struct iio_cb_buffer, buffer);
}
static int iio_buffer_cb_store_to(struct iio_buffer *buffer, const void *data)
{
struct iio_cb_buffer *cb_buff = buffer_to_cb_buffer(buffer);
return cb_buff->cb(data, cb_buff->private);
}
static void iio_buffer_cb_release(struct iio_buffer *buffer)
{
struct iio_cb_buffer *cb_buff = buffer_to_cb_buffer(buffer);
kfree(cb_buff->buffer.scan_mask);
kfree(cb_buff);
}
static const struct iio_buffer_access_funcs iio_cb_access = {
.store_to = &iio_buffer_cb_store_to,
.release = &iio_buffer_cb_release,
.modes = INDIO_BUFFER_TRIGGERED,
};
struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
int (*cb)(const void *data,
void *private),
void *private)
{
int ret;
struct iio_cb_buffer *cb_buff;
struct iio_dev *indio_dev;
struct iio_channel *chan;
cb_buff = kzalloc(sizeof(*cb_buff), GFP_KERNEL);
if (cb_buff == NULL)
return ERR_PTR(-ENOMEM);
iio_buffer_init(&cb_buff->buffer);
cb_buff->private = private;
cb_buff->cb = cb;
cb_buff->buffer.access = &iio_cb_access;
INIT_LIST_HEAD(&cb_buff->buffer.demux_list);
cb_buff->channels = iio_channel_get_all(dev);
if (IS_ERR(cb_buff->channels)) {
ret = PTR_ERR(cb_buff->channels);
goto error_free_cb_buff;
}
indio_dev = cb_buff->channels[0].indio_dev;
cb_buff->buffer.scan_mask
= kcalloc(BITS_TO_LONGS(indio_dev->masklength), sizeof(long),
GFP_KERNEL);
if (cb_buff->buffer.scan_mask == NULL) {
ret = -ENOMEM;
goto error_release_channels;
}
chan = &cb_buff->channels[0];
while (chan->indio_dev) {
if (chan->indio_dev != indio_dev) {
ret = -EINVAL;
goto error_free_scan_mask;
}
set_bit(chan->channel->scan_index,
cb_buff->buffer.scan_mask);
chan++;
}
return cb_buff;
error_free_scan_mask:
kfree(cb_buff->buffer.scan_mask);
error_release_channels:
iio_channel_release_all(cb_buff->channels);
error_free_cb_buff:
kfree(cb_buff);
return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(iio_channel_get_all_cb);
int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff)
{
return iio_update_buffers(cb_buff->channels[0].indio_dev,
&cb_buff->buffer,
NULL);
}
EXPORT_SYMBOL_GPL(iio_channel_start_all_cb);
void iio_channel_stop_all_cb(struct iio_cb_buffer *cb_buff)
{
iio_update_buffers(cb_buff->channels[0].indio_dev,
NULL,
&cb_buff->buffer);
}
EXPORT_SYMBOL_GPL(iio_channel_stop_all_cb);
void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff)
{
iio_channel_release_all(cb_buff->channels);
iio_buffer_put(&cb_buff->buffer);
}
EXPORT_SYMBOL_GPL(iio_channel_release_all_cb);
struct iio_channel
*iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer)
{
return cb_buffer->channels;
}
EXPORT_SYMBOL_GPL(iio_channel_cb_get_channels);
|
/*
* Copyright(C) 2017 Davidson Francis <davidsondfgl@gmail.com>
*
* This file is part of Nanvix.
*
* Nanvix 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.
*
* Nanvix 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 Nanvix. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Copyright (c) 1994-2009 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the BSD License. This program is distributed in the hope that
* it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
* including the implied warranties of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. A copy of this license is available at
* http://www.opensource.org/licenses. Any Red Hat trademarks that are
* incorporated in the source code or documentation are not subject to
* the BSD License and may only be used or replicated with the express
* permission of Red Hat, Inc.
*/
/*
* Copyright (c) 1981-2000 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:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the University 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.
*/
#include <ctype.h>
/**
* @brief Tests for a visible character.
*
* @details Tests whether @p c is a character of class graph in the
* current locale. The @p c argument is an int, the value of which the
* application shall ensure is representable as an unsigned char or
* equal to the value of the macro #EOF. If the argument has any other
* value, the behavior is undefined.
*
* @param Character to test.
*
* @returns Returns non-zero if @p c is a character with a visible
* representation; otherwise, it returns 0.
*/
int isprint(int c)
{
return(__ctype_ptr__[c+1] & (_P|_U|_L|_N|_B));
}
|
/******************************************************************************
*
* Copyright (C) 1999-2013 Broadcom Corporation
*
* 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 SRVC_ENG_INT_H
#define SRVC_ENG_INT_H
#include "bt_target.h"
#include "gatt_api.h"
#include "srvc_api.h"
#define SRVC_MAX_APPS GATT_CL_MAX_LCB
#define SRVC_ID_NONE 0
#define SRVC_ID_DIS 1
#define SRVC_ID_MAX SRVC_ID_DIS
#define SRVC_ACT_IGNORE 0
#define SRVC_ACT_RSP 1
#define SRVC_ACT_PENDING 2
typedef struct
{
BOOLEAN in_use;
UINT16 conn_id;
BOOLEAN connected;
BD_ADDR bda;
UINT32 trans_id;
UINT8 cur_srvc_id;
tDIS_VALUE dis_value;
}tSRVC_CLCB;
/* service engine control block */
typedef struct
{
tSRVC_CLCB clcb[SRVC_MAX_APPS]; /* connection link*/
tGATT_IF gatt_if;
BOOLEAN enabled;
}tSRVC_ENG_CB;
#ifdef __cplusplus
extern "C" {
#endif
/* Global GATT data */
#if GATT_DYNAMIC_MEMORY == FALSE
GATT_API extern tSRVC_ENG_CB srvc_eng_cb;
#else
GATT_API extern tSRVC_ENG_CB srvc_eng_cb_ptr;
#define srvc_eng_cb (*srvc_eng_cb_ptr)
#endif
extern tSRVC_CLCB *srvc_eng_find_clcb_by_conn_id(UINT16 conn_id);
extern tSRVC_CLCB *srvc_eng_find_clcb_by_bd_addr(BD_ADDR bda);
extern UINT16 srvc_eng_find_conn_id_by_bd_addr(BD_ADDR bda);
extern void srvc_eng_release_channel (UINT16 conn_id) ;
extern BOOLEAN srvc_eng_request_channel (BD_ADDR remote_bda, UINT8 srvc_id );
extern void srvc_sr_rsp(UINT8 clcb_idx, tGATT_STATUS st, tGATTS_RSP *p_rsp);
extern void srvc_sr_notify(BD_ADDR remote_bda, UINT16 handle, UINT16 len, UINT8 *p_value);
#ifdef __cplusplus
}
#endif
#endif
|
#import <oak/misc.h>
@class OakPasteboardSelectorTableViewHelper;
PUBLIC @interface OakPasteboardSelector : NSWindowController
{
@private
IBOutlet NSTableView* tableView;
OakPasteboardSelectorTableViewHelper* tableViewHelper;
}
+ (instancetype)sharedInstance;
- (void)setIndex:(unsigned)index;
- (void)setEntries:(NSArray*)entries;
- (unsigned)showAtLocation:(NSPoint)aLocation;
- (void)setWidth:(CGFloat)width;
- (void)setPerformsActionOnSingleClick;
- (BOOL)shouldSendAction;
- (NSArray*)entries;
@end
|
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_JS_GENERIC_LOWERING_H_
#define V8_COMPILER_JS_GENERIC_LOWERING_H_
#include "src/code-factory.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/linkage.h"
#include "src/compiler/opcodes.h"
namespace v8 {
namespace internal {
namespace compiler {
// Forward declarations.
class CommonOperatorBuilder;
class JSGraph;
class MachineOperatorBuilder;
class Linkage;
// Lowers JS-level operators to runtime and IC calls in the "generic" case.
class JSGenericLowering final : public Reducer {
public:
JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph);
~JSGenericLowering() final;
Reduction Reduce(Node* node) final;
protected:
#define DECLARE_LOWER(x) void Lower##x(Node* node);
// Dispatched depending on opcode.
JS_OP_LIST(DECLARE_LOWER)
#undef DECLARE_LOWER
// Helpers to replace existing nodes with a generic call.
void ReplaceWithCompareIC(Node* node, Token::Value token);
void ReplaceWithStubCall(Node* node, Callable c, CallDescriptor::Flags flags);
void ReplaceWithBuiltinCall(Node* node, Builtins::JavaScript id, int args);
void ReplaceWithRuntimeCall(Node* node, Runtime::FunctionId f, int args = -1);
// Helper for optimization of JSCallFunction.
bool TryLowerDirectJSCall(Node* node);
Zone* zone() const;
Isolate* isolate() const;
JSGraph* jsgraph() const { return jsgraph_; }
Graph* graph() const;
CommonOperatorBuilder* common() const;
MachineOperatorBuilder* machine() const;
private:
bool const is_typing_enabled_;
JSGraph* const jsgraph_;
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_JS_GENERIC_LOWERING_H_
|
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
This file is part of ChibiOS.
ChibiOS 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.
ChibiOS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file SPC563Mxx/ppcparams.h
* @brief PowerPC parameters for the SPC563Mxx.
*
* @defgroup PPC_SPC563Mxx SPC563Mxx Specific Parameters
* @ingroup PPC_SPECIFIC
* @details This file contains the PowerPC specific parameters for the
* SPC563Mxx platform.
* @{
*/
#ifndef _PPCPARAMS_H_
#define _PPCPARAMS_H_
/**
* @brief Family identification macro.
*/
#define PPC_SPC563Mxx
/**
* @brief PPC core model.
*/
#define PPC_VARIANT PPC_VARIANT_e200z3
/**
* @brief Number of cores.
*/
#define PPC_CORE_NUMBER 1
/**
* @brief Number of writable bits in IVPR register.
*/
#define PPC_IVPR_BITS 16
/**
* @brief IVORx registers support.
*/
#define PPC_SUPPORTS_IVORS TRUE
/**
* @brief Book E instruction set support.
*/
#define PPC_SUPPORTS_BOOKE TRUE
/**
* @brief VLE instruction set support.
*/
#define PPC_SUPPORTS_VLE TRUE
/**
* @brief Supports VLS Load/Store Multiple Volatile instructions.
*/
#define PPC_SUPPORTS_VLE_MULTI TRUE
/**
* @brief Supports the decrementer timer.
*/
#define PPC_SUPPORTS_DECREMENTER TRUE
/**
* @brief Number of interrupt sources.
*/
#define PPC_NUM_VECTORS 360
#endif /* _PPCPARAMS_H_ */
/** @} */
|
/*
* Copyright 2010-2014 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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.
*
* OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENXCOM_ARTICLESTATEBASEFACILITY_H
#define OPENXCOM_ARTICLESTATEBASEFACILITY_H
#include "ArticleState.h"
namespace OpenXcom
{
class Game;
class Surface;
class Text;
class TextList;
class ArticleDefinitionBaseFacility;
/**
* ArticleStateBaseFacility has a caption, text, preview image and a stats block.
* The facility image is found using the RuleBasefacility class.
*/
class ArticleStateBaseFacility : public ArticleState
{
public:
ArticleStateBaseFacility(ArticleDefinitionBaseFacility *article_defs);
virtual ~ArticleStateBaseFacility();
protected:
Surface *_image;
Text *_txtTitle;
Text *_txtInfo;
TextList *_lstInfo;
};
}
#endif
|
/*
* virsh-domain.h: Commands to manage domain
*
* Copyright (C) 2005, 2007-2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "virsh.h"
struct virshDomainEventCallback {
const char *name;
virConnectDomainEventGenericCallback cb;
};
typedef struct virshDomainEventCallback virshDomainEventCallback;
extern virshDomainEventCallback virshDomainEventCallbacks[];
typedef enum {
VIRSH_DOMAIN_HOSTNAME_SOURCE_AGENT,
VIRSH_DOMAIN_HOSTNAME_SOURCE_LEASE,
VIRSH_DOMAIN_HOSTNAME_SOURCE_LAST
} virshDomainHostnameSource;
VIR_ENUM_DECL(virshDomainHostnameSource);
typedef enum {
VIRSH_DOMAIN_INTERFACE_SOURCE_MODE_SERVER,
VIRSH_DOMAIN_INTERFACE_SOURCE_MODE_CLIENT,
VIRSH_DOMAIN_INTERFACE_SOURCE_MODE_LAST
} virshDomainInterfaceSourceMode;
VIR_ENUM_DECL(virshDomainInterfaceSourceMode);
typedef enum {
VIRSH_DOMAIN_DIRTYRATE_CALC_MODE_PAGE_SAMPLING,
VIRSH_DOMAIN_DIRTYRATE_CALC_MODE_DIRTY_BITMAP,
VIRSH_DOMAIN_DIRTYRATE_CALC_MODE_DIRTY_RING,
VIRSH_DOMAIN_DIRTYRATE_CALC_MODE_LAST,
} virshDomainDirtyRateCalcMode;
VIR_ENUM_DECL(virshDomainDirtyRateCalcMode);
extern const vshCmdDef domManagementCmds[];
VIR_ENUM_DECL(virshDomainProcessSignal);
VIR_ENUM_DECL(virshDomainLifecycle);
VIR_ENUM_DECL(virshDomainLifecycleAction);
VIR_ENUM_DECL(virshDomainCoreDumpFormat);
|
/*
* Copyright (C) 2013, 2014 INRIA
* 2015 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup boards_telosb TelosB
* @ingroup boards
* @brief Support for the TelosB board
*
* <h2>Compontents</h2>
* \li MSP430
* \li CC2420
*
* @{
*
* @file
* @brief Basic definitions for the TelosB board
*
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef TELOSB_BOARD_H_
#define TELOSB_BOARD_H_
#include "cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Define the CPU model for the <msp430.h>
*/
#ifndef __MSP430F1611__
#define __MSP430F1611__
#endif
/**
* @brief Override default baudrate for STDIO
* @{
*/
#ifndef UART_STDIO_BAUDRATE
#define UART_STDIO_BAUDRATE (9600)
#endif
/** @} */
/**
* @brief Xtimer configuration
* @{
*/
#define XTIMER_DEV (0)
#define XTIMER_CHAN (0)
#define XTIMER_WIDTH (16)
#define XTIMER_BACKOFF (40)
/** @} */
/**
* @brief CPU core configuration
*
* @todo Move this to the periph_conf.h
* @{
*/
#define MSP430_INITIAL_CPU_SPEED 2457600uL
#define F_CPU MSP430_INITIAL_CPU_SPEED
#define F_RC_OSCILLATOR 32768
#define MSP430_HAS_DCOR 0
#define MSP430_HAS_EXTERNAL_CRYSTAL 1
/** @} */
/**
* @brief LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(4, 0)
#define LED1_PIN GPIO_PIN(4, 1)
#define LED2_PIN GPIO_PIN(4, 2)
#define LED_OUT_REG P5OUT
#define LED0_MASK (0x10)
#define LED1_MASK (0x20)
#define LED2_MASK (0x40)
#define LED0_ON (LED_OUT_REG &=~LED0_MASK)
#define LED0_OFF (LED_OUT_REG |= LED0_MASK)
#define LED0_TOGGLE (LED_OUT_REG ^= LED0_MASK)
#define LED1_ON (LED_OUT_REG &=~LED1_MASK)
#define LED1_OFF (LED_OUT_REG |= LED1_MASK)
#define LED1_TOGGLE (LED_OUT_REG ^= LED1_MASK)
#define LED2_ON (LED_OUT_REG &=~LED2_MASK)
#define LED2_OFF (LED_OUT_REG |= LED2_MASK)
#define LED2_TOGGLE (LED_OUT_REG ^= LED2_MASK)
/** @} */
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* TELOSB_BOARD_H_ */
|
/********************************************************************************/
/* */
/* */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: HMAC_Start_fp.h 1257 2018-06-27 20:52:08Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
/* 1. Copyright Licenses: */
/* */
/* - Trusted Computing Group (TCG) grants to the user of the source code in */
/* this specification (the "Source Code") a worldwide, irrevocable, */
/* nonexclusive, royalty free, copyright license to reproduce, create */
/* derivative works, distribute, display and perform the Source Code and */
/* derivative works thereof, and to grant others the rights granted herein. */
/* */
/* - The TCG grants to the user of the other parts of the specification */
/* (other than the Source Code) the rights to reproduce, distribute, */
/* display, and perform the specification solely for the purpose of */
/* developing products based on such documents. */
/* */
/* 2. Source Code Distribution Conditions: */
/* */
/* - Redistributions of Source Code must retain the above copyright licenses, */
/* this list of conditions and the following disclaimers. */
/* */
/* - Redistributions in binary form must reproduce the above copyright */
/* licenses, this list of conditions and the following disclaimers in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* 3. Disclaimers: */
/* */
/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */
/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */
/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */
/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */
/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */
/* information on specification licensing rights available through TCG */
/* membership agreements. */
/* */
/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */
/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */
/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */
/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */
/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */
/* */
/* - Without limitation, TCG and its members and licensors disclaim all */
/* liability, including liability for infringement of any proprietary */
/* rights, relating to use of information in this specification and to the */
/* implementation of this specification, and TCG disclaims all liability for */
/* cost of procurement of substitute goods or services, lost profits, loss */
/* of use, loss of data or any incidental, consequential, direct, indirect, */
/* or special damages, whether under contract, tort, warranty or otherwise, */
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
/* (c) Copyright IBM Corp. and others, 2012-2015 */
/* */
/********************************************************************************/
/* rev 119 */
#ifndef HMAC_START_FP_H
#define HMAC_START_FP_H
typedef struct {
TPMI_DH_OBJECT handle;
TPM2B_AUTH auth;
TPMI_ALG_HASH hashAlg;
} HMAC_Start_In;
typedef struct {
TPMI_DH_OBJECT sequenceHandle;
} HMAC_Start_Out;
#define RC_HMAC_Start_handle (TPM_RC_H + TPM_RC_1)
#define RC_HMAC_Start_auth (TPM_RC_P + TPM_RC_1)
#define RC_HMAC_Start_hashAlg (TPM_RC_P + TPM_RC_2)
TPM_RC
TPM2_HMAC_Start(
HMAC_Start_In *in, // IN: input parameter list
HMAC_Start_Out *out // OUT: output parameter list
);
#endif
|
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_
#define V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_
#include "src/frames.h"
#include "src/interpreter/bytecode-register.h"
#include "src/interpreter/bytecodes.h"
#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
template <typename T>
class Handle;
class HandlerTable;
class Isolate;
namespace interpreter {
// A helper class for constructing exception handler tables for the interpreter.
class V8_EXPORT_PRIVATE HandlerTableBuilder final {
public:
explicit HandlerTableBuilder(Zone* zone);
// Builds the actual handler table by copying the current values into a heap
// object. Any further mutations to the builder won't be reflected.
Handle<ByteArray> ToHandlerTable(Isolate* isolate);
// Creates a new handler table entry and returns a {hander_id} identifying the
// entry, so that it can be referenced by below setter functions.
int NewHandlerEntry();
// Setter functions that modify certain values within the handler table entry
// being referenced by the given {handler_id}. All values will be encoded by
// the resulting {HandlerTable} class when copied into the heap.
void SetTryRegionStart(int handler_id, size_t offset);
void SetTryRegionEnd(int handler_id, size_t offset);
void SetHandlerTarget(int handler_id, size_t offset);
void SetPrediction(int handler_id, HandlerTable::CatchPrediction prediction);
void SetContextRegister(int handler_id, Register reg);
private:
struct Entry {
size_t offset_start; // Bytecode offset starting try-region.
size_t offset_end; // Bytecode offset ending try-region.
size_t offset_target; // Bytecode offset of handler target.
Register context; // Register holding context for handler.
// Optimistic prediction for handler.
HandlerTable::CatchPrediction catch_prediction_;
};
ZoneVector<Entry> entries_;
DISALLOW_COPY_AND_ASSIGN(HandlerTableBuilder);
};
} // namespace interpreter
} // namespace internal
} // namespace v8
#endif // V8_INTERPRETER_HANDLER_TABLE_BUILDER_H_
|
/* usb_cdc.h - USB CDC-ACM and CDC-ECM public header */
/*
* Copyright (c) 2017 PHYTEC Messtechnik GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief USB Communications Device Class (CDC) public header
*
* Header follows the Class Definitions for
* Communications Devices Specification (CDC120-20101103-track.pdf),
* PSTN Devices Specification (PSTN120.pdf) and
* Ethernet Control Model Devices Specification (ECM120.pdf).
* Header is limited to ACM and ECM Subclasses.
*/
#ifndef ZEPHYR_INCLUDE_USB_CLASS_USB_CDC_H_
#define ZEPHYR_INCLUDE_USB_CLASS_USB_CDC_H_
/** CDC Specification release number in BCD format */
#define CDC_SRN_1_20 0x0120
/** Communications Class Subclass Codes */
#define ACM_SUBCLASS 0x02
#define ECM_SUBCLASS 0x06
#define EEM_SUBCLASS 0x0c
/** Communications Class Protocol Codes */
#define AT_CMD_V250_PROTOCOL 0x01
#define EEM_PROTOCOL 0x07
#define ACM_VENDOR_PROTOCOL 0xFF
/**
* @brief Data Class Interface Codes
* @note CDC120-20101103-track.pdf, 4.5, Table 6
*/
#define DATA_INTERFACE_CLASS 0x0A
/**
* @brief bDescriptor SubType for Communications
* Class Functional Descriptors
* @note CDC120-20101103-track.pdf, 5.2.3, Table 13
*/
#define HEADER_FUNC_DESC 0x00
#define CALL_MANAGEMENT_FUNC_DESC 0x01
#define ACM_FUNC_DESC 0x02
#define UNION_FUNC_DESC 0x06
#define ETHERNET_FUNC_DESC 0x0F
/**
* @brief PSTN Subclass Specific Requests
* for ACM devices
* @note PSTN120.pdf, 6.3, Table 13
*/
#define CDC_SEND_ENC_CMD 0x00
#define CDC_GET_ENC_RSP 0x01
#define SET_LINE_CODING 0x20
#define GET_LINE_CODING 0x21
#define SET_CONTROL_LINE_STATE 0x22
/** Control Signal Bitmap Values for SetControlLineState */
#define SET_CONTROL_LINE_STATE_RTS 0x02
#define SET_CONTROL_LINE_STATE_DTR 0x01
/** Enhance enum uart_line_ctrl with CDC specific values */
#define USB_CDC_LINE_CTRL_BAUD_RATE UART_LINE_CTRL_BAUD_RATE
#define USB_CDC_LINE_CTRL_DCD UART_LINE_CTRL_DCD
#define USB_CDC_LINE_CTRL_DSR UART_LINE_CTRL_DSR
#define USB_CDC_LINE_CTRL_BREAK BIT(5)
#define USB_CDC_LINE_CTRL_RING_SIGNAL BIT(6)
#define USB_CDC_LINE_CTRL_FRAMING BIT(7)
#define USB_CDC_LINE_CTRL_PARITY BIT(8)
#define USB_CDC_LINE_CTRL_OVER_RUN BIT(9)
/** UART State Bitmap Values */
#define SERIAL_STATE_OVER_RUN 0x40
#define SERIAL_STATE_PARITY 0x20
#define SERIAL_STATE_FRAMING 0x10
#define SERIAL_STATE_RING_SIGNAL 0x08
#define SERIAL_STATE_BREAK 0x04
#define SERIAL_STATE_TX_CARRIER 0x02
#define SERIAL_STATE_RX_CARRIER 0x01
/**
* @brief Class-Specific Request Codes for Ethernet subclass
* @note ECM120.pdf, 6.2, Table 6
*/
#define SET_ETHERNET_MULTICAST_FILTERS 0x40
#define SET_ETHERNET_PM_FILTER 0x41
#define GET_ETHERNET_PM_FILTER 0x42
#define SET_ETHERNET_PACKET_FILTER 0x43
#define GET_ETHERNET_STATISTIC 0x44
/** Ethernet Packet Filter Bitmap */
#define PACKET_TYPE_MULTICAST 0x10
#define PACKET_TYPE_BROADCAST 0x08
#define PACKET_TYPE_DIRECTED 0x04
#define PACKET_TYPE_ALL_MULTICAST 0x02
#define PACKET_TYPE_PROMISCUOUS 0x01
/** Header Functional Descriptor */
struct cdc_header_descriptor {
uint8_t bFunctionLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
uint16_t bcdCDC;
} __packed;
/** Union Interface Functional Descriptor */
struct cdc_union_descriptor {
uint8_t bFunctionLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
uint8_t bControlInterface;
uint8_t bSubordinateInterface0;
} __packed;
/** Call Management Functional Descriptor */
struct cdc_cm_descriptor {
uint8_t bFunctionLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
uint8_t bmCapabilities;
uint8_t bDataInterface;
} __packed;
/** Abstract Control Management Functional Descriptor */
struct cdc_acm_descriptor {
uint8_t bFunctionLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
uint8_t bmCapabilities;
} __packed;
/** Data structure for GET_LINE_CODING / SET_LINE_CODING class requests */
struct cdc_acm_line_coding {
uint32_t dwDTERate;
uint8_t bCharFormat;
uint8_t bParityType;
uint8_t bDataBits;
} __packed;
/** Data structure for the notification about SerialState */
struct cdc_acm_notification {
uint8_t bmRequestType;
uint8_t bNotificationType;
uint16_t wValue;
uint16_t wIndex;
uint16_t wLength;
uint16_t data;
} __packed;
/** Ethernet Networking Functional Descriptor */
struct cdc_ecm_descriptor {
uint8_t bFunctionLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
uint8_t iMACAddress;
uint32_t bmEthernetStatistics;
uint16_t wMaxSegmentSize;
uint16_t wNumberMCFilters;
uint8_t bNumberPowerFilters;
} __packed;
#endif /* ZEPHYR_INCLUDE_USB_CLASS_USB_CDC_H_ */
|
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \
// RUN: -emit-llvm -o - %s -debug-info-kind=limited 2>&1 | FileCheck %s
void test_locals(void) {
// CHECK-DAG: name: "__clang_svint8x4_t",{{.*}}, baseType: ![[CT8:[0-9]+]]
// CHECK-DAG: ![[CT8]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY8:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS8x4:[0-9]+]])
// CHECK-DAG: ![[ELTTY8]] = !DIBasicType(name: "signed char", size: 8, encoding: DW_ATE_signed_char)
// CHECK-DAG: ![[ELTS8x4]] = !{![[REALELTS8x4:[0-9]+]]}
// CHECK-DAG: ![[REALELTS8x4]] = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 32, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
__clang_svint8x4_t s8;
// CHECK-DAG: name: "__clang_svuint8x4_t",{{.*}}, baseType: ![[CT8:[0-9]+]]
// CHECK-DAG: ![[CT8]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY8:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS8x4]])
// CHECK-DAG: ![[ELTTY8]] = !DIBasicType(name: "unsigned char", size: 8, encoding: DW_ATE_unsigned_char)
__clang_svuint8x4_t u8;
// CHECK-DAG: name: "__clang_svint16x4_t",{{.*}}, baseType: ![[CT16:[0-9]+]]
// CHECK-DAG: ![[CT16]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY16:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS16x4:[0-9]+]])
// CHECK-DAG: ![[ELTTY16]] = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)
// CHECK-DAG: ![[ELTS16x4]] = !{![[REALELTS16x4:[0-9]+]]}
// CHECK-DAG: ![[REALELTS16x4]] = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 16, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
__clang_svint16x4_t s16;
// CHECK-DAG: name: "__clang_svuint16x4_t",{{.*}}, baseType: ![[CT16:[0-9]+]]
// CHECK-DAG: ![[CT16]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY16:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS16x4]])
// CHECK-DAG: ![[ELTTY16]] = !DIBasicType(name: "unsigned short", size: 16, encoding: DW_ATE_unsigned)
__clang_svuint16x4_t u16;
// CHECK-DAG: name: "__clang_svint32x4_t",{{.*}}, baseType: ![[CT32:[0-9]+]]
// CHECK-DAG: ![[CT32]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY32:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS32x4:[0-9]+]])
// CHECK-DAG: ![[ELTTY32]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK-DAG: ![[ELTS32x4]] = !{![[REALELTS32x4:[0-9]+]]}
// CHECK-DAG: ![[REALELTS32x4]] = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 8, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
__clang_svint32x4_t s32;
// CHECK-DAG: name: "__clang_svuint32x4_t",{{.*}}, baseType: ![[CT32:[0-9]+]]
// CHECK-DAG: ![[CT32]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY32:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS32x4]])
// CHECK-DAG: ![[ELTTY32]] = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
__clang_svuint32x4_t u32;
// CHECK-DAG: name: "__clang_svint64x4_t",{{.*}}, baseType: ![[CT64:[0-9]+]]
// CHECK-DAG: ![[CT64]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY64:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS1x4_64:[0-9]+]])
// CHECK-DAG: ![[ELTTY64]] = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
// CHECK-DAG: ![[ELTS1x4_64]] = !{![[REALELTS1x4_64:[0-9]+]]}
// CHECK-DAG: ![[REALELTS1x4_64]] = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 4, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
__clang_svint64x4_t s64;
// CHECK-DAG: name: "__clang_svuint64x4_t",{{.*}}, baseType: ![[CT64:[0-9]+]]
// CHECK-DAG: ![[CT64]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY64:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS1x4_64]])
// CHECK-DAG: ![[ELTTY64]] = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
__clang_svuint64x4_t u64;
// CHECK: name: "__clang_svfloat16x4_t",{{.*}}, baseType: ![[CT16:[0-9]+]]
// CHECK-DAG: ![[CT16]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY16:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS16x4]])
// CHECK-DAG: ![[ELTTY16]] = !DIBasicType(name: "__fp16", size: 16, encoding: DW_ATE_float)
__clang_svfloat16x4_t f16;
// CHECK: name: "__clang_svfloat32x4_t",{{.*}}, baseType: ![[CT32:[0-9]+]]
// CHECK-DAG: ![[CT32]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY32:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS32x4]])
// CHECK-DAG: ![[ELTTY32]] = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
__clang_svfloat32x4_t f32;
// CHECK: name: "__clang_svfloat64x4_t",{{.*}}, baseType: ![[CT64:[0-9]+]]
// CHECK-DAG: ![[CT64]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[ELTTY64:[0-9]+]], flags: DIFlagVector, elements: ![[ELTS1x4_64]])
// CHECK-DAG: ![[ELTTY64]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
__clang_svfloat64x4_t f64;
}
|
#ifndef POLY_H
#define POLY_H
#include "params.h"
#include <stdint.h>
/*
* Elements of R_q = Z_q[X]/(X^n + 1). Represents polynomial
* coeffs[0] + X*coeffs[1] + X^2*xoeffs[2] + ... + X^{n-1}*coeffs[n-1]
*/
typedef struct {
int16_t coeffs[KYBER_N];
} poly;
void PQCLEAN_KYBER51290S_CLEAN_poly_compress(uint8_t *r, poly *a);
void PQCLEAN_KYBER51290S_CLEAN_poly_decompress(poly *r, const uint8_t *a);
void PQCLEAN_KYBER51290S_CLEAN_poly_tobytes(uint8_t *r, poly *a);
void PQCLEAN_KYBER51290S_CLEAN_poly_frombytes(poly *r, const uint8_t *a);
void PQCLEAN_KYBER51290S_CLEAN_poly_frommsg(poly *r, const uint8_t msg[KYBER_SYMBYTES]);
void PQCLEAN_KYBER51290S_CLEAN_poly_tomsg(uint8_t msg[KYBER_SYMBYTES], poly *a);
void PQCLEAN_KYBER51290S_CLEAN_poly_getnoise(poly *r, const uint8_t *seed, uint8_t nonce);
void PQCLEAN_KYBER51290S_CLEAN_poly_ntt(poly *r);
void PQCLEAN_KYBER51290S_CLEAN_poly_invntt(poly *r);
void PQCLEAN_KYBER51290S_CLEAN_poly_basemul(poly *r, const poly *a, const poly *b);
void PQCLEAN_KYBER51290S_CLEAN_poly_frommont(poly *r);
void PQCLEAN_KYBER51290S_CLEAN_poly_reduce(poly *r);
void PQCLEAN_KYBER51290S_CLEAN_poly_csubq(poly *r);
void PQCLEAN_KYBER51290S_CLEAN_poly_add(poly *r, const poly *a, const poly *b);
void PQCLEAN_KYBER51290S_CLEAN_poly_sub(poly *r, const poly *a, const poly *b);
#endif
|
/*
* Copyright 2008-2010 NVIDIA Corporation
*
* 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.
*/
#pragma once
#include <thrust/iterator/iterator_categories.h>
#include <thrust/iterator/iterator_traits.h>
#include <thrust/detail/type_traits.h>
#include <thrust/iterator/detail/device_iterator_category_to_backend_space.h>
namespace thrust
{
// XXX WAR circular #inclusion with forward declarations
struct random_access_universal_iterator_tag;
struct input_universal_iterator_tag;
struct output_universal_iterator_tag;
namespace detail
{
// forward declaration
template <typename> struct is_iterator_space;
template <typename> struct device_iterator_category_to_backend_space;
template<typename Category>
struct iterator_category_to_space
// convertible to any iterator?
: eval_if<
or_<
is_convertible<Category, thrust::input_universal_iterator_tag>,
is_convertible<Category, thrust::output_universal_iterator_tag>
>::value,
detail::identity_<thrust::any_space_tag>,
// convertible to host iterator?
eval_if<
or_<
is_convertible<Category, thrust::input_host_iterator_tag>,
is_convertible<Category, thrust::output_host_iterator_tag>
>::value,
detail::identity_<thrust::host_space_tag>,
// convertible to device iterator?
eval_if<
or_<
is_convertible<Category, thrust::input_device_iterator_tag>,
is_convertible<Category, thrust::output_device_iterator_tag>
>::value,
device_iterator_category_to_backend_space<Category>,
// unknown space
void
> // if device
> // if host
> // if any
{
}; // end iterator_category_to_space
template<typename CategoryOrTraversal>
struct iterator_category_or_traversal_to_space
: eval_if<
is_iterator_space<CategoryOrTraversal>::value,
detail::identity_<CategoryOrTraversal>,
iterator_category_to_space<CategoryOrTraversal>
>
{
}; // end iterator_category_or_traversal_to_space
} // end detail
} // end thrust
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _ZFS_COMUTIL_H
#define _ZFS_COMUTIL_H
#include <sys/fs/zfs.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
extern boolean_t zfs_allocatable_devs(nvlist_t *);
extern void zpool_get_rewind_policy(nvlist_t *, zpool_rewind_policy_t *);
extern int zfs_zpl_version_map(int spa_version);
extern int zfs_spa_version_map(int zpl_version);
extern const char *zfs_history_event_names[LOG_END];
#ifdef __cplusplus
}
#endif
#endif /* _ZFS_COMUTIL_H */
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/layer.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <guacamole/user.h>
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define U 0x80,0x80,0x80,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
/* Dimensions */
const int guac_common_ibar_cursor_width = 7;
const int guac_common_ibar_cursor_height = 16;
/* Format */
const cairo_format_t guac_common_ibar_cursor_format = CAIRO_FORMAT_ARGB32;
const int guac_common_ibar_cursor_stride = 28;
/* Embedded I-bar graphic */
unsigned char guac_common_ibar_cursor[] = {
X,X,X,X,X,X,X,
X,O,O,U,O,O,X,
X,X,X,O,X,X,X,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
X,X,X,O,X,X,X,
X,O,O,U,O,O,X,
X,X,X,X,X,X,X
};
void guac_common_set_ibar_cursor(guac_user* user) {
guac_client* client = user->client;
guac_socket* socket = user->socket;
/* Draw to buffer */
guac_layer* cursor = guac_client_alloc_buffer(client);
cairo_surface_t* graphic = cairo_image_surface_create_for_data(
guac_common_ibar_cursor,
guac_common_ibar_cursor_format,
guac_common_ibar_cursor_width,
guac_common_ibar_cursor_height,
guac_common_ibar_cursor_stride);
guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
0, 0, graphic);
cairo_surface_destroy(graphic);
/* Set cursor */
guac_protocol_send_cursor(socket, 0, 0, cursor,
guac_common_ibar_cursor_width / 2,
guac_common_ibar_cursor_height / 2,
guac_common_ibar_cursor_width,
guac_common_ibar_cursor_height);
/* Free buffer */
guac_client_free_buffer(client, cursor);
guac_client_log(client, GUAC_LOG_DEBUG,
"Client cursor image set to generic built-in I-bar.");
}
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_DEFINES_H_
#define MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_DEFINES_H_
#include <string>
#include <vector>
#include "api/video/video_frame.h"
// For EncodedImage
#include "common_video/include/video_frame.h"
#include "modules/include/module_common_types.h"
#include "typedefs.h" // NOLINT(build/include)
namespace webrtc {
// Error codes
#define VCM_FRAME_NOT_READY 3
#define VCM_MISSING_CALLBACK 1
#define VCM_OK 0
#define VCM_GENERAL_ERROR -1
#define VCM_LEVEL_EXCEEDED -2
#define VCM_MEMORY -3
#define VCM_PARAMETER_ERROR -4
#define VCM_UNKNOWN_PAYLOAD -5
#define VCM_CODEC_ERROR -6
#define VCM_UNINITIALIZED -7
#define VCM_NO_CODEC_REGISTERED -8
#define VCM_JITTER_BUFFER_ERROR -9
#define VCM_OLD_PACKET_ERROR -10
#define VCM_NO_FRAME_DECODED -11
#define VCM_NOT_IMPLEMENTED -20
enum {
// Timing frames settings. Timing frames are sent every
// |kDefaultTimingFramesDelayMs|, or if the frame is at least
// |kDefaultOutliserFrameSizePercent| in size of average frame.
kDefaultTimingFramesDelayMs = 200,
kDefaultOutlierFrameSizePercent = 250,
// Maximum number of frames for what we store encode start timing information.
kMaxEncodeStartTimeListSize = 50,
};
enum VCMVideoProtection {
kProtectionNone,
kProtectionNack,
kProtectionFEC,
kProtectionNackFEC,
};
enum VCMTemporalDecimation {
kBitrateOverUseDecimation,
};
struct VCMFrameCount {
uint32_t numKeyFrames;
uint32_t numDeltaFrames;
};
// Callback class used for passing decoded frames which are ready to be
// rendered.
class VCMReceiveCallback {
public:
virtual int32_t FrameToRender(VideoFrame& videoFrame, // NOLINT
rtc::Optional<uint8_t> qp,
VideoContentType content_type) = 0;
virtual int32_t ReceivedDecodedReferenceFrame(const uint64_t pictureId) {
return -1;
}
// Called when the current receive codec changes.
virtual void OnIncomingPayloadType(int payload_type) {}
virtual void OnDecoderImplementationName(const char* implementation_name) {}
protected:
virtual ~VCMReceiveCallback() {}
};
// Callback class used for informing the user of the incoming bit rate and frame
// rate.
class VCMReceiveStatisticsCallback {
public:
virtual void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) = 0;
virtual void OnCompleteFrame(bool is_keyframe,
size_t size_bytes,
VideoContentType content_type) = 0;
virtual void OnDiscardedPacketsUpdated(int discarded_packets) = 0;
virtual void OnFrameCountsUpdated(const FrameCounts& frame_counts) = 0;
virtual void OnFrameBufferTimingsUpdated(int decode_ms,
int max_decode_ms,
int current_delay_ms,
int target_delay_ms,
int jitter_buffer_ms,
int min_playout_delay_ms,
int render_delay_ms) = 0;
virtual void OnTimingFrameInfoUpdated(const TimingFrameInfo& info) = 0;
protected:
virtual ~VCMReceiveStatisticsCallback() {}
};
// Callback class used for telling the user about how to configure the FEC,
// and the rates sent the last second is returned to the VCM.
class VCMProtectionCallback {
public:
virtual int ProtectionRequest(const FecProtectionParams* delta_params,
const FecProtectionParams* key_params,
uint32_t* sent_video_rate_bps,
uint32_t* sent_nack_rate_bps,
uint32_t* sent_fec_rate_bps) = 0;
protected:
virtual ~VCMProtectionCallback() {}
};
// Callback class used for telling the user about what frame type needed to
// continue decoding.
// Typically a key frame when the stream has been corrupted in some way.
class VCMFrameTypeCallback {
public:
virtual int32_t RequestKeyFrame() = 0;
protected:
virtual ~VCMFrameTypeCallback() {}
};
// Callback class used for telling the user about which packet sequence numbers
// are currently
// missing and need to be resent.
// TODO(philipel): Deprecate VCMPacketRequestCallback
// and use NackSender instead.
class VCMPacketRequestCallback {
public:
virtual int32_t ResendPackets(const uint16_t* sequenceNumbers,
uint16_t length) = 0;
protected:
virtual ~VCMPacketRequestCallback() {}
};
class NackSender {
public:
virtual void SendNack(const std::vector<uint16_t>& sequence_numbers) = 0;
protected:
virtual ~NackSender() {}
};
class KeyFrameRequestSender {
public:
virtual void RequestKeyFrame() = 0;
protected:
virtual ~KeyFrameRequestSender() {}
};
} // namespace webrtc
#endif // MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_DEFINES_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_H_
#define CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_H_
#include <jni.h>
#include "base/android/scoped_java_ref.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "components/sessions/core/tab_restore_service_observer.h"
class Profile;
// Provides the list of recently closed tabs to Java.
class RecentlyClosedTabsBridge : public sessions::TabRestoreServiceObserver {
public:
explicit RecentlyClosedTabsBridge(Profile* profile);
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
void SetRecentlyClosedCallback(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jobject>& jcallback);
jboolean GetRecentlyClosedTabs(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jobject>& jtabs,
jint max_tab_count);
jboolean OpenRecentlyClosedTab(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jobject>& jtab,
jint tab_id,
jint j_disposition);
jboolean OpenMostRecentlyClosedTab(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void ClearRecentlyClosedTabs(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
// Observer callback for TabRestoreServiceObserver. Notifies the registered
// callback that the recently closed tabs list has changed.
void TabRestoreServiceChanged(sessions::TabRestoreService* service) override;
// Observer callback when our associated TabRestoreService is destroyed.
void TabRestoreServiceDestroyed(
sessions::TabRestoreService* service) override;
// Registers JNI methods.
static bool Register(JNIEnv* env);
private:
~RecentlyClosedTabsBridge() override;
// Construct and initialize tab_restore_service_ if it's NULL.
// tab_restore_service_ may still be NULL, however, in incognito mode.
void EnsureTabRestoreService();
// The callback to be notified when the list of recently closed tabs changes.
base::android::ScopedJavaGlobalRef<jobject> callback_;
// The profile whose recently closed tabs are being monitored.
Profile* profile_;
// TabRestoreService that we are observing.
sessions::TabRestoreService* tab_restore_service_;
DISALLOW_COPY_AND_ASSIGN(RecentlyClosedTabsBridge);
};
#endif // CHROME_BROWSER_ANDROID_RECENTLY_CLOSED_TABS_BRIDGE_H_
|
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
* Copyright (C) 2013 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.
* 3. Neither the name of Google, Inc. ("Google") 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 GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef Crypto_h
#define Crypto_h
#include "ContextDestructionObserver.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
namespace JSC {
class ArrayBufferView;
}
namespace WebCore {
typedef int ExceptionCode;
class Document;
class SubtleCrypto;
class Crypto : public ContextDestructionObserver, public RefCounted<Crypto> {
public:
static PassRefPtr<Crypto> create(Document& document) { return adoptRef(new Crypto(document)); }
virtual ~Crypto();
Document* document() const;
void getRandomValues(JSC::ArrayBufferView*, ExceptionCode&);
#if ENABLE(SUBTLE_CRYPTO)
SubtleCrypto* subtle();
#endif
private:
Crypto(Document&);
#if ENABLE(SUBTLE_CRYPTO)
RefPtr<SubtleCrypto> m_subtle;
#endif
};
}
#endif
|
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef BorderData_h
#define BorderData_h
#include "BorderValue.h"
#include "IntRect.h"
#include "LengthSize.h"
#include "NinePieceImage.h"
namespace WebCore {
class BorderData {
friend class RenderStyle;
public:
BorderData() : m_topLeft(Length(0, Fixed), Length(0, Fixed))
, m_topRight(Length(0, Fixed), Length(0, Fixed))
, m_bottomLeft(Length(0, Fixed), Length(0, Fixed))
, m_bottomRight(Length(0, Fixed), Length(0, Fixed))
{
}
bool hasBorder() const
{
bool haveImage = m_image.hasImage();
return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage);
}
bool hasBorderRadius() const
{
if (!m_topLeft.width().isZero())
return true;
if (!m_topRight.width().isZero())
return true;
if (!m_bottomLeft.width().isZero())
return true;
if (!m_bottomRight.width().isZero())
return true;
return false;
}
float borderLeftWidth() const
{
if (!m_image.hasImage() && (m_left.style() == BNONE || m_left.style() == BHIDDEN))
return 0;
return m_left.width();
}
float borderRightWidth() const
{
if (!m_image.hasImage() && (m_right.style() == BNONE || m_right.style() == BHIDDEN))
return 0;
return m_right.width();
}
float borderTopWidth() const
{
if (!m_image.hasImage() && (m_top.style() == BNONE || m_top.style() == BHIDDEN))
return 0;
return m_top.width();
}
float borderBottomWidth() const
{
if (!m_image.hasImage() && (m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN))
return 0;
return m_bottom.width();
}
bool operator==(const BorderData& o) const
{
return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && m_bottom == o.m_bottom && m_image == o.m_image
&& m_topLeft == o.m_topLeft && m_topRight == o.m_topRight && m_bottomLeft == o.m_bottomLeft && m_bottomRight == o.m_bottomRight;
}
bool operator!=(const BorderData& o) const
{
return !(*this == o);
}
const BorderValue& left() const { return m_left; }
const BorderValue& right() const { return m_right; }
const BorderValue& top() const { return m_top; }
const BorderValue& bottom() const { return m_bottom; }
const NinePieceImage& image() const { return m_image; }
const LengthSize& topLeft() const { return m_topLeft; }
const LengthSize& topRight() const { return m_topRight; }
const LengthSize& bottomLeft() const { return m_bottomLeft; }
const LengthSize& bottomRight() const { return m_bottomRight; }
private:
BorderValue m_left;
BorderValue m_right;
BorderValue m_top;
BorderValue m_bottom;
NinePieceImage m_image;
LengthSize m_topLeft;
LengthSize m_topRight;
LengthSize m_bottomLeft;
LengthSize m_bottomRight;
};
} // namespace WebCore
#endif // BorderData_h
|
/**
* @file jump64.c
*
* @brief jump function for tinymt64
*
* Jump function changes the internal state vector of tinymt64
* pseudorandom number generator to the state which is N step after
* current state, as if it generated N random numbers. The jump is
* much faster than generating N numbers, when N is large.
*
* @author Mutsuo Saito (Hiroshima University)
* @author Makoto Matsumoto (The University of Tokyo)
*
* Copyright (C) 2011, 2012 Mutsuo Saito, Makoto Matsumoto,
* Hiroshima University and University of Tokyo.
* All rights reserved.
*
* The 3-clause BSD License is applied to this software, see
* LICENSE.txt
*/
#include "jump64.h"
#include <stdio.h>
static void tinymt64_add(tinymt64_t *dest, const tinymt64_t *src);
/**
* Addition of internal state as F<sub>2</sub> vector.
* @param dest destination
* @param src source
*/
static void tinymt64_add(tinymt64_t *dest, const tinymt64_t *src)
{
dest->status[0] ^= src->status[0];
dest->status[1] ^= src->status[1];
}
/**
* jump function
* @param tiny tinymt64 structure, overwritten by new state after calling
* this function.
* @param lower_step lower bit of 128-bit integer
* @param upper_step upper bit of 128-bit integer
* @param poly_str string of the characteristic polynomial generated by
* tinymt32dc
*/void tinymt64_jump(tinymt64_t *tiny,
uint64_t lower_step,
uint64_t upper_step,
const char * poly_str)
{
f2_polynomial jump_poly;
calculate_jump_polynomial(
&jump_poly, lower_step, upper_step, poly_str);
tinymt64_jump_by_polynomial(tiny, &jump_poly);
}
/**
* jump using the jump polynomial.
* This function is not as time consuming as calculating jump polynomial.
* This function can use multiple time for the tinymt64 structure.
* @param tiny tinymt64 structure, overwritten by new state after calling
* this function.
* @param jump_poly the jump polynomial calculated by
* tinymt64_calculate_jump_polynomial.
*/
void tinymt64_jump_by_polynomial(tinymt64_t *tiny,
f2_polynomial * jump_poly)
{
tinymt64_t work_z;
tinymt64_t * work = &work_z;
*work = *tiny;
for (int i = 0; i < 2; i++) {
work->status[i] = 0;
}
uint64_t x64 = jump_poly->ar[0];
for (int i = 0; i < 64; i++) {
if ((x64 & 1) != 0) {
tinymt64_add(work, tiny);
}
tinymt64_next_state(tiny);
x64 = x64 >> 1;
}
x64 = jump_poly->ar[1];
while (x64 != 0) {
if ((x64 & 1) != 0) {
tinymt64_add(work, tiny);
}
tinymt64_next_state(tiny);
x64 = x64 >> 1;
}
*tiny = *work;
}
|
/*
This file is part of the PhantomJS project from Ofi Labs.
Copyright (C) 2012 Milian Wolff, KDAB <milian.wolff@kdab.com>
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 <organization> 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 <COPYRIGHT HOLDER> 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 CALLBACK_H
#define CALLBACK_H
#include <QObject>
#include <QVariant>
class Callback : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant returnValue READ returnValue WRITE setReturnValue)
public:
Callback(QObject* parent);
QVariant call(const QVariantList& arguments);
QVariant returnValue() const;
void setReturnValue(const QVariant& returnValue);
Q_SIGNALS:
void called(const QVariantList& arguments);
private:
QVariant m_returnValue;
};
#endif // CALLBACK_H
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file loaderFileTypePandatool.h
* @author drose
* @date 2000-06-20
*/
#ifndef LOADERFILETYPEPANDATOOL_H
#define LOADERFILETYPEPANDATOOL_H
#include "pandatoolbase.h"
#include "loaderFileType.h"
class SomethingToEggConverter;
class EggToSomethingConverter;
/**
* This defines the Loader interface to files whose converters are defined
* within the Pandatool package and inherit from SomethingToEggConverter, like
* FltToEggConverter and LwoToEggConverter.
*/
class EXPCL_PTLOADER LoaderFileTypePandatool : public LoaderFileType {
public:
LoaderFileTypePandatool(SomethingToEggConverter *loader,
EggToSomethingConverter *saver = NULL);
virtual ~LoaderFileTypePandatool();
virtual string get_name() const;
virtual string get_extension() const;
virtual string get_additional_extensions() const;
virtual bool supports_compressed() const;
virtual bool supports_load() const;
virtual bool supports_save() const;
virtual void resolve_filename(Filename &path) const;
virtual PT(PandaNode) load_file(const Filename &path, const LoaderOptions &options,
BamCacheRecord *record) const;
virtual bool save_file(const Filename &path, const LoaderOptions &options,
PandaNode *node) const;
private:
SomethingToEggConverter *_loader;
EggToSomethingConverter *_saver;
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
LoaderFileType::init_type();
register_type(_type_handle, "LoaderFileTypePandatool",
LoaderFileType::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
};
#endif
|
#ifndef ALIMESPPCOLTASK_H
#define ALIMESPPCOLTASK_H
////////////////////////////////////////////////////////////////////////////
// PP collision task for Multiplicity and Event Shape group //
// Authors: //
// Madalina Tarzila <mtarzila@niham.nipne.ro> //
// //
////////////////////////////////////////////////////////////////////////////
#ifndef ALIMESBASETASK_H
#include "AliMESbaseTask.h"
#include "AliVParticle.h"
#include "AliBasicParticle.h"
#endif
#define NMAXMULT 100
class AliMEStrackInfo;
class AliEventPoolManager;
class AliMESppColTask : public AliMESbaseTask
{
public:
class AliMESppColTaskExchange: public TObject
{
public:
AliMESppColTaskExchange();
void Add(Float_t deta, Float_t dphi);
private:
Int_t fN;
Float_t fDEta[NMAXMULT]; //[fN]
Float_t fDPhi[NMAXMULT]; //[fN]
ClassDef(AliMESppColTaskExchange, 1)
};
AliMESppColTask();
AliMESppColTask(const char *name);
virtual ~AliMESppColTask();
//
TObjArray* FindLeadingObjects(TObjArray* obj); // Looks for leading track
TObjArray* CloneTracks(TObjArray* tracks);
void QSortTracks(TObjArray &a, Int_t first, Int_t last); // Sort by pT an array of AliVParticles
Double_t RangePhi(Double_t DPhi);
Bool_t DefineMixedEventPool(); // Definition of the Event pool parameters
void FillCorrelationSE(Double_t MultipOrCent, TObjArray* selectedArray);
void FillCorrelationMixing(Double_t MultipOrCentMix, Double_t Zvtx, Double_t poolmax,Double_t poolmin, TObjArray*selectedArray);
Bool_t BuildQAHistos();
virtual void UserCreateOutputObjects();
virtual void UserExec(Option_t *opt);
virtual Bool_t PostProcess();
private:
AliMESppColTask(const AliMESppColTask&);
AliMESppColTask& operator=(const AliMESppColTask&);
protected:
AliEventPoolManager * fPoolMgr; // event pool manager for Event Mixing
ClassDef(AliMESppColTask, 1) // PP collision task for the Multi Event Shape
};
//---------------------------------------------------------------------------------------
#endif |
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_
#define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_
#include <list>
#include <queue>
#include <vector>
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "base/timer/timer.h"
#include "base/tuple.h"
#include "content/common/content_export.h"
#include "media/base/android/media_codec_bridge.h"
#include "media/video/video_encode_accelerator.h"
namespace media {
class BitstreamBuffer;
} // namespace media
namespace content {
// Android-specific implementation of media::VideoEncodeAccelerator, enabling
// hardware-acceleration of video encoding, based on Android's MediaCodec class
// (http://developer.android.com/reference/android/media/MediaCodec.html). This
// class expects to live and be called on a single thread (the GPU process'
// ChildThread).
class CONTENT_EXPORT AndroidVideoEncodeAccelerator
: public media::VideoEncodeAccelerator {
public:
AndroidVideoEncodeAccelerator();
~AndroidVideoEncodeAccelerator() override;
// media::VideoEncodeAccelerator implementation.
media::VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles()
override;
bool Initialize(media::VideoFrame::Format format,
const gfx::Size& input_visible_size,
media::VideoCodecProfile output_profile,
uint32 initial_bitrate,
Client* client) override;
void Encode(const scoped_refptr<media::VideoFrame>& frame,
bool force_keyframe) override;
void UseOutputBitstreamBuffer(const media::BitstreamBuffer& buffer) override;
void RequestEncodingParametersChange(uint32 bitrate,
uint32 framerate) override;
void Destroy() override;
private:
enum {
// Arbitrary choice.
INITIAL_FRAMERATE = 30,
// Until there are non-realtime users, no need for unrequested I-frames.
IFRAME_INTERVAL = kint32max,
};
// Impedance-mismatch fixers: MediaCodec is a poll-based API but VEA is a
// push-based API; these methods turn the crank to make the two work together.
void DoIOTask();
void QueueInput();
void DequeueOutput();
// Returns true if we don't need more or bigger output buffers.
bool DoOutputBuffersSuffice();
// Start & stop |io_timer_| if the time seems right.
void MaybeStartIOTimer();
void MaybeStopIOTimer();
// Used to DCHECK that we are called on the correct thread.
base::ThreadChecker thread_checker_;
// VideoDecodeAccelerator::Client callbacks go here. Invalidated once any
// error triggers.
scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_;
scoped_ptr<media::VideoCodecBridge> media_codec_;
// Bitstream buffers waiting to be populated & returned to the client.
std::vector<media::BitstreamBuffer> available_bitstream_buffers_;
// Frames waiting to be passed to the codec, queued until an input buffer is
// available. Each element is a tuple of <Frame, key_frame, enqueue_time>.
typedef std::queue<
Tuple<scoped_refptr<media::VideoFrame>, bool, base::Time>>
PendingFrames;
PendingFrames pending_frames_;
// Repeating timer responsible for draining pending IO to the codec.
base::RepeatingTimer<AndroidVideoEncodeAccelerator> io_timer_;
// The difference between number of buffers queued & dequeued at the codec.
int32 num_buffers_at_codec_;
// A monotonically-growing value, used as a fake timestamp just to keep things
// appearing to move forward.
base::TimeDelta fake_input_timestamp_;
// Number of requested output buffers and their capacity.
int num_output_buffers_; // -1 until RequireBitstreamBuffers.
size_t output_buffers_capacity_; // 0 until RequireBitstreamBuffers.
uint32 last_set_bitrate_; // In bps.
DISALLOW_COPY_AND_ASSIGN(AndroidVideoEncodeAccelerator);
};
} // namespace content
#endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_ENCODE_ACCELERATOR_H_
|
/******************************************************************************
* Copyright (c) 2018, Xilinx, 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 copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION). HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
/******************************************************************************
*
*
* @file timer.c
*
* Implementing timer related functions for PYNQ Microblaze,
* including the delay functions.
*
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- --- ------- -----------------------------------------------
* 1.00 yrq 01/09/18 release
* 1.01 yrq 01/30/18 add protection macro
*
* </pre>
*
*****************************************************************************/
#ifndef _TIMER_H_
#define _TIMER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <xparameters.h>
#ifdef XPAR_XTMRCTR_NUM_INSTANCES
// TCSR0 Timer 0 Control and Status Register
#define TCSR0 0x00
// TLR0 Timer 0 Load Register
#define TLR0 0x04
// TCR0 Timer 0 Counter Register
#define TCR0 0x08
// TCSR1 Timer 1 Control and Status Register
#define TCSR1 0x10
// TLR1 Timer 1 Load Register
#define TLR1 0x14
// TCR1 Timer 1 Counter Register
#define TCR1 0x18
// Default period value for 100000 us
#define MS1_VALUE 99998
// Default period value for 50% duty cycle
#define MS2_VALUE 49998
/*
* Timer API
*/
typedef int timer;
timer timer_open_device(unsigned int device);
#ifdef XPAR_IO_SWITCH_NUM_INSTANCES
#ifdef XPAR_IO_SWITCH_0_TIMER0_BASEADDR
timer timer_open(unsigned int pin);
#endif
#endif
void timer_delay(timer dev_id, unsigned int cycles);
void timer_close(timer dev_id);
void timer_pwm_generate(timer dev_id, unsigned int period, unsigned int pulse);
void timer_pwm_stop(timer dev_id);
unsigned int timer_get_num_devices(void);
/*
* Higher-level API for users
*/
void delay_us(unsigned int us);
void delay_ms(unsigned int ms);
#endif
#ifdef __cplusplus
}
#endif
#endif // _TIMER_H_
|
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
#pragma once
#include <algorithm>
#include <assert.h>
#include <codecvt>
#include <chrono>
#include <fstream>
#include <iostream>
#include <iterator>
#include <limits>
#include <limits.h>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <mutex>
#include <exception>
#include <bitset>
#include <condition_variable>
#include <functional>
// Defines for the Guid class and other platform dependent stuff.
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning (disable: 4250) // Class inherits by dominance.
#pragma warning (disable: 4512) // assignment operator could not be generated
#if _MSC_VER < 1900
// Before VS 2015 code like "while (true)" will create a (useless) warning in level 4.
#pragma warning (disable: 4127) // conditional expression is constant
#endif
#endif
#define GUID_WINDOWS
#ifdef _WIN64
typedef __int64 ssize_t;
#else
typedef __int32 ssize_t;
#endif
#if _MSC_VER >= 1900 && _MSC_VER < 2000
// VS 2015 has a known bug when using std::codecvt_utf8<char32_t>
// so we have to temporarily use __int32 instead.
// https://connect.microsoft.com/VisualStudio/feedback/details/1403302/unresolved-external-when-using-codecvt-utf8
typedef std::basic_string<__int32> i32string;
typedef i32string UTF32String;
#else
typedef std::u32string UTF32String;
#endif
#ifdef ANTLR4CPP_EXPORTS
#define ANTLR4CPP_PUBLIC __declspec(dllexport)
#else
#ifdef ANTLR4CPP_STATIC
#define ANTLR4CPP_PUBLIC
#else
#define ANTLR4CPP_PUBLIC __declspec(dllimport)
#endif
#endif
class ANTLR4CPP_PUBLIC std::exception; // Needed for VS 2015.
#elif defined(__APPLE__)
typedef std::u32string UTF32String;
#define GUID_CFUUID
#if __GNUC__ >= 4
#define ANTLR4CPP_PUBLIC __attribute__ ((visibility ("default")))
#else
#define ANTLR4CPP_PUBLIC
#endif
#else
typedef std::u32string UTF32String;
#define GUID_LIBUUID
#if __GNUC__ >= 6
#define ANTLR4CPP_PUBLIC __attribute__ ((visibility ("default")))
#else
#define ANTLR4CPP_PUBLIC
#endif
#endif
#include "support/guid.h"
#include "support/Declarations.h"
#if !defined(HAS_NOEXCEPT)
#if defined(__clang__)
#if __has_feature(cxx_noexcept)
#define HAS_NOEXCEPT
#endif
#else
#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 || \
defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026
#define HAS_NOEXCEPT
#endif
#endif
#ifdef HAS_NOEXCEPT
#define NOEXCEPT noexcept
#else
#define NOEXCEPT
#endif
#endif
// We have to undefine this symbol as ANTLR will use this name for own members and even
// generated functions. Because EOF is a global macro we cannot use e.g. a namespace scope to disambiguate.
#ifdef EOF
#undef EOF
#endif
#define INVALID_INDEX std::numeric_limits<size_t>::max()
template<class T> using Ref = std::shared_ptr<T>;
|
extern zend_class_entry *ice_auth_driver_model_users_ce;
ZEPHIR_INIT_CLASS(Ice_Auth_Driver_Model_Users);
PHP_METHOD(Ice_Auth_Driver_Model_Users, initialize);
PHP_METHOD(Ice_Auth_Driver_Model_Users, completeLogin);
PHP_METHOD(Ice_Auth_Driver_Model_Users, getRole);
ZEND_BEGIN_ARG_INFO_EX(arginfo_ice_auth_driver_model_users_getrole, 0, 0, 0)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO()
ZEPHIR_INIT_FUNCS(ice_auth_driver_model_users_method_entry) {
PHP_ME(Ice_Auth_Driver_Model_Users, initialize, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Ice_Auth_Driver_Model_Users, completeLogin, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Ice_Auth_Driver_Model_Users, getRole, arginfo_ice_auth_driver_model_users_getrole, ZEND_ACC_PUBLIC)
PHP_FE_END
};
|
#include "sway/commands.h"
#include "sway/config.h"
struct cmd_results *cmd_include(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "include", EXPECTED_EQUAL_TO, 1))) {
return error;
}
if (!load_include_configs(argv[0], config)) {
return cmd_results_new(CMD_INVALID, "include", "Failed to include sub configuration file: %s", argv[0]);
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
|
#ifndef __HELLO_H_
#define __HELLO_H_
void hello(const char *name);
#endif /* __HELLO_H_ */
|
#define SO_DEBUG 1
#define SO_REUSEADDR 2
#define SO_TYPE 3
#define SO_ERROR 4
#define SO_DONTROUTE 5
#define SO_BROADCAST 6
#define SO_SNDBUF 7
#define SO_RCVBUF 8
#define SO_KEEPALIVE 9
#define SO_OOBINLINE 10
#define SO_NO_CHECK 11
#define SO_PRIORITY 12
#define SO_LINGER 13
#define SO_BSDCOMPAT 14
#define SO_REUSEPORT 15
#define SO_RCVLOWAT 16
#define SO_SNDLOWAT 17
#define SO_PASSCRED 20
#define SO_PEERCRED 21
#define SO_ACCEPTCONN 30
#define SO_PEERSEC 31
#define SO_SNDBUFFORCE 32
#define SO_RCVBUFFORCE 33
#define SO_PROTOCOL 38
#define SO_DOMAIN 39
|
//
// IFlyVoiceWakeuper.h
// wakeup
//
// Created by admin on 14-3-18.
// Copyright (c) 2014年 iflytek. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IFlyVoiceWakeuperDelegate.h"
/**
版本描述:唤醒1.0.0.1
语音唤醒资源占用(iPhone5s实测)
内存占用:3M
CPU占用:< 12%
注意:目前仅仅支持32位iOS系统,尚不支持64位。
唤醒服务接口时序描述
createWakeuper 创建唤醒实例
setParameter 设置服务参数
例:[_voiceWakeuper setParameter:@"sst" value:@"wake"];
sst 表示服务类型,wake是唤醒,enroll是注册
例:[_voiceWakeuper setParameter:@"ivw_wake_list" value:m_wakeupResPath];
ivw_wake_list 表示唤醒资源的路径
例:[_voiceWakeuper setParameter:@"ivw_threshold" value:holdValue];
ivw_threshold 表示唤醒资源的阀值,holdValue形式:
ID:20;15;30
每个数字代表对应资源的阀值,15表示资源1阀值,20表示资源2阀值,30表示资源3阀值
本demo只有一个资源设置为ID:20 则可
startListening启动服务
cancel 取消服务,但是不释放内部资源
onFini 终止服务,并释放内部资源
*参数定义
* 服务设置参数
sst=wake表示唤醒
sst=enroll表示注册
SESSION_TYPE @"sst" //服务类型
WAKEUP @"wake" //唤醒
ENROLL @"enroll" //注册
* 唤醒时,表示资源对应的阀值,为输入值,参数类型为:ID:20;20;3
已ID为起始,中间用“;”隔开,表示公三个资源,各自阀值对应为20,20和3
IVW_THRESHOLD @"ivw_threshold" //唤醒词对应的门限
* 传入参数
主要是没有定义的参数,依赖params传入
PARAM @"params"
* 训练,合并生成的资源路径
例:ivw_word_path=/abc/123/newpath.irf
IVW_WORD_PATH @"ivw_word_path"
* 业务成功后的会话持续状态
keep_alive 0:唤醒一次就结束,1:唤醒后继续
KEEP_ALIVE @"keep_alive"
* focus_type注册和唤醒的返回参数
wake 唤醒
enroll 注册
FOCUS_TYPE @"focus_type" //服务类型
* 服务状态
status=success 服务正常
status=failed 服务失败
status=done 注册完成
STATUS @"status" //服务状态
SUCESS @"success" //服务成功
FAILED @"failed" //服务失败
DONE @"done" //训练完成
* 唤醒结果的位置
ID @"id" //唤醒结果的id
* 唤醒资源的阀值
注册时返回,表示注册资源对应的阀值,为输出值
THRESHOLD @"threshold" //训练资源的阀值
* 服务结果的可信度
SCORE @"score" //服务结果可信度
* 为注册时返回,表示已经注册成功的次数
NUM @"num" //已训练成功次数
* 表示服务传入音频对应的起始点和结束点
BOS @"bos" //前端点
EOS @"eos" //后端点
* 录音方式,如果是外部数据,设置为-1,通过WriteAudio送入音频
注意:目前紧紧支持唤醒服务,注册业务尚不支持
AUDIO_SOURCE @"audio_source"
* 表示资源合并操作
MERGE_RES_ACTION @"merge"
* 错误码定义
server success
SUCCESS 0
server failed
FAILURE -1
recorder start failed
ERROR_RECORD 800001
wakeuper busy
ERROR_IVP_BUSY 800039
wakeuper resource is invalid
ERROR_IVW_RES 800038
*/
@interface IFlyVoiceWakeuper : NSObject
{
}
@property(assign) id<IFlyVoiceWakeuperDelegate> delegate;
/**
创建唤醒实例,采用单例模式
*/
+ (id) sharedInstance;
/**
启动唤醒
返回值:0 成功,其他值:错误码
*/
-(BOOL) startListening;
/**
取消唤醒会话
注意与onFini的区别,紧紧停止服务,并不释放资源
*/
-(BOOL) stopListening;
/**
获取工作参数
*/
-(NSString*) getParameter:(NSString *)key;
/**
设置工作参数
注意服务正在运行中,不能设置参数
*/
-(BOOL) setParameter:(NSString *) value forKey:(NSString*)key;
/**
取消唤醒会话,并释放内部资源
*/
-(BOOL) cancel;
/**
唤醒业务更新,目前支持合并资源操作
*/
//+(int) updateWords:(NSString *)action params:(NSString*) params;
/**
写入录音数据
暂时紧紧支持唤醒的写入,注册服务尚不支持
*/
-(int) writeAudio:(const void*)buffer offset:(int)offset length:(int)length;
@property (readonly) BOOL isListening;
@end
|
/*
* Bluegiga APX4 Development Kit
*
* Copyright (C) 2012 Bluegiga Technologies Oy
*
* Authors:
* Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
* Lauri Hintsala <lauri.hintsala@bluegiga.com>
*
* Based on m28evk.c:
* Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
* on behalf of DENX Software Engineering GmbH
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/setup.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/iomux-mx28.h>
#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
#include <linux/mii.h>
#include <miiphy.h>
#include <netdev.h>
#include <errno.h>
DECLARE_GLOBAL_DATA_PTR;
/* Functions */
int board_early_init_f(void)
{
/* IO0 clock at 480MHz */
mxs_set_ioclk(MXC_IOCLK0, 480000);
/* IO1 clock at 480MHz */
mxs_set_ioclk(MXC_IOCLK1, 480000);
/* SSP0 clock at 96MHz */
mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
return 0;
}
int dram_init(void)
{
return mxs_dram_init();
}
int board_init(void)
{
/* Adress of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
return 0;
}
#ifdef CONFIG_CMD_MMC
int board_mmc_init(bd_t *bis)
{
return mxsmmc_initialize(bis, 0, NULL, NULL);
}
#endif
#ifdef CONFIG_CMD_NET
#define MII_PHY_CTRL2 0x1f
int fecmxc_mii_postcall(int phy)
{
/* change PHY RMII clock to 50MHz */
miiphy_write("FEC", 0, MII_PHY_CTRL2, 0x8180);
return 0;
}
int board_eth_init(bd_t *bis)
{
int ret;
struct eth_device *dev;
ret = cpu_eth_init(bis);
if (ret) {
printf("FEC MXS: Unable to init FEC clocks\n");
return ret;
}
ret = fecmxc_initialize(bis);
if (ret) {
printf("FEC MXS: Unable to init FEC\n");
return ret;
}
dev = eth_get_dev_by_name("FEC");
if (!dev) {
printf("FEC MXS: Unable to get FEC device entry\n");
return -EINVAL;
}
ret = fecmxc_register_mii_postcall(dev, fecmxc_mii_postcall);
if (ret) {
printf("FEC MXS: Unable to register FEC MII postcall\n");
return ret;
}
return ret;
}
#endif
#ifdef CONFIG_SERIAL_TAG
#define MXS_OCOTP_MAX_TIMEOUT 1000000
void get_board_serial(struct tag_serialnr *serialnr)
{
struct mxs_ocotp_regs *ocotp_regs =
(struct mxs_ocotp_regs *)MXS_OCOTP_BASE;
serialnr->high = 0;
serialnr->low = 0;
writel(OCOTP_CTRL_RD_BANK_OPEN, &ocotp_regs->hw_ocotp_ctrl_set);
if (mxs_wait_mask_clr(&ocotp_regs->hw_ocotp_ctrl_reg, OCOTP_CTRL_BUSY,
MXS_OCOTP_MAX_TIMEOUT)) {
printf("MXS: Can't get serial number from OCOTP\n");
return;
}
serialnr->low = readl(&ocotp_regs->hw_ocotp_cust3);
}
#endif
#ifdef CONFIG_REVISION_TAG
u32 get_board_rev(void)
{
if (env_get("revision#") != NULL)
return simple_strtoul(env_get("revision#"), NULL, 10);
return 0;
}
#endif
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include <bond/core/config.h>
#include <bond/core/blob.h>
#include <bond/core/containers.h>
#include <bond/core/traits.h>
#include <boost/static_assert.hpp>
#include <cstring>
namespace bond
{
template <typename T>
class RandomProtocolEngine
{
public:
// We don't need a good pseudo-random number generator but we do need one
// that is consistent accross compilers/libraries so that we can use
// randomly generated data files from one platfom to verify compatibility
// on another platform.
RandomProtocolEngine()
{}
// Variant of Marsaglia's xorshift generator
// http://arxiv.org/pdf/1404.0390v1.pdf
uint64_t Next()
{
uint64_t s1 = state[0];
const uint64_t s0 = state[1];
state[0] = s0;
s1 ^= s1 << 23;
return (state[1] = (s1 ^ s0 ^ (s1 >> 17) ^ (s0 >> 26))) + s0;
}
void Seed(uint64_t s0 = seed1, uint64_t s1 = seed2)
{
state[0] = s0;
state[1] = s1;
}
static uint64_t state[2];
const static uint64_t seed1 = 234578354U;
const static uint64_t seed2 = 753478U;
};
template <typename T>
uint64_t RandomProtocolEngine<T>::state[2] = {seed1, seed2};
//
// Protocol which generates a random stream of bits.
// In some cases it may be useful for initializing data in tests, e.g.:
//
// Params param;
// Apply(bond::To<Params>(param), bond::bonded<Params>(bond::RandomProtocolReader()));
//
class RandomProtocolReader
: public RandomProtocolEngine<RandomProtocolReader>
{
public:
typedef bond::StaticParser<RandomProtocolReader&> Parser;
RandomProtocolReader(uint32_t max_string_length = 50, uint32_t max_list_size = 20, bool json = false)
: _max_string_length(max_string_length),
_max_list_size(max_list_size),
_json(json)
{}
bool operator==(const RandomProtocolReader&) const
{
return false;
}
bool ReadVersion()
{
return false;
}
template <typename T>
typename boost::disable_if<is_string_type<T> >::type
Read(T& value)
{
BOOST_STATIC_ASSERT(std::is_trivially_copyable<T>::value);
// We only have 64 bits of randomness, so T needs to fit in that.
BOOST_STATIC_ASSERT(sizeof(T) <= sizeof(uint64_t));
uint64_t random = RandomProtocolEngine::Next();
std::memcpy(&value, &random, sizeof(T));
}
void Read(uint64_t& value)
{
value = RandomProtocolEngine::Next();
if (_json)
{
// NewtonsoftJson used by C# implementation doesn't support
// numbers larger that max int64.
value >>= 1;
}
}
void Read(bool& value)
{
int8_t n;
Read(n);
value = n > 0;
}
void Read(double& value)
{
BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t));
uint8_t sign;
uint8_t exponent;
uint32_t mantissa;
Read(sign);
Read(exponent);
Read(mantissa);
// don't return special values: infinity, NaN
if (exponent == 0)
exponent = 0x80;
uint64_t bits = ((uint64_t)(sign) << 63) | ((uint64_t)(exponent) << (52 + 3)) | (uint64_t)mantissa;
std::memcpy(&value, &bits, sizeof(bits));
}
void Read(float& value)
{
BOOST_STATIC_ASSERT(sizeof(float) == sizeof(uint32_t));
uint8_t sign;
uint8_t exponent;
uint16_t mantissa;
Read(sign);
Read(exponent);
Read(mantissa);
// don't return special values: infinity, NaN
if (exponent == 0 || exponent == 0xff)
exponent = 0x80;
uint32_t bits = ((uint32_t)(sign) << 31) | ((uint32_t)(exponent) << 23) | (uint32_t)mantissa;
std::memcpy(&value, &bits, sizeof(bits));
}
template <typename T>
typename boost::enable_if<is_string_type<T> >::type
Read(T& value)
{
uint32_t length = 0;
Read(length);
length %= _max_string_length;
length = length ? length : 1;
resize_string(value, length);
typename element_type<T>::type* p = string_data(value);
typename element_type<T>::type* const p_end = p + length;
for (; p != p_end; ++p)
{
uint8_t c;
Read(c);
*p = typename element_type<T>::type(' ') + c % ('z' - ' ');
}
}
// Read for blob
void Read(blob& value, uint32_t size)
{
boost::shared_ptr<char[]> buffer(boost::make_shared_noinit<char[]>(size));
char* p = buffer.get();
char* const p_end = p + size;
for (; p != p_end; ++p)
{
Read(*p);
}
value.assign(buffer, size);
}
template <typename T>
void Skip()
{}
template <typename T>
void Skip(const T&)
{}
template <typename T>
void ReadContainerBegin(uint32_t& size, T&)
{
Read(size);
size %= _max_list_size;
size = size ? size : 1;
}
void ReadContainerEnd() const
{
}
private:
uint32_t _max_string_length;
uint32_t _max_list_size;
bool _json;
};
template <typename Unused> struct
uses_marshaled_bonded<RandomProtocolReader, Unused>
: std::false_type {};
template <typename Unused> struct
uses_marshaled_bonded<RandomProtocolReader&, Unused>
: std::false_type {};
}
|
/*
* Freescale i.MX28 RTC Register Definitions
*
* Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
* on behalf of DENX Software Engineering GmbH
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __MX28_REGS_RTC_H__
#define __MX28_REGS_RTC_H__
#include <asm/mach-imx/regs-common.h>
#ifndef __ASSEMBLY__
struct mxs_rtc_regs {
mxs_reg_32(hw_rtc_ctrl)
mxs_reg_32(hw_rtc_stat)
mxs_reg_32(hw_rtc_milliseconds)
mxs_reg_32(hw_rtc_seconds)
mxs_reg_32(hw_rtc_rtc_alarm)
mxs_reg_32(hw_rtc_watchdog)
mxs_reg_32(hw_rtc_persistent0)
mxs_reg_32(hw_rtc_persistent1)
mxs_reg_32(hw_rtc_persistent2)
mxs_reg_32(hw_rtc_persistent3)
mxs_reg_32(hw_rtc_persistent4)
mxs_reg_32(hw_rtc_persistent5)
mxs_reg_32(hw_rtc_debug)
mxs_reg_32(hw_rtc_version)
};
#endif
#define RTC_CTRL_SFTRST (1 << 31)
#define RTC_CTRL_CLKGATE (1 << 30)
#define RTC_CTRL_SUPPRESS_COPY2ANALOG (1 << 6)
#define RTC_CTRL_FORCE_UPDATE (1 << 5)
#define RTC_CTRL_WATCHDOGEN (1 << 4)
#define RTC_CTRL_ONEMSEC_IRQ (1 << 3)
#define RTC_CTRL_ALARM_IRQ (1 << 2)
#define RTC_CTRL_ONEMSEC_IRQ_EN (1 << 1)
#define RTC_CTRL_ALARM_IRQ_EN (1 << 0)
#define RTC_STAT_RTC_PRESENT (1 << 31)
#define RTC_STAT_ALARM_PRESENT (1 << 30)
#define RTC_STAT_WATCHDOG_PRESENT (1 << 29)
#define RTC_STAT_XTAL32000_PRESENT (1 << 28)
#define RTC_STAT_XTAL32768_PRESENT (1 << 27)
#define RTC_STAT_STALE_REGS_MASK (0xff << 16)
#define RTC_STAT_STALE_REGS_OFFSET 16
#define RTC_STAT_NEW_REGS_MASK (0xff << 8)
#define RTC_STAT_NEW_REGS_OFFSET 8
#define RTC_MILLISECONDS_COUNT_MASK 0xffffffff
#define RTC_MILLISECONDS_COUNT_OFFSET 0
#define RTC_SECONDS_COUNT_MASK 0xffffffff
#define RTC_SECONDS_COUNT_OFFSET 0
#define RTC_ALARM_VALUE_MASK 0xffffffff
#define RTC_ALARM_VALUE_OFFSET 0
#define RTC_WATCHDOG_COUNT_MASK 0xffffffff
#define RTC_WATCHDOG_COUNT_OFFSET 0
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_MASK (0xf << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_OFFSET 28
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V83 (0x0 << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V78 (0x1 << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V73 (0x2 << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V68 (0x3 << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V62 (0x4 << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V57 (0x5 << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V52 (0x6 << 28)
#define RTC_PERSISTENT0_ADJ_POSLIMITBUCK_2V48 (0x7 << 28)
#define RTC_PERSISTENT0_EXTERNAL_RESET (1 << 21)
#define RTC_PERSISTENT0_THERMAL_RESET (1 << 20)
#define RTC_PERSISTENT0_ENABLE_LRADC_PWRUP (1 << 18)
#define RTC_PERSISTENT0_AUTO_RESTART (1 << 17)
#define RTC_PERSISTENT0_DISABLE_PSWITCH (1 << 16)
#define RTC_PERSISTENT0_LOWERBIAS_MASK (0xf << 14)
#define RTC_PERSISTENT0_LOWERBIAS_OFFSET 14
#define RTC_PERSISTENT0_LOWERBIAS_NOMINAL (0x0 << 14)
#define RTC_PERSISTENT0_LOWERBIAS_M25P (0x1 << 14)
#define RTC_PERSISTENT0_LOWERBIAS_M50P (0x3 << 14)
#define RTC_PERSISTENT0_DISABLE_XTALOK (1 << 13)
#define RTC_PERSISTENT0_MSEC_RES_MASK (0x1f << 8)
#define RTC_PERSISTENT0_MSEC_RES_OFFSET 8
#define RTC_PERSISTENT0_MSEC_RES_1MS (0x01 << 8)
#define RTC_PERSISTENT0_MSEC_RES_2MS (0x02 << 8)
#define RTC_PERSISTENT0_MSEC_RES_4MS (0x04 << 8)
#define RTC_PERSISTENT0_MSEC_RES_8MS (0x08 << 8)
#define RTC_PERSISTENT0_MSEC_RES_16MS (0x10 << 8)
#define RTC_PERSISTENT0_ALARM_WAKE (1 << 7)
#define RTC_PERSISTENT0_XTAL32_FREQ (1 << 6)
#define RTC_PERSISTENT0_XTAL32KHZ_PWRUP (1 << 5)
#define RTC_PERSISTENT0_XTAL24KHZ_PWRUP (1 << 4)
#define RTC_PERSISTENT0_LCK_SECS (1 << 3)
#define RTC_PERSISTENT0_ALARM_EN (1 << 2)
#define RTC_PERSISTENT0_ALARM_WAKE_EN (1 << 1)
#define RTC_PERSISTENT0_CLOCKSOURCE (1 << 0)
#define RTC_PERSISTENT1_GENERAL_MASK 0xffffffff
#define RTC_PERSISTENT1_GENERAL_OFFSET 0
#define RTC_PERSISTENT1_GENERAL_OTG_ALT_ROLE 0x0080
#define RTC_PERSISTENT1_GENERAL_OTG_HNP 0x0100
#define RTC_PERSISTENT1_GENERAL_USB_LPM 0x0200
#define RTC_PERSISTENT1_GENERAL_SKIP_CHECKDISK 0x0400
#define RTC_PERSISTENT1_GENERAL_USB_BOOT_PLAYER 0x0800
#define RTC_PERSISTENT1_GENERAL_ENUM_500MA_2X 0x1000
#define RTC_PERSISTENT2_GENERAL_MASK 0xffffffff
#define RTC_PERSISTENT2_GENERAL_OFFSET 0
#define RTC_PERSISTENT3_GENERAL_MASK 0xffffffff
#define RTC_PERSISTENT3_GENERAL_OFFSET 0
#define RTC_PERSISTENT4_GENERAL_MASK 0xffffffff
#define RTC_PERSISTENT4_GENERAL_OFFSET 0
#define RTC_PERSISTENT5_GENERAL_MASK 0xffffffff
#define RTC_PERSISTENT5_GENERAL_OFFSET 0
#define RTC_DEBUG_WATCHDOG_RESET_MASK (1 << 1)
#define RTC_DEBUG_WATCHDOG_RESET (1 << 0)
#define RTC_VERSION_MAJOR_MASK (0xff << 24)
#define RTC_VERSION_MAJOR_OFFSET 24
#define RTC_VERSION_MINOR_MASK (0xff << 16)
#define RTC_VERSION_MINOR_OFFSET 16
#define RTC_VERSION_STEP_MASK 0xffff
#define RTC_VERSION_STEP_OFFSET 0
#endif /* __MX28_REGS_RTC_H__ */
|
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
//
// functions.h: Rcpp R/C++ interface class library -- sugar functions
//
// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
// Rcpp 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.
//
// Rcpp 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 Rcpp. If not, see <http://www.gnu.org/licenses/>.
#ifndef RCPP_SUGAR_FUNCTIONS_H
#define RCPP_SUGAR_FUNCTIONS_H
/* for exp( double ) */
#include <cmath>
#include <Rcpp/sugar/functions/Lazy.h>
#include <Rcpp/sugar/functions/math.h>
#include <Rcpp/sugar/functions/complex.h>
#include <Rcpp/sugar/functions/any.h>
#include <Rcpp/sugar/functions/all.h>
#include <Rcpp/sugar/functions/is_na.h>
#include <Rcpp/sugar/functions/is_finite.h>
#include <Rcpp/sugar/functions/is_infinite.h>
#include <Rcpp/sugar/functions/is_nan.h>
#include <Rcpp/sugar/functions/na_omit.h>
#include <Rcpp/sugar/functions/seq_along.h>
#include <Rcpp/sugar/functions/sapply.h>
#include <Rcpp/sugar/functions/mapply.h>
#include <Rcpp/sugar/functions/lapply.h>
#include <Rcpp/sugar/functions/ifelse.h>
#include <Rcpp/sugar/functions/pmin.h>
#include <Rcpp/sugar/functions/pmax.h>
#include <Rcpp/sugar/functions/clamp.h>
#include <Rcpp/sugar/functions/min.h>
#include <Rcpp/sugar/functions/max.h>
#include <Rcpp/sugar/functions/range.h>
#include <Rcpp/sugar/functions/sign.h>
#include <Rcpp/sugar/functions/diff.h>
#include <Rcpp/sugar/functions/pow.h>
#include <Rcpp/sugar/functions/rep.h>
#include <Rcpp/sugar/functions/rep_len.h>
#include <Rcpp/sugar/functions/rep_each.h>
#include <Rcpp/sugar/functions/rev.h>
#include <Rcpp/sugar/functions/head.h>
#include <Rcpp/sugar/functions/tail.h>
#include <Rcpp/sugar/functions/sum.h>
#include <Rcpp/sugar/functions/mean.h>
#include <Rcpp/sugar/functions/var.h>
#include <Rcpp/sugar/functions/sd.h>
#include <Rcpp/sugar/functions/cumsum.h>
#include <Rcpp/sugar/functions/which_min.h>
#include <Rcpp/sugar/functions/which_max.h>
#include <Rcpp/sugar/functions/unique.h>
#include <Rcpp/sugar/functions/match.h>
#include <Rcpp/sugar/functions/table.h>
#include <Rcpp/sugar/functions/duplicated.h>
#include <Rcpp/sugar/functions/self_match.h>
#include <Rcpp/sugar/functions/setdiff.h>
#include <Rcpp/sugar/functions/strings/strings.h>
#include <Rcpp/sugar/functions/cumprod.h>
#include <Rcpp/sugar/functions/cummin.h>
#include <Rcpp/sugar/functions/cummax.h>
#include <Rcpp/sugar/functions/median.h>
#include <Rcpp/sugar/functions/cbind.h>
#endif
|
#include <Python.h>
#include <inttypes.h>
#include <stdint.h>
#include "compat_py23.h"
typedef struct {
uint8_t is_local;
uint64_t address;
} block_id;
typedef int (*jitted_func)(block_id*, PyObject*);
PyObject* gcc_exec_block(PyObject* self, PyObject* args)
{
jitted_func func;
PyObject* jitcpu;
PyObject* func_py;
PyObject* lbl2ptr;
PyObject* stop_offsets;
PyObject* retaddr = NULL;
int status;
block_id BlockDst;
uint64_t max_exec_per_call = 0;
uint64_t cpt;
int do_cpt;
if (!PyArg_ParseTuple(args, "OOOO|K",
&retaddr, &jitcpu, &lbl2ptr, &stop_offsets,
&max_exec_per_call))
return NULL;
/* The loop will decref retaddr always once */
Py_INCREF(retaddr);
if (max_exec_per_call == 0) {
do_cpt = 0;
cpt = 1;
} else {
do_cpt = 1;
cpt = max_exec_per_call;
}
for (;;) {
if (cpt == 0)
return retaddr;
if (do_cpt)
cpt --;
// Init
BlockDst.is_local = 0;
BlockDst.address = 0;
// Get the expected jitted function address
func_py = PyDict_GetItem(lbl2ptr, retaddr);
if (func_py)
func = (jitted_func) PyLong_AsVoidPtr((PyObject*) func_py);
else {
if (BlockDst.is_local == 1) {
fprintf(stderr, "return on local label!\n");
exit(EXIT_FAILURE);
}
// retaddr is not jitted yet
return retaddr;
}
// Execute it
status = func(&BlockDst, jitcpu);
Py_DECREF(retaddr);
retaddr = PyLong_FromUnsignedLongLong(BlockDst.address);
// Check exception
if (status)
return retaddr;
// Check stop offsets
if (PySet_Contains(stop_offsets, retaddr))
return retaddr;
}
}
static PyMethodDef GccMethods[] = {
{"gcc_exec_block", gcc_exec_block, METH_VARARGS,
"gcc exec block"},
{NULL, NULL, 0, NULL} /* Sentinel */
};
MOD_INIT(Jitgcc)
{
PyObject *module = NULL;
MOD_DEF(module, "Jitgcc", "gcc module", GccMethods);
RET_MODULE;
}
|
/******************************************************************************
Copyright (C), 2001-2011, huawei technology limited company
******************************************************************************
Filename : wireless_pm.h
Version : first draft
Author : cwx145522
Create date: 2012-12-10
Modify :
Func descr : inclue file
Func list :
Modi histoy:
1.Data : 2012-12-10
Author : cwx145522
Modify
content : Create File
******************************************************************************/
#ifndef __WIRELESS_PM_H__
#define __WIRELESS_PM_H__
/*****************************************************************************
1 Include other Head file
*****************************************************************************/
#include <linux/mutex.h>
#include <linux/kernel.h>
#include <linux/wakelock.h>
#include "../hw-ps/hw_bfg_ps.h"
/*****************************************************************************
2 Define macro
*****************************************************************************/
/*#define ENABLE_BFG_LOWPOWER_FEATURE*/
#define BFG_LOCK_NAME "bfg_wake_lock"
#define UART_INIT_OK 0x01
#define SDIO_INIT_OK 0x02
#define BT_STATE_SHUTDOWN 0x10
#define BT_STATE_BOOTUP 0x11
#define GNSS_STATE_SHUTDOWN 0x20
#define GNSS_STATE_BOOTUP 0x21
#define FM_STATE_SHUTDOWN 0x30
#define FM_STATE_BOOTUP 0x31
#define WLAN_STATE_SHUTDOWN 0x40
#define WLAN_STATE_BOOTUP 0x41
#define SUCC 0
#define FAIL 1
#define LOWLEVEL 0
#define HIGHLEVEL 1
#define WLAN_PINDISABLE 1
#define BFG_PINDISABLE 2
#define WLAN_PINSTATEENABLE 4
#define BFG_PINSTATEENABLE 8
#define PINENABLE 0
#define PINSTATE_NUM 2
#define PINSTATE_SWITCH_MASK ((1 << PINSTATE_NUM) - 1)
#define PINSTATE_ENABLE_MASK (PINSTATE_SWITCH_MASK << PINSTATE_NUM)
#define PINSTATE_MASK (PINSTATE_SWITCH_MASK | PINSTATE_ENABLE_MASK)
#define BT_STATE_FLAG 0
#define GNSS_STATE_FLAG 1
#define FM_STATE_FLAG 2
#define WLAN_STATE_FLAG 3
#define BT_AND_FM_STATE_FLAG 4
#define BT_AND_GNSS_STATE_FLAG 5
#define FM_AND_GNSS_STATE_FLAG 6
#define BT_FM_AND_GNSS_STATE_FLAG 7
#define EXCEPTION_RETRY_COUNTER 3
#define K3_32K_B_CLOCK_ADDR 0xFCC00140
#define K3_32K_B_CLOCK_ENABLE 0x2
#define GPIO_4_CONFIG_ADDR 0xFC80382C
#define GPIO_4_DISABLE_UP_PULLED 0xFFFE
#define GPIO_4_ENABLE_DOWN_PULLED 0x2
#define ADDR_LEN 32
#define DTS_COMP_HI1101_POWER_NAME "hisilicon,hi1101-power"
/* for huawei's BT, FM, GNSS, WLAN chip */
/*****************************************************************************
3 STRUCT DEFINE
*****************************************************************************/
/*interface for wlan*/
struct wlan_pm_s
{
int32 (*wlan_patch_download)(void);
void (*check_wlan_state)(void);
int32(*check_bfg_state)(void);
int32 (*check_bt_state) (void);
int32 (*wlan_gpio_state_get)(void);
void (*wlan_gpio_state_set)(uint8);
int32 (*sdio_reinit)(void);
int32 (*dev_wakeup)(void);
int32 (*wlan_patch_write)(uint8 *data, uint32 len);
int32 (*wlan_patch_read)(uint8 *data, uint32 len);
uint32 wlan_irq;
};
/*private data for pm driver*/
struct pm_drv_data
{
/*3 in 1 interface pointer*/
struct ps_pm_s *ps_pm_interface;
/*wlan interface pointer*/
struct wlan_pm_s *wlan_pm_info;
/*timer for bfg uart suspend*/
//struct timer_list bfg_timer;
/*wake lock for bfg,be used to prevent host form suspend*/
struct wake_lock bfg_wake_lock;
/*mutex for sync*/
struct mutex host_mutex;
/*Tasklet to respond to change in hostwake line */
struct tasklet_struct hostwake_task;
/*bfg tx spinlock*/
spinlock_t tx_lock;
/*flag for gnss going to sleep*/
//atomic_t gnss_sleep_flag;
/*wlan state*/
uint8 wlan_state;
/*bt state*/
uint8 bt_state;
/*gnss state*/
uint8 gnss_state;
/*fm state*/
uint8 fm_state;
/*flag for patch init*/
uint64 patch_init_flag;
/*wlan irq num*/
uint32 wlan_irq;
/*bfg irq num*/
uint32 bfg_irq;
};
enum PATCH_INFO_TYPE_ENUM
{
ENUM_INFO_SDIO = 0, /*download patch by sdio*/
ENUM_INFO_UART, /*download patch by uart*/
ENUM_INFO_TOTAL /*interface total*/
};
#endif
|
#ifndef __ISL29023_H__
#define __ISL29023_H__
#include <linux/kernel.h>
#include <linux/types.h>
#define LIGHTSENSOR_IRQ IRQ_EINT2
//#define ISL29023_DEBUG
#define USE_ISL29023_IOCTLS
#define error(fmt,arg...) printk(fmt "\n",## arg)
#ifdef ISL29023_DEBUG
#define debug(fmt,arg...) printk("--------" fmt "\n",## arg)
#else
#define debug(fmt,arg...)
#endif
/* Light Sensor Power Control */
#define ON 1
#define OFF 0
#ifdef USE_ISL29023_IOCTLS
/*IOCTLS*/
/*magic no*/
#define ISL29023_LIGHT_IOC_MAGIC 0xEE
/*max seq no*/
#define ISL29023_LIGHT_IOC_NR_MAX 9
#define ISL29023_LIGHT_IOC_SET_OPERATION_MODE _IOW(ISL29023_LIGHT_IOC_MAGIC, 0,u8)
#define ISL29023_LIGHT_IOC_SET_LUX_RANGE _IOW(ISL29023_LIGHT_IOC_MAGIC, 1,u32)
#define ISL29023_LIGHT_IOC_SET_ADC_RESOLUTION _IOW(ISL29023_LIGHT_IOC_MAGIC, 2,u8)
#define ISL29023_LIGHT_IOC_SET_INTERRUPT_PERSIST _IOW(ISL29023_LIGHT_IOC_MAGIC, 3,u8)
#define ISL29023_LIGHT_IOC_GET_OPERATION_MODE _IOR(ISL29023_LIGHT_IOC_MAGIC, 4,u8)
#define ISL29023_LIGHT_IOC_GET_LUX_RANGE _IOR(ISL29023_LIGHT_IOC_MAGIC, 5,u32)
#define ISL29023_LIGHT_IOC_GET_ADC_RESOLUTION _IOR(ISL29023_LIGHT_IOC_MAGIC, 6,u8)
#define ISL29023_LIGHT_IOC_GET_INTERRUPT_PERSIST _IOR(ISL29023_LIGHT_IOC_MAGIC, 7,u8)
#define ISL29023_LIGHT_IOC_SET_POLL_DELAY _IOR(ISL29023_LIGHT_IOC_MAGIC, 8, u32)
#endif
#endif
|
#ifndef _IP_CONNTRACK_CORE_H
#define _IP_CONNTRACK_CORE_H
#include <linux/netfilter_ipv4/lockhelp.h>
/* This header is used to share core functionality between the
standalone connection tracking module, and the compatibility layer's use
of connection tracking. */
extern unsigned int ip_conntrack_in(unsigned int hooknum,
struct sk_buff **pskb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff *));
extern int ip_conntrack_init(void);
extern void ip_conntrack_cleanup(void);
struct ip_conntrack_protocol;
extern struct ip_conntrack_protocol *find_proto(u_int8_t protocol);
/* Like above, but you already have conntrack read lock. */
extern struct ip_conntrack_protocol *__find_proto(u_int8_t protocol);
extern struct list_head protocol_list;
/* Returns conntrack if it dealt with ICMP, and filled in skb->nfct */
extern struct ip_conntrack *icmp_error_track(struct sk_buff *skb,
enum ip_conntrack_info *ctinfo,
unsigned int hooknum);
extern int get_tuple(const struct iphdr *iph, size_t len,
struct ip_conntrack_tuple *tuple,
struct ip_conntrack_protocol *protocol);
/* Find a connection corresponding to a tuple. */
struct ip_conntrack_tuple_hash *
ip_conntrack_find_get(const struct ip_conntrack_tuple *tuple,
const struct ip_conntrack *ignored_conntrack);
extern int __ip_conntrack_confirm(struct nf_ct_info *nfct);
/* Confirm a connection: returns NF_DROP if packet must be dropped. */
static inline int ip_conntrack_confirm(struct sk_buff *skb)
{
if (skb->nfct
&& !is_confirmed((struct ip_conntrack *)skb->nfct->master))
return __ip_conntrack_confirm(skb->nfct);
return NF_ACCEPT;
}
extern struct list_head *ip_conntrack_hash;
extern struct list_head expect_list;
DECLARE_RWLOCK_EXTERN(ip_conntrack_lock);
#endif /* _IP_CONNTRACK_CORE_H */
|
/*
* Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
* Copyright (C) 2016 Paul Davis <paul@linuxaudiosystems.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __ardour_meterbridge_h__
#define __ardour_meterbridge_h__
#include <glibmm/thread.h>
#include <gtkmm/box.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/label.h>
#include <gtkmm/window.h>
#include "ardour/ardour.h"
#include "ardour/types.h"
#include "ardour/session_handle.h"
#include "pbd/stateful.h"
#include "pbd/signals.h"
#include "gtkmm2ext/visibility_tracker.h"
#include "meter_strip.h"
class Meterbridge :
public Gtk::Window,
public PBD::ScopedConnectionList,
public ARDOUR::SessionHandlePtr,
public Gtkmm2ext::VisibilityTracker
{
public:
static Meterbridge* instance();
~Meterbridge();
void set_session (ARDOUR::Session *);
XMLNode& get_state (void);
int set_state (const XMLNode& );
void show_window ();
bool hide_window (GdkEventAny *ev);
private:
Meterbridge ();
static Meterbridge* _instance;
bool _visible;
bool _show_busses;
bool _show_master;
bool _show_midi;
Gtk::ScrolledWindow scroller;
Gtk::HBox meterarea;
Gtk::HBox global_hpacker;
Gtk::VBox global_vpacker;
gint start_updating ();
gint stop_updating ();
sigc::connection fast_screen_update_connection;
void fast_update_strips ();
void add_strips (ARDOUR::RouteList&);
void remove_strip (MeterStrip *);
void session_going_away ();
void sync_order_keys ();
void resync_order (PBD::PropertyChange what_changed = ARDOUR::Properties::order);
mutable Glib::Threads::Mutex _resync_mutex;
struct MeterBridgeStrip {
MeterStrip *s;
bool visible;
MeterBridgeStrip(MeterStrip *ss) {
s = ss;
visible = true;
}
};
struct MeterOrderRouteSorter
{
bool operator() (struct MeterBridgeStrip ma, struct MeterBridgeStrip mb) {
boost::shared_ptr<ARDOUR::Route> a = ma.s->route();
boost::shared_ptr<ARDOUR::Route> b = mb.s->route();
if (a->is_master() || a->is_monitor()) {
/* "a" is a special route (master, monitor, etc), and comes
* last in the mixer ordering
*/
return false;
} else if (b->is_master() || b->is_monitor()) {
/* everything comes before b */
return true;
}
return ARDOUR::Stripable::Sorter (true) (a, b);
}
};
std::list<MeterBridgeStrip> strips;
MeterStrip metrics_left;
MeterStrip metrics_right;
std::vector<MeterStrip *> _metrics;
Gtk::VBox metrics_vpacker_left;
Gtk::VBox metrics_vpacker_right;
Gtk::HBox metrics_spacer_left;
Gtk::HBox metrics_spacer_right;
static const int32_t default_width = 600;
static const int32_t default_height = 400;
static const int max_height = 1200; // == 1024 + 148 + 16 + 12 see meter_strip.cc
int cur_max_width;
void update_title ();
// for restoring window geometry.
int m_root_x, m_root_y, m_width, m_height;
void set_window_pos_and_size ();
void get_window_pos_and_size ();
bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*);
bool on_scroll_event (GdkEventScroll*);
void scroll_left ();
void scroll_right ();
void on_size_allocate (Gtk::Allocation&);
void on_size_request (Gtk::Requisition*);
void parameter_changed (std::string const & p);
void on_theme_changed ();
void on_scroll ();
sigc::connection scroll_connection;
int _mm_left, _mm_right;
ARDOUR::MeterType _mt_left, _mt_right;
};
#endif
|
#pragma once
#include "utils.h"
#include "ModelUtils.h"
#include <vector>
using namespace std;
namespace ParaEngine
{
struct AnimAlpha{
long frameNum;
float alphaValue;
};
// KGAO
struct KGAO{
long chunkNum;
long lineType; //(0:don't interp;1:linear;2:hermite;3:bezier)
long flag; //0xFFFFFFFF
void* data; // it is acutally AnimAlpha*
public:
KGAO(){data=NULL;}
~KGAO(){
if (data)
delete [] data;
}
};
struct GEOA{
float unk0;
int type; //0:none 1:Drop Shadow 2:static color
float blue; //static Color
float green; //static Color
float red; //static Color
long GeosetID;
};
/**
For animating the alpha of bones. This will cause bones to hide or unhide during animation.
TODO: currently X file does not support it. Only MDX file support it.
*/
class CGeosetAnim
{
public:
CGeosetAnim(void);
~CGeosetAnim(void);
void Read(TypePointer inP,int inSize);
float GetAnimAlpha(int geoID,const AnimInfo& animInfo);
private:
int numGeosetAnim;
vector <GEOA*> geosetAnim;
vector <KGAO*> geosetAlpha;
};
} |
#ifndef _TC_CORE_H_
#define _TC_CORE_H_ 1
#include <asm/types.h>
#include <linux/pkt_sched.h>
#define TIME_UNITS_PER_SEC 1000000
enum link_layer {
LINKLAYER_UNSPEC,
LINKLAYER_ETHERNET,
LINKLAYER_ATM,
};
int tc_core_time2big(unsigned time);
unsigned tc_core_time2tick(unsigned time);
unsigned tc_core_tick2time(unsigned tick);
unsigned tc_core_time2ktime(unsigned time);
unsigned tc_core_ktime2time(unsigned ktime);
unsigned tc_calc_xmittime(unsigned rate, unsigned size);
unsigned tc_calc_xmitsize(unsigned rate, unsigned ticks);
int tc_calc_rtable(struct tc_ratespec *r, __u32 *rtab,
int cell_log, unsigned mtu, enum link_layer link_layer);
int tc_calc_size_table(struct tc_sizespec *s, __u16 **stab);
int tc_setup_estimator(unsigned A, unsigned time_const, struct tc_estimator *est);
int tc_core_init(void);
extern struct rtnl_handle g_rth;
#endif
|
/**
* Copyright (c) 2012 Anup Patel.
* 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, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* @file cmd_heap.c
* @author Anup Patel (anup@brainfault.org)
* @brief command for heap status.
*/
#include <vmm_error.h>
#include <vmm_stdio.h>
#include <vmm_version.h>
#include <vmm_heap.h>
#include <vmm_host_aspace.h>
#include <vmm_modules.h>
#include <vmm_cmdmgr.h>
#include <libs/stringlib.h>
#include <libs/mathlib.h>
#define MODULE_DESC "Command heap"
#define MODULE_AUTHOR "Anup Patel"
#define MODULE_LICENSE "GPL"
#define MODULE_IPRIORITY 0
#define MODULE_INIT cmd_heap_init
#define MODULE_EXIT cmd_heap_exit
static void cmd_heap_usage(struct vmm_chardev *cdev)
{
vmm_cprintf(cdev, "Usage:\n");
vmm_cprintf(cdev, " heap help\n");
vmm_cprintf(cdev, " heap info\n");
vmm_cprintf(cdev, " heap state\n");
vmm_cprintf(cdev, " heap dma_info\n");
vmm_cprintf(cdev, " heap dma_state\n");
}
static int heap_info(struct vmm_chardev *cdev,
bool is_normal, virtual_addr_t heap_va,
u64 heap_sz, u64 heap_hksz, u64 heap_freesz)
{
int rc;
physical_addr_t heap_pa;
u64 pre, heap_usesz;
if (is_normal) {
heap_usesz = heap_sz - heap_hksz - heap_freesz;
} else {
heap_usesz = heap_sz - heap_freesz;
}
if ((rc = vmm_host_va2pa(heap_va, &heap_pa))) {
vmm_cprintf(cdev, "Error: Failed to get heap base PA\n");
return rc;
}
vmm_cprintf(cdev, "Base Virtual Addr : ");
vmm_cprintf(cdev, "0x%"PRIADDR"\n", heap_va);
vmm_cprintf(cdev, "Base Physical Addr : ");
vmm_cprintf(cdev, "0x%"PRIPADDR"\n", heap_pa);
pre = 1000; /* Division correct upto 3 decimal points */
vmm_cprintf(cdev, "House-Keeping Size : ");
heap_hksz = (heap_hksz * pre) >> 10;
vmm_cprintf(cdev, "%"PRId64".%03"PRId64" KB\n",
udiv64(heap_hksz, pre), umod64(heap_hksz, pre));
vmm_cprintf(cdev, "Used Space Size : ");
heap_usesz = (heap_usesz * pre) >> 10;
vmm_cprintf(cdev, "%"PRId64".%03"PRId64" KB\n",
udiv64(heap_usesz, pre), umod64(heap_usesz, pre));
vmm_cprintf(cdev, "Free Space Size : ");
heap_freesz = (heap_freesz * pre) >> 10;
vmm_cprintf(cdev, "%"PRId64".%03"PRId64" KB\n",
udiv64(heap_freesz, pre), umod64(heap_freesz, pre));
vmm_cprintf(cdev, "Total Size : ");
heap_sz = (heap_sz * pre) >> 10;
vmm_cprintf(cdev, "%"PRId64".%03"PRId64" KB\n",
udiv64(heap_sz, pre), umod64(heap_sz, pre));
return VMM_OK;
}
static int cmd_heap_info(struct vmm_chardev *cdev)
{
return heap_info(cdev, TRUE,
vmm_normal_heap_start_va(),
vmm_normal_heap_size(),
vmm_normal_heap_hksize(),
vmm_normal_heap_free_size());
}
static int cmd_heap_state(struct vmm_chardev *cdev)
{
return vmm_normal_heap_print_state(cdev);
}
static int cmd_heap_dma_info(struct vmm_chardev *cdev)
{
return heap_info(cdev, FALSE,
vmm_dma_heap_start_va(),
vmm_dma_heap_size(),
vmm_dma_heap_hksize(),
vmm_dma_heap_free_size());
}
static int cmd_heap_dma_state(struct vmm_chardev *cdev)
{
return vmm_dma_heap_print_state(cdev);
}
static int cmd_heap_exec(struct vmm_chardev *cdev, int argc, char **argv)
{
if (argc == 2) {
if (strcmp(argv[1], "help") == 0) {
cmd_heap_usage(cdev);
return VMM_OK;
} else if (strcmp(argv[1], "info") == 0) {
return cmd_heap_info(cdev);
} else if (strcmp(argv[1], "state") == 0) {
return cmd_heap_state(cdev);
} else if (strcmp(argv[1], "dma_info") == 0) {
return cmd_heap_dma_info(cdev);
} else if (strcmp(argv[1], "dma_state") == 0) {
return cmd_heap_dma_state(cdev);
}
}
cmd_heap_usage(cdev);
return VMM_EFAIL;
}
static struct vmm_cmd cmd_heap = {
.name = "heap",
.desc = "show heap status",
.usage = cmd_heap_usage,
.exec = cmd_heap_exec,
};
static int __init cmd_heap_init(void)
{
return vmm_cmdmgr_register_cmd(&cmd_heap);
}
static void __exit cmd_heap_exit(void)
{
vmm_cmdmgr_unregister_cmd(&cmd_heap);
}
VMM_DECLARE_MODULE(MODULE_DESC,
MODULE_AUTHOR,
MODULE_LICENSE,
MODULE_IPRIORITY,
MODULE_INIT,
MODULE_EXIT);
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef AUDIO_DEVICE_AUDIO_MIXER_MANAGER_PULSE_LINUX_H_
#define AUDIO_DEVICE_AUDIO_MIXER_MANAGER_PULSE_LINUX_H_
#include <pulse/pulseaudio.h>
#include <stdint.h>
#include "api/sequence_checker.h"
#ifndef UINT32_MAX
#define UINT32_MAX ((uint32_t)-1)
#endif
namespace webrtc {
class AudioMixerManagerLinuxPulse {
public:
int32_t SetPlayStream(pa_stream* playStream);
int32_t SetRecStream(pa_stream* recStream);
int32_t OpenSpeaker(uint16_t deviceIndex);
int32_t OpenMicrophone(uint16_t deviceIndex);
int32_t SetSpeakerVolume(uint32_t volume);
int32_t SpeakerVolume(uint32_t& volume) const;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
int32_t MinSpeakerVolume(uint32_t& minVolume) const;
int32_t SpeakerVolumeIsAvailable(bool& available);
int32_t SpeakerMuteIsAvailable(bool& available);
int32_t SetSpeakerMute(bool enable);
int32_t StereoPlayoutIsAvailable(bool& available);
int32_t StereoRecordingIsAvailable(bool& available);
int32_t SpeakerMute(bool& enabled) const;
int32_t MicrophoneMuteIsAvailable(bool& available);
int32_t SetMicrophoneMute(bool enable);
int32_t MicrophoneMute(bool& enabled) const;
int32_t MicrophoneVolumeIsAvailable(bool& available);
int32_t SetMicrophoneVolume(uint32_t volume);
int32_t MicrophoneVolume(uint32_t& volume) const;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
int32_t SetPulseAudioObjects(pa_threaded_mainloop* mainloop,
pa_context* context);
int32_t Close();
int32_t CloseSpeaker();
int32_t CloseMicrophone();
bool SpeakerIsInitialized() const;
bool MicrophoneIsInitialized() const;
public:
AudioMixerManagerLinuxPulse();
~AudioMixerManagerLinuxPulse();
private:
static void PaSinkInfoCallback(pa_context* c,
const pa_sink_info* i,
int eol,
void* pThis);
static void PaSinkInputInfoCallback(pa_context* c,
const pa_sink_input_info* i,
int eol,
void* pThis);
static void PaSourceInfoCallback(pa_context* c,
const pa_source_info* i,
int eol,
void* pThis);
static void PaSetVolumeCallback(pa_context* /*c*/,
int success,
void* /*pThis*/);
void PaSinkInfoCallbackHandler(const pa_sink_info* i, int eol);
void PaSinkInputInfoCallbackHandler(const pa_sink_input_info* i, int eol);
void PaSourceInfoCallbackHandler(const pa_source_info* i, int eol);
void WaitForOperationCompletion(pa_operation* paOperation) const;
bool GetSinkInputInfo() const;
bool GetSinkInfoByIndex(int device_index) const;
bool GetSourceInfoByIndex(int device_index) const;
private:
int16_t _paOutputDeviceIndex;
int16_t _paInputDeviceIndex;
pa_stream* _paPlayStream;
pa_stream* _paRecStream;
pa_threaded_mainloop* _paMainloop;
pa_context* _paContext;
mutable uint32_t _paVolume;
mutable uint32_t _paMute;
mutable uint32_t _paVolSteps;
bool _paSpeakerMute;
mutable uint32_t _paSpeakerVolume;
mutable uint8_t _paChannels;
bool _paObjectsSet;
// Stores thread ID in constructor.
// We can then use RTC_DCHECK_RUN_ON(&worker_thread_checker_) to ensure that
// other methods are called from the same thread.
// Currently only does RTC_DCHECK(thread_checker_.IsCurrent()).
SequenceChecker thread_checker_;
};
} // namespace webrtc
#endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_LINUX_AUDIO_MIXER_MANAGER_PULSE_LINUX_H_
|
/* linux/arch/arm/mach-exynos/include/mach/pm-core.h
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Based on arch/arm/mach-s3c2410/include/mach/pm-core.h,
* Copyright 2008 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
* http://armlinux.simtec.co.uk/
*
* EXYNOS4210 - PM core support for arch/arm/plat-s5p/pm.c
*
* 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.
*/
#include <mach/regs-pmu.h>
#include <mach/regs-gpio.h>
static inline void s3c_pm_debug_init_uart(void)
{
/* nothing here yet */
}
static inline void s3c_pm_arch_prepare_irqs(void)
{
#if defined(CONFIG_EXYNOS4212) || defined(CONFIG_EXYNOS4412)
/* Mask externel GIC and GPS_ALIVE wakeup source */
s3c_irqwake_intmask |= 0x3BF0000;
#endif
__raw_writel((s3c_irqwake_intmask & S5P_WAKEUP_MASK_BIT), S5P_WAKEUP_MASK);
__raw_writel(s3c_irqwake_eintmask, S5P_EINT_WAKEUP_MASK);
}
static inline void s3c_pm_arch_stop_clocks(void)
{
/* nothing here yet */
}
static inline void s3c_pm_arch_show_resume_irqs(void)
{
#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_CPU_EXYNOS4412)\
|| defined(CONFIG_CPU_EXYNOS5250)
pr_info("WAKEUP_STAT: 0x%x\n", __raw_readl(S5P_WAKEUP_STAT));
#if defined(CONFIG_PM_DEBUG_SAVE)
pr_info("RST_STAT: 0x%x\n", __raw_readl(S5P_PMUREG(0x0404)));
pr_info("CHIP_ID(0x10000004): 0x%0x\n", __raw_readl(S5P_VA_CHIPID + 0x4));
#endif
pr_info("WAKEUP_INTx_PEND: 0x%x, 0x%x, 0x%x, 0x%x\n",
__raw_readl(S5P_EINT_PEND(0)),
__raw_readl(S5P_EINT_PEND(1)),
__raw_readl(S5P_EINT_PEND(2)),
__raw_readl(S5P_EINT_PEND(3)));
#endif
}
static inline void s3c_pm_arch_update_uart(void __iomem *regs,
struct pm_uart_save *save)
{
/* nothing here yet */
}
static inline void s3c_pm_restored_gpios(void)
{
/* nothing here yet */
}
static inline void s3c_pm_saved_gpios(void)
{
/* nothing here yet */
}
|
/****************************************************************************
* *
* GNAT COMPILER COMPONENTS *
* *
* G N A T D E C O *
* *
* *
* C Header File *
* *
* Copyright (C) 2001-2002, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
* ware Foundation; either version 2, or (at your option) any later ver- *
* sion. GNAT is distributed in the hope that it will be useful, but WITH- *
* OUT 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 distributed with GNAT; see file COPYING. If not, write *
* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
* MA 02111-1307, USA. *
* *
* As a special exception, if you link this file 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 except- *
* ion does not however invalidate any other reasons why the executable *
* file might be covered by the GNU Public License. *
* *
* GNAT was originally developed by the GNAT team at New York University. *
* Extensive contributions were provided by Ada Core Technologies Inc. *
* *
****************************************************************************/
/* This function will return the Ada name from the encoded form.
The Ada coding is done in exp_dbug.ads and this is the inverse function.
see exp_dbug.ads for full encoding rules, a short description is added
below. Right now only objects and routines are handled. There is no support
for Ada types.
CODED_NAME is the encoded entity name.
ADA_NAME is a pointer to a buffer, it will receive the Ada name. A safe
size for this buffer is: strlen (coded_name) * 2 + 60. (60 is for the
verbose information).
VERBOSE is nonzero if more information about the entity is to be
added at the end of the Ada name and surrounded by ( and ). */
extern void __gnat_decode PARAMS ((const char *, char *, int));
/* ada_demangle is added for COMPATIBILITY ONLY. It has the name of the
function used in the binutils and GDB. Always consider using __gnat_decode
instead of ada_demangle. Caller must free the pointer returned. */
extern char *ada_demangle PARAMS ((const char *));
|
/*
* Copyright (C) 2008, Nokia <ivan.frade@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU 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 __TRACKER_MINER_FS_FILES_H__
#define __TRACKER_MINER_FS_FILES_H__
#include <libtracker-miner/tracker-miner.h>
#include "tracker-config.h"
G_BEGIN_DECLS
#define TRACKER_TYPE_MINER_FILES (tracker_miner_files_get_type())
#define TRACKER_MINER_FILES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_MINER_FILES, TrackerMinerFiles))
#define TRACKER_MINER_FILES_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TRACKER_TYPE_MINER_FILES, TrackerMinerFilesClass))
#define TRACKER_IS_MINER_FILES(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TRACKER_TYPE_MINER_FILES))
#define TRACKER_IS_MINER_FILES_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TRACKER_TYPE_MINER_FILES))
#define TRACKER_MINER_FILES_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_MINER_FILES, TrackerMinerFilesClass))
typedef struct TrackerMinerFiles TrackerMinerFiles;
typedef struct TrackerMinerFilesClass TrackerMinerFilesClass;
typedef struct TrackerMinerFilesPrivate TrackerMinerFilesPrivate;
struct TrackerMinerFiles {
TrackerMinerFS parent_instance;
TrackerMinerFilesPrivate *private;
};
struct TrackerMinerFilesClass {
TrackerMinerFSClass parent_class;
};
GType tracker_miner_files_get_type (void) G_GNUC_CONST;
TrackerMiner *tracker_miner_files_new (TrackerConfig *config,
GError **error);
/* Convenience functions for --eligible tracker-miner-fs cmdline */
gboolean tracker_miner_files_check_file (GFile *file,
GSList *ignored_file_paths,
GSList *ignored_file_patterns);
gboolean tracker_miner_files_check_directory (GFile *file,
GSList *index_recursive_directories,
GSList *index_single_directories,
GSList *ignored_directory_paths,
GSList *ignored_directory_patterns);
gboolean tracker_miner_files_check_directory_contents (GFile *parent,
GList *children,
GSList *ignored_content);
gboolean tracker_miner_files_monitor_directory (GFile *file,
gboolean enable_monitors,
GSList *directories_to_check);
gboolean tracker_miner_files_is_file_eligible (TrackerMinerFiles *miner,
GFile *file);
G_END_DECLS
#endif /* __TRACKER_MINER_FS_FILES_H__ */
|
/* -*- Mode: C; c-basic-offset: 4 -*- */
/* Python plug-in for dia
* Copyright (C) 1999 James Henstridge
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <config.h>
#include "pydia-geometry.h"
#include "pydia-cpoint.h"
#include "pydia-object.h"
PyObject *
PyDiaConnectionPoint_New(ConnectionPoint *cpoint)
{
PyDiaConnectionPoint *self;
self = PyObject_NEW(PyDiaConnectionPoint, &PyDiaConnectionPoint_Type);
if (!self) return NULL;
self->cpoint = cpoint;
return (PyObject *)self;
}
static void
PyDiaConnectionPoint_Dealloc(PyDiaConnectionPoint *self)
{
PyObject_DEL(self);
}
static int
PyDiaConnectionPoint_Compare(PyDiaConnectionPoint *self,
PyDiaConnectionPoint *other)
{
if (self->cpoint == other->cpoint) return 0;
if (self->cpoint > other->cpoint) return -1;
return 1;
}
static long
PyDiaConnectionPoint_Hash(PyDiaConnectionPoint *self)
{
return (long)self->cpoint;
}
static PyObject *
PyDiaConnectionPoint_GetAttr(PyDiaConnectionPoint *self, gchar *attr)
{
if (!strcmp(attr, "__members__"))
return Py_BuildValue("[sss]", "connected", "object", "pos");
else if (!strcmp(attr, "pos"))
return PyDiaPoint_New(&(self->cpoint->pos));
else if (!strcmp(attr, "object"))
return PyDiaObject_New(self->cpoint->object);
else if (!strcmp(attr, "connected")) {
PyObject *ret;
GList *tmp;
gint i;
ret = PyTuple_New(g_list_length(self->cpoint->connected));
for (i = 0, tmp = self->cpoint->connected; tmp; i++, tmp = tmp->next)
PyTuple_SetItem(ret, i, PyDiaObject_New((DiaObject *)tmp->data));
return ret;
}
PyErr_SetString(PyExc_AttributeError, attr);
return NULL;
}
PyTypeObject PyDiaConnectionPoint_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"dia.ConnectionPoint",
sizeof(PyDiaConnectionPoint),
0,
(destructor)PyDiaConnectionPoint_Dealloc,
(printfunc)0,
(getattrfunc)PyDiaConnectionPoint_GetAttr,
(setattrfunc)0,
(cmpfunc)PyDiaConnectionPoint_Compare,
(reprfunc)0,
0,
0,
0,
(hashfunc)PyDiaConnectionPoint_Hash,
(ternaryfunc)0,
(reprfunc)0,
(getattrofunc)0,
(setattrofunc)0,
(PyBufferProcs *)0,
0L, /* Flags */
"One of the major features of Dia are connectable objects. They work by this type accesible "
"through dia.Object.connections[]."
};
|
#ifndef __ARM_TYPES_H__
#define __ARM_TYPES_H__
#ifndef __ASSEMBLY__
#include <xen/config.h>
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#endif
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
typedef u64 paddr_t;
#define INVALID_PADDR (~0ULL)
#define PRIpaddr "016llx"
typedef unsigned long size_t;
typedef char bool_t;
#define test_and_set_bool(b) xchg(&(b), 1)
#define test_and_clear_bool(b) xchg(&(b), 0)
#endif /* __ASSEMBLY__ */
#define BITS_PER_LONG 32
#define BYTES_PER_LONG 4
#define LONG_BYTEORDER 2
#endif /* __ARM_TYPES_H__ */
/*
* Local variables:
* mode: C
* c-set-style: "BSD"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
|
/* -----------------------------------------------------------------------
ffi.c
m68k Foreign Function Interface
----------------------------------------------------------------------- */
#include <ffi.h>
#include <ffi_common.h>
#include <stdlib.h>
/* ffi_prep_args is called by the assembly routine once stack space has
been allocated for the function's arguments. */
static void *
ffi_prep_args (void *stack, extended_cif *ecif)
{
unsigned int i;
int tmp;
unsigned int avn;
void **p_argv;
char *argp;
ffi_type **p_arg;
void *struct_value_ptr;
tmp = 0;
argp = stack;
if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
&& ecif->cif->rtype->size > 8)
struct_value_ptr = ecif->rvalue;
else
struct_value_ptr = NULL;
avn = ecif->cif->nargs;
p_argv = ecif->avalue;
for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
i != 0 && avn != 0;
i--, p_arg++)
{
size_t z;
/* Align if necessary. */
if (((*p_arg)->alignment - 1) & (unsigned) argp)
argp = (char *) ALIGN (argp, (*p_arg)->alignment);
if (avn != 0)
{
avn--;
z = (*p_arg)->size;
if (z < sizeof (int))
{
switch ((*p_arg)->type)
{
case FFI_TYPE_SINT8:
*(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
break;
case FFI_TYPE_UINT8:
*(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
break;
case FFI_TYPE_SINT16:
*(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
break;
case FFI_TYPE_UINT16:
*(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
break;
case FFI_TYPE_STRUCT:
memcpy (argp + sizeof (int) - z, *p_argv, z);
break;
default:
FFI_ASSERT (0);
}
z = sizeof (int);
}
else
memcpy (argp, *p_argv, z);
p_argv++;
argp += z;
}
}
return struct_value_ptr;
}
#define CIF_FLAGS_INT 1
#define CIF_FLAGS_DINT 2
#define CIF_FLAGS_FLOAT 4
#define CIF_FLAGS_DOUBLE 8
#define CIF_FLAGS_LDOUBLE 16
#define CIF_FLAGS_POINTER 32
#define CIF_FLAGS_STRUCT 64
/* Perform machine dependent cif processing */
ffi_status
ffi_prep_cif_machdep (ffi_cif *cif)
{
/* Set the return type flag */
switch (cif->rtype->type)
{
case FFI_TYPE_VOID:
cif->flags = 0;
break;
case FFI_TYPE_STRUCT:
if (cif->rtype->size > 4 && cif->rtype->size <= 8)
cif->flags = CIF_FLAGS_DINT;
else if (cif->rtype->size <= 4)
cif->flags = CIF_FLAGS_STRUCT;
else
cif->flags = 0;
break;
case FFI_TYPE_FLOAT:
cif->flags = CIF_FLAGS_FLOAT;
break;
case FFI_TYPE_DOUBLE:
cif->flags = CIF_FLAGS_DOUBLE;
break;
case FFI_TYPE_LONGDOUBLE:
cif->flags = CIF_FLAGS_LDOUBLE;
break;
case FFI_TYPE_POINTER:
cif->flags = CIF_FLAGS_POINTER;
break;
case FFI_TYPE_SINT64:
case FFI_TYPE_UINT64:
cif->flags = CIF_FLAGS_DINT;
break;
default:
cif->flags = CIF_FLAGS_INT;
break;
}
return FFI_OK;
}
extern void ffi_call_SYSV (void *(*) (void *, extended_cif *),
extended_cif *,
unsigned, unsigned, unsigned,
void *, void (*fn) ());
void
ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
{
extended_cif ecif;
ecif.cif = cif;
ecif.avalue = avalue;
/* If the return value is a struct and we don't have a return value
address then we need to make one. */
if (rvalue == NULL
&& cif->rtype->type == FFI_TYPE_STRUCT
&& cif->rtype->size > 8)
ecif.rvalue = alloca (cif->rtype->size);
else
ecif.rvalue = rvalue;
switch (cif->abi)
{
case FFI_SYSV:
ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes,
cif->flags, cif->rtype->size * 8,
ecif.rvalue, fn);
break;
default:
FFI_ASSERT (0);
break;
}
}
|
#ifndef _DDP_OVL_H_
#define _DDP_OVL_H_
#include "ddp_hal.h"
#include "DpDataType.h"
#include "ddp_info.h"
#define OVL_MAX_WIDTH (4095)
#define OVL_MAX_HEIGHT (4095)
#ifdef OVL_CASCADE_SUPPORT
#define OVL_LAYER_NUM (6)
#else
#define OVL_LAYER_NUM (4)
#endif
#define OVL_LAYER_NUM_PER_OVL 4
typedef enum {
DDP_OVL1_STATUS_IDLE = 0,
DDP_OVL1_STATUS_PRIMARY = 1, /* used for primary 8 layer blending */
DDP_OVL1_STATUS_SUB = 2, /* used for sub 4 layer bleding */
DDP_OVL1_STATUS_SUB_REQUESTING = 3, /* sub request to use OVL1 */
DDP_OVL1_STATUS_PRIMARY_RELEASED = 4,
DDP_OVL1_STATUS_PRIMARY_RELEASING = 5,
DDP_OVL1_STATUS_PRIMARY_DISABLE = 6
} DISP_OVL1_STATUS;
/* start overlay module */
int ovl_start(DISP_MODULE_ENUM module, void *handle);
/* stop overlay module */
int ovl_stop(DISP_MODULE_ENUM module, void *handle);
/* reset overlay module */
int ovl_reset(DISP_MODULE_ENUM module, void *handle);
/* set region of interest */
int ovl_roi(DISP_MODULE_ENUM module, unsigned int bgW, unsigned int bgH, /* region size */
unsigned int bgColor, /* border color */
void *handle);
/* switch layer on/off */
int ovl_layer_switch(DISP_MODULE_ENUM module, unsigned layer, unsigned int en, void *handle);
/* get ovl input address */
void ovl_get_address(DISP_MODULE_ENUM module, unsigned long *add);
int ovl_3d_config(DISP_MODULE_ENUM module,
unsigned int layer_id,
unsigned int en_3d, unsigned int landscape, unsigned int r_first, void *handle);
void ovl_dump_analysis(DISP_MODULE_ENUM module);
void ovl_dump_reg(DISP_MODULE_ENUM module);
void ovl_get_info(int idx, void *data);
void ovl_reset_by_cmdq(void *handle, DISP_MODULE_ENUM module);
DISP_OVL1_STATUS ovl_get_status(void);
void ovl_set_status(DISP_OVL1_STATUS status);
unsigned int ddp_ovl_get_cur_addr(bool rdma_mode, int layerid);
struct DDP_MODULE_DRIVER;
#endif
|
/*
* Hisilicon Terminal SoCs drm fbdev driver
*
* Copyright (c) 2014-2015 Hisilicon Limited.
* Author: z.liuxinliang@huawei.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.
*
*/
#include <drm/drmP.h>
#include <drm/drm_gem_cma_helper.h>
#include <drm/drm_crtc_helper.h>
#include "hisi_drm_fb.h"
struct hisi_drm_fb *to_hisi_drm_fb(struct drm_framebuffer *fb)
{
return container_of(fb, struct hisi_drm_fb, fb);
}
void hisi_drm_fb_destroy(struct drm_framebuffer *fb)
{
struct hisi_drm_fb *hisi_fb = to_hisi_drm_fb(fb);
int i;
for (i = 0; i < 4; i++) {
if (hisi_fb->obj[i])
drm_gem_object_unreference_unlocked( \
&hisi_fb->obj[i]->base);
}
drm_framebuffer_cleanup(fb);
kfree(hisi_fb);
}
static int hisi_drm_fb_create_handle(struct drm_framebuffer *fb,
struct drm_file *file_priv, unsigned int *handle)
{
struct hisi_drm_fb *hisi_fb = to_hisi_drm_fb(fb);
return drm_gem_handle_create(file_priv,
&hisi_fb->obj[0]->base, handle);
}
static int hisi_drm_fb_dirty(struct drm_framebuffer *fb,
struct drm_file *file_priv, unsigned flags,
unsigned color, struct drm_clip_rect *clips,
unsigned num_clips)
{
/* TODO */
return 0;
}
static struct drm_framebuffer_funcs hisi_drm_fb_funcs = {
.destroy = hisi_drm_fb_destroy,
.create_handle = hisi_drm_fb_create_handle,
.dirty = hisi_drm_fb_dirty,
};
struct hisi_drm_fb *hisi_drm_fb_alloc(struct drm_device *dev,
struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_cma_object **obj,
unsigned int num_planes, bool is_fbdev_fb)
{
struct hisi_drm_fb *hisi_fb;
int ret;
int i;
hisi_fb = kzalloc(sizeof(*hisi_fb), GFP_KERNEL);
if (!hisi_fb)
return ERR_PTR(-ENOMEM);
hisi_fb->is_fbdev_fb = is_fbdev_fb;
drm_helper_mode_fill_fb_struct(&hisi_fb->fb, mode_cmd);
for (i = 0; i < num_planes; i++)
hisi_fb->obj[i] = obj[i];
ret = drm_framebuffer_init(dev, &hisi_fb->fb, &hisi_drm_fb_funcs);
if (ret) {
DRM_ERROR("Failed to initialize framebuffer: %d\n", ret);
kfree(hisi_fb);
return ERR_PTR(ret);
}
return hisi_fb;
}
/**
* hisi_drm_fb_create() - (struct drm_mode_config_funcs *)->fb_create callback function
*
* If your hardware has special alignment or pitch requirements these should be
* checked before calling this function.
*/
static struct drm_framebuffer *hisi_drm_fb_create(struct drm_device *dev,
struct drm_file *file_priv, struct drm_mode_fb_cmd2 *mode_cmd)
{
struct hisi_drm_fb *hisi_fb;
struct drm_gem_cma_object *objs[4];
struct drm_gem_object *obj;
unsigned int hsub;
unsigned int vsub;
int ret;
int i;
/* TODO: Need to use ion heaps to create frame buffer?? */
hsub = drm_format_horz_chroma_subsampling(mode_cmd->pixel_format);
vsub = drm_format_vert_chroma_subsampling(mode_cmd->pixel_format);
for (i = 0; i < drm_format_num_planes(mode_cmd->pixel_format); i++) {
unsigned int width = mode_cmd->width / (i ? hsub : 1);
unsigned int height = mode_cmd->height / (i ? vsub : 1);
unsigned int min_size;
obj = drm_gem_object_lookup(dev, file_priv,
mode_cmd->handles[i]);
if (!obj) {
DRM_ERROR("Failed to lookup GEM object\n");
ret = -ENXIO;
goto err_gem_object_unreference;
}
min_size = (height - 1) * mode_cmd->pitches[i]
+ width*drm_format_plane_cpp(mode_cmd->pixel_format, i)
+ mode_cmd->offsets[i];
if (obj->size < min_size) {
drm_gem_object_unreference_unlocked(obj);
ret = -EINVAL;
goto err_gem_object_unreference;
}
objs[i] = to_drm_gem_cma_obj(obj);
}
hisi_fb = hisi_drm_fb_alloc(dev, mode_cmd, objs, i, false);
if (IS_ERR(hisi_fb)) {
ret = PTR_ERR(hisi_fb);
goto err_gem_object_unreference;
}
return &hisi_fb->fb;
err_gem_object_unreference:
for (i--; i >= 0; i--)
drm_gem_object_unreference_unlocked(&objs[i]->base);
return ERR_PTR(ret);
}
/**
* hisi_drm_fb_get_gem_obj() - Get CMA GEM object for framebuffer
* @fb: The framebuffer
* @plane: Which plane
*
* Return the CMA GEM object for given framebuffer.
*
* This function will usually be called from the CRTC callback functions.
*/
struct drm_gem_cma_object *hisi_drm_fb_get_gem_obj(struct drm_framebuffer *fb,
unsigned int plane)
{
struct hisi_drm_fb *hisi_fb = to_hisi_drm_fb(fb);
if (plane >= 4)
return NULL;
return hisi_fb->obj[plane];
}
static const struct drm_mode_config_funcs hisi_drm_mode_config_funcs = {
.fb_create = hisi_drm_fb_create,
};
void hisi_drm_mode_config_init(struct drm_device *dev)
{
dev->mode_config.min_width = 0;
dev->mode_config.min_height = 0;
dev->mode_config.max_width = 2048;
dev->mode_config.max_height = 2048;
dev->mode_config.funcs = &hisi_drm_mode_config_funcs;
}
|
/* Modula 2 language support definitions for GDB, the GNU debugger.
Copyright (C) 1992-2017 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
struct type_print_options;
struct parser_state;
extern int m2_parse (struct parser_state *); /* Defined in m2-exp.y */
extern void m2_yyerror (const char *); /* Defined in m2-exp.y */
/* Defined in m2-typeprint.c */
extern void m2_print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *);
extern void m2_print_typedef (struct type *, struct symbol *,
struct ui_file *);
extern int m2_is_long_set (struct type *type);
extern int m2_is_unbounded_array (struct type *type);
extern void m2_val_print (struct type *, int, CORE_ADDR,
struct ui_file *, int,
struct value *,
const struct value_print_options *);
extern int get_long_set_bounds (struct type *type, LONGEST *low,
LONGEST *high);
/* Modula-2 types */
struct builtin_m2_type
{
struct type *builtin_char;
struct type *builtin_int;
struct type *builtin_card;
struct type *builtin_real;
struct type *builtin_bool;
};
/* Return the Modula-2 type table for the specified architecture. */
extern const struct builtin_m2_type *builtin_m2_type (struct gdbarch *gdbarch);
|
/*
Copyright (C) 2010 Brad Hards <bradh@frogmouth.net>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RTFREADER_FONTTABLEDESTINATION_H
#define RTFREADER_FONTTABLEDESTINATION_H
#include <QString>
#include <QColor>
#include "Destination.h"
#include "FontTableEntry.h"
#include "rtfreader_export.h"
namespace RtfReader
{
class Reader;
class RTFREADER_EXPORT FontTableDestination: public Destination
{
public:
FontTableDestination( Reader *reader, AbstractRtfOutput *output, const QString &name );
virtual ~FontTableDestination();
virtual void handleControlWord( const QString &controlWord, bool hasValue, const int value );
virtual void handlePlainText( const QString &plainText );
virtual void aboutToEndDestination();
protected:
quint32 m_currentFontTableIndex;
FontTableEntry m_fontTableEntry;
};
}
#endif
|
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef __ODM_REGDEFINE11AC_H__
#define __ODM_REGDEFINE11AC_H__
//2 RF REG LIST
//2 BB REG LIST
//PAGE 8
#define ODM_REG_CCK_RPT_FORMAT_11AC 0x804
#define ODM_REG_BB_RX_PATH_11AC 0x808
#define ODM_REG_BB_TX_PATH_11AC 0x80c
#define ODM_REG_BB_ATC_11AC 0x860
#define ODM_REG_EDCCA_POWER_CAL 0x8dc
#define ODM_REG_DBG_RPT_11AC 0x8fc
//PAGE 9
#define ODM_REG_EDCCA_DOWN_OPT 0x900
#define ODM_REG_ACBB_EDCCA_ENHANCE 0x944
#define ODM_ADC_TRIGGER_Jaguar2 0x95C /*ADC sample mode*/
#define ODM_REG_OFDM_FA_RST_11AC 0x9A4
#define ODM_REG_CCX_PERIOD_11AC 0x990
#define ODM_REG_NHM_TH9_TH10_11AC 0x994
#define ODM_REG_CLM_11AC 0x994
#define ODM_REG_NHM_TH3_TO_TH0_11AC 0x998
#define ODM_REG_NHM_TH7_TO_TH4_11AC 0x99c
#define ODM_REG_NHM_TH8_11AC 0x9a0
#define ODM_REG_NHM_9E8_11AC 0x9e8
#define ODM_REG_CSI_CONTENT_VALUE 0x9b4
//PAGE A
#define ODM_REG_CCK_CCA_11AC 0xA0A
#define ODM_REG_CCK_FA_RST_11AC 0xA2C
#define ODM_REG_CCK_FA_11AC 0xA5C
//PAGE B
#define ODM_REG_RST_RPT_11AC 0xB58
//PAGE C
#define ODM_REG_TRMUX_11AC 0xC08
#define ODM_REG_IGI_A_11AC 0xC50
//PAGE E
#define ODM_REG_IGI_B_11AC 0xE50
#define ODM_REG_TRMUX_11AC_B 0xE08
//PAGE F
#define ODM_REG_CCK_CRC32_CNT_11AC 0xF04
#define ODM_REG_CCK_CCA_CNT_11AC 0xF08
#define ODM_REG_VHT_CRC32_CNT_11AC 0xF0c
#define ODM_REG_HT_CRC32_CNT_11AC 0xF10
#define ODM_REG_OFDM_CRC32_CNT_11AC 0xF14
#define ODM_REG_OFDM_FA_11AC 0xF48
#define ODM_REG_RPT_11AC 0xfa0
#define ODM_REG_CLM_RESULT_11AC 0xfa4
#define ODM_REG_NHM_CNT_11AC 0xfa8
#define ODM_REG_NHM_DUR_READY_11AC 0xfb4
#define ODM_REG_NHM_CNT7_TO_CNT4_11AC 0xfac
#define ODM_REG_NHM_CNT11_TO_CNT8_11AC 0xfb0
#define ODM_REG_OFDM_FA_TYPE2_11AC 0xFD0
//PAGE 18
#define ODM_REG_IGI_C_11AC 0x1850
//PAGE 1A
#define ODM_REG_IGI_D_11AC 0x1A50
//2 MAC REG LIST
#define ODM_REG_RESP_TX_11AC 0x6D8
//DIG Related
#define ODM_BIT_IGI_11AC 0xFFFFFFFF
#define ODM_BIT_CCK_RPT_FORMAT_11AC BIT16
#define ODM_BIT_BB_RX_PATH_11AC 0xF
#define ODM_BIT_BB_TX_PATH_11AC 0xF
#define ODM_BIT_BB_ATC_11AC BIT14
#endif
|
/*============================================================================
KWSys - Kitware System Library
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef cmsys_MD5_h
#define cmsys_MD5_h
#include <cmsys/Configure.h>
/* Redefine all public interface symbol names to be in the proper
namespace. These macros are used internally to kwsys only, and are
not visible to user code. Use kwsysHeaderDump.pl to reproduce
these macros after making changes to the interface. */
#if !defined(KWSYS_NAMESPACE)
# define kwsys_ns(x) cmsys##x
# define kwsysEXPORT cmsys_EXPORT
#endif
#if !cmsys_NAME_IS_KWSYS
# define kwsysMD5 kwsys_ns(MD5)
# define kwsysMD5_s kwsys_ns(MD5_s)
# define kwsysMD5_New kwsys_ns(MD5_New)
# define kwsysMD5_Delete kwsys_ns(MD5_Delete)
# define kwsysMD5_Initialize kwsys_ns(MD5_Initialize)
# define kwsysMD5_Append kwsys_ns(MD5_Append)
# define kwsysMD5_Finalize kwsys_ns(MD5_Finalize)
# define kwsysMD5_FinalizeHex kwsys_ns(MD5_FinalizeHex)
# define kwsysMD5_DigestToHex kwsys_ns(MD5_DigestToHex)
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
/**
* MD5 state data structure.
*/
typedef struct kwsysMD5_s kwsysMD5;
/**
* Create a new MD5 instance. The returned instance is not initialized.
*/
kwsysEXPORT kwsysMD5* kwsysMD5_New(void);
/**
* Delete an old MD5 instance.
*/
kwsysEXPORT void kwsysMD5_Delete(kwsysMD5* md5);
/**
* Initialize a new MD5 digest.
*/
kwsysEXPORT void kwsysMD5_Initialize(kwsysMD5* md5);
/**
* Append data to an MD5 digest. If the given length is negative,
* data will be read up to but not including a terminating null.
*/
kwsysEXPORT void kwsysMD5_Append(kwsysMD5* md5, unsigned char const* data,
int length);
/**
* Finalize a MD5 digest and get the 16-byte hash value.
*/
kwsysEXPORT void kwsysMD5_Finalize(kwsysMD5* md5, unsigned char digest[16]);
/**
* Finalize a MD5 digest and get the 32-bit hexadecimal representation.
*/
kwsysEXPORT void kwsysMD5_FinalizeHex(kwsysMD5* md5, char buffer[32]);
/**
* Convert a MD5 digest 16-byte value to a 32-byte hexadecimal representation.
*/
kwsysEXPORT void kwsysMD5_DigestToHex(unsigned char const digest[16],
char buffer[32]);
#if defined(__cplusplus)
} /* extern "C" */
#endif
/* If we are building a kwsys .c or .cxx file, let it use these macros.
Otherwise, undefine them to keep the namespace clean. */
#if !defined(KWSYS_NAMESPACE)
# undef kwsys_ns
# undef kwsysEXPORT
# if !cmsys_NAME_IS_KWSYS
# undef kwsysMD5
# undef kwsysMD5_s
# undef kwsysMD5_New
# undef kwsysMD5_Delete
# undef kwsysMD5_Initialize
# undef kwsysMD5_Append
# undef kwsysMD5_Finalize
# undef kwsysMD5_FinalizeHex
# undef kwsysMD5_DigestToHex
# endif
#endif
#endif
|
/*
* An rtc/i2c driver for the Micro Crystal RV-4162 Real-time clock
*
* Copyright 2013 Boundary Devices
*
* Author: Eric Nelson <eric.nelson@boundarydevices.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.
*/
#include <linux/i2c.h>
#include <linux/rtc.h>
/* Registers */
#define RV4162_REG_SECS 0x01
#define RV4162_SECFLAG_ST 0x80
#define RV4162_REG_FLAGS 0x0f
#define RV4162_FLAG_OF 4
static struct i2c_driver rv4162_driver;
#define BCD_TO_BIN(v) (((v)&0x0f)+(((v)&0xF0)>>4)*10)
static int rv4162_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct i2c_client *client = to_i2c_client(dev);
u8 addr = 0;
u8 buf[8];
int err;
struct i2c_msg msgs[] = {
{client->addr, 0, 1, &addr},
{client->addr, I2C_M_RD, sizeof(buf), buf},
};
memset(tm,0,sizeof(*tm));
if (2 == (err=i2c_transfer(client->adapter, &msgs[0], 2))) {
tm->tm_sec = BCD_TO_BIN(buf[1]&0x7f);
tm->tm_min = BCD_TO_BIN(buf[2]&0x7f);
tm->tm_hour = BCD_TO_BIN(buf[3]);
tm->tm_mon = BCD_TO_BIN(buf[6]&0x1F)-1;
tm->tm_mday = BCD_TO_BIN(buf[5]);
tm->tm_wday = (buf[4]&7)-1;
tm->tm_yday = -1;
tm->tm_year = BCD_TO_BIN(buf[7])+(100*(buf[6]>>6));
dev_dbg(&client->dev, "%s: read time: %04u-%02u-%02u %02u:%02u:%02u\n",
__func__,
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
dev_dbg(&client->dev, "%s: %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x\n",
__func__,
buf[0], buf[1], buf[2], buf[3],
buf[4], buf[5], buf[6], buf[7]);
return 0;
}
else {
dev_err(&client->dev, "%s: error %d reading time\n",
__func__, err);
return err;
}
}
#define BIN_TO_BCD(v) ((((v)/10)<<4)|((v)%10))
static int rv4162_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
struct i2c_client *client = to_i2c_client(dev);
u8 buf[9];
int err;
struct i2c_msg msg = {
client->addr, 0, sizeof(buf), buf
};
buf[0] = 0;
buf[1] = 0;
buf[2] = BIN_TO_BCD(tm->tm_sec);
buf[3] = BIN_TO_BCD(tm->tm_min);
buf[4] = BIN_TO_BCD(tm->tm_hour);
buf[5] = tm->tm_wday+1;
buf[6] = BIN_TO_BCD(tm->tm_mday);
buf[7] = BIN_TO_BCD(tm->tm_mon+1) | ((tm->tm_year/100)<<6);
buf[8] = BIN_TO_BCD(tm->tm_year%100);
if (1 == (err=i2c_transfer(client->adapter, &msg, 1))) {
dev_dbg(&client->dev, "%s: %04u-%02u-%02u %02u:%02u:%02u\n",
__func__,
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
dev_dbg(&client->dev, "%s: %02x:%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x\n",
__func__,
buf[0], buf[1], buf[2], buf[3],
buf[4], buf[5], buf[6], buf[7], buf[8]);
return 0;
}
else {
dev_err(&client->dev, "%s: error %d saving time\n",
__func__, err);
return err;
}
}
static const struct rtc_class_ops rv4162_rtc_ops = {
.read_time = rv4162_rtc_read_time,
.set_time = rv4162_rtc_set_time,
};
static int rv4162_remove(struct i2c_client *client)
{
struct rtc_device *rtc = i2c_get_clientdata(client);
if (rtc)
rtc_device_unregister(rtc);
return 0;
}
static int rv4162_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct rtc_device *rtc;
unsigned char addr = RV4162_REG_FLAGS;
unsigned char flags;
struct i2c_msg msgs[] = {
{client->addr, 0, 1, &addr},
{client->addr, I2C_M_RD, 1, &flags},
};
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
return -ENODEV;
if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) {
dev_err(&client->dev, "%s: read error\n", __func__);
return -EIO;
}
dev_info(&client->dev, "%s: chip found: flags 0x%02x\n", __func__, flags);
rtc = rtc_device_register(rv4162_driver.driver.name, &client->dev,
&rv4162_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
i2c_set_clientdata(client, rtc);
return 0;
}
static struct i2c_device_id rv4162_id[] = {
{ "rv4162", 0 },
{ }
};
static struct i2c_driver rv4162_driver = {
.driver = {
.name = "rtc-rv4162",
},
.probe = &rv4162_probe,
.remove = &rv4162_remove,
.id_table = rv4162_id,
};
static int __init rv4162_init(void)
{
return i2c_add_driver(&rv4162_driver);
}
static void __exit rv4162_exit(void)
{
i2c_del_driver(&rv4162_driver);
}
MODULE_AUTHOR("Eric Nelson <eric.nelson@boundarydevices.com>");
MODULE_DESCRIPTION("Micro Crystal RV-4162 Real-time clock driver");
MODULE_LICENSE("GPL");
module_init(rv4162_init);
module_exit(rv4162_exit);
|
// Rar/Handler.h
#ifndef __RAR_HANDLER_H
#define __RAR_HANDLER_H
#include "../IArchive.h"
#include "RarIn.h"
#include "RarVolumeInStream.h"
#include "../../Common/CreateCoder.h"
namespace NArchive {
namespace NRar {
class CHandler:
public IInArchive,
PUBLIC_ISetCompressCodecsInfo
public CMyUnknownImp
{
public:
MY_QUERYINTERFACE_BEGIN2(IInArchive)
QUERY_ENTRY_ISetCompressCodecsInfo
MY_QUERYINTERFACE_END
MY_ADDREF_RELEASE
INTERFACE_IInArchive(;)
DECL_ISetCompressCodecsInfo
private:
CRecordVector<CRefItem> _refItems;
CObjectVector<CItemEx> _items;
CObjectVector<CInArchive> _archives;
NArchive::NRar::CInArchiveInfo _archiveInfo;
DECL_EXTERNAL_CODECS_VARS
UInt64 GetPackSize(int refIndex) const;
// NArchive::NRar::CInArchive _archive;
bool IsSolid(int refIndex)
{
const CItemEx &item = _items[_refItems[refIndex].ItemIndex];
if (item.UnPackVersion < 20)
{
if (_archiveInfo.IsSolid())
return (refIndex > 0);
return false;
}
return item.IsSolid();
}
HRESULT Open2(IInStream *stream,
const UInt64 *maxCheckStartPosition,
IArchiveOpenCallback *openArchiveCallback);
};
}}
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2015 secunet Security Networks AG
*
* 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.
*/
#include <stdint.h>
#include <device/pci.h>
#include <northbridge/intel/sandybridge/raminit.h>
#include <northbridge/intel/sandybridge/raminit_native.h>
#include <northbridge/intel/sandybridge/sandybridge.h>
#include <southbridge/intel/bd82x6x/pch.h>
void pch_enable_lpc(void)
{
/* Enable KBC on 0x60/0x64 (KBC),
EC on 0x62/0x66 (MC) */
pci_write_config16(PCH_LPC_DEV, LPC_EN,
KBC_LPC_EN | MC_LPC_EN);
}
void mainboard_config_superio(void)
{
}
void mainboard_fill_pei_data(struct pei_data *const pei_data)
{
const struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
.mchbar = (uintptr_t)DEFAULT_MCHBAR,
.dmibar = (uintptr_t)DEFAULT_DMIBAR,
.epbar = DEFAULT_EPBAR,
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
.smbusbar = SMBUS_IO_BASE,
.wdbbar = 0x4000000,
.wdbsize = 0x1000,
.hpet_address = CONFIG_HPET_ADDRESS,
.rcba = (uintptr_t)DEFAULT_RCBABASE,
.pmbase = DEFAULT_PMBASE,
.gpiobase = DEFAULT_GPIOBASE,
.thermalbase = 0xfed08000,
.system_type = 0, // 0 Mobile, 1 Desktop/Server
.tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xA0, 0x00, 0xA4, 0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
.gbe_enable = 1,
.ddr3lv_support = 0,
// 0 = leave channel enabled
// 1 = disable dimm 0 on channel
// 2 = disable dimm 1 on channel
// 3 = disable dimm 0+1 on channel
.dimm_channel0_disabled = 2,
.dimm_channel1_disabled = 2,
.max_ddr3_freq = 1600,
.usb_port_config = {
/* Enabled / OC PIN / Length */
{ 1, 0, 0x0040 }, /* P00: 1st USB3 (OC #0) */
{ 1, 4, 0x0040 }, /* P01: 2nd USB3 (OC #4) */
{ 1, 1, 0x0080 }, /* P02: 1st Multibay USB3 (OC #1) */
{ 1, 2, 0x0080 }, /* P03: 2nd Multibay USB3 (OC #2) */
{ 1, 8, 0x0040 }, /* P04: MiniPCIe 1 USB2 (no OC) */
{ 1, 8, 0x0040 }, /* P05: MiniPCIe 2 USB2 (no OC) */
{ 1, 8, 0x0040 }, /* P06: MiniPCIe 3 USB2 (no OC) */
{ 1, 8, 0x0040 }, /* P07: GPS USB2 (no OC) */
{ 1, 8, 0x0040 }, /* P08: MiniPCIe 4 USB2 (no OC) */
{ 1, 3, 0x0040 }, /* P09: Express Card USB2 (OC #3) */
{ 1, 8, 0x0040 }, /* P10: SD card reader USB2 (no OC) */
{ 1, 8, 0x0040 }, /* P11: Sensors Hub? USB2 (no OC) */
{ 1, 8, 0x0040 }, /* P12: Touch Screen USB2 (no OC) */
{ 1, 5, 0x0040 }, /* P13: reserved? USB2 (OC #5) */
},
.usb3 = {
.mode = 3, /* Smart Auto? */
.hs_port_switch_mask = 0xf, /* All four ports. */
.preboot_support = 1, /* preOS driver? */
.xhci_streams = 1, /* Enable. */
},
.pcie_init = 1,
};
*pei_data = pei_data_template;
}
const struct southbridge_usb_port mainboard_usb_ports[] = {
/* Enabled / Power / OC PIN */
{ 1, 0, 0 }, /* P00: 1st USB3 (OC #0) */
{ 1, 0, 4 }, /* P01: 2nd USB3 (OC #4) */
{ 1, 1, 1 }, /* P02: 1st Multibay USB3 (OC #1) */
{ 1, 1, 2 }, /* P03: 2nd Multibay USB3 (OC #2) */
{ 1, 0, 8 }, /* P04: MiniPCIe 1 USB2 (no OC) */
{ 1, 0, 8 }, /* P05: MiniPCIe 2 USB2 (no OC) */
{ 1, 0, 8 }, /* P06: MiniPCIe 3 USB2 (no OC) */
{ 1, 0, 8 }, /* P07: GPS USB2 (no OC) */
{ 1, 0, 8 }, /* P08: MiniPCIe 4 USB2 (no OC) */
{ 1, 0, 3 }, /* P09: Express Card USB2 (OC #3) */
{ 1, 0, 8 }, /* P10: SD card reader USB2 (no OC) */
{ 1, 0, 8 }, /* P11: Sensors Hub? USB2 (no OC) */
{ 1, 0, 8 }, /* P12: Touch Screen USB2 (no OC) */
{ 1, 0, 5 }, /* P13: reserved? USB2 (OC #5) */
};
void mainboard_get_spd(spd_raw_data *spd, bool id_only)
{
read_spd(&spd[0], 0x50, id_only);
read_spd(&spd[2], 0x52, id_only);
}
|
/*
* HTML Entity & Encoding normalization.
*
* Copyright (C) 2007-2008 Sourcefire, Inc.
*
* Authors: Török Edvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <hashtab.h>
static struct element aliases_htable_elements[] = {
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{"UTF32BE", 3, 7},
{NULL,0,0},
{NULL,0,0},
{"UTF-16LE", 7, 8},
{NULL,0,0},
{NULL,0,0},
{"UCS-4BE", 3, 7},
{"UTF32LE", 2, 7},
{NULL,0,0},
{"ISO-10646/UTF8", 8, 14},
{NULL,0,0},
{"UTF-16BE", 6, 8},
{"UTF-32BE", 3, 8},
{NULL,0,0},
{NULL,0,0},
{"UCS2", 1, 4},
{"UTF16BE", 6, 7},
{NULL,0,0},
{"UTF32", 0, 5},
{"UCS-4", 0, 5},
{"UTF-16", 1, 6},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{"ISO-10646/UCS2", 1, 14},
{NULL,0,0},
{NULL,0,0},
{"UTF-8", 8, 5},
{"ISO-10646/UTF-8", 8, 15},
{"UCS4", 0, 4},
{"10646-1:1993/UCS4", 0, 17},
{NULL,0,0},
{NULL,0,0},
{"UTF16LE", 7, 7},
{"UCS-4LE", 2, 7},
{"ISO-10646", 0, 9},
{"UTF-32LE", 2, 8},
{"UTF8", 8, 4},
{"ISO-10646/UCS4", 0, 14},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{"10646-1:1993", 0, 12},
{"UTF-32", 0, 6},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
{NULL,0,0},
};
const struct hashtable aliases_htable = {
aliases_htable_elements, 64, 25, 51
};
|
/*
Copyright (c) 2006 Nikolaj Hald Nielsen <nhnFreespirit@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef MAGNATUNE_REDOWNLOAD_DIALOG_H
#define MAGNATUNE_REDOWNLOAD_DIALOG_H
#include "magnatuneredownloaddialogbase.h"
#include <qstringlist.h>
class MagnatuneRedownloadDialog : public magnatuneReDownloadDialogBase
{
Q_OBJECT
public:
MagnatuneRedownloadDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
~MagnatuneRedownloadDialog();
/*$PUBLIC_FUNCTIONS$*/
void setRedownloadItems(QStringList items);
signals:
void redownload(QString downloadInfoFileName);
void cancelled();
public slots:
/*$PUBLIC_SLOTS$*/
protected:
/*$PROTECTED_FUNCTIONS$*/
protected slots:
/*$PROTECTED_SLOTS$*/
void redownload();
void selectionChanged();
void reject();
};
#endif
|
#ifndef ZMUSECOUNT_H
#define ZMUSECOUNT_H
// ----------------------------------------------------------------------
//
// ZMuseCount.h - utility class for use in reference-counting
//
//
// History:
// 19-Sep-1997 WEB Design stolen, and code adapted, from pp 70-73 of
// Koenig & Moo: "Ruminations on C++" (1996)
//
// ----------------------------------------------------------------------
class ZMuseCount {
public:
// --------------------------
// Constructors & destructor:
// --------------------------
ZMuseCount();
// Constructor
ZMuseCount( const ZMuseCount & u );
// Copy constructor
~ZMuseCount();
// Destructor
// -----------------------------------
// Functions useful to a handle class:
// -----------------------------------
bool only();
// Is there exactly one copy of the referent?
bool makeonly();
// Enables the handle (to a ClassType) to refer to a unique (copy of)
// the referent via the following usage:
// if ( u.makeonly() ) /* ZMuseCount u; */
// p = new ClassType( *p ); /* ClassType * p; */
// This is useful in implementing copy-on-write semantics
// (i.e., non-shared or value semantics), and would appear just before
// updating (any part of) *p in such a context.
bool reattach( const ZMuseCount & u );
// Simplifies a handle's implementation of assignment via the following
// usage:
// if ( u.reattach(h.u) ) /* Handle<ClassType> h; */
// delete p; /* p and u as above */
// p = h.p;
private:
int * p;
// *p is the reference counter itself
ZMuseCount & operator=( const ZMuseCount & );
// Forbidden operation on a ZMuseCount object
}; // ZMuseCount
//#include "CLHEP/RefCount/ZMuseCount.icc"
#endif // ZMUSECOUNT_H
|
/*
Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
obtain a copy of the License at
http://www.imagemagick.org/script/license.php
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.
MagickCore magic methods.
*/
#ifndef _MAGICKCORE_MAGIC_H
#define _MAGICKCORE_MAGIC_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
typedef struct _MagicInfo
{
char
*path,
*name,
*target;
unsigned char
*magic;
size_t
length;
MagickOffsetType
offset;
MagickBooleanType
exempt,
stealth;
struct _MagicInfo
*previous,
*next; /* deprecated, use GetMagicInfoList() */
size_t
signature;
} MagicInfo;
extern MagickExport char
**GetMagicList(const char *,size_t *,ExceptionInfo *);
extern MagickExport const char
*GetMagicName(const MagicInfo *);
extern MagickExport MagickBooleanType
ListMagicInfo(FILE *,ExceptionInfo *),
MagicComponentGenesis(void);
extern MagickExport const MagicInfo
*GetMagicInfo(const unsigned char *,const size_t,ExceptionInfo *),
**GetMagicInfoList(const char *,size_t *,ExceptionInfo *);
extern MagickExport void
MagicComponentTerminus(void);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.