text
stringlengths 4
6.14k
|
|---|
/**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2022 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* 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 _U2_HMMER_BUILD_WORKER_H_
#define _U2_HMMER_BUILD_WORKER_H_
#include <U2Lang/LocalDomain.h>
#include <U2Lang/WorkflowUtils.h>
#include "HmmerBuildSettings.h"
namespace U2 {
namespace LocalWorkflow {
class HmmerBuildPrompter : public PrompterBase<HmmerBuildPrompter> {
Q_OBJECT
public:
HmmerBuildPrompter(Actor* p = 0);
protected:
QString composeRichDoc() override;
};
class HmmerBuildWorker : public BaseWorker {
Q_OBJECT
public:
HmmerBuildWorker(Actor* a);
void init() override;
bool isReady() const override;
Task* tick() override;
void cleanup() override;
private slots:
void sl_taskFinished(Task* task);
protected:
IntegralBus* input;
IntegralBus* output;
HmmerBuildSettings cfg;
};
class HmmerBuildWorkerFactory : public DomainFactory {
public:
static const QString ACTOR;
static void init();
static void cleanup();
HmmerBuildWorkerFactory();
Worker* createWorker(Actor* a) override;
};
} // namespace LocalWorkflow
} // namespace U2
#endif // _U2_HMMER_BUILD_WORKER_H_
|
/*
* include/linux/random.h
*
* Include file for the random number generator.
*/
#ifndef _LINUX_RANDOM_H
#define _LINUX_RANDOM_H
#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/irqnr.h>
/* ioctl()'s for the random number generator */
/* Get the entropy count. */
#define RNDGETENTCNT _IOR( 'R', 0x00, int )
/* Add to (or subtract from) the entropy count. (Superuser only.) */
#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
/* Get the contents of the entropy pool. (Superuser only.) */
#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
/*
* Write bytes into the entropy pool and add to the entropy count.
* (Superuser only.)
*/
#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
/* Clear entropy count to 0. (Superuser only.) */
#define RNDZAPENTCNT _IO( 'R', 0x04 )
/* Clear the entropy pool and associated counters. (Superuser only.) */
#define RNDCLEARPOOL _IO( 'R', 0x06 )
struct rand_pool_info {
int entropy_count;
int buf_size;
__u32 buf[0];
};
struct rnd_state {
__u32 s1, s2, s3;
};
/* Exported functions */
#ifdef __KERNEL__
extern void rand_initialize_irq(int irq);
extern void add_input_randomness(unsigned int type, unsigned int code,
unsigned int value);
extern void add_interrupt_randomness(int irq);
extern void get_random_bytes(void *buf, int nbytes);
void generate_random_uuid(unsigned char uuid_out[16]);
#ifndef MODULE
extern const struct file_operations random_fops, urandom_fops;
#endif
unsigned int get_random_int(void);
unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len);
u32 random32(void);
void srandom32(u32 seed);
u32 prandom32(struct rnd_state *);
/*
* Handle minimum values for seeds
*/
static inline u32 __seed(u32 x, u32 m)
{
return (x < m) ? x + m : x;
}
/**
* prandom32_seed - set seed for prandom32().
* @state: pointer to state structure to receive the seed.
* @seed: arbitrary 64-bit value to use as a seed.
*/
static inline void prandom32_seed(struct rnd_state *state, u64 seed)
{
u32 i = (seed >> 32) ^ (seed << 10) ^ seed;
state->s1 = __seed(i, 1);
state->s2 = __seed(i, 7);
state->s3 = __seed(i, 15);
}
#ifdef CONFIG_ARCH_RANDOM
# include <asm/archrandom.h>
#else
static inline int arch_get_random_long(unsigned long *v)
{
return 0;
}
static inline int arch_get_random_int(unsigned int *v)
{
return 0;
}
#endif
u32 prandom_u32(void);
/**
* prandom_u32_max - returns a pseudo-random number in interval [0, ep_ro)
* @ep_ro: right open interval endpoint
*
* Returns a pseudo-random number that is in interval [0, ep_ro). Note
* that the result depends on PRNG being well distributed in [0, ~0U]
* u32 space. Here we use maximally equidistributed combined Tausworthe
* generator, that is, prandom_u32(). This is useful when requesting a
* random index of an array containing ep_ro elements, for example.
*
* Returns: pseudo-random number in interval [0, ep_ro)
*/
static inline u32 prandom_u32_max(u32 ep_ro)
{
return (u32)(((u64) prandom_u32() * ep_ro) >> 32);
}
#endif /* __KERNEL___ */
#endif /* _LINUX_RANDOM_H */
|
/*
* nvec_leds: LED driver for a NVIDIA compliant embedded controller
*
* Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.launchpad.net>
*
* Authors: Ilya Petrov <ilya.muromec@gmail.com>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
*/
#include <linux/module.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/leds.h>
#include <linux/platform_device.h>
#include "nvec.h"
#define to_nvec_led(led_cdev) \
container_of(led_cdev, struct nvec_led, cdev)
#define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'}
#define NVEC_LED_MAX 8
struct nvec_led {
struct led_classdev cdev;
struct nvec_chip *nvec;
};
static void nvec_led_brightness_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
struct nvec_led *led = to_nvec_led(led_cdev);
unsigned char buf[] = NVEC_LED_REQ;
buf[4] = value;
nvec_write_async(led->nvec, buf, sizeof(buf));
led->cdev.brightness = value;
}
static int __devinit nvec_led_probe(struct platform_device *pdev)
{
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
struct nvec_led *led;
int ret = 0;
led = kzalloc(sizeof(*led), GFP_KERNEL);
if (led == NULL)
return -ENOMEM;
led->cdev.max_brightness = NVEC_LED_MAX;
led->cdev.brightness_set = nvec_led_brightness_set;
led->cdev.name = "nvec-led";
led->cdev.flags |= LED_CORE_SUSPENDRESUME;
led->nvec = nvec;
platform_set_drvdata(pdev, led);
ret = led_classdev_register(&pdev->dev, &led->cdev);
if (ret < 0)
goto err_led;
/* to expose the default value to userspace */
led->cdev.brightness = 0;
return 0;
err_led:
kfree(led);
return ret;
}
static int __devexit nvec_led_remove(struct platform_device *pdev)
{
struct nvec_led *led = platform_get_drvdata(pdev);
led_classdev_unregister(&led->cdev);
kfree(led);
return 0;
}
static struct platform_driver nvec_led_driver = {
.probe = nvec_led_probe,
.remove = __devexit_p(nvec_led_remove),
.driver = {
.name = "nvec-leds",
.owner = THIS_MODULE,
},
};
static int __init nvec_led_init(void)
{
return platform_driver_register(&nvec_led_driver);
}
module_init(nvec_led_init);
static void __exit nvec_led_exit(void)
{
platform_driver_unregister(&nvec_led_driver);
}
module_exit(nvec_led_exit);
MODULE_AUTHOR("Ilya Petrov <ilya.muromec@gmail.com>");
MODULE_DESCRIPTION("Tegra NVEC LED driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:nvec-leds");
|
/*
** renametbl.c for epiDatabase in /epiEngine
**
** Made by Julien Assémat
** Login assema_j
**
** Started on 01/01/2005 assema_j
** Last update 24/02/2005 moular_t
*/
#include "renametbl.h"
void renametbl(struct s_sql_query *query, struct s_sql_result *result)
{
p_lident lident;
char filename_src[S_TABLE+strlen(EXTENSION_TABLE)-1];
char filename_data_src[S_TABLE+strlen(EXTENSION_DATA)-1];
char filename_dest[S_TABLE+strlen(EXTENSION_TABLE)-1];
char filename_data_dest[S_TABLE+strlen(EXTENSION_DATA)-1];
printf("\t Rename table to %s\n",getFirstTblName(query));
lident=query->identlist;
if(lident)
while(lident->next)
{
*filename_src = 0;
*filename_data_src = 0;
strcpy(filename_src, PATH_DATA);
strcat(filename_src, lident->db_name);
strcat(filename_src, "\\");
strcat(filename_src, lident->tbl_name);
strcpy(filename_data_src, filename_src);
strcat(filename_src, EXTENSION_TABLE);
strcat(filename_data_src, EXTENSION_DATA);
lident=lident->next;
*filename_dest = 0;
*filename_data_dest = 0;
strcpy(filename_dest, PATH_DATA);
strcat(filename_dest, lident->db_name);
strcat(filename_dest, "\\");
strcat(filename_dest, lident->tbl_name);
strcpy(filename_data_dest, filename_dest);
strcat(filename_dest, EXTENSION_TABLE);
strcat(filename_data_dest, EXTENSION_DATA);
rename(filename_src,filename_dest);
rename(filename_data_src,filename_data_dest);
if(lident->next) lident=lident->next;
}
result->error_code = MSG_OK;
}
|
#include "boot_pack.h"
#include "wind_type.h"
w_err_t thread_shell(w_int32_t argc,char **argv);
int main(int argc,char **argv)
{
return pack_main(argc,argv);
}
|
/*
AlceOSD - Graphical OSD
Copyright (C) 2015 Luis Alves
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/>.
*/
#ifndef VIDEOCORE_H
#define VIDEOCORE_H
enum {
VIDEO_XSIZE_420 = 0,
VIDEO_XSIZE_480,
VIDEO_XSIZE_560,
VIDEO_XSIZE_672,
VIDEO_XSIZE_END,
};
enum {
VIDEO_STANDARD_PAL_P = 0,
VIDEO_STANDARD_PAL_I = 1,
VIDEO_STANDARD_NTSC_P = 2,
VIDEO_STANDARD_NTSC_I = 3,
VIDEO_STANDARD_END = 4,
};
#define VIDEO_STANDARD_MASK (0x02)
#define VIDEO_STANDARD_SCAN_MASK (0x01)
union sram_addr {
unsigned long l;
struct {
unsigned int w0:16;
unsigned int w1:16;
};
struct {
unsigned char b0:8;
unsigned char b1:8;
unsigned char b2:8;
unsigned char b3:8;
};
} __attribute__((aligned(2)));
struct osd_xsize_tbl {
unsigned int xsize;
unsigned int clk_ps;
};
struct canvas {
unsigned int x, y;
unsigned int width, height;
unsigned int rwidth;
unsigned int size;
__eds__ unsigned char *buf;
unsigned char lock;
};
struct video_config {
/* video standard and scan */
unsigned char standard;
/* video X resolution id */
unsigned char x_size_id;
/* video Y resolution */
unsigned int y_size;
/* video X resolution */
unsigned int x_offset;
/* video Y resolution */
unsigned int y_offset;
/* video brightness */
unsigned int brightness;
};
void init_video(void);
/* canvas related functions */
int alloc_canvas(struct canvas *ca, void *widget_cfg);
int init_canvas(struct canvas *ca, unsigned char b);
void schedule_canvas(struct canvas *ca);
void render_canvas(struct canvas *ca);
void free_mem(void);
/* clear up display */
void clear_video(void);
void clear_sram(void);
void video_apply_config(struct video_config *cfg);
void video_get_size(unsigned int *xsize, unsigned int *ysize);
void video_pause(void);
void video_resume(void);
#endif
|
#import <UIKit/UIKit.h>
#import "ThingerController.h"
@interface MethodListController : UIViewController <UITableViewDataSource> {
NSArray *instanceMethods, *classMethods, *ivars, *protocols;
NSString *cls;
id theCls;
IBOutlet UITableView *tableView;
}
@property (nonatomic, retain) NSArray *instanceMethods, *classMethods, *ivars, *protocols;
@property (nonatomic, retain) NSString *cls;
@property (nonatomic, retain) UITableView *tableView;
@end
|
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "fuzix_fs.h"
int dev_fd;
int dev_offset;
extern int swizzling;
int fd_open(char *name)
{
char *namecopy, *sd;
int bias = 0;
namecopy = strdup(name);
sd = index(namecopy, ':');
if (sd) {
*sd = 0;
sd++;
bias = atoi(sd);
}
printf("Opening %s (offset %d)\n", namecopy, bias);
dev_offset = bias;
dev_fd = open(namecopy, O_RDWR | O_CREAT, 0666);
free(namecopy);
if (dev_fd < 0)
return -1;
printf("fd=%d, dev_offset = %d\n", dev_fd, dev_offset);
return 0;
}
void panic(char *s)
{
fprintf(stderr, "panic: %s\n", s);
exit(1);
}
uint16_t swizzle16(uint32_t v)
{
int top = v & 0xFFFF0000UL;
if (top && top != 0xFFFF0000) {
fprintf(stderr, "swizzle16 given a 32bit input\n");
exit(1);
}
if (swizzling)
return (v & 0xFF) << 8 | ((v & 0xFF00) >> 8);
else
return v;
}
uint32_t swizzle32(uint32_t v)
{
if (!swizzling)
return v;
return (v & 0xFF) << 24 | (v & 0xFF00) << 8 | (v & 0xFF0000) >> 8 |
(v & 0xFF000000) >> 24;
}
|
#ifndef __SIM_RAND__
#define __SIM_RAND__
double gen_rand(void);
/* UNIF makes a uniform distribution in the range (c1,c2)*/
#define UNIF(c1, c2) (c1 + gen_rand() * (c2 - c1))
#define IRAND() (int)(gen_rand() * 1000)
#endif /* __SIM_RAND */
|
/* lxstat using old-style Unix lstat system call.
Copyright (C) 1991-2015 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/>. */
/* Ho hum, if xstat == xstat64 we must get rid of the prototype or gcc
will complain since they don't strictly match. */
#define __lxstat64 __lxstat64_disable
#include <errno.h>
#include <stddef.h>
#include <sys/stat.h>
#include <kernel_stat.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <xstatconv.h>
/* Get information about the file NAME in BUF. */
int
__lxstat (int vers, const char *name, struct stat *buf)
{
int result;
if (vers == _STAT_VER_KERNEL)
return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf);
{
struct stat64 buf64;
INTERNAL_SYSCALL_DECL (err);
result = INTERNAL_SYSCALL (lstat64, err, 2, name, &buf64);
if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result,
err));
else
return __xstat32_conv (vers, &buf64, buf);
}
}
hidden_def (__lxstat)
weak_alias (__lxstat, _lxstat);
#ifdef XSTAT_IS_XSTAT64
#undef __lxstat64
strong_alias (__lxstat, __lxstat64);
hidden_ver (__lxstat, __lxstat64)
#endif
|
/*
* (c) Copyright 1992 by Panagiotis Tsirigotis
* (c) Sections Copyright 1998-2001 by Rob Braun
* All rights reserved. The file named COPYRIGHT specifies the terms
* and conditions for redistribution.
*/
#ifndef ATTR_H
#define ATTR_H
/*
* $Id: attr.h,v 1.3 2005/10/05 17:15:33 bbraun Exp $
*/
/*
* Attribute IDs
*/
#define A_NONE 0
#define A_WAIT 1
#define A_SOCKET_TYPE 2
#define A_PROTOCOL 3
#define A_USER 4
#define A_GROUP 5
#define A_SERVER 6
#define A_SERVER_ARGS 7
#define A_INSTANCES 8
#define A_ID 9
#define A_ONLY_FROM 10
#define A_ACCESS_TIMES 11
#define A_RPC_VERSION 12
#define A_LOG_TYPE 13
#define A_NO_ACCESS 14
#define A_TYPE 15
#define A_LOG_ON_FAILURE 16
#define A_LOG_ON_SUCCESS 17
#define A_ENV 18
#define A_PORT 19
#define A_PASSENV 20
#define A_FLAGS 21
#define A_RPC_NUMBER 22
#define A_NICE 23
#define A_REDIR 24
#define A_BIND 25
#define A_BANNER 26
#define A_PER_SOURCE 27
#define A_GROUPS 28
#define A_BANNER_SUCCESS 29
#define A_BANNER_FAIL 30
#define A_MAX_LOAD 31
#define A_CPS 32
#define A_SVCDISABLE 33
#define A_RLIMIT_AS 34
#define A_RLIMIT_CPU 35
#define A_RLIMIT_DATA 36
#define A_RLIMIT_RSS 37
#define A_RLIMIT_STACK 38
#define A_V6ONLY 39
#define A_DENY_TIME 40
#define A_UMASK 41
#define A_ENABLED 42
#define A_DISABLED 43
#define A_MDNS 44
#define A_LIBWRAP 45
/*
* SERVICE_ATTRIBUTES is the number of service attributes and also
* the number from which defaults-only attributes start.
*/
#define SERVICE_ATTRIBUTES ( A_MDNS + 1 )
/*
* Mask of attributes that must be specified.
*/
#define NECESSARY_ATTRS ( XMASK( A_SOCKET_TYPE ) + XMASK( A_WAIT ) )
#define NECESSARY_ATTRS_EXTERNAL ( XMASK( A_SERVER ) + XMASK( A_USER ) )
#define NECESSARY_ATTRS_UNLISTED ( XMASK( A_PROTOCOL ) + XMASK( A_PORT ) )
#define NECESSARY_ATTRS_UNLISTED_MUX ( XMASK( A_PROTOCOL ) )
#define NECESSARY_ATTRS_RPC ( XMASK( A_PROTOCOL ) + \
XMASK( A_RPC_VERSION ) )
#define NECESSARY_ATTRS_RPC_UNLISTED XMASK( A_RPC_NUMBER )
#endif /* ATTR_H */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/*
* This file is based on WME Lite.
* http://dead-code.org/redir.php?target=wmelite
* Copyright (c) 2011 Jan Nedoma
*/
#ifndef WINTERMUTE_WINTYPES_H
#define WINTERMUTE_WINTYPES_H
#include "common/scummsys.h"
namespace Wintermute {
#define BYTETORGBA(r,g,b,a) ((uint32)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
#define RGBCOLGetB(rgb) ((byte )(rgb))
#define RGBCOLGetG(rgb) ((byte )(((uint16)(rgb)) >> 8))
#define RGBCOLGetR(rgb) ((byte )((rgb)>>16))
#define RGBCOLGetA(rgb) ((byte )((rgb)>>24))
#define DID_SUCCEED(hr) ((bool)(hr))
#define DID_FAIL(hr) (!((bool)(hr)))
#define STATUS_OK (true)
#define STATUS_FAILED (false)
#define MAX_PATH_LENGTH 512
} // End of namespace Wintermute
#endif
|
#include <stdlib.h>
#include <stdio.h>
void selection_sort(int *a, int n);
int min(int *a, int from, int to);
int main() {
int a[100];
a[0] = 15;
a[1] = 2;
a[2] = 8;
a[3] = 7;
a[4] = 3;
a[5] = 6;
a[6] = 9;
a[7] = 17;
int n = 8;
selection_sort(a, n);
for (int i = 0; i < n; i++) {
printf("%d ", a[i]);
}
printf("\n");
return 0;
}
void selection_sort(int *a, int n) {
for(int i = 0; i < n - 1; i++) {
int min_index = min(a, i + 1, n - 1);
if (a[i] > a[min_index]) {
int temp = a[i];
a[i] = a[min_index];
a[min_index] = temp;
}
}
}
int min(int *a, int from, int to) {
int min_index = from;
int min = a[min_index];
for (int i = from + 1; i <= to; i++) {
if (a[i] < min) {
min_index = i;
min = a[min_index];
}
}
return min_index ;
}
|
#ifndef __PROTOCOL_H_
#define __PROTOCOL_H_
#define ZERO 0
//判断两个尺寸大小相同的二维数组内容是否完全相等,是则返回1,否则返回0
int is_equal_map(int ** map1,int **map2,int length);
//将二维数组的内容复制到新的二维数组中,并返回新数组的指针
int ** copy_map(int ** new_map,int ** map,int length);
//申请一个长度为length的二维数组
int ** malloc_map(int length);
//将0,1,2,3,4,5,6转换为2,4,8...并返回转换值
int convert_num(int val);
//交换a,b内容
void exc(int * a,int * b);
#endif
|
//
// BTSPulseViewController.h
// CoreAnimationFunHouse
//
// Created by Brian Coyner on 9/30/11.
// Copyright (c) 2011 Brian Coyner. All rights reserved.
//
#import <UIKit/UIKit.h>
@import UIKit;
@import Foundation;
@interface BTSPulseViewController : UIViewController
@end
|
/*
** ZABBIX
** Copyright (C) 2000-2005 SIA Zabbix
**
** 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.
**/
#include "common.h"
#include "sysinfo.h"
int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
{
assert(result);
init_result(result);
return SYSINFO_RET_FAIL;
}
int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
{
assert(result);
init_result(result);
return SYSINFO_RET_FAIL;
}
int NET_IF_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
{
assert(result);
init_result(result);
return SYSINFO_RET_FAIL;
}
int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
{
assert(result);
init_result(result);
return SYSINFO_RET_FAIL;
}
int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
{
assert(result);
init_result(result);
return SYSINFO_RET_FAIL;
}
|
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/init.h>
#include <plat/cpu.h>
#include <plat/devs.h>
#include <plat/s3c6400.h>
#include <plat/s3c6410.h>
void __init s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
s3c24xx_init_uartdevs("s3c6400-uart", s3c64xx_uart_resources, cfg, no);
}
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* This file is part of guh. *
* *
* Guh 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. *
* *
* Guh 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 guh. If not, see <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef WEMODISCOVERY_H
#define WEMODISCOVERY_H
#include <QUdpSocket>
#include <QHostAddress>
#include <QTimer>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QUrl>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QXmlStreamAttributes>
#include "wemoswitch.h"
class WemoDiscovery : public QUdpSocket
{
Q_OBJECT
public:
explicit WemoDiscovery(QObject *parent = 0);
private:
QHostAddress m_host;
qint16 m_port;
QTimer *m_timeout;
QNetworkAccessManager *m_manager;
QByteArray m_deviceInformationData;
bool checkXmlData(QByteArray data);
QString printXmlData(QByteArray data);
QList<WemoSwitch*> m_deviceList;
signals:
void discoveryDone(QList<WemoSwitch*> deviceList);
private slots:
void error(QAbstractSocket::SocketError error);
void sendDiscoverMessage();
void readData();
void discoverTimeout();
void requestDeviceInformation(QUrl location);
void replyFinished(QNetworkReply *reply);
void parseDeviceInformation(QByteArray data);
public slots:
void discover(int timeout);
};
#endif // WEMODISCOVERY_H
|
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2015, ITU/ISO/IEC
* 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 ITU/ISO/IEC 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 TComWeightPrediction.h
\brief weighting prediction class (header)
*/
#ifndef __TCOMWEIGHTPREDICTION__
#define __TCOMWEIGHTPREDICTION__
#include "CommonDef.h"
// forward declarations
class TComDataCU;
class TComYuv;
struct WPScalingParam;
// ====================================================================================================================
// Class definition
// ====================================================================================================================
/// weighting prediction class
class TComWeightPrediction
{
public:
TComWeightPrediction();
Void getWpScaling( TComDataCU *const pcCU,
const Int iRefIdx0,
const Int iRefIdx1,
WPScalingParam *&wp0,
WPScalingParam *&wp1);
Void addWeightBi( const TComYuv *pcYuvSrc0,
const TComYuv *pcYuvSrc1,
const BitDepths &bitDepths,
const UInt iPartUnitIdx,
const UInt uiWidth,
const UInt uiHeight,
const WPScalingParam *const wp0,
const WPScalingParam *const wp1,
TComYuv *const rpcYuvDst,
const Bool bRoundLuma=true );
Void addWeightUni( const TComYuv *const pcYuvSrc0,
const BitDepths &bitDepths,
const UInt iPartUnitIdx,
const UInt uiWidth,
const UInt uiHeight,
const WPScalingParam *const wp0,
TComYuv *const rpcYuvDst );
Void xWeightedPredictionUni( TComDataCU *const pcCU,
const TComYuv *const pcYuvSrc,
const UInt uiPartAddr,
const Int iWidth,
const Int iHeight,
const RefPicList eRefPicList,
TComYuv *pcYuvPred,
const Int iRefIdx=-1 );
Void xWeightedPredictionBi( TComDataCU *const pcCU,
const TComYuv *const pcYuvSrc0,
const TComYuv *const pcYuvSrc1,
const Int iRefIdx0,
const Int iRefIdx1,
const UInt uiPartIdx,
const Int iWidth,
const Int iHeight,
TComYuv *pcYuvDst );
};
#endif
|
//
// UIImage+ColorFinder.h
// ColorFinder
//
// Created by Mert Buran on 13/04/15.
// Copyright (c) 2015 Mert Buran. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (ColorFinder)
- (void)getDominantColorInRect:(CGRect)rect WithCompletionHandler:(void (^)(UIColor* dominantColor))completion;
@end
|
// Copyright (C) 2008-2010 Lothar Braun <lothar@lobraun.de>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "size_dumper.h"
#include <module_list.h>
#include <tools/pcap-tools.h>
#include <tools/msg.h>
#include <stdlib.h>
#include <string.h>
#define MAX_FILENAME 65535
struct dumping_module* size_dumper_new()
{
struct dumping_module* ret = (struct dumping_module*)malloc(sizeof(struct dumping_module));
ret->dinit = size_dumper_init;
ret->dfunc = size_dumper_run;
ret->dfinish = size_dumper_finish;
return ret;
}
struct size_dumper_data {
char base_filename[MAX_FILENAME];
char dump_filename[MAX_FILENAME];
size_t number;
size_t file_data_count;
size_t max_file_data_count;
struct dumper_tool* dumper;
};
int createNewFile(struct size_dumper_data* data, int linktype)
{
snprintf(data->dump_filename, MAX_FILENAME, "%s.%lu",
data->base_filename, (unsigned long)data->number);
data->dumper = dumper_tool_open_file(data->dump_filename, linktype);
if (!data->dumper) {
return -1;
}
data->number++;
data->file_data_count = 0;
return 0;
}
int size_dumper_init(struct dumping_module* m, struct config* c)
{
struct size_dumper_data* sdata = (struct size_dumper_data*)malloc(
sizeof(struct size_dumper_data));
const char* tmp = config_get_option(c, SIZE_DUMPER_NAME, "file_prefix");
if (tmp == NULL) {
msg(MSG_ERROR, "%s: no filename in config file", SIZE_DUMPER_NAME);
return -1;
}
strncpy(sdata->base_filename, tmp, MAX_FILENAME);
sdata->number = 0;
sdata->file_data_count = 0;
tmp = config_get_option(c, SIZE_DUMPER_NAME, "size");
if (tmp == NULL) {
msg(MSG_ERROR, "%s: no file size in config file", "size");
return -1;
}
sdata->max_file_data_count = atoi(tmp);
if (-1 == createNewFile(sdata, m->linktype))
goto out;
m->module_data = (void*)sdata;
return 0;
out:
free(sdata);
return -1;
}
int size_dumper_finish(struct dumping_module* m)
{
struct size_dumper_data* d = (struct size_dumper_data*)m->module_data;
dumper_tool_close_file(&d->dumper);
free(d);
m->module_data = NULL;
return 0;
}
int size_dumper_run(struct dumping_module* m, struct packet* p)
{
struct size_dumper_data* d = (struct size_dumper_data*)m->module_data;
dumper_tool_dump(d->dumper, &p->header, p->data);
d->file_data_count += p->header.len;
if (d->file_data_count >= d->max_file_data_count) {
dumper_tool_close_file(&d->dumper);
if (-1 == createNewFile(d, m->linktype)) {
return -1;
}
}
return 0;
}
|
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
//#define USE_ERROR
//#define USE_TRACE
#if USE_PLATFORM_MIDI_IN == TRUE
#include "PLATFORM_API_MacOSX_MidiUtils.h"
char* MIDI_IN_GetErrorStr(INT32 err) {
return (char *) MIDI_Utils_GetErrorMsg((int) err);
}
INT32 MIDI_IN_GetNumDevices() {
return MIDI_Utils_GetNumDevices(MIDI_IN);
}
INT32 MIDI_IN_GetDeviceName(INT32 deviceID, char *name, UINT32 nameLength) {
return MIDI_Utils_GetDeviceName(MIDI_IN, deviceID, name, nameLength);
}
INT32 MIDI_IN_GetDeviceVendor(INT32 deviceID, char *name, UINT32 nameLength) {
return MIDI_Utils_GetDeviceVendor(MIDI_IN, deviceID, name, nameLength);
}
INT32 MIDI_IN_GetDeviceDescription(INT32 deviceID, char *name, UINT32 nameLength) {
return MIDI_Utils_GetDeviceDescription(MIDI_IN, deviceID, name, nameLength);
}
INT32 MIDI_IN_GetDeviceVersion(INT32 deviceID, char *name, UINT32 nameLength) {
return MIDI_Utils_GetDeviceVersion(MIDI_IN, deviceID, name, nameLength);
}
INT32 MIDI_IN_OpenDevice(INT32 deviceID, MidiDeviceHandle** handle) {
TRACE0("MIDI_IN_OpenDevice\n");
return
MIDI_Utils_OpenDevice(MIDI_IN, deviceID, (MacMidiDeviceHandle**) handle,
MIDI_IN_MESSAGE_QUEUE_SIZE,
MIDI_IN_LONG_QUEUE_SIZE,
MIDI_IN_LONG_MESSAGE_SIZE);
}
INT32 MIDI_IN_CloseDevice(MidiDeviceHandle* handle) {
TRACE0("MIDI_IN_CloseDevice\n");
return MIDI_Utils_CloseDevice((MacMidiDeviceHandle*) handle);
}
INT32 MIDI_IN_StartDevice(MidiDeviceHandle* handle) {
TRACE0("MIDI_IN_StartDevice\n");
return MIDI_Utils_StartDevice((MacMidiDeviceHandle*) handle);
}
INT32 MIDI_IN_StopDevice(MidiDeviceHandle* handle) {
TRACE0("MIDI_IN_StopDevice\n");
return MIDI_Utils_StopDevice((MacMidiDeviceHandle*) handle);
}
INT64 MIDI_IN_GetTimeStamp(MidiDeviceHandle* handle) {
return MIDI_Utils_GetTimeStamp((MacMidiDeviceHandle*) handle);
}
/* read the next message from the queue */
MidiMessage* MIDI_IN_GetMessage(MidiDeviceHandle* handle) {
if (handle == NULL) {
return NULL;
}
while (handle->queue != NULL && handle->platformData != NULL) {
MidiMessage* msg = MIDI_QueueRead(handle->queue);
if (msg != NULL) {
//fprintf(stdout, "GetMessage returns index %d\n", msg->data.l.index); fflush(stdout);
return msg;
}
TRACE0("MIDI_IN_GetMessage: before waiting\n");
handle->isWaiting = TRUE;
MIDI_WaitOnConditionVariable(handle->platformData, handle->queue->lock);
handle->isWaiting = FALSE;
TRACE0("MIDI_IN_GetMessage: waiting finished\n");
}
return NULL;
}
void MIDI_IN_ReleaseMessage(MidiDeviceHandle* handle, MidiMessage* msg) {
if (handle == NULL || handle->queue == NULL) {
return;
}
MIDI_QueueRemove(handle->queue, TRUE /*onlyLocked*/);
}
#endif /* USE_PLATFORM_MIDI_IN */
|
/*
* Copyright(c) 2012, Analogix Semiconductor. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __SP_TX_DRV_H
#define __SP_TX_DRV_H
#define FALSE 0
#define TRUE 1
#define MAX_BUF_CNT 16
#define VID_DVI_MODE 0x00
#define VID_HDMI_MODE 0x01
#define VIDEO_STABLE_TH 2
#define AUDIO_STABLE_TH 1
#define SCDT_EXPIRE_TH 10
#define SP_TX_HDCP_FAIL_TH 10
#define SP_TX_DS_VID_STB_TH 20
#define GET_HDMI_CONNECTION_MAX_TRIES 6
/* */
extern unchar bedid_extblock[128];
extern unchar bedid_firstblock[128];
extern unchar slimport_link_bw;
#ifdef SP_REGISTER_SET_TEST
extern unchar val_SP_TX_LT_CTRL_REG[20];
extern bool val_SP_TX_LT_CTRL_REG_write_flag[20];
#endif
enum SP_TX_System_State {
STATE_INIT = 1,
STATE_CABLE_PLUG,
STATE_PARSE_EDID,
STATE_CONFIG_HDMI,
STATE_LINK_TRAINING,
STATE_CONFIG_OUTPUT,
STATE_HDCP_AUTH,
STATE_PLAY_BACK
};
enum HDMI_RX_System_State {
HDMI_CLOCK_DET = 1,
HDMI_SYNC_DET,
HDMI_VIDEO_CONFIG,
HDMI_AUDIO_CONFIG,
HDMI_PLAYBACK
};
enum HDMI_color_depth {
Hdmi_legacy,
Hdmi_24bit,
Hdmi_30bit,
Hdmi_36bit
};
enum SP_TX_POWER_BLOCK {
SP_TX_PWR_REG,
SP_TX_PWR_HDCP,
SP_TX_PWR_AUDIO,
SP_TX_PWR_VIDEO,
SP_TX_PWR_LINK,
SP_TX_PWR_TOTAL
};
enum SP_TX_SEND_MSG {
MSG_INPUT_HDMI,
MSG_INPUT_DVI,
MSG_CLEAR_IRQ,
};
enum PACKETS_TYPE {
AVI_PACKETS,
SPD_PACKETS,
MPEG_PACKETS,
VSI_PACKETS,
AUDIF_PACKETS
};
struct Packet_AVI {
unchar AVI_data[13];
};
struct Packet_SPD {
unchar SPD_data[25];
};
struct Packet_MPEG {
unchar MPEG_data[13];
};
struct AudiInfoframe {
unchar type;
unchar version;
unchar length;
unchar pb_byte[11];
};
enum INTStatus {
COMMON_INT_1 = 0,
COMMON_INT_2 = 1,
COMMON_INT_3 = 2,
COMMON_INT_4 = 3,
SP_INT_STATUS = 6
};
enum SP_LINK_BW {
BW_54G = 0x14,
BW_27G = 0x0A,
BW_162G = 0x06,
BW_NULL = 0x00
};
enum RX_CBL_TYPE {
RX_NULL = 0x00,
RX_HDMI = 0x01,
RX_DP = 0x02,
RX_VGA_GEN = 0x03,
RX_VGA_9832 = 0x04,
};
void sp_tx_variable_init(void);
void sp_tx_initialization(void);
void sp_tx_show_infomation(void);
void hdmi_rx_show_video_info(void);
void sp_tx_power_down(enum SP_TX_POWER_BLOCK sp_tx_pd_block);
void sp_tx_power_on(enum SP_TX_POWER_BLOCK sp_tx_pd_block);
void sp_tx_avi_setup(void);
void sp_tx_clean_hdcp(void);
unchar sp_tx_chip_located(void);
void sp_tx_vbus_poweron(void);
void sp_tx_vbus_powerdown(void);
void sp_tx_rst_aux(void);
void sp_tx_config_packets(enum PACKETS_TYPE bType);
unchar sp_tx_hw_link_training(void);
unchar sp_tx_lt_pre_config(void);
void sp_tx_video_mute(unchar enable);
void sp_tx_aux_polling_enable(bool benable);
void sp_tx_set_colorspace(void);
void sp_tx_int_irq_handler(void);
void sp_tx_send_message(enum SP_TX_SEND_MSG message);
void sp_tx_hdcp_process(void);
void sp_tx_set_sys_state(enum SP_TX_System_State ss);
unchar sp_tx_get_cable_type(bool bdelay);
bool sp_tx_get_dp_connection(void);
bool sp_tx_get_hdmi_connection(void);
bool sp_tx_get_vga_connection(void);
unchar sp_tx_get_downstream_type(void);
unchar sp_tx_get_downstream_connection(enum RX_CBL_TYPE cabletype);
void sp_tx_edid_read(void);
uint sp_tx_link_err_check(void);
void sp_tx_eye_diagram_test(void);
void sp_tx_phy_auto_test(void);
void sp_tx_enable_video_input(unchar enable);
unchar sp_tx_aux_dpcdwrite_bytes(unchar addrh, unchar addrm,
unchar addrl, unchar cCount, unchar *pBuf);
unchar sp_tx_aux_dpcdread_bytes(unchar addrh, unchar addrm,
unchar addrl, unchar cCount, unchar *pBuf);
/* */
/* */
/* */
void sp_tx_config_hdmi_input(void);
void hdmi_rx_set_hpd(unchar enable);
void hdmi_rx_initialization(void);
void hdmi_rx_int_irq_handler(void);
void hdmi_rx_set_termination(unchar enable);
#endif
|
#undef CONFIG_INPUT_UINPUT
|
/*
* TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid
* Copyright (C) 2007 C2ME S.A. <tuxdroid@c2me.be>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Id: audio_fifo.c 2994 2008-12-03 13:20:41Z ks156 $ */
#include <inttypes.h>
#include "audio_fifo.h"
uint8_t AudioInIdx = 0;
uint8_t AudioOutIdx = 0;
uint8_t AudioFifoSize = 128;
uint8_t AudioBuffer[128];
/* Empty the buffer by clearing the indexes. */
void AudioFifoClear(void)
{
AudioInIdx = 0;
AudioOutIdx = 0;
}
/* Add one data byte to the fifo buffer.
* param data : Data byte to add to the queue.
* return : Return A_FIFO_OK if the data has been added, A_FIFO_FULL if the buffer
* was full and the data couldn't be added.
*/
int8_t AudioFifoPut(uint8_t const data)
{
if (AudioFifoLength() == AudioFifoSize)
return A_FIFO_FULL;
AudioBuffer[AudioInIdx++ & (AudioFifoSize-1)] = data;
return A_FIFO_OK;
}
/* Pop the oldest byte from the buffer.
* param data : pointer for storing the data read from the queue
* return : A_FIFO_OK if a value has been popped out at the pointer address. If
* the fifo is empty, A_FIFO_EMPTY is returned and the pointed data is left
* unchanged.
*/
int8_t AudioFifoGet(uint8_t *data)
{
if (AudioOutIdx == AudioInIdx)
return A_FIFO_EMPTY;
*data = AudioBuffer[AudioOutIdx++ & (AudioFifoSize - 1)];
return A_FIFO_OK;
}
|
#ifndef VM_EVENT_ITEM_H_INCLUDED
#define VM_EVENT_ITEM_H_INCLUDED
#ifdef CONFIG_ZONE_DMA
#define DMA_ZONE(xx) xx##_DMA,
#else
#define DMA_ZONE(xx)
#endif
#ifdef CONFIG_ZONE_DMA32
#define DMA32_ZONE(xx) xx##_DMA32,
#else
#define DMA32_ZONE(xx)
#endif
#ifdef CONFIG_HIGHMEM
#define HIGHMEM_ZONE(xx) , xx##_HIGH
#else
#define HIGHMEM_ZONE(xx)
#endif
#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE
enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
FOR_ALL_ZONES(PGALLOC),
PGFREE, PGACTIVATE, PGDEACTIVATE,
PGFAULT, PGMAJFAULT,
FOR_ALL_ZONES(PGREFILL),
FOR_ALL_ZONES(PGSTEAL_KSWAPD),
FOR_ALL_ZONES(PGSTEAL_DIRECT),
FOR_ALL_ZONES(PGSCAN_KSWAPD),
FOR_ALL_ZONES(PGSCAN_DIRECT),
PGSCAN_DIRECT_THROTTLE,
#ifdef CONFIG_NUMA
PGSCAN_ZONE_RECLAIM_FAILED,
#endif
PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
PAGEOUTRUN, ALLOCSTALL, SLOWPATH_ENTERED, PGROTATED,
#ifdef CONFIG_NUMA_BALANCING
NUMA_PTE_UPDATES,
NUMA_HINT_FAULTS,
NUMA_HINT_FAULTS_LOCAL,
NUMA_PAGE_MIGRATE,
#endif
#ifdef CONFIG_MIGRATION
PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,
#endif
#ifdef CONFIG_COMPACTION
COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED,
COMPACTISOLATED,
COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
#endif
#ifdef CONFIG_HUGETLB_PAGE
HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
#endif
UNEVICTABLE_PGCULLED, /* culled to noreclaim list */
UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */
UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */
UNEVICTABLE_PGMLOCKED,
UNEVICTABLE_PGMUNLOCKED,
UNEVICTABLE_PGCLEARED, /* on COW, page truncate */
UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
THP_FAULT_ALLOC,
THP_FAULT_FALLBACK,
THP_COLLAPSE_ALLOC,
THP_COLLAPSE_ALLOC_FAILED,
THP_SPLIT,
THP_ZERO_PAGE_ALLOC,
THP_ZERO_PAGE_ALLOC_FAILED,
#endif
NR_VM_EVENT_ITEMS
};
#endif /* VM_EVENT_ITEM_H_INCLUDED */
|
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Christian Stocker <chregu@php.net> |
| Rob Richards <rrichards@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#include "php_dom.h"
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationlist_item, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO();
/* }}} */
/*
* class domimplementationlist
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList
* Since: DOM Level 3
*/
const zend_function_entry php_dom_domimplementationlist_class_functions[] = {
PHP_FALIAS(item, dom_domimplementationlist_item, arginfo_dom_implementationlist_item)
{NULL, NULL, NULL}
};
/* {{{ attribute protos, not implemented yet */
/* {{{ length unsigned long
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-length
Since:
*/
int dom_domimplementationlist_length_read(dom_object *obj, zval **retval TSRMLS_DC)
{
ALLOC_ZVAL(*retval);
ZVAL_STRING(*retval, "TEST", 1);
return SUCCESS;
}
/* }}} */
/* {{{ proto domdomimplementation dom_domimplementationlist_item(int index);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-item
Since:
*/
PHP_FUNCTION(dom_domimplementationlist_item)
{
DOM_NOT_IMPLEMENTED();
}
/* }}} end dom_domimplementationlist_item */
/* }}} */
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
|
#ifndef PERSON_H
#define PERSON_H
#include <QString>
#include <QDate>
#include <iostream>
/**
* @brief The Person class
*
* This class is abstract (you can't make objects of this type), and is used to represent general Person characteristics.
*
* Public methods:
* QString getName() const;
* bool getGender() const;
* QString getGenderAsString() const;
* unsigned int getAge() const;
*/
class Person {
public:
Person(): firstName(QString()), lastName(QString()), gender(false), born_date(QDate::currentDate()) {}
Person(const QString& firstName, const QString& lastName): firstName(firstName), lastName(lastName), gender(false), born_date(QDate::currentDate()) {}
Person(const QString& firstName, const QString& lastName, bool gender, const QDate& born_date):
firstName(firstName), lastName(lastName), gender(gender), born_date(born_date) {}
virtual ~Person() {}
virtual void setFirstName(const QString&);
virtual void setLastName(const QString&);
virtual void setGender(bool);
virtual QString getFullName() const;
virtual QString getFirstName() const;
virtual QString getLastName() const;
virtual bool getGender() const;
virtual QString getGenderAsString() const;
virtual unsigned int getAge() const;
virtual QString getContact() const = 0;
private:
QString firstName;
QString lastName;
bool gender;
QDate born_date;
};
#endif // PERSON_H
|
/*************************************************************************
bq Cervantes e-book reader application
Copyright (C) 2011-2013 Mundoreader, S.L
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 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 the source code. If not, see <http://www.gnu.org/licenses/>.
*************************************************************************/
#ifndef VIEWERSEARCHCONTEXTMENU_H
#define VIEWERSEARCHCONTEXTMENU_H
#include "ui_ViewerSearchContextMenu.h"
#include "PopUp.h"
class ViewerSearchContextMenu : public PopUp
,protected Ui::ViewerSearchContextMenu
{
Q_OBJECT
public:
ViewerSearchContextMenu(QWidget*);
virtual ~ViewerSearchContextMenu();
public slots:
void setCurrentResultIndex(int);
void setTotalResults(int);
signals:
void close();
void previousResult();
void nextResult();
void backToList();
protected:
void mousePressEvent(QMouseEvent *);
};
#endif // VIEWERSEARCHCONTEXTMENU_H
|
/************************************************************************
$Id: gamecontroller.h,v 1.2 2005/02/24 10:27:53 jonico Exp $
RTB - Team Framework: Framework for RealTime Battle robots to communicate efficiently in a team
Copyright (C) 2004 The RTB- Team Framework Group: http://rtb-team.sourceforge.net
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
$Log: gamecontroller.h,v $
Revision 1.2 2005/02/24 10:27:53 jonico
Updated newest version of the framework
Revision 1.2 2005/01/06 17:59:32 jonico
Now all files in the repository have their new header format.
**************************************************************************/
#ifndef GAMECONTROLLER_H
#define GAMECONTROLLER_H
#include <exception>
/**
* Namespace GameControl
*/
namespace GameControl {
using std::bad_exception;
/**
* Class GameController
*/
class GameController {
/*
* Public stuff
*/
public:
/*
* Operations
*/
/**
* When this method will return, the whole sequence is over or an unrevoverable error has occured
* @return true for success, false for error
*/
virtual bool start () throw (bad_exception) =0; // I think, the GameContollers should handle all occuring exceptions by itself
/**
* destructor (does nothing)
*/
virtual ~GameController () throw () {};
};
}
#endif //GAMECONTROLLER_H
|
/*
* Copyright 2012-2014 Applifier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "EveryplayFaceCam.h"
#import "EveryplayCapture.h"
#import "EveryplayAccount.h"
#import "EveryplayRequest.h"
#import "EveryplaySoundEngine.h"
#pragma mark - Developer metadata
extern NSString * const kEveryplayMetadataScoreInteger; // @"score"
extern NSString * const kEveryplayMetadataLevelInteger; // @"level"
extern NSString * const kEveryplayMetadataLevelNameString; // @"level_name"
#pragma mark - View controller flow settings
typedef enum {
EveryplayFlowReturnsToGame = 1 << 0, // Default
EveryplayFlowReturnsToVideoPlayer = 1 << 1
} EveryplayFlowDefs;
#pragma mark - Error codes
extern NSString * const kEveryplayErrorDomain; // @"com.everyplay"
extern const int kEveryplayLoginCanceledError; // 100
extern const int kEveryplayMovieExportCanceledError; // 101
extern const int kEveryplayFileUploadError; // 102
#pragma mark - Notifications
extern NSString * const EveryplayAccountDidChangeNotification;
extern NSString * const EveryplayDidFailToRequestAccessNotification;
#pragma mark - Handler
typedef void(^EveryplayAccessRequestCompletionHandler)(NSError *error);
typedef void(^EveryplayPreparedAuthorizationURLHandler)(NSURL *preparedURL);
typedef void(^EveryplayDataLoadingHandler)(NSError *error, id data);
#pragma mark - Compile-time options
@interface EveryplayFeatures : NSObject
/*
* Is running on iOS 5 or later?
* Useful for disabling functionality on older devices.
*/
+ (BOOL) isSupported;
/*
* Returns the number of CPU cores on device.
* Useful for disabling functionality on older devices.
*/
+ (NSUInteger) numCores;
/*
* To disable Everyplay OpenAL implementation, override this class
* method to return NO.
*/
+ (BOOL) supportsOpenAL;
/*
* To disable Everyplay OpenAL "missing implementation" messages, override
* this class method to return YES.
*/
+ (BOOL) disableOpenALMessages;
/*
* CocosDenshion background music support currently lacks hardware
* decoder support. To disable recording support for background music,
* override this class method to return NO.
*/
+ (BOOL) supportsCocosDenshion;
/*
* AVFoundation AVAudioPlayer support currently lacks hardware
* decoder support. To disable recording support for background music,
* override this class method to return NO.
*/
+ (BOOL) supportsAVFoundation;
@end
#pragma mark -
@class EveryplayAccount;
@class EveryplayVideoPlayerViewController;
@protocol EveryplayDelegate <NSObject>
- (void)everyplayShown;
- (void)everyplayHidden;
@optional
- (void)everyplayReadyForRecording:(NSNumber *)enabled;
- (void)everyplayRecordingStarted;
- (void)everyplayRecordingStopped;
- (void)everyplayFaceCamSessionStarted;
- (void)everyplayFaceCamRecordingPermission:(NSNumber *)granted;
- (void)everyplayFaceCamSessionStopped;
- (void)everyplayUploadDidStart:(NSNumber *)videoId;
- (void)everyplayUploadDidProgress:(NSNumber *)videoId progress:(NSNumber *)progress;
- (void)everyplayUploadDidComplete:(NSNumber *)videoId;
- (void)everyplayThumbnailReadyAtFilePath:(NSString *)thumbnailFilePath;
- (void)everyplayThumbnailReadyAtURL:(NSURL *)thumbnailUrl;
- (void)everyplayThumbnailReadyAtTextureId:(NSNumber *)textureId portraitMode:(NSNumber *)portrait;
@end
@interface Everyplay : NSObject
#pragma mark - Properties
@property (nonatomic, unsafe_unretained) EveryplayCapture *capture;
@property (nonatomic, strong) EveryplayFaceCam *faceCam;
@property (nonatomic, strong) UIViewController *parentViewController;
@property (nonatomic, strong) id <EveryplayDelegate> everyplayDelegate;
@property (nonatomic, assign) EveryplayFlowDefs flowControl;
#pragma mark - Singleton
+ (Everyplay *)sharedInstance;
+ (BOOL)isSupported;
+ (Everyplay *)initWithDelegate:(id <EveryplayDelegate>)everyplayDelegate;
+ (Everyplay *)initWithDelegate:(id <EveryplayDelegate>)everyplayDelegate andParentViewController:(UIViewController *)viewController;
+ (Everyplay *)initWithDelegate:(id <EveryplayDelegate>)everyplayDelegate andAddRootViewControllerForView:(UIView *)view;
#pragma mark - Public Methods
- (void)showEveryplay;
- (void)showEveryplayWithPath:(NSString *)path;
- (void)showEveryplaySharingModal;
- (void)hideEveryplay;
- (void)playLastRecording;
- (void)mergeSessionDeveloperData:(NSDictionary *)dictionary;
#pragma mark - Video playback
- (void)playVideoWithURL:(NSURL *)videoURL;
- (void)playVideoWithDictionary:(NSDictionary *)videoDictionary;
#pragma mark - Manage Accounts
+ (EveryplayAccount *)account;
+ (void)requestAccessWithCompletionHandler:(EveryplayAccessRequestCompletionHandler)aCompletionHandler;
+ (void)requestAccessforScopes:(NSString *)scopes
withCompletionHandler:(EveryplayAccessRequestCompletionHandler)aCompletionHandler;
+ (void)removeAccess;
#pragma mark - Facebook authentication
+ (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(id)sourceApplication annotation:(id)annotation;
#pragma mark - Configuration
+ (void)setClientId:(NSString *)client
clientSecret:(NSString *)secret
redirectURI:(NSString *)url;
#pragma mark - OAuth2 Flow
+ (BOOL)handleRedirectURL:(NSURL *)URL;
@end
#pragma mark - Macros
#define EVERYPLAY_CANCELED(error) ([error.domain isEqualToString:(NSString *)kEveryplayErrorDomain] && error.code == kEveryplayLoginCanceledError)
|
/* $Id$
*
* Lasso - A free implementation of the Liberty Alliance specifications.
*
* Copyright (C) 2004-2007 Entr'ouvert
* http://lasso.entrouvert.org
*
* Authors: See AUTHORS file in top-level directory.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "../private.h"
#include "samlp2_manage_name_id_response.h"
/**
* SECTION:samlp2_manage_name_id_response
* @short_description: <samlp2:ManageNameIDResponse>
*
* <figure><title>Schema fragment for samlp2:ManageNameIDResponse</title>
* <programlisting><![CDATA[
*
* <element name="ManageNameIDResponse" type="samlp:StatusResponseType"/>
* ]]></programlisting>
* </figure>
*/
/*****************************************************************************/
/* private methods */
/*****************************************************************************/
static struct XmlSnippet schema_snippets[] = {
{NULL, 0, 0, NULL, NULL, NULL}
};
/*****************************************************************************/
/* instance and class init functions */
/*****************************************************************************/
static void
class_init(LassoSamlp2ManageNameIDResponseClass *klass)
{
LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
nclass->node_data = g_new0(LassoNodeClassData, 1);
lasso_node_class_set_nodename(nclass, "ManageNameIDResponse");
lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX);
lasso_node_class_add_snippets(nclass, schema_snippets);
}
GType
lasso_samlp2_manage_name_id_response_get_type()
{
static GType this_type = 0;
if (!this_type) {
static const GTypeInfo this_info = {
sizeof (LassoSamlp2ManageNameIDResponseClass),
NULL,
NULL,
(GClassInitFunc) class_init,
NULL,
NULL,
sizeof(LassoSamlp2ManageNameIDResponse),
0,
NULL,
NULL
};
this_type = g_type_register_static(LASSO_TYPE_SAMLP2_STATUS_RESPONSE,
"LassoSamlp2ManageNameIDResponse", &this_info, 0);
}
return this_type;
}
/**
* lasso_samlp2_manage_name_id_response_new:
*
* Creates a new #LassoSamlp2ManageNameIDResponse object.
*
* Return value: a newly created #LassoSamlp2ManageNameIDResponse object
**/
LassoNode*
lasso_samlp2_manage_name_id_response_new()
{
return g_object_new(LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_RESPONSE, NULL);
}
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* gmtk.h
* Copyright (C) Kevin DeKorte 2006 <kdekorte@gmail.com>
*
* gmtk.h is free software.
*
* You may 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.
*
* gmtk.h 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 playlist.c. If not, write to:
* The Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301, USA.
*/
#include "gmtk_audio_meter.h"
#include "gmtk_media_tracker.h"
#include "gmtk_media_player.h"
#include "gmtk_output_combo_box.h"
#include "gmtk_common.h"
|
/*****************************************************************************
* vlc_es_out.h: es_out (demuxer output) descriptor, queries and methods
*****************************************************************************
* Copyright (C) 1999-2004 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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 VLC_ES_OUT_H
#define VLC_ES_OUT_H 1
/**
* \file
* This file defines functions and structures for handling es_out in stream output
*/
/**
* \defgroup es out Es Out
* @{
*/
enum es_out_mode_e
{
ES_OUT_MODE_NONE, /* don't select anything */
ES_OUT_MODE_ALL, /* eg for stream output */
ES_OUT_MODE_AUTO, /* best audio/video or for input follow audio-track, sub-track */
ES_OUT_MODE_PARTIAL /* select programs given after --programs */
};
enum es_out_query_e
{
/* activate application of mode */
ES_OUT_SET_ACTIVE, /* arg1= bool */
/* see if mode is currently aplied or not */
ES_OUT_GET_ACTIVE, /* arg1= bool* */
/* set/get mode */
ES_OUT_SET_MODE, /* arg1= int */
ES_OUT_GET_MODE, /* arg2= int* */
/* set ES selected for the es category (audio/video/spu) */
ES_OUT_SET_ES, /* arg1= es_out_id_t* */
/* set 'default' tag on ES (copied across from container) */
ES_OUT_SET_DEFAULT, /* arg1= es_out_id_t* */
/* force selection/unselection of the ES (bypass current mode) */
ES_OUT_SET_ES_STATE,/* arg1= es_out_id_t* arg2=bool */
ES_OUT_GET_ES_STATE,/* arg1= es_out_id_t* arg2=bool* */
/* */
ES_OUT_SET_GROUP, /* arg1= int */
ES_OUT_GET_GROUP, /* arg1= int* */
/* PCR handling, DTS/PTS will be automatically computed using thoses PCR
* XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait
* to slow down the demuxer so that it reads at the right speed.
* XXX: if you want PREROLL just call RESET_PCR and
* ES_OUT_SET_NEXT_DISPLAY_TIME and send data to the decoder *without*
* calling SET_PCR until preroll is finished.
*/
ES_OUT_SET_PCR, /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/
ES_OUT_SET_GROUP_PCR, /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/
ES_OUT_RESET_PCR, /* no arg */
/* Timestamp handling, convert an input timestamp to a global clock one.
* (shouldn't have to be used by input plugins directly) */
ES_OUT_GET_TS, /* arg1=int64_t i_ts(microsecond!) (using default group 0), arg2=int64_t* converted i_ts */
/* Try not to use this one as it is a bit hacky */
ES_OUT_SET_FMT, /* arg1= es_out_id_t* arg2=es_format_t* */
/* Allow preroll of data (data with dts/pts < i_pts for one ES will be decoded but not displayed */
ES_OUT_SET_NEXT_DISPLAY_TIME, /* arg1=es_out_id_t* arg2=int64_t i_pts(microsecond) */
/* Set meta data for group (dynamic) */
ES_OUT_SET_GROUP_META, /* arg1=int i_group arg2=vlc_meta_t */
/* Set epg for group (dynamic) */
ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=vlc_epg_t */
/* */
ES_OUT_DEL_GROUP /* arg1=int i_group */
};
struct es_out_t
{
es_out_id_t *(*pf_add) ( es_out_t *, es_format_t * );
int (*pf_send) ( es_out_t *, es_out_id_t *, block_t * );
void (*pf_del) ( es_out_t *, es_out_id_t * );
int (*pf_control)( es_out_t *, int i_query, va_list );
bool b_sout;
es_out_sys_t *p_sys;
};
static inline es_out_id_t * es_out_Add( es_out_t *out, es_format_t *fmt )
{
return out->pf_add( out, fmt );
}
static inline void es_out_Del( es_out_t *out, es_out_id_t *id )
{
out->pf_del( out, id );
}
static inline int es_out_Send( es_out_t *out, es_out_id_t *id,
block_t *p_block )
{
return out->pf_send( out, id, p_block );
}
static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args )
{
return out->pf_control( out, i_query, args );
}
static inline int es_out_Control( es_out_t *out, int i_query, ... )
{
va_list args;
int i_result;
va_start( args, i_query );
i_result = es_out_vaControl( out, i_query, args );
va_end( args );
return i_result;
}
/**
* @}
*/
#endif
|
/*
* include/asm-arm/arch-tegra/include/mach/sdhci.h
*
* Copyright (C) 2009 Palm, Inc.
* Author: Yvonne Yip <y@palm.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARM_ARCH_TEGRA_SDHCI_H
#define __ASM_ARM_ARCH_TEGRA_SDHCI_H
#include <linux/mmc/host.h>
#include <asm/mach/mmc.h>
/*
* MMC_OCR_1V8_MASK will be used in board sdhci file
* Example for cardhu it will be used in board-cardhu-sdhci.c
* for built_in = 0 devices enabling ocr_mask to MMC_OCR_1V8_MASK
* sets the voltage to 1.8V
*/
#define MMC_OCR_1V8_MASK 0x8
struct tegra_sdhci_platform_data {
int cd_gpio;
int cd_polarity;
int wp_gpio;
int power_gpio;
int is_8bit;
int async_suspend;
int pm_flags;
int pm_caps;
unsigned int max_clk_limit;
unsigned int ddr_clk_limit;
unsigned int tap_delay;
struct mmc_platform_data mmc_data;
};
#endif
|
/* This file is part of the dynarmic project.
* Copyright (c) 2016 MerryMage
* This software may be used and distributed according to the terms of the GNU
* General Public License version 2 or any later version.
*/
#pragma once
#include <type_traits>
#include <xbyak.h>
#include "backend_x64/jitstate.h"
#include "common/common_types.h"
#include "dynarmic/callbacks.h"
namespace Dynarmic {
namespace BackendX64 {
class BlockOfCode final : public Xbyak::CodeGenerator {
public:
explicit BlockOfCode(UserCallbacks cb);
/// Clears this block of code and resets code pointer to beginning.
void ClearCache();
/// Runs emulated code for approximately `cycles_to_run` cycles.
size_t RunCode(JitState* jit_state, CodePtr basic_block, size_t cycles_to_run) const;
/// Code emitter: Returns to host
void ReturnFromRunCode(bool MXCSR_switch = true);
/// Code emitter: Makes guest MXCSR the current MXCSR
void SwitchMxcsrOnEntry();
/// Code emitter: Makes saved host MXCSR the current MXCSR
void SwitchMxcsrOnExit();
/// Code emitter: Calls the function
template <typename FunctionPointer>
void CallFunction(FunctionPointer fn) {
static_assert(std::is_pointer<FunctionPointer>() && std::is_function<std::remove_pointer_t<FunctionPointer>>(),
"Supplied type must be a pointer to a function");
const u64 address = reinterpret_cast<u64>(fn);
const u64 distance = address - (getCurr<u64>() + 5);
if (distance >= 0x0000000080000000ULL && distance < 0xFFFFFFFF80000000ULL) {
// Far call
mov(rax, address);
call(rax);
} else {
call(fn);
}
}
Xbyak::Address MFloatPositiveZero32() {
return xword[rip + consts.FloatPositiveZero32];
}
Xbyak::Address MFloatNegativeZero32() {
return xword[rip + consts.FloatNegativeZero32];
}
Xbyak::Address MFloatNaN32() {
return xword[rip + consts.FloatNaN32];
}
Xbyak::Address MFloatNonSignMask32() {
return xword[rip + consts.FloatNonSignMask32];
}
Xbyak::Address MFloatPositiveZero64() {
return xword[rip + consts.FloatPositiveZero64];
}
Xbyak::Address MFloatNegativeZero64() {
return xword[rip + consts.FloatNegativeZero64];
}
Xbyak::Address MFloatNaN64() {
return xword[rip + consts.FloatNaN64];
}
Xbyak::Address MFloatNonSignMask64() {
return xword[rip + consts.FloatNonSignMask64];
}
Xbyak::Address MFloatPenultimatePositiveDenormal64() {
return xword[rip + consts.FloatPenultimatePositiveDenormal64];
}
Xbyak::Address MFloatMinS32() {
return xword[rip + consts.FloatMinS32];
}
Xbyak::Address MFloatMaxS32() {
return xword[rip + consts.FloatMaxS32];
}
Xbyak::Address MFloatMinU32() {
return xword[rip + consts.FloatMinU32];
}
Xbyak::Address MFloatMaxU32() {
return xword[rip + consts.FloatMaxU32];
}
const void* GetReturnFromRunCodeAddress() const {
return return_from_run_code;
}
const void* GetMemoryReadCallback(size_t bit_size) const {
switch (bit_size) {
case 8:
return read_memory_8;
case 16:
return read_memory_16;
case 32:
return read_memory_32;
case 64:
return read_memory_64;
default:
return nullptr;
}
}
const void* GetMemoryWriteCallback(size_t bit_size) const {
switch (bit_size) {
case 8:
return write_memory_8;
case 16:
return write_memory_16;
case 32:
return write_memory_32;
case 64:
return write_memory_64;
default:
return nullptr;
}
}
void int3() { db(0xCC); }
void nop(size_t size = 1);
void SetCodePtr(CodePtr code_ptr);
void EnsurePatchLocationSize(CodePtr begin, size_t size);
#ifdef _WIN32
Xbyak::Reg64 ABI_RETURN = rax;
Xbyak::Reg64 ABI_PARAM1 = rcx;
Xbyak::Reg64 ABI_PARAM2 = rdx;
Xbyak::Reg64 ABI_PARAM3 = r8;
Xbyak::Reg64 ABI_PARAM4 = r9;
#else
Xbyak::Reg64 ABI_RETURN = rax;
Xbyak::Reg64 ABI_PARAM1 = rdi;
Xbyak::Reg64 ABI_PARAM2 = rsi;
Xbyak::Reg64 ABI_PARAM3 = rdx;
Xbyak::Reg64 ABI_PARAM4 = rcx;
#endif
private:
UserCallbacks cb;
struct Consts {
Xbyak::Label FloatPositiveZero32;
Xbyak::Label FloatNegativeZero32;
Xbyak::Label FloatNaN32;
Xbyak::Label FloatNonSignMask32;
Xbyak::Label FloatPositiveZero64;
Xbyak::Label FloatNegativeZero64;
Xbyak::Label FloatNaN64;
Xbyak::Label FloatNonSignMask64;
Xbyak::Label FloatPenultimatePositiveDenormal64;
Xbyak::Label FloatMinS32;
Xbyak::Label FloatMaxS32;
Xbyak::Label FloatMinU32;
Xbyak::Label FloatMaxU32;
} consts;
void GenConstants();
using RunCodeFuncType = void(*)(JitState*, CodePtr);
RunCodeFuncType run_code = nullptr;
void GenRunCode();
const void* return_from_run_code = nullptr;
const void* return_from_run_code_without_mxcsr_switch = nullptr;
void GenReturnFromRunCode();
const void* read_memory_8 = nullptr;
const void* read_memory_16 = nullptr;
const void* read_memory_32 = nullptr;
const void* read_memory_64 = nullptr;
const void* write_memory_8 = nullptr;
const void* write_memory_16 = nullptr;
const void* write_memory_32 = nullptr;
const void* write_memory_64 = nullptr;
void GenMemoryAccessors();
};
} // namespace BackendX64
} // namespace Dynarmic
|
#include "platform.h"
#include "lolevel.h"
//These functions now are part of platform/a495/lib.c
/*
char *hook_raw_image_addr()
{
return (char*) 0x10E52420; // Ok, ROM:FFCE9A44
}
long hook_raw_size()
{
return 0xEC04F0; // "CRAW BUFF SIZE"
}
// Live picture buffer (shoot not pressed)
void *vid_get_viewport_live_fb()
{
return (void*)0;
//void **fb=(void **)0x3E80; // ?
//unsigned char buff = *((unsigned char*)0x3CF0); // sub_FFC87F0C
//if (buff == 0) buff = 2; else buff--;
//return fb[buff];
}
// OSD buffer
void *vid_get_bitmap_fb()
{
return (void*)0x10361000; // "BmpDDev.c", 0xFFCD1DD4
}
// Live picture buffer (shoot half-pressed)
void *vid_get_viewport_fb()
{
return (void*)0x10648CC0; // "VRAM Address" sub_FFCA6830
}
void *vid_get_viewport_fb_d()
{
return (void*)(*(int*)(0x2540+0x54)); // sub_FFC528C0 / sub_FFC53554?
}
long vid_get_viewport_height() { return 240; }
char *camera_jpeg_count_str()
{
return (char*)0x7486C; // ROM:FFD72194 "9999"
}
*/
|
#ifndef __ASM_IRQ_H
#define __ASM_IRQ_H
#include <asm-generic/irq.h>
extern void (*handle_arch_irq)(struct pt_regs *);
extern void migrate_irqs(void);
extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
/*
void arch_trigger_all_cpu_backtrace(void);
#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
*/
#endif
|
/*
*
* (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation, and any use by you of this program is subject to the terms
* of such GNU licence.
*
* A copy of the licence is included with the program, and can also be obtained
* from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifdef CONFIG_ARM64
#include <mali_kbase.h>
#include <mali_kbase_smc.h>
#include <linux/compiler.h>
static noinline u64 invoke_smc_fid(u64 _function_id,
u64 _arg0, u64 _arg1, u64 _arg2)
{
register u64 function_id asm("x0") = _function_id;
register u64 arg0 asm("x1") = _arg0;
register u64 arg1 asm("x2") = _arg1;
register u64 arg2 asm("x3") = _arg2;
asm volatile(
__asmeq("%0", "x0")
__asmeq("%1", "x1")
__asmeq("%2", "x2")
__asmeq("%3", "x3")
"smc #0\n"
: "+r" (function_id)
: "r" (arg0), "r" (arg1), "r" (arg2));
return function_id;
}
u64 kbase_invoke_smc_fid(u32 fid, u64 arg0, u64 arg1, u64 arg2)
{
/* Is fast call (bit 31 set) */
KBASE_DEBUG_ASSERT(fid & ~SMC_FAST_CALL);
/* bits 16-23 must be zero for fast calls */
KBASE_DEBUG_ASSERT((fid & (0xFF << 16)) == 0);
return invoke_smc_fid(fid, arg0, arg1, arg2);
}
u64 kbase_invoke_smc(u32 oen, u16 function_number, bool smc64,
u64 arg0, u64 arg1, u64 arg2)
{
u32 fid = 0;
/* Only the six bits allowed should be used. */
KBASE_DEBUG_ASSERT((oen & ~SMC_OEN_MASK) == 0);
fid |= SMC_FAST_CALL; /* Bit 31: Fast call */
if (smc64)
fid |= SMC_64; /* Bit 30: 1=SMC64, 0=SMC32 */
fid |= oen; /* Bit 29:24: OEN */
/* Bit 23:16: Must be zero for fast calls */
fid |= (function_number); /* Bit 15:0: function number */
return kbase_invoke_smc_fid(fid, arg0, arg1, arg2);
}
#endif /* CONFIG_ARM64 */
|
#ifndef ASM_KVM_CACHE_REGS_H
#define ASM_KVM_CACHE_REGS_H
#define KVM_POSSIBLE_CR0_GUEST_BITS X86_CR0_TS
#define KVM_POSSIBLE_CR4_GUEST_BITS \
(X86_CR4_PVI | X86_CR4_DE | X86_CR4_PCE | X86_CR4_OSFXSR \
| X86_CR4_OSXMMEXCPT | X86_CR4_PGE)
static inline unsigned long kvm_register_read(struct kvm_vcpu *vcpu,
enum kvm_reg reg)
{
if (!test_bit(reg, (unsigned long *)&vcpu->arch.regs_avail))
kvm_x86_ops->cache_reg(vcpu, reg);
return vcpu->arch.regs[reg];
}
static inline void kvm_register_write(struct kvm_vcpu *vcpu,
enum kvm_reg reg,
unsigned long val)
{
vcpu->arch.regs[reg] = val;
__set_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
__set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
}
static inline unsigned long kvm_rip_read(struct kvm_vcpu *vcpu)
{
return kvm_register_read(vcpu, VCPU_REGS_RIP);
}
static inline void kvm_rip_write(struct kvm_vcpu *vcpu, unsigned long val)
{
kvm_register_write(vcpu, VCPU_REGS_RIP, val);
}
static inline u64 kvm_pdptr_read(struct kvm_vcpu *vcpu, int index)
{
if (!test_bit(VCPU_EXREG_PDPTR,
(unsigned long *)&vcpu->arch.regs_avail))
kvm_x86_ops->cache_reg(vcpu, VCPU_EXREG_PDPTR);
return vcpu->arch.pdptrs[index];
}
static inline ulong kvm_read_cr0_bits(struct kvm_vcpu *vcpu, ulong mask)
{
ulong tmask = mask & KVM_POSSIBLE_CR0_GUEST_BITS;
if (tmask & vcpu->arch.cr0_guest_owned_bits)
kvm_x86_ops->decache_cr0_guest_bits(vcpu);
return vcpu->arch.cr0 & mask;
}
static inline ulong kvm_read_cr0(struct kvm_vcpu *vcpu)
{
return kvm_read_cr0_bits(vcpu, ~0UL);
}
static inline ulong kvm_read_cr4_bits(struct kvm_vcpu *vcpu, ulong mask)
{
ulong tmask = mask & KVM_POSSIBLE_CR4_GUEST_BITS;
if (tmask & vcpu->arch.cr4_guest_owned_bits)
kvm_x86_ops->decache_cr4_guest_bits(vcpu);
return vcpu->arch.cr4 & mask;
}
static inline ulong kvm_read_cr4(struct kvm_vcpu *vcpu)
{
return kvm_read_cr4_bits(vcpu, ~0UL);
}
#endif
|
#define CONFIG_FBCON_CFB8_MODULE 1
|
/*
* buffer.h
*
* Copyright (C) Thomas Oestreich - June 2001
*
* This file is part of transcode, a video stream processing tool
*
* transcode 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.
*
* transcode 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 GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include "transcode.h"
#ifndef _BUFFER_H
#define _BUFFER_H
#define BUFFER_NULL -1
#define BUFFER_EMPTY 0
#define BUFFER_READY 1
#define MAX_PCM_BUFFER (SIZE_PCM_FRAME<<2)
typedef struct buffer_list {
int id; // buffer number
int status; // buffer status
struct buffer_list *next;
struct buffer_list *prev;
int size;
char *data;
} buffer_list_t;
buffer_list_t *buffer_register(int id);
void buffer_remove(buffer_list_t *ptr);
buffer_list_t *buffer_retrieve(void);
extern buffer_list_t *buffer_list_head;
extern buffer_list_t *buffer_list_tail;
#endif
|
/* This source file is a part of the GePhex Project.
Copyright (C) 2001-2004
Georg Seidel <georg@gephex.org>
Martin Bayer <martin@gephex.org>
Phillip Promesberger <coma@gephex.org>
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 "audiobuffer.h"
#include <stdio.h>
#include <assert.h>
#include <windows.h>
// ---------------------------------------------------------------------------
static int init_buffer_block(HWAVEIN wavein, WAVEHDR* hdr, int block_size)
{
MMRESULT res;
memset(hdr, 0, sizeof(*hdr));
hdr->lpData = malloc(block_size);
hdr->dwBufferLength = block_size;
hdr->dwFlags = 0;
res = waveInPrepareHeader(wavein, hdr, sizeof(*hdr));
if (res != MMSYSERR_NOERROR)
{
char error_msg[128];
waveInGetErrorText(res, error_msg, sizeof(error_msg));
printf("init_buffer_block failed: %s!\n", error_msg);
return 0;
}
return 1;
}
static int deinit_buffer_block(HWAVEIN wavein, WAVEHDR* hdr)
{
MMRESULT res;
res = waveInUnprepareHeader(wavein, hdr, sizeof(*hdr));
if (res != MMSYSERR_NOERROR)
{
char error_msg[128];
waveInGetErrorText(res, error_msg, sizeof(error_msg));
printf("init_buffer_block failed: %s!\n", error_msg);
return 0;
}
free(hdr->lpData);
return 1;
}
// ---------------------------------------------------------------------------
struct ab_queue_node
{
struct ab_queue_node* next;
WAVEHDR hdr;
};
struct ab_queue
{
int len;
HWAVEIN wavein;
struct ab_queue_node* first;
};
static struct ab_queue* ab_queue_create(int len, int block_size, HWAVEIN wavein)
{
struct ab_queue* queue = malloc(sizeof(*queue));
struct ab_queue_node* last_node;
struct ab_queue_node* current_node;
int i;
queue->len = len;
queue->wavein = wavein;
last_node = 0;
for (i = 0; i < len; ++i)
{
MMRESULT res;
current_node = malloc(sizeof(*current_node));
init_buffer_block(wavein, ¤t_node->hdr, block_size);
res = waveInAddBuffer(wavein, ¤t_node->hdr, sizeof(current_node->hdr));
if (res != MMSYSERR_NOERROR)
{
char error_msg[128];
waveInGetErrorText(res, error_msg, sizeof(error_msg));
printf("waveInAddBuffer failed: %s!\n", error_msg);
return 0;
}
if (last_node != 0)
last_node->next = current_node;
else {
queue->first = current_node;
}
last_node = current_node;
}
last_node->next = queue->first;
return queue;
}
static void ab_queue_destroy(struct ab_queue* queue)
{
int num_nodes = 0;
struct ab_queue_node* current;
current = queue->first;
do
{
struct ab_queue_node* tmp;
deinit_buffer_block(queue->wavein, ¤t->hdr);
tmp = current;
current = current->next;
free(tmp);
++num_nodes;
} while (current != queue->first);
assert(num_nodes = queue->len);
free(queue);
}
static WAVEHDR* ab_queue_top(struct ab_queue* self) {
return &self->first->hdr;
}
static void ab_queue_next(struct ab_queue* self) {
self->first = self->first->next;
}
// ---------------------------------------------------------------------------
struct audio_buffer
{
int block_size;
int num_blocks;
HWAVEIN wavein;
struct ab_queue* queue;
};
struct audio_buffer* ab_create(void* wavein, int block_size, int num_blocks)
{
struct audio_buffer* buf = malloc(sizeof(*buf));
buf->block_size = block_size;
buf->num_blocks = num_blocks;
buf->wavein = wavein;
buf->queue = ab_queue_create(num_blocks, block_size, wavein);
return buf;
}
void ab_destroy(struct audio_buffer* buf) {
ab_queue_destroy(buf->queue);
free(buf);
}
int ab_block_ready(const struct audio_buffer* buf) {
const WAVEHDR* hdr = ab_queue_top(buf->queue);
return (hdr->dwFlags & WHDR_DONE);
}
int ab_get_block(struct audio_buffer* buf, unsigned char* data, int data_len)
{
WAVEHDR* hdr;
MMRESULT res;
int min_len;
if (!ab_block_ready(buf))
return 0;
hdr = ab_queue_top(buf->queue);
min_len = min(data_len, (int)hdr->dwBytesRecorded);
memcpy(data, hdr->lpData, min_len);
//TODO: is it necessary to unprepare and prepare the header here?
res = waveInAddBuffer(buf->wavein, hdr, sizeof(*hdr));
if (res != MMSYSERR_NOERROR)
{
char error_msg[128];
waveInGetErrorText(res, error_msg, sizeof(error_msg));
printf("waveInAddBuffer failed: %s!\n", error_msg);
return 0;
}
ab_queue_next(buf->queue);
return min_len;
}
// ---------------------------------------------------------------------------
|
/*
* Copyright (C) 2003-2009 The Music Player Daemon Project
* http://www.musicpd.org
*
* 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.
*/
/*
* Imported from AudioCompress by J. Shagam <fluffy@beesbuzz.biz>
*/
#ifndef MPD_COMPRESS_H
#define MPD_COMPRESS_H
/* These are copied from the AudioCompress config.h, mainly because CompressDo
* needs GAINSHIFT defined. The rest are here so they can be used as defaults
* to pass to CompressCfg(). -- jat */
#define ANTICLIP 0 /* Strict clipping protection */
#define TARGET 25000 /* Target level */
#define GAINMAX 32 /* The maximum amount to amplify by */
#define GAINSHIFT 10 /* How fine-grained the gain is */
#define GAINSMOOTH 8 /* How much inertia ramping has*/
#define BUCKETS 400 /* How long of a history to store */
void CompressCfg(int monitor,
int anticlip,
int target,
int maxgain,
int smooth,
unsigned buckets);
void CompressDo(void *data, unsigned int numSamples);
void CompressFree(void);
#endif
|
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* PF_INET6 protocol dispatch tables.
*
* Version: $Id: protocol.c,v 1.1.1.1 2004/06/19 05:03:03 ashieh Exp $
*
* Authors: Pedro Roque <roque@di.fc.ul.pt>
*
* 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.
*/
/*
* Changes:
*
* Vince Laviano (vince@cs.stanford.edu) 16 May 2001
* - Removed unused variable 'inet6_protocol_base'
* - Modified inet6_del_protocol() to correctly maintain copy bit.
*/
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/sched.h>
#include <linux/net.h>
#include <linux/in6.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/brlock.h>
#include <net/sock.h>
#include <net/snmp.h>
#include <net/ipv6.h>
#include <net/protocol.h>
struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
void inet6_add_protocol(struct inet6_protocol *prot)
{
unsigned char hash;
struct inet6_protocol *p2;
hash = prot->protocol & (MAX_INET_PROTOS - 1);
br_write_lock_bh(BR_NETPROTO_LOCK);
prot->next = inet6_protos[hash];
inet6_protos[hash] = prot;
prot->copy = 0;
/*
* Set the copy bit if we need to.
*/
p2 = (struct inet6_protocol *) prot->next;
while(p2 != NULL) {
if (p2->protocol == prot->protocol) {
prot->copy = 1;
break;
}
p2 = (struct inet6_protocol *) p2->next;
}
br_write_unlock_bh(BR_NETPROTO_LOCK);
}
/*
* Remove a protocol from the hash tables.
*/
int inet6_del_protocol(struct inet6_protocol *prot)
{
struct inet6_protocol *p;
struct inet6_protocol *lp = NULL;
unsigned char hash;
hash = prot->protocol & (MAX_INET_PROTOS - 1);
br_write_lock_bh(BR_NETPROTO_LOCK);
if (prot == inet6_protos[hash]) {
inet6_protos[hash] = (struct inet6_protocol *) inet6_protos[hash]->next;
br_write_unlock_bh(BR_NETPROTO_LOCK);
return(0);
}
p = (struct inet6_protocol *) inet6_protos[hash];
if (p != NULL && p->protocol == prot->protocol)
lp = p;
while(p != NULL) {
/*
* We have to worry if the protocol being deleted is
* the last one on the list, then we may need to reset
* someone's copied bit.
*/
if (p->next != NULL && p->next == prot) {
/*
* if we are the last one with this protocol and
* there is a previous one, reset its copy bit.
*/
if (prot->copy == 0 && lp != NULL)
lp->copy = 0;
p->next = prot->next;
br_write_unlock_bh(BR_NETPROTO_LOCK);
return(0);
}
if (p->next != NULL && p->next->protocol == prot->protocol)
lp = p->next;
p = (struct inet6_protocol *) p->next;
}
br_write_unlock_bh(BR_NETPROTO_LOCK);
return(-1);
}
|
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// cl_inv.c -- client inventory screen
#include "client.h"
/*
================
CL_ParseInventory
================
*/
void CL_ParseInventory (void)
{
int32_t i;
for (i=0 ; i<MAX_ITEMS ; i++)
cl.inventory[i] = MSG_ReadShort (&net_message);
}
/*
================
Inv_DrawString
================
*/
void Hud_DrawString (int32_t x, int32_t y, const char *string, int32_t alpha, qboolean isStatusBar);
void Inv_DrawString (int32_t x, int32_t y, char *string)
{
Hud_DrawString(x, y, string, 255, false);
}
void SetStringHighBit (char *s)
{
while (*s)
*s++ |= 128;
}
/*
================
CL_DrawInventory
================
*/
#define DISPLAY_ITEMS 17
void CL_DrawInventory (void)
{
int32_t i;
int32_t num, selected_num, item;
int32_t index[MAX_ITEMS];
char string[1024];
int32_t x, y;
char *bind;
int32_t selected;
int32_t top;
selected = cl.frame.playerstate.stats[STAT_SELECTED_ITEM];
num = 0;
selected_num = 0;
for (i=0; i<MAX_ITEMS; i++)
{
if (i==selected)
selected_num = num;
if (cl.inventory[i])
{
index[num] = i;
num++;
}
}
// determine scroll point
top = selected_num - DISPLAY_ITEMS/2;
if (num - top < DISPLAY_ITEMS)
top = num - DISPLAY_ITEMS;
if (top < 0)
top = 0;
//x = (viddef.width-256)/2;
//y = (viddef.height-240)/2;
// x = viddef.width/2 - scaledHud(128);
// y = viddef.height/2 - scaledHud(120);
x = SCREEN_WIDTH/2 - 128;
y = SCREEN_HEIGHT/2 - 116;
// R_DrawScaledPic (x, y+scaledHud(8), HudScale(), hud_alpha->value, "inventory");
// y += scaledHud(24);
// x += scaledHud(24);
// Inv_DrawString (x, y, S_COLOR_BOLD"hotkey ### item");
// Inv_DrawString (x, y+scaledHud(8), S_COLOR_BOLD"------ --- ----");
// y += scaledHud(16);
SCR_DrawPic (x, y, 256, 192, ALIGN_CENTER, "inventory", hud_alpha->value);
x += 24;
y += 20;
SCR_DrawString (x, y, ALIGN_CENTER, S_COLOR_BOLD"hotkey ### item", 255);
y += 8;
SCR_DrawString (x, y, ALIGN_CENTER, S_COLOR_BOLD"------ --- ----", 255);
x += 16;
y += 8;
for (i=top; i<num && i < top+DISPLAY_ITEMS; i++)
{
item = index[i];
// search for a binding
bind = "";
if (cl.inventorykey[item] >= 0)
{
bind = Key_KeynumToString(cl.inventorykey[item]);
}
// Knightmare- BIG UGLY HACK for connected to server using old protocol
// Changed config strings require different parsing
if ( LegacyProtocol() )
{
if (item != selected)
{
Com_sprintf (string, sizeof(string), " "S_COLOR_BOLD S_COLOR_ALT"%3s %3i %7s", bind, cl.inventory[item],
cl.configstrings[OLD_CS_ITEMS+item] );
}
else // draw a blinky cursor by the selected item
{
Com_sprintf (string, sizeof(string), S_COLOR_BOLD">"S_COLOR_ITALIC"%3s %3i %7s", bind, cl.inventory[item],
cl.configstrings[OLD_CS_ITEMS+item] );
}
}
else
{
if (item != selected)
{
Com_sprintf (string, sizeof(string), " "S_COLOR_BOLD S_COLOR_ALT"%3s %3i %7s", bind, cl.inventory[item],
cl.configstrings[CS_ITEMS+item] );
}
else // draw a blinky cursor by the selected item
{
Com_sprintf (string, sizeof(string), S_COLOR_BOLD">"S_COLOR_ITALIC"%3s %3i %7s", bind, cl.inventory[item],
cl.configstrings[CS_ITEMS+item] );
}
}
// Inv_DrawString (x, y, string);
// y += scaledHud(8);
SCR_DrawString (x, y, ALIGN_CENTER, string, 255);
y += 8;
}
}
|
#ifndef ENGINEERING_SCREEN_H
#define ENGINEERING_SCREEN_H
#include "gui/gui2_overlay.h"
#include "shipTemplate.h"
#include "playerInfo.h"
class GuiKeyValueDisplay;
class GuiLabel;
class GuiSlider;
class GuiAutoLayout;
class GuiImage;
class GuiArrow;
class GuiToggleButton;
class GuiProgressbar;
class EngineeringScreen : public GuiOverlay
{
private:
GuiOverlay* background_gradient;
GuiOverlay* background_crosses;
GuiKeyValueDisplay* energy_display;
GuiKeyValueDisplay* hull_display;
GuiKeyValueDisplay* front_shield_display;
GuiKeyValueDisplay* rear_shield_display;
GuiLabel* power_label;
GuiSlider* power_slider;
GuiLabel* coolant_label;
GuiSlider* coolant_slider;
class SystemRow
{
public:
GuiAutoLayout* layout;
GuiToggleButton* button;
GuiProgressbar* damage_bar;
GuiLabel* damage_label;
GuiProgressbar* heat_bar;
GuiArrow* heat_arrow;
GuiImage* heat_icon;
GuiProgressbar* power_bar;
GuiProgressbar* coolant_bar;
};
std::vector<SystemRow> system_rows;
GuiAutoLayout* system_effects_container;
std::vector<GuiKeyValueDisplay*> system_effects;
unsigned int system_effects_index;
ESystem selected_system;
float previous_energy_measurement;
float previous_energy_level;
float average_energy_delta;
void addSystemEffect(string key, string value);
void selectSystem(ESystem system);
public:
EngineeringScreen(GuiContainer* owner, ECrewPosition crew_position=engineering);
virtual void onDraw(sf::RenderTarget& window) override;
virtual void onHotkey(const HotkeyResult& key) override;
};
#endif//ENGINEERING_SCREEN_H
|
#ifndef _OMFS_H
#define _OMFS_H
#include <linux/module.h>
#include <linux/fs.h>
#include "omfs_fs.h"
/* In-memory structures */
struct omfs_sb_info {
u64 s_num_blocks;
u64 s_bitmap_ino;
u64 s_root_ino;
u32 s_blocksize;
u32 s_mirrors;
u32 s_sys_blocksize;
u32 s_clustersize;
int s_block_shift;
unsigned long **s_imap;
int s_imap_size;
struct mutex s_bitmap_lock;
int s_uid;
int s_gid;
int s_dmask;
int s_fmask;
};
/* convert a cluster number to a scaled block number */
static inline sector_t clus_to_blk(struct omfs_sb_info *sbi, sector_t block)
{
return block << sbi->s_block_shift;
}
static inline struct omfs_sb_info *OMFS_SB(struct super_block *sb)
{
return sb->s_fs_info;
}
/* bitmap.c */
extern unsigned long omfs_count_free(struct super_block *sb);
extern int omfs_allocate_block(struct super_block *sb, u64 block);
extern int omfs_allocate_range(struct super_block *sb, int min_request,
int max_request, u64 *return_block, int *return_size);
extern int omfs_clear_range(struct super_block *sb, u64 block, int count);
/* dir.c */
extern struct file_operations omfs_dir_operations;
extern const struct inode_operations omfs_dir_inops;
extern int omfs_make_empty(struct inode *inode, struct super_block *sb);
extern int omfs_is_bad(struct omfs_sb_info *sbi, struct omfs_header *header,
u64 fsblock);
/* file.c */
extern struct file_operations omfs_file_operations;
extern const struct inode_operations omfs_file_inops;
extern const struct address_space_operations omfs_aops;
extern void omfs_make_empty_table(struct buffer_head *bh, int offset);
extern int omfs_shrink_inode(struct inode *inode);
/* inode.c */
extern struct inode *omfs_iget(struct super_block *sb, ino_t inode);
extern struct inode *omfs_new_inode(struct inode *dir, int mode);
extern int omfs_reserve_block(struct super_block *sb, sector_t block);
extern int omfs_find_empty_block(struct super_block *sb, int mode, ino_t *ino);
extern int omfs_sync_inode(struct inode *inode);
#endif
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_H_
#define CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_H_
#pragma once
#import <Cocoa/Cocoa.h>
@interface ToolbarButton : NSButton {
@protected
BOOL handleMiddleClick_;
BOOL handlingMiddleClick_;
}
@property(assign, nonatomic) BOOL handleMiddleClick;
@end
@interface ToolbarButton (ExposedForTesting)
- (BOOL)shouldHandleEvent:(NSEvent*)theEvent;
@end
#endif
|
/** @file
WT0124 Pool Thermometer decoder.
Copyright (C) 2018 Benjamin Larsson
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.
*/
/**
WT0124 Pool Thermometer decoder.
5e ba 9a 9f e1 34
01011110 10111010 10011010 10011111 11100001 00110100
5555RRRR RRRRTTTT TTTTTTTT UUCCFFFF XXXXXXXX ????????
- 5 = constant 5
- R = random power on id
- T = 12 bits of temperature with 0x900 bias and scaled by 10
- U = unk, maybe battery indicator (display is missing one though)
- C = channel
- F = constant F
- X = xor checksum
- ? = unknown
*/
#include "decoder.h"
static int wt1024_callback(r_device *decoder, bitbuffer_t *bitbuffer)
{
data_t *data;
uint8_t *b; // bits of a row
uint16_t sensor_rid;
int16_t value;
float temp_c;
uint8_t channel;
if (bitbuffer->bits_per_row[1] !=49)
return DECODE_ABORT_LENGTH;
/* select row after preamble */
b = bitbuffer->bb[1];
/* Validate constant */
if (b[0]>>4 != 0x5) {
return DECODE_ABORT_EARLY;
}
/* Validate checksum */
if ((b[0]^b[1]^b[2]^b[3]) != b[4])
return DECODE_FAIL_MIC;
/* Get rid */
sensor_rid = (b[0]&0x0F)<<4 | (b[1]&0x0F);
/* Get temperature */
temp_c = ((((b[1] & 0xF) << 8) | b[2]) - 0x990) * 0.1f;
/* Get channel */
channel = ((b[3]>>4) & 0x3);
/* unk */
value = b[5];
if (decoder->verbose) {
fprintf(stderr, "wt1024_callback:");
bitbuffer_print(bitbuffer);
}
data = data_make(
"model", "", DATA_STRING, _X("WT0124-Pool","WT0124 Pool Thermometer"),
_X("id","rid"), "Random ID", DATA_INT, sensor_rid,
"channel", "Channel", DATA_INT, channel,
"temperature_C", "Temperature", DATA_FORMAT, "%.1f C", DATA_DOUBLE, temp_c,
"mic", "Integrity", DATA_STRING, "CHECKSUM",
"data", "Data", DATA_INT, value,
NULL);
decoder_output_data(decoder, data);
// Return 1 if message successfully decoded
return 1;
}
/*
* List of fields that may appear in the output
*
* Used to determine what fields will be output in what
* order for this device when using -F csv.
*
*/
static char *output_fields[] = {
"model",
"rid", // TODO: delete this
"id",
"channel",
"temperature_C",
"mic",
"data",
NULL,
};
r_device wt1024 = {
.name = "WT0124 Pool Thermometer",
.modulation = OOK_PULSE_PWM,
.short_width = 680,
.long_width = 1850,
.reset_limit = 30000,
.gap_limit = 4000,
.sync_width = 10000,
.decode_fn = &wt1024_callback,
.disabled = 0,
.fields = output_fields,
};
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "../../utils/hostosinfo.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QPoint>
#include <QRect>
#include <QWidget>
namespace Utils {
namespace Internal {
inline int screenNumber(const QPoint &pos, QWidget *w) {
if (QApplication::desktop()->isVirtualDesktop())
return QApplication::desktop()->screenNumber(pos);
else
return QApplication::desktop()->screenNumber(w);
}
inline QRect screenGeometry(const QPoint &pos, QWidget *w) {
if (HostOsInfo::isMacHost())
return QApplication::desktop()->availableGeometry(screenNumber(pos, w));
return QApplication::desktop()->screenGeometry(screenNumber(pos, w));
}
} // namespace Internal
} // namespace Utils
|
/*
Copyright 1991, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/*
* Author: Keith Packard, MIT X Consortium
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "libxfontint.h"
#include "src/util/replace.h"
#include <X11/fonts/fntfilst.h>
BitmapSourcesRec FontFileBitmapSources;
Bool
FontFileRegisterBitmapSource (FontPathElementPtr fpe)
{
FontPathElementPtr *new;
int i;
int newsize;
for (i = 0; i < FontFileBitmapSources.count; i++)
if (FontFileBitmapSources.fpe[i] == fpe)
return TRUE;
if (FontFileBitmapSources.count == FontFileBitmapSources.size)
{
newsize = FontFileBitmapSources.size + 4;
new = reallocarray (FontFileBitmapSources.fpe, newsize, sizeof *new);
if (!new)
return FALSE;
FontFileBitmapSources.size = newsize;
FontFileBitmapSources.fpe = new;
}
FontFileBitmapSources.fpe[FontFileBitmapSources.count++] = fpe;
return TRUE;
}
void
FontFileUnregisterBitmapSource (FontPathElementPtr fpe)
{
int i;
for (i = 0; i < FontFileBitmapSources.count; i++)
if (FontFileBitmapSources.fpe[i] == fpe)
{
FontFileBitmapSources.count--;
if (FontFileBitmapSources.count == 0)
{
FontFileBitmapSources.size = 0;
free (FontFileBitmapSources.fpe);
FontFileBitmapSources.fpe = 0;
}
else
{
for (; i < FontFileBitmapSources.count; i++)
FontFileBitmapSources.fpe[i] = FontFileBitmapSources.fpe[i+1];
}
break;
}
}
/*
* Our set_path_hook: unregister all bitmap sources.
* This is necessary because already open fonts will keep their FPEs
* allocated, but they may not be on the new font path.
* The bitmap sources in the new path will be registered by the init_func.
*/
void
FontFileEmptyBitmapSource(void)
{
if (FontFileBitmapSources.count == 0)
return;
FontFileBitmapSources.count = 0;
FontFileBitmapSources.size = 0;
free (FontFileBitmapSources.fpe);
FontFileBitmapSources.fpe = 0;
}
int
FontFileMatchBitmapSource (FontPathElementPtr fpe,
FontPtr *pFont,
int flags,
FontEntryPtr entry,
FontNamePtr zeroPat,
FontScalablePtr vals,
fsBitmapFormat format,
fsBitmapFormatMask fmask,
Bool noSpecificSize)
{
int source;
FontEntryPtr zero;
FontBitmapEntryPtr bitmap;
int ret;
FontDirectoryPtr dir;
FontScaledPtr scaled;
/*
* Look through all the registered bitmap sources for
* the same zero name as ours; entries along that one
* can be scaled as desired.
*/
ret = BadFontName;
for (source = 0; source < FontFileBitmapSources.count; source++)
{
if (FontFileBitmapSources.fpe[source] == fpe)
continue;
dir = (FontDirectoryPtr) FontFileBitmapSources.fpe[source]->private;
zero = FontFileFindNameInDir (&dir->scalable, zeroPat);
if (!zero)
continue;
scaled = FontFileFindScaledInstance (zero, vals, noSpecificSize);
if (scaled)
{
if (scaled->pFont)
{
*pFont = scaled->pFont;
(*pFont)->fpe = FontFileBitmapSources.fpe[source];
ret = Successful;
}
else if (scaled->bitmap)
{
entry = scaled->bitmap;
bitmap = &entry->u.bitmap;
if (bitmap->pFont)
{
*pFont = bitmap->pFont;
(*pFont)->fpe = FontFileBitmapSources.fpe[source];
ret = Successful;
}
else
{
ret = FontFileOpenBitmap (
FontFileBitmapSources.fpe[source],
pFont, flags, entry, format, fmask);
if (ret == Successful && *pFont)
(*pFont)->fpe = FontFileBitmapSources.fpe[source];
}
}
else /* "cannot" happen */
{
ret = BadFontName;
}
break;
}
}
return ret;
}
|
/*
* common.c
*
* Copyright (c) 1999 Pekka Riikonen, priikone@poseidon.pspt.fi.
*
* 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.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "signal.h"
#include "common.h"
/*
* Generates Portable Bitmap picture file (type P5 PGM).
*/
void generate_pgm(int o_fp, int o_fh, int o_fv, double o_tone,
double o_carr, int o_res_x, int o_res_y, int o_square)
{
int i, x, y;
double p, R;
Signal ns;
double *signal;
ns.o_fp = o_fp;
ns.o_fh = o_fh;
ns.o_fv = o_fv;
ns.o_tone = o_tone;
ns.o_carr = o_carr;
ns.o_res_x = o_res_x;
ns.o_res_y = o_res_y;
ns.o_square = o_square;
signal = (double *)NULL;
signal = generate_am_signal(&ns);
fprintf(stdout, "P5\n");
fprintf(stdout, "%d %d 255\n", o_res_x, o_res_y);
srand((unsigned int)time(0));
i = 0;
for (y = 0; y < o_res_y; y++) {
for (x = 0; x < o_res_x; x++) {
R = 1+(double) (1.0*rand() / (RAND_MAX+1.0)) - 1;
p = ((double)127.5 + signal[i++]) + R;
if (p < 0)
p = 0;
if (p > 255)
p = 255;
putchar((int)p);
}
}
fflush(stdout);
if (signal)
free(signal);
}
|
/*
command.h
flexemu, an MC6809 emulator running FLEX
Copyright (C) 1997-2022 W. Schwotzer
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
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef COMMAND_INCLUDED
#define COMMAND_INCLUDED
#include "misc1.h"
#include "iodevice.h"
#include "bobservd.h"
#include <string>
#define MAX_COMMAND (128)
#define INVALID_DRIVE (4)
#define CR (0x0d)
class Inout;
class E2floppy;
class Scheduler;
class Command : public IoDevice, public BObserved
{
// Internal registers
protected:
Inout &inout;
Scheduler &scheduler;
E2floppy &fdc;
char command[MAX_COMMAND];
Word command_index;
Word answer_index;
std::string answer;
// private interface:
private:
void skip_token(char **);
const char *next_token(char **, int *);
const char *modify_command_token(char *p);
// public interface
public:
void resetIo() override;
Byte readIo(Word offset) override;
void writeIo(Word offset, Byte val) override;
const char *getName() override
{
return "command";
};
Word sizeOfIo() override
{
return 1;
}
public:
Command(
Inout &x_inout,
Scheduler &x_scheduler,
E2floppy &x_fdc);
virtual ~Command();
};
#endif // COMMAND_INCLUDED
|
// Aseprite UI Library
// Copyright (C) 2001-2014 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef UI_MOVE_REGION_H_INCLUDED
#define UI_MOVE_REGION_H_INCLUDED
#pragma once
#include "gfx/region.h"
namespace ui { // TODO all these functions are deprecated and must be replaced by Graphics methods.
void move_region(const gfx::Region& region, int dx, int dy);
} // namespace ui
#endif
|
/* $Id: newgrf_widget.h 23932 2012-02-12 10:32:41Z rubidium $ */
/*
* This file is part of OpenTTD.
* OpenTTD 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.
* OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file newgrf_widget.h Types related to the newgrf widgets. */
#ifndef WIDGETS_NEWGRF_WIDGET_H
#define WIDGETS_NEWGRF_WIDGET_H
#include "../newgrf_config.h"
#include "../textfile_type.h"
/** Widgets of the #NewGRFParametersWindow class. */
enum NewGRFParametersWidgets {
WID_NP_SHOW_NUMPAR, ///< #NWID_SELECTION to optionally display #WID_NP_NUMPAR.
WID_NP_NUMPAR_DEC, ///< Button to decrease number of parameters.
WID_NP_NUMPAR_INC, ///< Button to increase number of parameters.
WID_NP_NUMPAR, ///< Optional number of parameters.
WID_NP_NUMPAR_TEXT, ///< Text description.
WID_NP_BACKGROUND, ///< Panel to draw the settings on.
WID_NP_SCROLLBAR, ///< Scrollbar to scroll through all settings.
WID_NP_ACCEPT, ///< Accept button.
WID_NP_RESET, ///< Reset button.
WID_NP_SHOW_DESCRIPTION, ///< #NWID_SELECTION to optionally display parameter descriptions.
WID_NP_DESCRIPTION, ///< Multi-line description of a parameter.
};
/** Widgets of the #NewGRFWindow class. */
enum NewGRFStateWidgets {
WID_NS_PRESET_LIST, ///< Active NewGRF preset.
WID_NS_PRESET_SAVE, ///< Save list of active NewGRFs as presets.
WID_NS_PRESET_DELETE, ///< Delete active preset.
WID_NS_ADD, ///< Add NewGRF to active list.
WID_NS_REMOVE, ///< Remove NewGRF from active list.
WID_NS_MOVE_UP, ///< Move NewGRF up in active list.
WID_NS_MOVE_DOWN, ///< Move NewGRF down in active list.
WID_NS_UPGRADE, ///< Upgrade NewGRFs that have a newer version available.
WID_NS_FILTER, ///< Filter list of available NewGRFs.
WID_NS_FILE_LIST, ///< List window of active NewGRFs.
WID_NS_SCROLLBAR, ///< Scrollbar for active NewGRF list.
WID_NS_AVAIL_LIST, ///< List window of available NewGRFs.
WID_NS_SCROLL2BAR, ///< Scrollbar for available NewGRF list.
WID_NS_NEWGRF_INFO_TITLE, ///< Title for Info on selected NewGRF.
WID_NS_NEWGRF_INFO, ///< Panel for Info on selected NewGRF.
WID_NS_OPEN_URL, ///< Open URL of NewGRF.
WID_NS_NEWGRF_TEXTFILE, ///< Open NewGRF readme, changelog (+1) or license (+2).
WID_NS_SET_PARAMETERS = WID_NS_NEWGRF_TEXTFILE + TFT_END, ///< Open Parameters Window for selected NewGRF for editing parameters.
WID_NS_VIEW_PARAMETERS, ///< Open Parameters Window for selected NewGRF for viewing parameters.
WID_NS_TOGGLE_PALETTE, ///< Toggle Palette of selected, active NewGRF.
WID_NS_APPLY_CHANGES, ///< Apply changes to NewGRF config.
WID_NS_RESCAN_FILES, ///< Rescan files (available NewGRFs).
WID_NS_RESCAN_FILES2, ///< Rescan files (active NewGRFs).
WID_NS_CONTENT_DOWNLOAD, ///< Open content download (available NewGRFs).
WID_NS_CONTENT_DOWNLOAD2, ///< Open content download (active NewGRFs).
WID_NS_SHOW_REMOVE, ///< Select active list buttons (0 = normal, 1 = simple layout).
WID_NS_SHOW_APPLY, ///< Select display of the buttons below the 'details'.
};
/** Widgets of the #SavePresetWindow class. */
enum SavePresetWidgets {
WID_SVP_PRESET_LIST, ///< List with available preset names.
WID_SVP_SCROLLBAR, ///< Scrollbar for the list available preset names.
WID_SVP_EDITBOX, ///< Edit box for changing the preset name.
WID_SVP_CANCEL, ///< Button to cancel saving the preset.
WID_SVP_SAVE, ///< Button to save the preset.
};
/** Widgets of the #ScanProgressWindow class. */
enum ScanProgressWidgets {
WID_SP_PROGRESS_BAR, ///< Simple progress bar.
WID_SP_PROGRESS_TEXT, ///< Text explaining what is happening.
};
#endif /* WIDGETS_NEWGRF_WIDGET_H */
|
/*
* Copyright (C) 2010 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v.2.1.
*
* You should have received a copy of the GNU Lesser 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 "lib.h"
#include "log.h"
#include "lvm2cmd.h"
#include "errors.h"
#include "libdevmapper-event.h"
#include "dmeventd_lvm.h"
#include <pthread.h>
#include <syslog.h>
extern int dmeventd_debug;
/*
* register_device() is called first and performs initialisation.
* Only one device may be registered or unregistered at a time.
*/
static pthread_mutex_t _register_mutex = PTHREAD_MUTEX_INITIALIZER;
/*
* Number of active registrations.
*/
static int _register_count = 0;
static struct dm_pool *_mem_pool = NULL;
static void *_lvm_handle = NULL;
/*
* Currently only one event can be processed at a time.
*/
static pthread_mutex_t _event_mutex = PTHREAD_MUTEX_INITIALIZER;
/*
* FIXME Do not pass things directly to syslog, rather use the existing logging
* facilities to sort logging ... however that mechanism needs to be somehow
* configurable and we don't have that option yet
*/
static void _temporary_log_fn(int level,
const char *file __attribute__((unused)),
int line __attribute__((unused)),
int dm_errno __attribute__((unused)),
const char *message)
{
level &= ~(_LOG_STDERR | _LOG_ONCE);
switch (level) {
case _LOG_DEBUG:
if (dmeventd_debug >= 3)
syslog(LOG_DEBUG, "%s", message);
break;
case _LOG_INFO:
if (dmeventd_debug >= 2)
syslog(LOG_INFO, "%s", message);
break;
case _LOG_NOTICE:
if (dmeventd_debug >= 1)
syslog(LOG_NOTICE, "%s", message);
break;
case _LOG_WARN:
syslog(LOG_WARNING, "%s", message);
break;
case _LOG_ERR:
syslog(LOG_ERR, "%s", message);
break;
default:
syslog(LOG_CRIT, "%s", message);
}
}
void dmeventd_lvm2_lock(void)
{
pthread_mutex_lock(&_event_mutex);
}
void dmeventd_lvm2_unlock(void)
{
pthread_mutex_unlock(&_event_mutex);
}
int dmeventd_lvm2_init(void)
{
int r = 0;
pthread_mutex_lock(&_register_mutex);
/*
* Need some space for allocations. 1024 should be more
* than enough for what we need (device mapper name splitting)
*/
if (!_mem_pool && !(_mem_pool = dm_pool_create("mirror_dso", 1024)))
goto out;
if (!_lvm_handle) {
lvm2_log_fn(_temporary_log_fn);
if (!(_lvm_handle = lvm2_init())) {
dm_pool_destroy(_mem_pool);
_mem_pool = NULL;
goto out;
}
lvm2_disable_dmeventd_monitoring(_lvm_handle);
/* FIXME Temporary: move to dmeventd core */
lvm2_run(_lvm_handle, "_memlock_inc");
}
_register_count++;
r = 1;
out:
pthread_mutex_unlock(&_register_mutex);
return r;
}
void dmeventd_lvm2_exit(void)
{
pthread_mutex_lock(&_register_mutex);
if (!--_register_count) {
lvm2_run(_lvm_handle, "_memlock_dec");
dm_pool_destroy(_mem_pool);
_mem_pool = NULL;
lvm2_exit(_lvm_handle);
_lvm_handle = NULL;
}
pthread_mutex_unlock(&_register_mutex);
}
struct dm_pool *dmeventd_lvm2_pool(void)
{
return _mem_pool;
}
int dmeventd_lvm2_run(const char *cmdline)
{
return lvm2_run(_lvm_handle, cmdline);
}
int dmeventd_lvm2_command(struct dm_pool *mem, char *buffer, size_t size,
const char *cmd, const char *device)
{
char *vg = NULL, *lv = NULL, *layer;
int r;
if (!dm_split_lvm_name(mem, device, &vg, &lv, &layer)) {
syslog(LOG_ERR, "Unable to determine VG name from %s.\n",
device);
return 0;
}
/* strip off the mirror component designations */
layer = strstr(lv, "_mlog");
if (layer)
*layer = '\0';
r = dm_snprintf(buffer, size, "%s %s/%s", cmd, vg, lv);
dm_pool_free(mem, vg);
if (r < 0) {
syslog(LOG_ERR, "Unable to form LVM command. (too long).\n");
return 0;
}
return 1;
}
|
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __INCLUDE_BBU_H
#define __INCLUDE_BBU_H
#include <asm-generic/errno.h>
#include <linux/list.h>
#include <linux/types.h>
#include <filetype.h>
struct bbu_data {
#define BBU_FLAG_FORCE (1 << 0)
#define BBU_FLAG_YES (1 << 1)
unsigned long flags;
int force;
const void *image;
const char *imagefile;
const char *devicefile;
size_t len;
const char *handler_name;
const struct imd_header *imd_data;
};
struct bbu_handler {
int (*handler)(struct bbu_handler *, struct bbu_data *);
const char *name;
struct list_head list;
#define BBU_HANDLER_FLAG_DEFAULT (1 << 0)
#define BBU_HANDLER_CAN_REFRESH (1 << 1)
/*
* The lower 16bit are generic flags, the upper 16bit are reserved
* for handler specific flags.
*/
unsigned long flags;
/* default device file, can be overwritten on the command line */
const char *devicefile;
};
int bbu_force(struct bbu_data *, const char *fmt, ...)
__attribute__ ((format(__printf__, 2, 3)));
int bbu_confirm(struct bbu_data *);
int barebox_update(struct bbu_data *, struct bbu_handler *);
struct bbu_handler *bbu_find_handler_by_name(const char *name);
struct bbu_handler *bbu_find_handler_by_device(const char *devicepath);
void bbu_handlers_list(void);
int bbu_handlers_iterate(int (*fn)(struct bbu_handler *, void *), void *);
#ifdef CONFIG_BAREBOX_UPDATE
int bbu_register_handler(struct bbu_handler *);
int bbu_register_std_file_update(const char *name, unsigned long flags,
const char *devicefile, enum filetype imagetype);
#else
static inline int bbu_register_handler(struct bbu_handler *unused)
{
return -EINVAL;
}
static inline int bbu_register_std_file_update(const char *name, unsigned long flags,
const char *devicefile, enum filetype imagetype)
{
return -ENOSYS;
}
#endif
#if defined(CONFIG_BAREBOX_UPDATE_IMX_NAND_FCB)
int imx6_bbu_nand_register_handler(const char *name, unsigned long flags);
int imx28_bbu_nand_register_handler(const char *name, unsigned long flags);
#else
static inline int imx6_bbu_nand_register_handler(const char *name, unsigned long flags)
{
return -ENOSYS;
}
static inline int imx28_bbu_nand_register_handler(const char *name, unsigned long flags)
{
return -ENOSYS;
}
#endif
#endif /* __INCLUDE_BBU_H */
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, 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 PAIR_CLASS
PairStyle(zbl/gpu,PairZBLGPU)
#else
#ifndef LMP_PAIR_ZBL_GPU_H
#define LMP_PAIR_ZBL_GPU_H
#include "pair_zbl.h"
namespace LAMMPS_NS {
class PairZBLGPU : public PairZBL {
public:
PairZBLGPU(LAMMPS *lmp);
~PairZBLGPU();
void cpu_compute(int, int, int, int, int *, int *, int **);
void compute(int, int);
void init_style();
double memory_usage();
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
private:
int gpu_mode;
double cpu_time;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Insufficient memory on accelerator
There is insufficient memory on one of the devices specified for the gpu
package
E: Cannot use newton pair with zbl/gpu pair style
Self-explanatory.
*/
|
/*
memsrc.h
flexemu, an MC6809 emulator running FLEX
Copyright (C) 2018-2022 W. Schwotzer
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
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef MEMSRC_INCLUDED
#define MEMSRC_INCLUDED
#include "typedefs.h"
#include "bintervl.h"
#include <vector>
template<class T>
class MemorySource
{
public:
using AddressRange = BInterval<T>;
using AddressRanges = std::vector<AddressRange>;
virtual const AddressRanges& GetAddressRanges() const = 0;
virtual void CopyTo(Byte *buffer, T address, T aSize) const = 0;
};
#endif
|
/*
* Copyright (C) 2006-Today Guy Deleeuw
*
* See the LICENSE file for terms of use.
*/
#ifndef WsModEditorUploader_H__
#define WsModEditorUploader_H__ 1
#include <Wt/WContainerWidget>
#include <Wt/WFileUpload>
#include <Wt/WProgressBar>
#include <WsModule/WsModule.h>
using namespace Wt;
/*!
\file WsModEditorUploader.h
\brief a wittyShare module
*/
class WsEditorUploader : public Wt::WContainerWidget, public WsOptions {
public :
/*! \brief CTor. */
WsEditorUploader(Wt::WContainerWidget* parent = 0);
~WsEditorUploader();
void load();
public slots :
void doUpload();
void doFileTooLarge(int64_t nSize);
void doUploaded();
private :
Wt::WFileUpload* m_pFU;
Wt::WText* m_label;
Wt::WText* m_destPath;
Wt::WPushButton* m_uploadOther;
};
class WsModEditorUploader : public WsModule {
public :
/*! \brief CTor. */
WsModEditorUploader();
~WsModEditorUploader();
Wt::WWidget* createContentsMenuBar(Wt::WContainerWidget* parent = 0) const;
Wt::WWidget* createContents(Wt::WContainerWidget* parent = 0) const;
WsEditorWidget* createEditor(Wt::WContainerWidget* parent = 0) const;
Wt::WWidget* createAdmin(Wt::WContainerWidget* parent = 0) const;
std::string description() const;
};
extern "C" {
// http://phoxis.org/2011/04/27/c-language-constructors-and-destructors-with-gcc/
void WsModEditorUploaderInit(void) __attribute__((constructor));
WsModEditorUploader* buildModule()
{
return new WsModEditorUploader();
}
}
#endif // ifndef WsModEditorUploader_H__
|
/*
* QEMU coroutine sleep
*
* Copyright IBM, Corp. 2011
*
* Authors:
* Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2 or later.
* See the COPYING.LIB file in the top-level directory.
*
*/
#include "block/coroutine.h"
#include "qemu/timer.h"
typedef struct CoSleepCB {
QEMUTimer *ts;
Coroutine *co;
} CoSleepCB;
static void co_sleep_cb(void *opaque)
{
CoSleepCB *sleep_cb = opaque;
qemu_coroutine_enter(sleep_cb->co, NULL);
}
void coroutine_fn co_sleep_ns(QEMUClock *clock, int64_t ns)
{
CoSleepCB sleep_cb = {
.co = qemu_coroutine_self(),
};
sleep_cb.ts = qemu_new_timer(clock, SCALE_NS, co_sleep_cb, &sleep_cb);
qemu_mod_timer(sleep_cb.ts, qemu_get_clock_ns(clock) + ns);
qemu_coroutine_yield();
qemu_del_timer(sleep_cb.ts);
qemu_free_timer(sleep_cb.ts);
}
|
//-----------------------------------------------------------------------------
//
// $Id: CudaUtils.h 874 2014-09-08 02:21:29Z weegreenblobbie $
//
// Nsound is a C++ library and Python module for audio synthesis featuring
// dynamic digital filters. Nsound lets you easily shape waveforms and write
// to disk or plot them. Nsound aims to be as powerful as Csound but easy to
// use.
//
// Copyright (c) 2008 to Present Nick Hilton
//
// weegreenblobbie2_gmail_com (replace '_' with '@' and '.')
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
// 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 Library General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//-----------------------------------------------------------------------------
#ifndef _NSOUND_CUDA_UTILS_H_
#define _NSOUND_CUDA_UTILS_H_
namespace Nsound
{
//-----------------------------------------------------------------------------
// Magic macro to check for cuda errors.
#define checkForCudaError() \
{ \
cudaError_t ecode = cudaGetLastError(); \
if(ecode) \
{ \
printf("%s:%3d: Error: %s\n", \
__FILE__, \
__LINE__, \
cudaGetErrorString(ecode)); \
} \
}
struct Context
{
enum State
{
BOOTING_ = 1,
INITALIZED_ = 10,
UNLOADED_ = 20,
ERROR_ = 30,
};
static State state_;
//! Initialize the card once.
void
init(int flags = 0);
};
} // namespace
#endif
// :mode=c++: jEdit modeline
|
/* header file for bd-imp.c --
* test code for bd-imp.c
* Copyright (C) 2007 Kengo Ichiki <kichiki@users.sourceforge.net>
* $Id: check-bd-imp.h,v 1.1 2007/12/12 06:31:52 kichiki Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _CHECK_BD_IMP_H_
#define _CHECK_BD_IMP_H_
int
check_BD_evolve_JGdP00 (int version, int flag_lub, int flag_mat,
int flag_Q, double dt,
int verbose, double tiny);
int
check_BD_imp_ode_evolve (int version, int flag_lub, int flag_mat,
int flag_Q, double dt, double t_out,
int verbose, double tiny);
#endif /* !_CHECK_BD_IMP_H_ */
|
/*
* Author: MontaVista Software, Inc. <source@mvista.com>
*
* 2007 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/init.h>
#include <linux/mvl_patch.h>
static __init int regpatch(void)
{
return mvl_register_patch(279);
}
module_init(regpatch);
|
/*
* ALSA Patch Bay
*
* Copyright (C) 2002 Robert Ham (node@users.sourceforge.net)
*
* You have permission to use this file under the GNU General
* Public License, version 2 or later. See the file COPYING
* for the full text.
*
*/
#ifndef __APB_ALSA_DRIVER_H__
#define __APB_ALSA_DRIVER_H__
#include <list>
#include <string>
#include <iostream>
#include <alsa/asoundlib.h>
#include <pthread.h>
#include "apb.h"
#include "driver.h"
#include "subscription.h"
#include "addr.h"
#include "alsa-addr.h"
namespace APB {
namespace Alsa {
class Driver : public APB::Driver {
private:
snd_seq_t * _seq;
std::list<APB::Addr *> _readPorts;
std::list<APB::Addr *> _writePorts;
std::list<APB::Subscription *> _subscriptions;
std::string _title;
void refreshPorts (std::list<APB::Addr *>&, unsigned int);
void doPortSubscription (snd_seq_port_subscribe_t *,
const APB::Addr *,
const APB::Addr *);
void doPortUnsubscription (snd_seq_port_subscribe_t *,
const APB::Addr *,
const APB::Addr *);
int createListenPort ();
void sendRefresh ();
void getEvent ();
pthread_t _listenThread;
public:
Driver (const std::string&, int *, char ***);
virtual ~Driver () {
}
virtual std::string findClientName (const APB::Addr *) const;
virtual std::string findPortName (const APB::Addr *) const;
virtual const std::list<APB::Addr *>& getReadPorts ();
virtual const std::list<APB::Addr *>& getWritePorts ();
virtual const std::list<const APB::Subscription *>& getSubscriptions ();
virtual void refreshPorts ();
virtual void refreshSubscriptions ();
virtual void subscribePorts (const APB::Addr *, const APB::Addr *);
virtual void subscribeClients (const APB::Addr *, const APB::Addr *);
virtual void removeSubscription (const Subscription *);
static void * refreshMain (void *);
void refreshIMain (void);
};
} /* namespace Alsa */
} /* namespace APB */
#endif /* __APB_ALSA_DRIVER_H__ */
|
/*****************************************************************************
* *
* File: espi.h *
* $Revision: #1 $ *
* $Date: 2012/09/27 $ *
* Description: *
* part of the Chelsio 10Gb Ethernet Driver. *
* *
* 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. *
* *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
* *
* http://www.chelsio.com *
* *
* Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
* All rights reserved. *
* *
* Maintainers: maintainers@chelsio.com *
* *
* Authors: Dimitrios Michailidis <dm@chelsio.com> *
* Tina Yang <tainay@chelsio.com> *
* Felix Marti <felix@chelsio.com> *
* Scott Bardone <sbardone@chelsio.com> *
* Kurt Ottaway <kottaway@chelsio.com> *
* Frank DiMambro <frank@chelsio.com> *
* *
* History: *
* *
****************************************************************************/
#ifndef _CXGB_ESPI_H_
#define _CXGB_ESPI_H_
#include "common.h"
struct espi_intr_counts {
unsigned int DIP4_err;
unsigned int rx_drops;
unsigned int tx_drops;
unsigned int rx_ovflw;
unsigned int parity_err;
unsigned int DIP2_parity_err;
};
struct peespi;
struct peespi *t1_espi_create(adapter_t *adapter);
void t1_espi_destroy(struct peespi *espi);
int t1_espi_init(struct peespi *espi, int mac_type, int nports);
void t1_espi_intr_enable(struct peespi *);
void t1_espi_intr_clear(struct peespi *);
void t1_espi_intr_disable(struct peespi *);
int t1_espi_intr_handler(struct peespi *);
const struct espi_intr_counts *t1_espi_get_intr_counts(struct peespi *espi);
u32 t1_espi_get_mon(adapter_t *adapter, u32 addr, u8 wait);
int t1_espi_get_mon_t204(adapter_t *, u32 *, u8);
#endif /* _CXGB_ESPI_H_ */
|
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:41 2014 */
/* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/scsi/dh/emc.h */
|
/* Test that stack overflow and SIGSEGV are correctly distinguished.
Copyright (C) 2002-2006, 2008 Bruno Haible <bruno@clisp.org>
Copyright (C) 2010 Eric Blake <eblake@redhat.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, 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 _MSC_VER
# include <config.h>
#endif
#include "sigsegv.h"
#include <stdio.h>
#include <limits.h>
#if HAVE_STACK_OVERFLOW_RECOVERY && HAVE_SIGSEGV_RECOVERY
#if defined _WIN32 && !defined __CYGWIN__
/* Windows doesn't have sigset_t. */
typedef int sigset_t;
# define sigemptyset(set)
# define sigprocmask(how,set,oldset)
#endif
#include "mmaputil.h"
#include <stddef.h> /* needed for NULL on SunOS4 */
#include <stdlib.h> /* for abort, exit */
#include <signal.h>
#include <setjmp.h>
#if HAVE_SETRLIMIT
# include <sys/types.h>
# include <sys/time.h>
# include <sys/resource.h>
#endif
#include "altstack.h"
jmp_buf mainloop;
sigset_t mainsigset;
volatile int pass = 0;
unsigned long page;
static void
stackoverflow_handler_continuation (void *arg1, void *arg2, void *arg3)
{
int arg = (int) (long) arg1;
longjmp (mainloop, arg);
}
void
stackoverflow_handler (int emergency, stackoverflow_context_t scp)
{
pass++;
if (pass <= 2)
printf ("Stack overflow %d caught.\n", pass);
else
{
printf ("Segmentation violation misdetected as stack overflow.\n");
exit (1);
}
sigprocmask (SIG_SETMASK, &mainsigset, NULL);
sigsegv_leave_handler (stackoverflow_handler_continuation,
(void *) (long) (emergency ? -1 : pass), NULL, NULL);
}
int
sigsegv_handler (void *address, int emergency)
{
/* This test is necessary to distinguish stack overflow and SIGSEGV. */
if (!emergency)
return 0;
pass++;
if (pass <= 2)
{
printf ("Stack overflow %d missed.\n", pass);
exit (1);
}
else
printf ("Segmentation violation correctly detected.\n");
sigprocmask (SIG_SETMASK, &mainsigset, NULL);
return sigsegv_leave_handler (stackoverflow_handler_continuation,
(void *) (long) pass, NULL, NULL);
}
volatile int *
recurse_1 (int n, volatile int *p)
{
if (n < INT_MAX)
*recurse_1 (n + 1, p) += n;
return p;
}
int
recurse (volatile int n)
{
return *recurse_1 (n, &n);
}
int
main ()
{
int prot_unwritable;
void *p;
sigset_t emptyset;
#if HAVE_SETRLIMIT && defined RLIMIT_STACK
/* Before starting the endless recursion, try to be friendly to the user's
machine. On some Linux 2.2.x systems, there is no stack limit for user
processes at all. We don't want to kill such systems. */
struct rlimit rl;
rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
setrlimit (RLIMIT_STACK, &rl);
#endif
/* Prepare the storage for the alternate stack. */
prepare_alternate_stack ();
/* Install the stack overflow handler. */
if (stackoverflow_install_handler (&stackoverflow_handler,
mystack, SIGSTKSZ)
< 0)
exit (2);
/* Preparations. */
#if !HAVE_MMAP_ANON && !HAVE_MMAP_ANONYMOUS && HAVE_MMAP_DEVZERO
zero_fd = open ("/dev/zero", O_RDONLY, 0644);
#endif
#if defined __linux__ && defined __sparc__
/* On Linux 2.6.26/SPARC64, PROT_READ has the same effect as
PROT_READ | PROT_WRITE. */
prot_unwritable = PROT_NONE;
#else
prot_unwritable = PROT_READ;
#endif
/* Setup some mmaped memory. */
p = mmap_zeromap ((void *) 0x12340000, 0x4000);
if (p == (void *)(-1))
{
fprintf (stderr, "mmap_zeromap failed.\n");
exit (2);
}
page = (unsigned long) p;
/* Make it read-only. */
if (mprotect ((void *) page, 0x4000, prot_unwritable) < 0)
{
fprintf (stderr, "mprotect failed.\n");
exit (2);
}
/* Install the SIGSEGV handler. */
if (sigsegv_install_handler (&sigsegv_handler) < 0)
exit (2);
/* Save the current signal mask. */
sigemptyset (&emptyset);
sigprocmask (SIG_BLOCK, &emptyset, &mainsigset);
/* Provoke two stack overflows in a row. */
switch (setjmp (mainloop))
{
case -1:
printf ("emergency exit\n"); exit (1);
case 0: case 1:
printf ("Starting recursion pass %d.\n", pass + 1);
recurse (0);
printf ("no endless recursion?!\n"); exit (1);
case 2:
*(volatile int *) (page + 0x678) = 42;
break;
case 3:
*(volatile int *) 0 = 42;
break;
case 4:
break;
default:
abort ();
}
/* Validate that the alternate stack did not overflow. */
check_alternate_stack_no_overflow ();
printf ("Test passed.\n");
exit (0);
}
#else
int
main ()
{
return 77;
}
#endif
|
/*
* platform_mt9m114.c: mt9m114 platform data initilization file
*
* (C) Copyright 2008 Intel Corporation
* Author:
*
* 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.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/delay.h>
#include <linux/atomisp_platform.h>
#include <asm/intel-mid.h>
#include <asm/intel_scu_ipcutil.h>
#include <media/v4l2-subdev.h>
#include "platform_camera.h"
#include "platform_mt9m114.h"
#include "platform_mt9e013.h"
int mt9m114_camera_reset;
int mt9m114_camera_power_down;
/*
* MFLD PR2 secondary camera sensor - MT9M114 platform data
*/
static int mt9m114_gpio_ctrl(struct v4l2_subdev *sd, int flag)
{
int ret;
if (mt9m114_camera_reset < 0) {
ret = camera_sensor_gpio(-1, GP_CAMERA_1_RESET,
GPIOF_DIR_OUT, 1);
if (ret < 0)
return ret;
mt9m114_camera_reset = ret;
}
if (flag) {
#ifdef CONFIG_BOARD_CTP
gpio_set_value(mt9m114_camera_reset, 0);
msleep(60);
#endif
gpio_set_value(mt9m114_camera_reset, 1);
} else
gpio_set_value(mt9m114_camera_reset, 0);
return 0;
}
static int mt9m114_flisclk_ctrl(struct v4l2_subdev *sd, int flag)
{
static const unsigned int clock_khz = 19200;
return intel_scu_ipc_osc_clk(OSC_CLK_CAM1, flag ? clock_khz : 0);
}
static int mt9m114_power_ctrl(struct v4l2_subdev *sd, int flag)
{
#ifndef CONFIG_BOARD_CTP
int ret;
/* Note here, there maybe a workaround to avoid I2C SDA issue */
if (mt9m114_camera_power_down < 0) {
ret = camera_sensor_gpio(-1, GP_CAMERA_1_POWER_DOWN,
GPIOF_DIR_OUT, 1);
#ifndef CONFIG_BOARD_REDRIDGE
if (ret < 0)
return ret;
#endif
mt9m114_camera_power_down = ret;
}
if (mt9m114_camera_reset < 0) {
ret = camera_sensor_gpio(-1, GP_CAMERA_1_RESET,
GPIOF_DIR_OUT, 1);
if (ret < 0)
return ret;
mt9m114_camera_reset = ret;
}
#endif
if (flag) {
#ifndef CONFIG_BOARD_CTP
if (!mt9e013_reset_value) {
if (mt9e013_reset)
mt9e013_reset(sd);
mt9e013_reset_value = 1;
}
#ifdef CONFIG_BOARD_REDRIDGE
gpio_direction_output(mt9m114_camera_reset, 0);
#endif
gpio_set_value(mt9m114_camera_reset, 0);
#endif
if (!mt9e013_camera_vprog1_on) {
mt9e013_camera_vprog1_on = 1;
intel_scu_ipc_msic_vprog1(1);
}
#ifndef CONFIG_BOARD_CTP
#ifdef CONFIG_BOARD_REDRIDGE
if (mt9m114_camera_power_down >= 0)
gpio_set_value(mt9m114_camera_power_down, 1);
#else
gpio_set_value(mt9m114_camera_power_down, 1);
#endif
#endif
} else {
if (mt9e013_camera_vprog1_on) {
mt9e013_camera_vprog1_on = 0;
intel_scu_ipc_msic_vprog1(0);
}
#ifndef CONFIG_BOARD_CTP
#ifdef CONFIG_BOARD_REDRIDGE
if (mt9m114_camera_power_down >= 0)
gpio_set_value(mt9m114_camera_power_down, 0);
#else
gpio_set_value(mt9m114_camera_power_down, 0);
#endif
mt9e013_reset_value = 0;
#endif
}
return 0;
}
static int mt9m114_csi_configure(struct v4l2_subdev *sd, int flag)
{
/* soc sensor, there is no raw bayer order (set to -1) */
return camera_sensor_csi(sd, ATOMISP_CAMERA_PORT_SECONDARY, 1,
ATOMISP_INPUT_FORMAT_YUV422_8, -1,
false, /*SOF */
flag);
}
static struct camera_sensor_platform_data mt9m114_sensor_platform_data = {
.gpio_ctrl = mt9m114_gpio_ctrl,
.flisclk_ctrl = mt9m114_flisclk_ctrl,
.power_ctrl = mt9m114_power_ctrl,
.csi_cfg = mt9m114_csi_configure,
};
void *mt9m114_platform_data(void *info)
{
mt9m114_camera_reset = -1;
mt9m114_camera_power_down = -1;
return &mt9m114_sensor_platform_data;
}
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef __GDM_SERVER_H
#define __GDM_SERVER_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GDM_TYPE_SERVER (gdm_server_get_type ())
#define GDM_SERVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_SERVER, GdmServer))
#define GDM_SERVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_SERVER, GdmServerClass))
#define GDM_IS_SERVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_SERVER))
#define GDM_IS_SERVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_SERVER))
#define GDM_SERVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_SERVER, GdmServerClass))
typedef struct GdmServerPrivate GdmServerPrivate;
typedef struct
{
GObject parent;
GdmServerPrivate *priv;
} GdmServer;
typedef struct
{
GObjectClass parent_class;
void (* ready) (GdmServer *server);
void (* exited) (GdmServer *server,
int exit_code);
void (* died) (GdmServer *server,
int signal_number);
} GdmServerClass;
GType gdm_server_get_type (void);
GdmServer * gdm_server_new (const char *display_id,
const char *auth_file);
gboolean gdm_server_start (GdmServer *server);
gboolean gdm_server_stop (GdmServer *server);
char * gdm_server_get_display_device (GdmServer *server);
G_END_DECLS
#endif /* __GDM_SERVER_H */
|
/*
* i-scream libstatgrab
* http://www.i-scream.org
* Copyright (C) 2000-2013 i-scream
* Copyright (C) 2010-2013 Jens Rehsack
*
* 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.
*
* $Id$
*/
#include <stdio.h>
#include <statgrab.h>
#include <stdlib.h>
#include <unistd.h>
#include "helpers.h"
int main(int argc, char **argv){
size_t nusers, x;
sg_user_stats *users;
#if 0
int c;
int delay = 1;
while ((c = getopt(argc, argv, "d:")) != -1){
switch (c){
case 'd':
delay = atoi(optarg);
break;
}
}
#endif
/* Initialise helper - e.g. logging, if any */
sg_log_init("libstatgrab-examples", "SGEXAMPLES_LOG_PROPERTIES", argc ? argv[0] : NULL);
/* Initialise statgrab */
sg_init(1);
/* Drop setuid/setgid privileges. */
if (sg_drop_privileges() != SG_ERROR_NONE)
sg_die("Error. Failed to drop privileges", 1);
users = sg_get_user_stats(&nusers);
if( users == NULL )
sg_die("Failed to get logged on users", 1);
printf( "%16s %16s %24s %8s %24s\n", "login name", "device", "hostname", "pid", "login time" );
for( x = 0; x < nusers; ++x ) {
char ltbuf[256];
struct tm *tm;
tm = localtime(&users[x].login_time);
strftime(ltbuf, sizeof(ltbuf), "%c", tm);
printf( "%16s %16s %24s %8d %24s\n", users[x].login_name, users[x].device, users[x].hostname, (int) users[x].pid, ltbuf );
}
exit(0);
}
|
#include <kernel.h>
#include <version.h>
#include <tape.h>
#include <kdata.h>
#include <devlpr.h>
#include <printf.h>
#include <devstringy.h>
/*
* Stringy tape wrapper. Note that the asm code uses the ROM which
* also uses some values in 0x40xx (40B1 and 401A in particular)
*/
static uint8_t fileid = 1;
static uint8_t mode;
static uint8_t inpos = 0; /* in position */
static uint8_t inio = 0;
static uint8_t curtape = 255;
static int busy = 0;
uint8_t tape_err;
static int tape_error(void)
{
uint8_t a = tape_err;
tape_err = 0;
/* EOF on read */
if (a & 0x80)
return 0;
/* Write protected */
if (a & 0x01)
udata.u_error = EROFS;
/* BREAK */
if (a & 0x02)
udata.u_error = EINTR;
/* End of tape while writing */
else if (a & 0x04)
udata.u_error = ENOSPC;
/* Buffer too small (read) */
else if (a & 0x20)
udata.u_error = EINVAL; /* Not a good error for this really */
else
udata.u_error = EIO;
kprintf("tape: error %x\n", a);
inpos = inio = 0;
return -1;
}
static int tape_rewind(void)
{
if (!tape_op(0, TAPE_REWIND)) {
/* rewind */
fileid = 1;
inpos = 0;
return 0;
}
return tape_error();
}
int tape_open(uint8_t minor, uint16_t flag)
{
minor; flag;
uint8_t unit;
/* Check for the floppy tape ROM */
if (*((uint16_t *)0x3034) != 0x3C3C) {
udata.u_error = ENODEV;
return -1;
}
if (busy) {
udata.u_error = EBUSY;
return -1;
}
unit = minor & 7;
if (unit != curtape && tape_op(unit, TAPE_SELECT)) {
udata.u_error = ENODEV;
return -1;
}
/* Can't open for mixed read/write at the same time */
if (O_ACCMODE(flag) == O_RDWR) {
udata.u_error = EINVAL;
return -1;
}
mode = O_ACCMODE(flag);
if (minor & 0x08)
if (tape_rewind())
return -1;
/* Only one drive can be used at a time */
busy = 1;
if (unit != curtape) {
inio = 0;
tape_err = 0;
fileid = 1;
curtape = unit;
}
return 0;
}
int tape_close(uint8_t minor)
{
minor;
busy = 0;
inio = 0;
inpos = 0;
if (mode == O_WRONLY)
if (tape_op(fileid, TAPE_CLOSEW))
return tape_error();
if (fileid < 99)
fileid++;
return 0;
}
static int tape_rw(uint8_t op)
{
uint8_t pos = fileid;
if (!inpos) {
if (tape_op(pos, TAPE_FIND) == 0)
inpos = 1;
else
return tape_error();
}
inio = 1;
udata.u_done = tape_op(fileid, op);
if (tape_err)
return tape_error();
return udata.u_done;
}
int tape_read(uint8_t minor, uint8_t rawflag, uint8_t flag)
{
used(minor);
used(rawflag);
used(flag);
return tape_rw(TAPE_READ);
}
int tape_write(uint8_t minor, uint8_t rawflag, uint8_t flag)
{
used(minor);
used(rawflag);
used(flag);
return tape_rw(TAPE_WRITE);
}
static struct mtstatus tapei = {
MT_TYPE_EXATRON,
0,
~0UL
};
int tape_ioctl(uint8_t minor, uarg_t op, char *ptr)
{
used(minor);
switch(op) {
case MTSTATUS:
if (inpos)
tapei.mt_file = fileid;
else
tapei.mt_file = 0xFFFF;
return uput(&tapei, ptr, sizeof(tapei));
}
/* Now calls we can only make when not mid stream */
if (mode || inio)
goto bad;
switch (op) {
case MTREWIND:
return tape_rewind();
case MTSEEKF:
if (fileid > 99)
goto bad;
fileid++;
if (tape_op(fileid, TAPE_FIND))
goto bad;
inpos = 1;
return 0;
case MTSEEKB:
if (fileid < 2)
goto bad;
fileid--;
if (tape_op(fileid, TAPE_FIND))
goto bad;
inpos = 1;
return 0;
case MTERASE:
/* Erase from this point to the end of tape */
if (fileid > 99)
goto bad;
if (tape_op(fileid, TAPE_ERASE))
goto bad;
inpos = 0;
return 0;
default:
return -1;
}
bad:
udata.u_error = EINVAL;
return -1;
}
void tape_init(void)
{
*(uint16_t*)0x40b1 = 0x4000; /* Somewhere to put the tape variables */
}
|
// Copyright (c) 2011 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 PRINTING_PAGE_SETUP_H_
#define PRINTING_PAGE_SETUP_H_
#include "printing/printing_export.h"
#include "ui/gfx/rect.h"
namespace printing {
class PRINTING_EXPORT PageMargins {
public:
PageMargins();
void Clear();
bool Equals(const PageMargins& rhs) const;
int header;
int footer;
int left;
int right;
int top;
int bottom;
};
class PRINTING_EXPORT PageSetup {
public:
PageSetup();
~PageSetup();
void Clear();
bool Equals(const PageSetup& rhs) const;
void Init(const gfx::Size& physical_size, const gfx::Rect& printable_area,
int text_height);
void SetRequestedMargins(const PageMargins& requested_margins);
void ForceRequestedMargins(const PageMargins& requested_margins);
void FlipOrientation();
const gfx::Size& physical_size() const { return physical_size_; }
const gfx::Rect& overlay_area() const { return overlay_area_; }
const gfx::Rect& content_area() const { return content_area_; }
const gfx::Rect& printable_area() const { return printable_area_; }
const PageMargins& effective_margins() const {
return effective_margins_;
}
private:
void SetRequestedMarginsAndCalculateSizes(
const PageMargins& requested_margins);
void CalculateSizesWithinRect(const gfx::Rect& bounds, int text_height);
gfx::Size physical_size_;
gfx::Rect printable_area_;
gfx::Rect overlay_area_;
gfx::Rect content_area_;
PageMargins effective_margins_;
PageMargins requested_margins_;
bool forced_margins_;
int text_height_;
};
}
#endif
|
// SPDX-License-Identifier: GPL-2.0+
/* NetworkManager Applet -- allow user control over networking
*
* Dan Williams <dcbw@redhat.com>
*
* Copyright 2007 - 2014 Red Hat, Inc.
*/
#include "nm-default.h"
#include <ctype.h>
#include <string.h>
#include "wireless-security.h"
#include "eap-method.h"
struct _WirelessSecurityWPAEAP {
WirelessSecurity parent;
GtkSizeGroup *size_group;
};
static void
destroy (WirelessSecurity *parent)
{
WirelessSecurityWPAEAP *sec = (WirelessSecurityWPAEAP *) parent;
if (sec->size_group)
g_object_unref (sec->size_group);
}
static gboolean
validate (WirelessSecurity *parent, GError **error)
{
return ws_802_1x_validate (parent, "wpa_eap_auth_combo", error);
}
static void
add_to_size_group (WirelessSecurity *parent, GtkSizeGroup *group)
{
WirelessSecurityWPAEAP *sec = (WirelessSecurityWPAEAP *) parent;
if (sec->size_group)
g_object_unref (sec->size_group);
sec->size_group = g_object_ref (group);
ws_802_1x_add_to_size_group (parent,
sec->size_group,
"wpa_eap_auth_label",
"wpa_eap_auth_combo");
}
static void
fill_connection (WirelessSecurity *parent, NMConnection *connection)
{
NMSettingWirelessSecurity *s_wireless_sec;
ws_802_1x_fill_connection (parent, "wpa_eap_auth_combo", connection);
s_wireless_sec = nm_connection_get_setting_wireless_security (connection);
g_assert (s_wireless_sec);
g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-eap", NULL);
}
static void
auth_combo_changed_cb (GtkWidget *combo, gpointer user_data)
{
WirelessSecurity *parent = WIRELESS_SECURITY (user_data);
WirelessSecurityWPAEAP *sec = (WirelessSecurityWPAEAP *) parent;
ws_802_1x_auth_combo_changed (combo,
parent,
"wpa_eap_method_vbox",
sec->size_group);
}
static void
update_secrets (WirelessSecurity *parent, NMConnection *connection)
{
ws_802_1x_update_secrets (parent, "wpa_eap_auth_combo", connection);
}
WirelessSecurityWPAEAP *
ws_wpa_eap_new (NMConnection *connection,
gboolean is_editor,
gboolean secrets_only,
const char *const*secrets_hints)
{
WirelessSecurity *parent;
GtkWidget *widget;
parent = wireless_security_init (sizeof (WirelessSecurityWPAEAP),
validate,
add_to_size_group,
fill_connection,
update_secrets,
destroy,
"/org/freedesktop/network-manager-applet/ws-wpa-eap.ui",
"wpa_eap_notebook",
NULL);
if (!parent)
return NULL;
parent->adhoc_compatible = FALSE;
parent->hotspot_compatible = FALSE;
widget = ws_802_1x_auth_combo_init (parent,
"wpa_eap_auth_combo",
"wpa_eap_auth_label",
(GCallback) auth_combo_changed_cb,
connection,
is_editor,
secrets_only,
secrets_hints);
auth_combo_changed_cb (widget, parent);
return (WirelessSecurityWPAEAP *) parent;
}
|
/*------------------------------------------------------------------------
* Jastram-Test-Model for Adaptive FD-Grid
*
* Daniel Koehn
* last update 23.10.2004
*
* ---------------------------------------------------------------------*/
#include "fd.h"
void model_elastic(float ** rho, float ** pi, float ** u){
/*--------------------------------------------------------------------------*/
FILE *FP1, *FP2, *FP3;
/* extern variables */
extern float DH;
extern int NX, NY, NXG, NYG, POS[3], MYID;
/* local variables */
float Rho, Vp, Vs, Vpnm1, x, y, undf, r;
float aund, ampund, FW, shiftx;
int i, j, ii, jj;
char modfile[STRING_SIZE];
/* parameters for background */
const float vp2=2000.0, vs2=vp2/sqrt(3.0), rho2=1000.0*0.31*pow(vp2,(1.0/4.0));
/* parameters for sphere 1 and 2 */
const float vp3=1500.0, vs3=vp3/sqrt(3.0), rho3=1000.0*0.31*pow(vp3,(1.0/4.0));
/* location of the spheres */
const float X01 = 80.0;
const float Y01 = 130.0;
/* radii of spheres */
float A0, A1, A3, A4, lambda0, lambda1, lambda3, lambda4;
float y0, y1, y2, y3, y4, y5, undy0, undy1, undy3, undy4;
lambda0=1600.0;
A0=50.0;
y0=1200.0;
lambda1=lambda0/2.0;
A1=100.0;
y1=1000.0;
y2=800.0;
lambda3=lambda0/2.0;
A3=150.0;
y3=600.0;
lambda4=lambda0/2.0;
A4=50.0;
y4=410.0;
y5=100.0;
FP1=fopen("/fastfs/koehn/DENISE_backup/par/start/crase_smooth_model_vp.dat","r");
FP2=fopen("/fastfs/koehn/DENISE_backup/par/start/crase_smooth_model_vs.dat","r");
FP3=fopen("/fastfs/koehn/DENISE_backup/par/start/crase_smooth_model_rho.dat","r");
/* loop over global grid */
for (i=1;i<=NXG;i++){
for (j=1;j<=NYG;j++){
fscanf(FP1,"%e\n",&Vp);
fscanf(FP2,"%e\n",&Vs);
fscanf(FP3,"%e\n",&Rho);
if ((POS[1]==((i-1)/NX)) &&
(POS[2]==((j-1)/NY))){
ii=i-POS[1]*NX;
jj=j-POS[2]*NY;
u[jj][ii]=Vs*Vs*Rho;
rho[jj][ii]=Rho;
pi[jj][ii] = Vp*Vp*Rho - 2.0 * u[jj][ii];
/*if(j==NYG){pi[jj][ii] = pi[jj-1][ii];}*/
}
}
}
/* each PE writes his model to disk */
sprintf(modfile,"model/waveform_test_model_u.bin");
writemod(modfile,u,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(modfile,3);
sprintf(modfile,"model/waveform_test_model_pi.bin");
writemod(modfile,pi,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(modfile,3);
sprintf(modfile,"model/waveform_test_model_rho.bin");
writemod(modfile,rho,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(modfile,3);
fclose(FP1);
fclose(FP2);
fclose(FP3);
}
|
/*
Miranda NG: the free IM client for Microsoft* Windows*
Copyright (C) 2012-22 Miranda NG team (https://miranda-ng.org),
Copyright (c) 2004-009 Roman Miklashevsky, A. Petkevich, Kosh&chka, persei
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef M_STOPSPAM_H__
#define M_STOPSPAM_H__
#define CS_NOTPASSED 0
#define CS_PASSED 1
//check is contact pass the stopspam
//wParam=(HANDLE)hContact
//lParam=0
//returns a "Contact Stae" flag
#define MS_STOPSPAM_CONTACTPASSED "StopSpam/IsContactPassed"
#endif
|
/* Copyright (C) 1993-2013 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 <unistd.h>
#include <hurd.h>
#include <hurd/id.h>
/* Get the real user ID of the calling process. */
uid_t
__getuid ()
{
error_t err;
uid_t uid;
HURD_CRITICAL_BEGIN;
__mutex_lock (&_hurd_id.lock);
if (err = _hurd_check_ids ())
{
errno = err;
uid = -1;
}
else if (_hurd_id.aux.nuids >= 1)
uid = _hurd_id.aux.uids[0];
else
{
/* We do not even have a real uid. */
errno = EGRATUITOUS;
uid = -1;
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
return uid;
}
weak_alias (__getuid, getuid)
|
/*
* %kadu copyright begin%
* Copyright 2009, 2010, 2011, 2012 Piotr Galiszewski (piotr.galiszewski@kadu.im)
* Copyright 2009 Wojciech Treter (juzefwt@gmail.com)
* Copyright 2009 Michał Podsiadlik (michal@kadu.net)
* Copyright 2009 Bartłomiej Zimoń (uzi18@o2.pl)
* Copyright 2010, 2011, 2013, 2014 Bartosz Brachaczek (b.brachaczek@gmail.com)
* Copyright 2009, 2010, 2011, 2012, 2013, 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com)
* %kadu copyright end%
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHAT_H
#define CHAT_H
#include "chat/chat-shared.h"
#include "exports.h"
#include "storage/shared-base.h"
class Account;
class ContactSet;
class ChatDetails;
class ChatType;
class StoragePoint;
class QString;
/**
* @addtogroup Chat
* @{
*/
/**
* @class Chat
* @short Access object for chat data.
*
* This class allows to access to chat data defined in @link ChatShared @endlink class.
*/
class KADUAPI Chat : public SharedBase<ChatShared>
{
KaduSharedBaseClass(Chat)
public : static Chat null;
Chat();
Chat(ChatShared *data);
explicit Chat(QObject *data);
Chat(const Chat ©);
virtual ~Chat();
bool showInAllGroup() const;
bool isInGroup(Group group) const;
void addToGroup(Group group) const;
void removeFromGroup(Group group) const;
KaduSharedBase_PropertyRead(ContactSet, contacts, Contacts);
KaduSharedBase_PropertyRead(QString, name, Name);
/**
* @short Details object for this chat.
*
* When ChatType for this chat is loaded and registered in ChatTypeManager
* this field contains ChatDetails object that holds detailed information
* about this chat.
*/
KaduSharedBase_PropertyRead(ChatDetails *, details, Details);
/**
* @short Account of this chat.
*
* Every chat is assigned to account. All contacts in every chat must
* belong to the same account as chat.
*/
KaduSharedBase_PropertyCRW(Account, chatAccount, ChatAccount);
/**
* @short Name of chat type.
*
* Name of chat type. @link ChatType @endlink object with the same name must be loaded
* and registered in @link ChatTypeManager @endlink to allow this chat object to
* be fully functional and used. Example chat types are: 'contact' (for one-to-one chats)
* and 'contact-set' (for on-to-many chats). Other what types could be: 'irc-room' (for irc room
* chats).
*/
KaduSharedBase_PropertyCRW(QString, type, Type);
KaduSharedBase_PropertyCRW(QString, display, Display);
KaduSharedBase_PropertyBool(IgnoreAllMessages);
KaduSharedBase_PropertyCRW(QSet<Group>, groups, Groups);
KaduSharedBase_Property(quint16, unreadMessagesCount, UnreadMessagesCount);
/**
* @short Return true when chat is connected.
* @return true when chat is connected
*
* Chat messages can only be send to/received from connected chat.
* Chat connection depends on chat type and is implemented in @link ChatDetails @endlink subclasses.
*
* For example, simple Contact and ContactSet chats are connected when an account is connected.
* MUC chats in XMPP are connected when account is connected and given group chat is joined.
*/
bool isConnected() const;
/**
* @short Get value of Open property.
* @return true when chat is open
*
* Chat is open when an associated chat widget is open.
*/
bool isOpen() const;
/**
* @short Set value of open property.
* @param open new value of Open property
*
* Changing value of Open property may result in emiting of @link opened() @endlink or @link closed() @endlink
* singals.
*/
void setOpen(bool open);
};
KADUAPI QString title(const Chat &chat);
/**
* @}
*/
Q_DECLARE_METATYPE(Chat)
#endif // CHAT_H
|
//
// jawt_md.h
//
// Copyright (c) 2002-2008 Apple Inc. All rights reserved.
//
#ifndef _JAVASOFT_JAWT_MD_H_
#define _JAVASOFT_JAWT_MD_H_
#include <jawt.h>
#include <AppKit/NSView.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct JAWT_MacOSXDrawingSurfaceInfo
{
NSView *cocoaViewRef; // the view is guaranteed to be valid only for the duration of Component.paint method
}
JAWT_MacOSXDrawingSurfaceInfo;
#ifdef __cplusplus
}
#endif
#endif /* !_JAVASOFT_JAWT_MD_H_ */
|
#ifndef FILTERCONTROLLER_H
#define FILTERCONTROLLER_H
#include <QObject>
#include <QRunnable>
#include <QMutex>
#include <QWaitCondition>
#include "../Operacao/filter.h"
#include "../../ImagemController/imagem.h"
#include <opencv2/core/core.hpp>
#include <opencv/cv.h>
#include <opencv2/gpu/gpumat.hpp>
using namespace cv;
class FilterController : public QObject,public QRunnable
{
Q_OBJECT
public:
explicit FilterController(QObject *parent = 0);
~FilterController();
void addProcessa(Imagem frame);
void stopThread();
void run();
signals:
void onTerminouSalEPimenta(Imagem frame);
public slots:
private:
QList<Imagem> listaProcessa;
Filter *filter;
QWaitCondition sincronizedThread;
bool finishedThread;
void processImage();
void executeFilter();
};
#endif // FILTERCONTROLLER_H
|
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id$
//
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 2006-2012 by The Odamex 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.
//
// DESCRIPTION:
// Rendering of moving objects, sprites.
//
//-----------------------------------------------------------------------------
#ifndef __R_THINGS__
#define __R_THINGS__
// [RH] Particle details
struct particle_s {
fixed_t x,y,z;
fixed_t velx,vely,velz;
fixed_t accx,accy,accz;
byte ttl;
byte trans;
byte size;
byte fade;
int color;
WORD next;
WORD nextinsubsector;
};
typedef struct particle_s particle_t;
extern int NumParticles;
extern int ActiveParticles;
extern int InactiveParticles;
extern particle_t *Particles;
extern TArray<WORD> ParticlesInSubsec;
const WORD NO_PARTICLE = 0xffff;
#ifdef _MSC_VER
__inline particle_t *NewParticle (void)
{
particle_t *result = NULL;
if (InactiveParticles != NO_PARTICLE) {
result = Particles + InactiveParticles;
InactiveParticles = result->next;
result->next = ActiveParticles;
ActiveParticles = result - Particles;
}
return result;
}
#else
particle_t *NewParticle (void);
#endif
void R_InitParticles (void);
void R_ClearParticles (void);
void R_DrawParticleP (vissprite_t *, int, int);
void R_DrawParticleD (vissprite_t *, int, int);
void R_ProjectParticle (particle_t *, const sector_t* sector, int fakeside);
void R_FindParticleSubsectors();
extern int MaxVisSprites;
extern vissprite_t *vissprites;
extern vissprite_t* vissprite_p;
extern vissprite_t vsprsortedhead;
// Constant arrays used for psprite clipping
// and initializing clipping.
extern int *negonearray;
extern int *screenheightarray;
// vars for R_DrawMaskedColumn
extern int* mfloorclip;
extern int* mceilingclip;
extern fixed_t spryscale;
extern fixed_t sprtopscreen;
extern fixed_t pspritexscale;
extern fixed_t pspriteyscale;
extern fixed_t pspritexiscale;
void R_DrawMaskedColumn(tallpost_t* post);
void R_CacheSprite (spritedef_t *sprite);
void R_SortVisSprites (void);
void R_AddSprites (sector_t *sec, int lightlevel, int fakeside);
void R_AddPSprites (void);
void R_DrawSprites (void);
void R_InitSprites (const char** namelist);
void R_ClearSprites (void);
void R_DrawMasked (void);
#endif
|
/*
This file is part of EqualizerAPO, a system-wide equalizer.
Copyright (C) 2015 Jonas Thedering
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.
*/
#pragma once
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <fftw3.h>
#include "DeviceAPOInfo.h"
class AnalysisThread : public QThread
{
Q_OBJECT
public:
AnalysisThread();
~AnalysisThread();
void setParameters(std::shared_ptr<AbstractAPOInfo> device, int channelMask, int channelIndex, QString configPath, int frameCount);
void beginGetResult();
void endGetResult();
fftwf_complex* getFreqData() const;
int getFreqDataLength() const;
int getFreqDataSampleRate() const;
double getPeakGain() const;
int getLatency() const;
double getInitializationTime() const;
double getProcessingTime() const;
unsigned getProcessedFrames() const;
signals:
void analysisFinished();
protected:
void run() override;
private:
QMutex mutex;
QWaitCondition condition;
bool quit = false;
// input
std::shared_ptr<AbstractAPOInfo> device;
int channelMask;
int channelIndex;
QString configPath;
int frameCount = 0;
// output
fftwf_complex* resultFreqData = NULL;
int freqDataLength = 0;
int freqDataSampleRate;
double peakGain;
int latency;
double initializationTime;
double processingTime;
int processedFrames;
// internal (not protected by mutex)
int lastFrameCount = -1;
int lastChannelCount = -1;
float* buf = NULL;
float* buf2 = NULL;
float* timeData = NULL;
fftwf_complex* freqData = NULL;
fftwf_plan planForward = NULL;
};
|
/*
* linux/include/asm-c6x/page_offset.h
*
* Port on Texas Instruments TMS320C6x architecture
*
* Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
* Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.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.
*
*/
#ifndef _ASM_C6X_PAGE_OFFSET_H
#define _ASM_C6X_PAGE_OFFSET_H
#include <mach/hardware.h>
/* This handles the memory map */
#ifdef CONFIG_PAGE_OFFSET
#define PAGE_OFFSET_RAW CONFIG_PAGE_OFFSET
#else
#define PAGE_OFFSET_RAW RAM_DDR2_CE0
#endif
/* Maximum size for the kernel code */
#define KERNEL_TEXT_LEN 0x07ffffff
#endif /* _ASM_C6X_PAGE_OFFSET_H */
|
#ifdef O3_WITH_GLUE
#pragma warning( disable : 4100)
#pragma warning( disable : 4189)
namespace o3 {
Trait* cJs1::select()
{
return clsTraits();
}
Trait* cJs1::clsTraits()
{
static Trait TRAITS[] = {
{ 0, Trait::TYPE_BEGIN, "cJs1", 0, 0, 0, cScr::clsTraits() },
{ 0, Trait::TYPE_FUN, "cJs1", "include", clsInvoke, 0, 0 },
{ 1, Trait::TYPE_FUN, "cJs1", "eval", clsInvoke, 1, 0 },
{ 0, Trait::TYPE_END, "cJs1", 0, 0, 0, 0 },
};
return TRAITS;
}
Trait* cJs1::extTraits()
{
static Trait TRAITS[] = {
{ 0, Trait::TYPE_BEGIN, "cJs1", 0, 0, 0, 0 },
{ 0, Trait::TYPE_GET, "cO3", "js", extInvoke, 0, 0 },
{ 0, Trait::TYPE_END, "cJs1", 0, 0, 0, 0 },
};
return TRAITS;
}
siEx cJs1::clsInvoke(iScr* pthis, iCtx* ctx, int index, int argc,
const Var* argv, Var* rval)
{
siEx ex;
cJs1* pthis1 = (cJs1*) pthis;
switch(index) {
case 0:
if (argc != 1)
return o3_new(cEx)("Invalid argument count. ( include )");
*rval = pthis1->include(argv[0].toStr(),&ex);
break;
case 1:
if (argc != 1)
return o3_new(cEx)("Invalid argument count. ( eval )");
*rval = pthis1->eval(argv[0].toStr(),&ex);
break;
}
return ex;
}
siEx cJs1::extInvoke(iScr* pthis, iCtx* ctx, int index, int argc,
const Var* argv, Var* rval)
{
siEx ex;
cJs1* pthis1 = (cJs1*) pthis;
switch(index) {
case 0:
if (argc != 0)
return o3_new(cEx)("Invalid argument count. ( js )");
*rval = pthis1->js(ctx);
break;
}
return ex;
}
}
#endif
#pragma warning(default : 4100)
#pragma warning(default : 4189)
|
/* This file is part of the KDE libraries
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 __ktexteditor_editinterface_h__
#define __ktexteditor_editinterface_h__
#include <qstring.h>
#include <kdelibs_export.h>
namespace KTextEditor {
/**
* This is the main interface for accessing and modifying
* text of the Document class.
*/
class KTEXTEDITOR_EXPORT EditInterface {
friend class PrivateEditInterface;
public:
EditInterface();
virtual ~EditInterface();
uint editInterfaceNumber() const;
protected:
void setEditInterfaceDCOPSuffix(const QCString &suffix);
public:
/**
* slots !!!
*/
/**
* @return the complete document as a single QString
*/
virtual QString text() const = 0;
/**
* @return a QString
*/
virtual QString text(uint startLine, uint startCol, uint endLine, uint endCol) const = 0;
/**
* @return All the text from the requested line.
*/
virtual QString textLine(uint line) const = 0;
/**
* @return The current number of lines in the document
*/
virtual uint numLines() const = 0;
/**
* @return the number of characters in the document
*/
virtual uint length() const = 0;
/**
* @return the number of characters in the line (-1 if no line "line")
*/
virtual int lineLength(uint line) const = 0;
/**
* Set the given text into the view.
* Warning: This will overwrite any data currently held in this view.
*/
virtual bool setText(const QString &text) = 0;
/**
* clears the document
* Warning: This will overwrite any data currently held in this view.
*/
virtual bool clear() = 0;
/**
* Inserts text at line "line", column "col"
* returns true if success
* Use insertText(numLines(), ...) to append text at end of document
*/
virtual bool insertText(uint line, uint col, const QString &text) = 0;
/**
* remove text at line "line", column "col"
* returns true if success
*/
virtual bool removeText(uint startLine, uint startCol, uint endLine, uint endCol) = 0;
/**
* Insert line(s) at the given line number.
* Use insertLine(numLines(), text) to append line at end of document
*/
virtual bool insertLine(uint line, const QString &text) = 0;
/**
* Remove line(s) at the given line number.
*/
virtual bool removeLine(uint line) = 0;
/**
* signals !!!
*/
public:
virtual void textChanged() = 0;
virtual void
charactersInteractivelyInserted(int, int,
const QString &) = 0; // line, col, characters if you don't support this, don't create a signal, just overload it.
/**
* only for the interface itself - REAL PRIVATE
*/
private:
class PrivateEditInterface *d;
static uint globalEditInterfaceNumber;
uint myEditInterfaceNumber;
};
KTEXTEDITOR_EXPORT EditInterface *editInterface(class Document *doc);
}
#endif
|
/* ============================================================
*
* This file is a part of kipi-plugins project
* http://www.digikam.org
*
* Date : 2006-10-18
* Description : images list settings page.
*
* Copyright (C) 2006-2012 by Gilles Caulier <caulier dot gilles 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, 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.
*
* ============================================================ */
#ifndef IMAGES_PAGE_H
#define IMAGES_PAGE_H
// Local includes
#include "kpimageslist.h"
#include "emailsettingscontainer.h"
namespace KIPI
{
class Interface;
}
using namespace KIPI;
using namespace KIPIPlugins;
namespace KIPISendimagesPlugin
{
class ImagesPage : public KPImagesList
{
Q_OBJECT
public:
ImagesPage(QWidget* const parent, Interface* const iface);
~ImagesPage();
QList<EmailItem> imagesList() const;
};
} // namespace KIPISendimagesPlugin
#endif // IMAGES_PAGE_H
|
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Rosegarden
A MIDI and audio sequencer and musical notation editor.
Copyright 2000-2018 the Rosegarden development team.
Other copyrights also apply to some parts of this work. Please
see the AUTHORS file and individual file headers for details.
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. See the file
COPYING included with this distribution for more information.
*/
#ifndef RG_CONFIGUREDIALOGBASE_H
#define RG_CONFIGUREDIALOGBASE_H
#include <QMessageBox>
#include <QDialog>
#include <QString>
#include <vector>
class QWidget;
class QTabWidget;
class QDialogButtonBox;
class IconStackedWidget;
namespace Rosegarden
{
class ConfigurationPage;
class ConfigureDialogBase : public QDialog
{
Q_OBJECT
public:
ConfigureDialogBase(QWidget *parent = nullptr, const QString &label = {}, const char *name = nullptr);
~ConfigureDialogBase() override;
typedef std::vector<ConfigurationPage*> configurationpages;
void addPage( const QString& name, const QString& title, const QPixmap& icon, QWidget *page );
void setPageByIndex(int index);
protected slots:
void accept() override;
virtual void slotApply();
virtual void slotCancelOrClose();
virtual void slotHelpRequested();
public slots:
virtual void slotActivateApply();
public:
void deactivateApply();
protected:
configurationpages m_configurationPages;
QPushButton *m_applyButton;
QDialogButtonBox *m_dialogButtonBox;
IconStackedWidget *m_iconWidget;
};
}
#endif
|
/* Company : Nequeo Pty Ltd, http://www.nequeo.com.au/
* Copyright : Copyright © Nequeo Pty Ltd 2015 http://www.nequeo.com.au/
*
* File : OnCallRxOfferParam.h
* Purpose : SIP OnCallRxOfferParam class.
*
*/
/*
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef _ONCALLRXOFFERPARAM_H
#define _ONCALLRXOFFERPARAM_H
#include "stdafx.h"
#include "Call.h"
#include "CallInfo.h"
#include "SipEventType.h"
#include "SdpSession.h"
#include "CallSetting.h"
#include "StatusCode.h"
#include "pjsua2.hpp"
using namespace System;
using namespace System::Collections;
using namespace System::Collections::Generic;
namespace Nequeo
{
namespace Net
{
namespace PjSip
{
/// <summary>
/// This structure contains parameters for Call::onCallRxOffer() callback.
/// </summary>
public ref class OnCallRxOfferParam sealed
{
public:
/// <summary>
/// This structure contains parameters for Call::onCallRxOffer() callback.
/// </summary>
OnCallRxOfferParam();
/// <summary>
/// Gets or sets the current call.
/// </summary>
property Call^ CurrentCall
{
Call^ get();
void set(Call^ value);
}
/// <summary>
/// Gets or sets the call information.
/// </summary>
property CallInfo^ Info
{
CallInfo^ get();
void set(CallInfo^ value);
}
/// <summary>
/// Gets or sets the new offer received.
/// </summary>
property SdpSession^ Offer
{
SdpSession^ get();
void set(SdpSession^ value);
}
/// <summary>
/// Gets or sets the current call setting, application can update this setting for answering the offer.
/// </summary>
property CallSetting^ Setting
{
CallSetting^ get();
void set(CallSetting^ value);
}
/// <summary>
/// Gets or sets the Status code to be returned for answering the offer. On input,
/// it contains status code 200. Currently, valid values are only 200 and 488.
/// </summary>
property StatusCode Code
{
StatusCode get();
void set(StatusCode value);
}
private:
Call^ _currentCall;
CallInfo^ _info;
SdpSession^ _offer;
CallSetting^ _setting;
StatusCode _code;
};
}
}
}
#endif
|
/*
Copyright (C) 2013 Lasath Fernando <kde@lasath.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef NOTIFYFILTER_H
#define NOTIFYFILTER_H
#include "chat-widget.h"
#include <KTp/abstract-message-filter.h>
class NotifyFilter : public KTp::AbstractMessageFilter
{
Q_OBJECT
public:
explicit NotifyFilter(ChatWidget *widget);
public Q_SLOTS:
void sendMessageNotification(const KTp::Message &message);
private:
ChatWidget *m_widget;
};
#endif // NOTIFYFILTER_H
|
/*
Copyright (c) 2013, 2014 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SENDLATERJOB_H
#define SENDLATERJOB_H
#include <QObject>
#include "sendlatermanager.h"
#include <KMime/Message>
#include <Akonadi/ItemFetchScope>
#include <Akonadi/Item>
namespace SendLater {
class SendLaterInfo;
}
class KJob;
class SendLaterJob : public QObject
{
Q_OBJECT
public:
explicit SendLaterJob(SendLaterManager *manager, SendLater::SendLaterInfo *info, QObject *parent = 0);
~SendLaterJob();
void start();
private Q_SLOTS:
void sendDone();
void sendError(const QString &error, SendLaterManager::ErrorType type);
void slotMessageTransfered(const Akonadi::Item::List& );
void slotJobFinished(KJob*);
void slotDeleteItem(KJob*);
private:
void updateAndCleanMessageBeforeSending(const KMime::Message::Ptr &msg);
Akonadi::ItemFetchScope mFetchScope;
SendLaterManager *mManager;
SendLater::SendLaterInfo *mInfo;
Akonadi::Item mItem;
};
#endif // SENDLATERJOB_H
|
//***********************************************************
// Copyright © 2003-2008 Alexander S. Kiselev, Valentin Pavlyuchenko
//
// This file is part of Boltun.
//
// Boltun 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.
//
// Boltun 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 Boltun. If not, see <http://www.gnu.org/licenses/>.
//
//***********************************************************
#ifndef ACTIONQUEUE_H
#define ACTIONQUEUE_H
void AnswerToContact(MCONTACT hContact, const wchar_t* messageToAnswer);
void StartChatting(MCONTACT hContact);
#endif /* ACTIONQUEUE_H */
|
//
// DiEdge.h
// AbstractGraph
//
// Created by Jiageng Li on 4/8/12.
// Copyright (c) 2012 University of Illinois at Urbana-Champaign. All rights reserved.
//
#ifndef _DIEDGE_H_
#define _DIEDGE_H_
#include "../Nodes/DiNode.h"
#include "AbstractEdge.h"
#include "../incl.h"
class DiNode;
class AGRAPH_EXPORT DiEdge : public AbstractEdge{
public:
DiEdge(int id, DiNode * s, DiNode * t);
DiEdge(int id, DiNode * s, DiNode * t, int v);
~DiEdge();
AbstractNode* getFrom();
AbstractNode* getTo();
void printEdge();
private:
DiNode * from;
DiNode * to;
};
#endif
|
/*
* athena-file-info.h - Information about a file
*
* Copyright (C) 2003 Novell, Inc.
*
* 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; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
/* AthenaFileInfo is an interface to the AthenaFile object. It
* provides access to the asynchronous data in the AthenaFile.
* Extensions are passed objects of this type for operations. */
#ifndef ATHENA_FILE_INFO_H
#define ATHENA_FILE_INFO_H
#include <glib-object.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#define ATHENA_TYPE_FILE_INFO (athena_file_info_get_type ())
#define ATHENA_FILE_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATHENA_TYPE_FILE_INFO, AthenaFileInfo))
#define ATHENA_IS_FILE_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATHENA_TYPE_FILE_INFO))
#define ATHENA_FILE_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATHENA_TYPE_FILE_INFO, AthenaFileInfoIface))
#ifndef ATHENA_FILE_DEFINED
#define ATHENA_FILE_DEFINED
/* Using AthenaFile for the vtable to make implementing this in
* AthenaFile easier */
typedef struct AthenaFile AthenaFile;
#endif
typedef AthenaFile AthenaFileInfo;
typedef struct _AthenaFileInfoIface AthenaFileInfoIface;
struct _AthenaFileInfoIface
{
GTypeInterface g_iface;
gboolean (*is_gone) (AthenaFileInfo *file);
char * (*get_name) (AthenaFileInfo *file);
char * (*get_uri) (AthenaFileInfo *file);
char * (*get_parent_uri) (AthenaFileInfo *file);
char * (*get_uri_scheme) (AthenaFileInfo *file);
char * (*get_mime_type) (AthenaFileInfo *file);
gboolean (*is_mime_type) (AthenaFileInfo *file,
const char *mime_Type);
gboolean (*is_directory) (AthenaFileInfo *file);
void (*add_emblem) (AthenaFileInfo *file,
const char *emblem_name);
char * (*get_string_attribute) (AthenaFileInfo *file,
const char *attribute_name);
void (*add_string_attribute) (AthenaFileInfo *file,
const char *attribute_name,
const char *value);
void (*invalidate_extension_info) (AthenaFileInfo *file);
char * (*get_activation_uri) (AthenaFileInfo *file);
GFileType (*get_file_type) (AthenaFileInfo *file);
GFile * (*get_location) (AthenaFileInfo *file);
GFile * (*get_parent_location) (AthenaFileInfo *file);
AthenaFileInfo* (*get_parent_info) (AthenaFileInfo *file);
GMount * (*get_mount) (AthenaFileInfo *file);
gboolean (*can_write) (AthenaFileInfo *file);
};
GList *athena_file_info_list_copy (GList *files);
void athena_file_info_list_free (GList *files);
GType athena_file_info_get_type (void);
/* Return true if the file has been deleted */
gboolean athena_file_info_is_gone (AthenaFileInfo *file);
/* Name and Location */
GFileType athena_file_info_get_file_type (AthenaFileInfo *file);
GFile * athena_file_info_get_location (AthenaFileInfo *file);
char * athena_file_info_get_name (AthenaFileInfo *file);
char * athena_file_info_get_uri (AthenaFileInfo *file);
char * athena_file_info_get_activation_uri (AthenaFileInfo *file);
GFile * athena_file_info_get_parent_location (AthenaFileInfo *file);
char * athena_file_info_get_parent_uri (AthenaFileInfo *file);
GMount * athena_file_info_get_mount (AthenaFileInfo *file);
char * athena_file_info_get_uri_scheme (AthenaFileInfo *file);
/* It's not safe to call this recursively multiple times, as it works
* only for files already cached by Athena.
*/
AthenaFileInfo* athena_file_info_get_parent_info (AthenaFileInfo *file);
/* File Type */
char * athena_file_info_get_mime_type (AthenaFileInfo *file);
gboolean athena_file_info_is_mime_type (AthenaFileInfo *file,
const char *mime_type);
gboolean athena_file_info_is_directory (AthenaFileInfo *file);
gboolean athena_file_info_can_write (AthenaFileInfo *file);
/* Modifying the AthenaFileInfo */
void athena_file_info_add_emblem (AthenaFileInfo *file,
const char *emblem_name);
char * athena_file_info_get_string_attribute (AthenaFileInfo *file,
const char *attribute_name);
void athena_file_info_add_string_attribute (AthenaFileInfo *file,
const char *attribute_name,
const char *value);
/* Invalidating file info */
void athena_file_info_invalidate_extension_info (AthenaFileInfo *file);
AthenaFileInfo *athena_file_info_lookup (GFile *location);
AthenaFileInfo *athena_file_info_create (GFile *location);
AthenaFileInfo *athena_file_info_lookup_for_uri (const char *uri);
AthenaFileInfo *athena_file_info_create_for_uri (const char *uri);
G_END_DECLS
#endif
|
/*
* arch/arm/mach-rpc/include/mach/io.h
*
* Copyright (C) 1997 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Modifications:
* 06-Dec-1997 RMK Created.
*/
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
#include <mach/hardware.h>
#define IO_SPACE_LIMIT 0xffffffff
/*
* We use two different types of addressing - PC style addresses, and ARM
* addresses. PC style accesses the PC hardware with the normal PC IO
* addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
* and are translated to the start of IO. Note that all addresses are
* shifted left!
*/
#define __PORT_PCIO(x) (!((x) & 0x80000000))
/*
* Dynamic IO functions.
*/
static inline void __outb (unsigned int value, unsigned int port)
{
unsigned long temp;
__asm__ __volatile__(
"tst %2, #0x80000000\n\t"
"mov %0, %4\n\t"
"addeq %0, %0, %3\n\t"
"strb %1, [%0, %2, lsl #2] @ outb"
: "=&r" (temp)
: "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
: "cc");
}
static inline void __outw (unsigned int value, unsigned int port)
{
unsigned long temp;
__asm__ __volatile__(
"tst %2, #0x80000000\n\t"
"mov %0, %4\n\t"
"addeq %0, %0, %3\n\t"
"str %1, [%0, %2, lsl #2] @ outw"
: "=&r" (temp)
: "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
: "cc");
}
static inline void __outl (unsigned int value, unsigned int port)
{
unsigned long temp;
__asm__ __volatile__(
"tst %2, #0x80000000\n\t"
"mov %0, %4\n\t"
"addeq %0, %0, %3\n\t"
"str %1, [%0, %2, lsl #2] @ outl"
: "=&r" (temp)
: "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
: "cc");
}
#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
static inline unsigned sz __in##fnsuffix (unsigned int port) \
{ \
unsigned long temp, value; \
__asm__ __volatile__( \
"tst %2, #0x80000000\n\t" \
"mov %0, %4\n\t" \
"addeq %0, %0, %3\n\t" \
"ldr" instr " %1, [%0, %2, lsl #2] @ in" #fnsuffix \
: "=&r" (temp), "=r" (value) \
: "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
: "cc"); \
return (unsigned sz)value; \
}
static inline void __iomem *__deprecated __ioaddr(unsigned int port)
{
void __iomem *ret;
if (__PORT_PCIO(port))
ret = PCIO_BASE;
else
ret = IO_BASE;
return ret + (port << 2);
}
#define DECLARE_IO(sz,fnsuffix,instr) \
DECLARE_DYN_IN(sz,fnsuffix,instr)
DECLARE_IO(char,b,"b")
DECLARE_IO(short,w,"")
DECLARE_IO(int,l,"")
#undef DECLARE_IO
#undef DECLARE_DYN_IN
/*
* Constant address IO functions
*
* These have to be macros for the 'J' constraint to work -
* +/-4096 immediate operand.
*/
#define __outbc(value,port) \
({ \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
"strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
})
#define __inbc(port) \
({ \
unsigned char result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
"ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
#define __outwc(value,port) \
({ \
unsigned long __v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"str %0, [%1, %2] @ outwc" \
: : "r" (__v|__v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
"str %0, [%1, %2] @ outwc" \
: : "r" (__v|__v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
})
#define __inwc(port) \
({ \
unsigned short result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
"ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result & 0xffff; \
})
#define __outlc(value,port) \
({ \
unsigned long __v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"str %0, [%1, %2] @ outlc" \
: : "r" (__v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
"str %0, [%1, %2] @ outlc" \
: : "r" (__v), "r" (IO_BASE), "r" ((port) << 2)); \
})
#define __inlc(port) \
({ \
unsigned long result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
"ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
"ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
/* the following macro is deprecated */
#define ioaddr(port) ((unsigned long)__ioaddr((port)))
#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l)
#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l)
#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
#endif
|
// -*- C++ -*-
// Class which controls what tasks are executed.
// Copyright (C) 2004 David Dooling <banjo@users.sourceforge.net>
//
// This file is part of CHIMP.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
#ifndef CH_MANAGER_H
#define CH_MANAGER_H 1
#include <map>
#include <string>
#include <vector>
#include "except.h"
#include "mechanism.h"
#include "unique.h"
#include "task.h"
// set namespace to avoid possible clashes
CH_BEGIN_NAMESPACE
// set of tasks for a specific mechanism
typedef CH_STD::map<mechanism*,task::seq> mechanism_tasks;
typedef mechanism_tasks::iterator mechanism_tasks_iter;
typedef mechanism_tasks::const_iterator mechanism_tasks_citer;
typedef CH_STD::vector<CH_STD::string> input_seq;
typedef input_seq::iterator input_seq_iter;
typedef input_seq::const_iterator input_seq_citer;
// class to parse input file and perform tasks
class task_manager
{
static task_manager master; // singleton instance of task_manager
mechanism::seq mechanisms; // all mechanisms in correct order
mechanism_tasks tasks; // the to do list for each mechanism
mechanism* current; // current active mechanism
private:
// ctor: (default) make private for singleton
task_manager();
// prevent copy construction and assignment
task_manager(const task_manager&);
task_manager& operator=(const task_manager&);
// parse a single control file
void parse_control(CH_STD::string path)
throw (bad_file, bad_input, bad_pointer, bad_request, bad_value, bad_type);
// this, tokenizer(), file_name(),
// parameter_file(), task_file(),
// new_mechanism()
// create an empty mechanism, put it into list, make current
void new_mechanism(const CH_STD::string& name)
throw (bad_file, bad_input, bad_request); // mechanism(),
// mechanism::parse()
// create a new parameter task and parse input
void parameter_file(const CH_STD::string& path)
throw (bad_pointer, bad_file, bad_input); // this, parameter_task(),
// parameter_task::parse()
// send the file to the task parser and insert return values
void task_file(const CH_STD::string& file_name)
throw (bad_pointer, bad_file, bad_input, bad_request, bad_value, bad_type);
// this, task::parse_file()
public:
// dtor: erase name from list and delete tasks
~task_manager();
// return a reference to the singleton
static task_manager& get();
// parse a list of control files
void parse_control(const input_seq& input_files)
throw (bad_file, bad_input, bad_pointer, bad_request, bad_value, bad_type);
// parse_control()
// return pointer to current mechanism
mechanism* get_current_mechanism() const
throw (bad_pointer); // this
// find the task of the given name for current mechanism
const task* find_task(const CH_STD::string& name)
throw (bad_pointer); // this
// perform the given tasks
void perform()
throw (bad_pointer, bad_file, bad_input, bad_value, bad_type, bad_request);
// this, model_reaction(), model_task::perform()
}; // end class task_manager
CH_END_NAMESPACE
#endif // not CH_MANAGER_H
/* $Id: manager.h,v 1.1.1.1 2004/11/25 20:24:05 banjo Exp $ */
|
#ifndef RNGSUPPORT_H
#define RNGSUPPORT_H
#ifdef __cplusplus
#if __cplusplus >= 201103L || (defined _MSC_VER && _MSC_VER >= 1600)
#define NYQ_USE_RANDOM_HEADER
#endif
#if defined NYQ_USE_RANDOM_HEADER
#include <vector>
#include <random>
namespace Nyq
{
typedef std::mt19937 nyq_generator;
const int nyq_generator_state_size = nyq_generator::state_size;
typedef std::seed_seq nyq_seed_seq;
typedef std::uniform_real_distribution<float> nyq_uniform_float_distribution;
typedef std::normal_distribution<float> nyq_normal_float_distribution;
typedef std::uniform_real_distribution<double> nyq_uniform_double_distribution;
typedef std::normal_distribution<double> nyq_normal_double_distribution;
typedef std::uniform_int_distribution<int> nyq_uniform_int_distribution;
class RngSupportBase
{
protected:
static std::vector<unsigned int> CreateRootSeedVector();
};
template <class RNG = nyq_generator>
class RngSupport : RngSupportBase
{
private:
friend std::vector<unsigned int> CreateRootSeedVector();
static RNG CreateRootGenerator()
{
auto seed_data = CreateRootSeedVector();
std::seed_seq seed(begin(seed_data), end(seed_data));
RNG generator(seed);
return generator;
}
static RNG& GetRootGenerator()
{
static thread_local auto generator = CreateRootGenerator();
return generator;
}
public:
template<class RealFwdIt, class Real>
static void RandomFillUniform(RealFwdIt first, RealFwdIt last, Real low, Real high)
{
RNG& generator = GetRootGenerator();
std::uniform_real_distribution<Real> uniform{ low, high };
for (; first != last; ++first)
*first = uniform(generator);
}
template<class RealFwdIt, class Real>
static void RandomFillNormal(RealFwdIt first, RealFwdIt last, Real mean, Real stDev)
{
RNG& generator = GetRootGenerator();
std::normal_distribution<Real> uniform{ mean, stDev };
for (; first != last; ++first)
*first = uniform(generator);
}
template<class RealFwdIt, class Real>
static bool RandomFillClampedNormal(RealFwdIt first, RealFwdIt last, Real mean, Real stDev, Real low, Real high)
{
RNG& generator = GetRootGenerator();
std::normal_distribution<Real> uniform{ mean, stDev };
for (; first != last; ++first)
{
int retry = 10;
for (;;)
{
Real x = uniform(generator);
if (x <= high && x >= low)
{
*first = x;
break;
}
if (--retry <= 0)
return false;
}
}
return true;
}
template<class Real>
static Real RandomUniformReal(Real low, Real high)
{
auto& generator = GetRootGenerator();
std::uniform_real_distribution<Real> uniform{ low, high };
return uniform(generator);
}
template<class Int>
static Int RandomUniformInt(Int low, Int high)
{
auto& generator = GetRootGenerator();
std::uniform_int_distribution<Int> uniform{ low, high };
return uniform(generator);
}
static std::vector<unsigned int> CreateSeedVector(std::vector<unsigned int>::size_type size)
{
std::vector<unsigned int> seed;
seed.reserve(size);
auto rng = GetRootGenerator();
for (; size > 0; --size)
seed.push_back(rng());
return seed;
}
}; // class RngSupport
template <class RNG = nyq_generator>
static RNG CreateGenerator(int size = 32)
{
auto seed_data = RngSupport<RNG>::CreateSeedVector(size);
nyq_seed_seq seq(begin(seed_data), end(seed_data));
RNG generator(seq);
return generator;
}
template <class RNG = nyq_generator>
static void ReseedGenerator(RNG& generator, int size = 32)
{
auto seed_data = RngSupport<RNG>::CreateSeedVector(size);
nyq_seed_seq seq(begin(seed_data), end(seed_data));
generator.seed(seq);
}
template <class RNG = nyq_generator>
class NyqEngine : public RNG
{
public:
explicit NyqEngine(int size = 32) : RNG(CreateGenerator(size))
{ }
};
} // namespace Nyq
#endif // NYQ_USE_RANDOM_HEADER
extern "C" {
#endif // __cplusplus
void RandomFillUniformFloat(float* p, size_t count, float low, float high);
void RandomFillNormalFloat(float* p, size_t count, float mean, float stDev);
int RandomFillClampedNormalFloat(float* p, size_t count, float mean, float stDev, float low, float high);
float RandomUniformFloat(float low, float high);
void RandomFillUniformDouble(double* p, size_t count, double low, double high);
void RandomFillNormalDouble(double* p, size_t count, double mean, double stDev);
int RandomFillClampedNormalDouble(double* p, size_t count, double mean, double stDev, double low, double high);
double RandomUniformDouble(double low, double high);
int RandomUniformInt(int lowInclusive, int highExclusive);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // RNGSUPPORT_H
|
/*
* u-boot/include/linux/mtd/nand_ids.h
*
* Copyright (c) 2000 David Woodhouse <dwmw2@mvhi.com>
* Steven J. Hill <sjhill@cotw.com>
*
* $Id: nand_ids.h,v 1.1 2000/10/13 16:16:26 mdeans Exp $
*
* 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.
*
* Info:
* Contains standard defines and IDs for NAND flash devices
*
* Changelog:
* 01-31-2000 DMW Created
* 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers
* so it can be used by other NAND flash device
* drivers. I also changed the copyright since none
* of the original contents of this file are specific
* to DoC devices. David can whack me with a baseball
* bat later if I did something naughty.
* 10-11-2000 SJH Added private NAND flash structure for driver
* 2000-10-13 BE Moved out of 'nand.h' - avoids duplication.
*/
#ifndef __LINUX_MTD_NAND_IDS_H
#define __LINUX_MTD_NAND_IDS_H
#ifndef CFG_NAND_LEGACY
#error This module is for the legacy NAND support
#endif
static struct nand_flash_dev nand_flash_ids[] = {
{"Toshiba TC5816BDC", NAND_MFR_TOSHIBA, 0x64, 21, 1, 2, 0x1000, 0},
{"Toshiba TC5832DC", NAND_MFR_TOSHIBA, 0x6b, 22, 0, 2, 0x2000, 0},
{"Toshiba TH58V128DC", NAND_MFR_TOSHIBA, 0x73, 24, 0, 2, 0x4000, 0},
{"Toshiba TC58256FT/DC", NAND_MFR_TOSHIBA, 0x75, 25, 0, 2, 0x4000, 0},
{"Toshiba TH58512FT", NAND_MFR_TOSHIBA, 0x76, 26, 0, 3, 0x4000, 0},
{"Toshiba TC58V32DC", NAND_MFR_TOSHIBA, 0xe5, 22, 0, 2, 0x2000, 0},
{"Toshiba TC58V64AFT/DC", NAND_MFR_TOSHIBA, 0xe6, 23, 0, 2, 0x2000, 0},
{"Toshiba TC58V16BDC", NAND_MFR_TOSHIBA, 0xea, 21, 1, 2, 0x1000, 0},
{"Toshiba TH58100FT", NAND_MFR_TOSHIBA, 0x79, 27, 0, 3, 0x4000, 0},
{"Samsung KM29N16000", NAND_MFR_SAMSUNG, 0x64, 21, 1, 2, 0x1000, 0},
{"Samsung unknown 4Mb", NAND_MFR_SAMSUNG, 0x6b, 22, 0, 2, 0x2000, 0},
{"Samsung KM29U128T", NAND_MFR_SAMSUNG, 0x73, 24, 0, 2, 0x4000, 0},
{"Samsung KM29U256T", NAND_MFR_SAMSUNG, 0x75, 25, 0, 2, 0x4000, 0},
{"Samsung unknown 64Mb", NAND_MFR_SAMSUNG, 0x76, 26, 0, 3, 0x4000, 0},
{"Samsung KM29W32000", NAND_MFR_SAMSUNG, 0xe3, 22, 0, 2, 0x2000, 0},
{"Samsung unknown 4Mb", NAND_MFR_SAMSUNG, 0xe5, 22, 0, 2, 0x2000, 0},
{"Samsung KM29U64000", NAND_MFR_SAMSUNG, 0xe6, 23, 0, 2, 0x2000, 0},
{"Samsung KM29W16000", NAND_MFR_SAMSUNG, 0xea, 21, 1, 2, 0x1000, 0},
{"Samsung K9F5616Q0C", NAND_MFR_SAMSUNG, 0x45, 25, 0, 2, 0x4000, 1},
{"Samsung K9K1216Q0C", NAND_MFR_SAMSUNG, 0x46, 26, 0, 3, 0x4000, 1},
{"Samsung K9K1208Q0C", NAND_MFR_SAMSUNG, 0x36, 26, 0, 3, 0x4000, 0},
{"Samsung K9F1G08U0M", NAND_MFR_SAMSUNG, 0xf1, 27, 0, 2, 0, 0},
{NULL,}
};
#endif /* __LINUX_MTD_NAND_IDS_H */
|
/* $Id: thread-r0drv-freebsd.c 56290 2015-06-09 14:01:31Z vboxsync $ */
/** @file
* IPRT - Threads (Part 1), Ring-0 Driver, FreeBSD.
*/
/*
* Copyright (C) 2007-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "the-freebsd-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
#include <iprt/asm.h>
#include <iprt/asm-amd64-x86.h>
#include <iprt/assert.h>
#include <iprt/err.h>
#include <iprt/mp.h>
#include "internal/thread.h"
RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void)
{
return (RTNATIVETHREAD)curthread;
}
static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMillies)
{
int rc;
int cTicks;
/*
* 0 ms sleep -> yield.
*/
if (!cMillies)
{
RTThreadYield();
return VINF_SUCCESS;
}
/*
* Translate milliseconds into ticks and go to sleep.
*/
if (cMillies != RT_INDEFINITE_WAIT)
{
if (hz == 1000)
cTicks = cMillies;
else if (hz == 100)
cTicks = cMillies / 10;
else
{
int64_t cTicks64 = ((uint64_t)cMillies * hz) / 1000;
cTicks = (int)cTicks64;
if (cTicks != cTicks64)
cTicks = INT_MAX;
}
}
else
cTicks = 0; /* requires giant lock! */
rc = tsleep((void *)RTThreadSleep,
PZERO | PCATCH,
"iprtsl", /* max 6 chars */
cTicks);
switch (rc)
{
case 0:
return VINF_SUCCESS;
case EWOULDBLOCK:
return VERR_TIMEOUT;
case EINTR:
case ERESTART:
return VERR_INTERRUPTED;
default:
AssertMsgFailed(("%d\n", rc));
return VERR_NO_TRANSLATION;
}
}
RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
{
return rtR0ThreadFbsdSleepCommon(cMillies);
}
RTDECL(int) RTThreadSleepNoLog(RTMSINTERVAL cMillies)
{
return rtR0ThreadFbsdSleepCommon(cMillies);
}
RTDECL(bool) RTThreadYield(void)
{
#if __FreeBSD_version >= 900032
kern_yield(curthread->td_user_pri);
#else
uio_yield();
#endif
return false; /** @todo figure this one ... */
}
RTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread)
{
Assert(hThread == NIL_RTTHREAD);
return curthread->td_critnest == 0
&& ASMIntAreEnabled(); /** @todo is there a native freebsd function/macro for this? */
}
RTDECL(bool) RTThreadPreemptIsPending(RTTHREAD hThread)
{
Assert(hThread == NIL_RTTHREAD);
return curthread->td_owepreempt == 1;
}
RTDECL(bool) RTThreadPreemptIsPendingTrusty(void)
{
/* yes, RTThreadPreemptIsPending is reliable. */
return true;
}
RTDECL(bool) RTThreadPreemptIsPossible(void)
{
/* yes, kernel preemption is possible. */
return true;
}
RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState)
{
AssertPtr(pState);
Assert(pState->u32Reserved == 0);
pState->u32Reserved = 42;
critical_enter();
RT_ASSERT_PREEMPT_CPUID_DISABLE(pState);
}
RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState)
{
AssertPtr(pState);
Assert(pState->u32Reserved == 42);
pState->u32Reserved = 0;
RT_ASSERT_PREEMPT_CPUID_RESTORE(pState);
critical_exit();
}
RTDECL(bool) RTThreadIsInInterrupt(RTTHREAD hThread)
{
Assert(hThread == NIL_RTTHREAD); NOREF(hThread);
/** @todo FreeBSD: Implement RTThreadIsInInterrupt. Required for guest
* additions! */
return !ASMIntAreEnabled();
}
|
#pragma once
#include "Mat.h"
#include <vector>
#include "general.h"
using namespace std;
//#define MAX_MATSTACK (20)
class MatStack
{
private:
struct MatEntry {
MatEntry() : msg(nullptr) {}
MatEntry(const Mat4 _m, const char* _msg) : m(_m), msg(_msg) {}
Mat4 m;
const char* msg;
};
public:
MatStack() {}
Mat4& cur() {
return m_cur.m;
}
void push(const char* msg = nullptr) {
#ifdef MAX_MATSTACK
if (m_s.size() > MAX_MATSTACK)
throw HCException("matrix stack overflow");
#endif
m_s.push_back(MatEntry(m_cur.m, msg));
}
void pop() {
if (m_s.size() <= 0)
throw HCException("matrix stack underflow");
m_cur = m_s.back();
m_s.pop_back();
}
Mat4& peek(int back) {
if (back == 0)
return m_cur.m;
if (m_s.size() < back)
throw HCException("matrix stack underflow(peek)");
return m_s[m_s.size() - back].m;
}
void translate(float x, float y, float z) {
m_cur.m.translate(x, y, z);
}
void rotate(float angle, float x, float y, float z) {
m_cur.m.rotate(angle, x, y, z);
}
void scale(float x, float y, float z) {
m_cur.m.scale(x, y, z);
}
void scale(float v) {
m_cur.m.scale(v, v, v);
}
void mult(const Mat4& o) {
m_cur.m.mult(o);
}
void identity() {
m_cur.m.identity();
}
void set(const Mat4& o) {
m_cur.m = o;
}
private:
MatEntry m_cur;
vector<MatEntry> m_s;
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.