text
stringlengths 4
6.14k
|
|---|
/*
* OSPF AS Boundary Router functions.
* Copyright (C) 1999, 2000 Kunihiro Ishiguro, Toshiaki Takada
*
* This file is part of GNU Zebra.
*
* GNU Zebra 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.
*
* GNU Zebra is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _ZEBRA_OSPF_ASBR_H
#define _ZEBRA_OSPF_ASBR_H
struct route_map_set_values {
int32_t metric;
int32_t metric_type;
};
/* Redistributed external information. */
struct external_info {
/* Type of source protocol. */
uint8_t type;
unsigned short instance;
/* Prefix. */
struct prefix_ipv4 p;
/* Interface index. */
ifindex_t ifindex;
/* Nexthop address. */
struct in_addr nexthop;
/* Additional Route tag. */
route_tag_t tag;
/* Actual tag received from zebra*/
route_tag_t orig_tag;
struct route_map_set_values route_map_set;
#define ROUTEMAP_METRIC(E) (E)->route_map_set.metric
#define ROUTEMAP_METRIC_TYPE(E) (E)->route_map_set.metric_type
/* Back pointer to summary address */
struct ospf_external_aggr_rt *aggr_route;
/* To identify the routes to be originated
* after a summary address deletion.
*/
bool to_be_processed;
};
#define OSPF_EXTL_AGGR_DEFAULT_DELAY 5
#define OSPF_EXTERNAL_RT_COUNT(aggr) \
(((struct ospf_external_aggr_rt *)aggr)->match_extnl_hash->count)
enum ospf_aggr_action_t {
OSPF_ROUTE_AGGR_NONE = 0,
OSPF_ROUTE_AGGR_ADD,
OSPF_ROUTE_AGGR_DEL,
OSPF_ROUTE_AGGR_MODIFY
};
#define OSPF_SUCCESS 1
#define OSPF_FAILURE 0
#define OSPF_INVALID -1
#define OSPF_EXTERNAL_AGGRT_NO_ADVERTISE 0x1
#define OSPF_EXTERNAL_AGGRT_ORIGINATED 0x2
/* Data structures for external route aggregator */
struct ospf_external_aggr_rt {
/* Prefix. */
struct prefix_ipv4 p;
/* Bit 1 : Dont advertise.
* Bit 2 : Originated as Type-5
*/
uint8_t flags;
/* Tag for summary route */
route_tag_t tag;
/* Action to be done at the delay
* timer expairy.
*/
enum ospf_aggr_action_t action;
/* Hash Table of external routes */
struct hash *match_extnl_hash;
};
#define OSPF_ASBR_CHECK_DELAY 30
#define OSPF_ASBR_NSSA_REDIST_UPDATE_DELAY 9
extern void ospf_external_route_remove(struct ospf *, struct prefix_ipv4 *);
extern struct external_info *ospf_external_info_new(uint8_t, unsigned short);
extern void ospf_reset_route_map_set_values(struct route_map_set_values *);
extern int ospf_route_map_set_compare(struct route_map_set_values *,
struct route_map_set_values *);
extern struct external_info *ospf_external_info_add(struct ospf *, uint8_t,
unsigned short,
struct prefix_ipv4,
ifindex_t, struct in_addr,
route_tag_t);
extern void ospf_external_info_delete(struct ospf *, uint8_t, unsigned short,
struct prefix_ipv4);
extern struct external_info *ospf_external_info_lookup(struct ospf *, uint8_t,
unsigned short,
struct prefix_ipv4 *);
extern void ospf_asbr_status_update(struct ospf *, uint8_t);
extern void ospf_schedule_asbr_nssa_redist_update(struct ospf *ospf);
extern void ospf_redistribute_withdraw(struct ospf *, uint8_t, unsigned short);
extern void ospf_asbr_check(void);
extern void ospf_schedule_asbr_check(void);
extern void ospf_asbr_route_install_lsa(struct ospf_lsa *);
extern struct ospf_lsa *ospf_external_info_find_lsa(struct ospf *,
struct prefix_ipv4 *p);
/* External Route Aggregator */
extern void ospf_asbr_external_aggregator_init(struct ospf *instance);
extern void ospf_external_aggregator_free(struct ospf_external_aggr_rt *aggr);
extern bool is_valid_summary_addr(struct prefix_ipv4 *p);
extern struct ospf_external_aggr_rt *
ospf_external_aggr_match(struct ospf *ospf, struct prefix_ipv4 *p);
extern void ospf_unlink_ei_from_aggr(struct ospf *ospf,
struct ospf_external_aggr_rt *aggr,
struct external_info *ei);
extern struct ospf_lsa *
ospf_originate_summary_lsa(struct ospf *ospf,
struct ospf_external_aggr_rt *aggr,
struct external_info *ei);
extern int ospf_external_aggregator_timer_set(struct ospf *ospf,
unsigned int interval);
extern void ospf_external_aggrigator_free(struct ospf_external_aggr_rt *aggr);
extern struct ospf_external_aggr_rt *
ospf_extrenal_aggregator_lookup(struct ospf *ospf, struct prefix_ipv4 *p);
void ospf_unset_all_aggr_flag(struct ospf *ospf);
extern int ospf_asbr_external_aggregator_set(struct ospf *ospf,
struct prefix_ipv4 *p,
route_tag_t tag);
extern int ospf_asbr_external_aggregator_unset(struct ospf *ospf,
struct prefix_ipv4 *p,
route_tag_t tag);
extern int ospf_asbr_external_rt_no_advertise(struct ospf *ospf,
struct prefix_ipv4 *p);
extern int ospf_asbr_external_rt_advertise(struct ospf *ospf,
struct prefix_ipv4 *p);
#endif /* _ZEBRA_OSPF_ASBR_H */
|
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#define _GNU_SOURCE // for the definition of REG_RIP in ucontext.h
#include <stdio.h>
#include <jni.h>
#include <signal.h>
#include <sys/ucontext.h>
#ifdef __cplusplus
extern "C" {
#endif
void sig_handler(int sig, siginfo_t *info, ucontext_t *context) {
int thrNum;
printf( " HANDLER (1) " );
// Move forward RIP to skip failing instruction
context->uc_mcontext.gregs[REG_RIP] += 6;
}
JNIEXPORT void JNICALL Java_TestJNI_doSomething(JNIEnv *env, jclass klass, jint val) {
struct sigaction act;
struct sigaction oact;
act.sa_flags = SA_ONSTACK|SA_RESTART|SA_SIGINFO;
sigfillset(&act.sa_mask);
act.sa_handler = SIG_DFL;
act.sa_sigaction = (void (*)())sig_handler;
sigaction(0x20+val, &act, &oact);
printf( " doSomething(%d) " , val);
printf( " old handler = %p " , oact.sa_handler);
}
#ifdef __cplusplus
}
#endif
|
/*
* This file is part of the UCB release of Plan 9. It is subject to the license
* terms in the LICENSE file found in the top-level directory of this
* distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
* part of the UCB release of Plan 9, including this file, may be copied,
* modified, propagated, or distributed except according to the terms contained
* in the LICENSE file.
*/
#ifndef __GRP
#define __GRP
#ifndef _POSIX_SOURCE
This header file is not defined in pure ANSI
#endif
#pragma lib "/$M/lib/ape/libap.a"
#include <sys/types.h>
struct group {
char *gr_name;
gid_t gr_gid;
char **gr_mem;
};
#ifdef __cplusplus
extern "C" {
#endif
extern struct group *getgrgid(gid_t);
extern struct group *getgrnam(const char *);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* Copyright (c) 2003, 2007-11 Matteo Frigo
* Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Tue Feb 21 19:03:52 EST 2012 */
#include "codelet-rdft.h"
#ifdef HAVE_FMA
/* Generated by: ../../../genfft/gen_hc2c.native -fma -reorder-insns -schedule-for-pipeline -compact -variables 4 -pipeline-latency 4 -sign 1 -n 4 -dif -name hc2cb_4 -include hc2cb.h */
/*
* This function contains 22 FP additions, 12 FP multiplications,
* (or, 16 additions, 6 multiplications, 6 fused multiply/add),
* 25 stack variables, 0 constants, and 16 memory accesses
*/
#include "hc2cb.h"
static void hc2cb_4(R *Rp, R *Ip, R *Rm, R *Im, const R *W, stride rs, INT mb, INT me, INT ms)
{
{
INT m;
for (m = mb, W = W + ((mb - 1) * 6); m < me; m = m + 1, Rp = Rp + ms, Ip = Ip + ms, Rm = Rm - ms, Im = Im - ms, W = W + 6, MAKE_VOLATILE_STRIDE(rs)) {
E Th, Ta, T7, Ti, T9;
{
E Tq, Td, T3, Tg, Tu, Tm, T6, Tp;
{
E Tk, T4, Tl, T5;
{
E Tb, Tc, T1, T2, Te, Tf;
Tb = Ip[0];
Tc = Im[WS(rs, 1)];
T1 = Rp[0];
T2 = Rm[WS(rs, 1)];
Te = Ip[WS(rs, 1)];
Tq = Tb + Tc;
Td = Tb - Tc;
Tf = Im[0];
Tk = T1 - T2;
T3 = T1 + T2;
T4 = Rp[WS(rs, 1)];
Tg = Te - Tf;
Tl = Te + Tf;
T5 = Rm[0];
}
Tu = Tk + Tl;
Tm = Tk - Tl;
T6 = T4 + T5;
Tp = T4 - T5;
}
Rm[0] = Td + Tg;
{
E Tx, Tr, T8, Tn, Ts, To, Tj;
Tj = W[0];
Tx = Tq - Tp;
Tr = Tp + Tq;
Rp[0] = T3 + T6;
T8 = T3 - T6;
Tn = Tj * Tm;
Ts = Tj * Tr;
To = W[1];
{
E Tt, Tw, Ty, Tv;
Tt = W[4];
Tw = W[5];
Th = Td - Tg;
Im[0] = FMA(To, Tm, Ts);
Ip[0] = FNMS(To, Tr, Tn);
Ty = Tt * Tx;
Tv = Tt * Tu;
Ta = W[3];
T7 = W[2];
Im[WS(rs, 1)] = FMA(Tw, Tu, Ty);
Ip[WS(rs, 1)] = FNMS(Tw, Tx, Tv);
Ti = Ta * T8;
T9 = T7 * T8;
}
}
}
Rm[WS(rs, 1)] = FMA(T7, Th, Ti);
Rp[WS(rs, 1)] = FNMS(Ta, Th, T9);
}
}
}
static const tw_instr twinstr[] = {
{TW_FULL, 1, 4},
{TW_NEXT, 1, 0}
};
static const hc2c_desc desc = { 4, "hc2cb_4", twinstr, &GENUS, {16, 6, 6, 0} };
void X(codelet_hc2cb_4) (planner *p) {
X(khc2c_register) (p, hc2cb_4, &desc, HC2C_VIA_RDFT);
}
#else /* HAVE_FMA */
/* Generated by: ../../../genfft/gen_hc2c.native -compact -variables 4 -pipeline-latency 4 -sign 1 -n 4 -dif -name hc2cb_4 -include hc2cb.h */
/*
* This function contains 22 FP additions, 12 FP multiplications,
* (or, 16 additions, 6 multiplications, 6 fused multiply/add),
* 13 stack variables, 0 constants, and 16 memory accesses
*/
#include "hc2cb.h"
static void hc2cb_4(R *Rp, R *Ip, R *Rm, R *Im, const R *W, stride rs, INT mb, INT me, INT ms)
{
{
INT m;
for (m = mb, W = W + ((mb - 1) * 6); m < me; m = m + 1, Rp = Rp + ms, Ip = Ip + ms, Rm = Rm - ms, Im = Im - ms, W = W + 6, MAKE_VOLATILE_STRIDE(rs)) {
E T3, Ti, Tc, Tn, T6, Tm, Tf, Tj;
{
E T1, T2, Ta, Tb;
T1 = Rp[0];
T2 = Rm[WS(rs, 1)];
T3 = T1 + T2;
Ti = T1 - T2;
Ta = Ip[0];
Tb = Im[WS(rs, 1)];
Tc = Ta - Tb;
Tn = Ta + Tb;
}
{
E T4, T5, Td, Te;
T4 = Rp[WS(rs, 1)];
T5 = Rm[0];
T6 = T4 + T5;
Tm = T4 - T5;
Td = Ip[WS(rs, 1)];
Te = Im[0];
Tf = Td - Te;
Tj = Td + Te;
}
Rp[0] = T3 + T6;
Rm[0] = Tc + Tf;
{
E T8, Tg, T7, T9;
T8 = T3 - T6;
Tg = Tc - Tf;
T7 = W[2];
T9 = W[3];
Rp[WS(rs, 1)] = FNMS(T9, Tg, T7 * T8);
Rm[WS(rs, 1)] = FMA(T9, T8, T7 * Tg);
}
{
E Tk, To, Th, Tl;
Tk = Ti - Tj;
To = Tm + Tn;
Th = W[0];
Tl = W[1];
Ip[0] = FNMS(Tl, To, Th * Tk);
Im[0] = FMA(Th, To, Tl * Tk);
}
{
E Tq, Ts, Tp, Tr;
Tq = Ti + Tj;
Ts = Tn - Tm;
Tp = W[4];
Tr = W[5];
Ip[WS(rs, 1)] = FNMS(Tr, Ts, Tp * Tq);
Im[WS(rs, 1)] = FMA(Tp, Ts, Tr * Tq);
}
}
}
}
static const tw_instr twinstr[] = {
{TW_FULL, 1, 4},
{TW_NEXT, 1, 0}
};
static const hc2c_desc desc = { 4, "hc2cb_4", twinstr, &GENUS, {16, 6, 6, 0} };
void X(codelet_hc2cb_4) (planner *p) {
X(khc2c_register) (p, hc2cb_4, &desc, HC2C_VIA_RDFT);
}
#endif /* HAVE_FMA */
|
/*
* Copyright (c) 2009 Cyrille Berger <cberger@cberger.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* either version 2, or (at your option) any later version of the License.
*
* 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; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _SECTIONS_SAVER_H_
#define _SECTIONS_SAVER_H_
#include <QObject>
#include <QMap>
class QDomDocument;
class QDomElement;
class QTimer;
class RootSection;
class Section;
class SectionGroup;
class KUndo2Stack;
class SectionsIO : public QObject
{
Q_OBJECT
public:
explicit SectionsIO(RootSection* rootSection);
~SectionsIO();
public:
enum PushMode {
SinglePush,
RecursivePush
};
/**
* push a section to save
*/
void push(Section* _section, PushMode _pushMode = SinglePush);
public slots:
void save();
private:
void load();
private:
RootSection* m_rootSection;
QTimer* m_timer;
struct SaveContext;
QMap<Section*, SaveContext*> m_contextes;
QString m_directory; ///< directory where the sections are saved
private:
/**
* Save the structure and update the m_contextes map
* @param contextToRemove contains a list of used context, that need to be removed
* from that list, otherwise doSave will remove the
* associated files
*/
void saveTheStructure(QDomDocument& doc, QDomElement& elt, SectionGroup* root, QList<SaveContext*>& contextToRemove);
void loadTheStructure(QDomElement& elt, SectionGroup* root, RootSection* _rootSection);
QString generateFileName();
bool usedFileName(const QString&);
QString structureFileName();
int m_nextNumber;
QList<Section* > m_sectionsToSave;
};
#endif
|
/*
* linux/mm/page_io.c
*
* Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
*
* Swap reorganised 29.12.95,
* Asynchronous swapping added 30.12.95. Stephen Tweedie
* Removed race in async swapping. 14.4.1996. Bruno Haible
* Add swap of shared pages through the page cache. 20.2.1998. Stephen Tweedie
* Always use brw_page, life becomes simpler. 12 May 1998 Eric Biederman
*/
#include <linux/mm.h>
#include <linux/kernel_stat.h>
#include <linux/gfp.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/bio.h>
#include <linux/swapops.h>
#include <linux/writeback.h>
#include <linux/frontswap.h>
#include <linux/ratelimit.h>
#include <asm/pgtable.h>
/*
* We don't need to see swap errors more than once every 1 second to know
* that a problem is occurring.
*/
#define SWAP_ERROR_LOG_RATE_MS 1000
static struct bio *get_swap_bio(gfp_t gfp_flags,
struct page *page, bio_end_io_t end_io)
{
struct bio *bio;
bio = bio_alloc(gfp_flags, 1);
if (bio) {
bio->bi_sector = map_swap_page(page, &bio->bi_bdev);
bio->bi_sector <<= PAGE_SHIFT - 9;
bio->bi_io_vec[0].bv_page = page;
bio->bi_io_vec[0].bv_len = PAGE_SIZE;
bio->bi_io_vec[0].bv_offset = 0;
bio->bi_vcnt = 1;
bio->bi_idx = 0;
bio->bi_size = PAGE_SIZE;
bio->bi_end_io = end_io;
}
return bio;
}
static void end_swap_bio_write(struct bio *bio, int err)
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct page *page = bio->bi_io_vec[0].bv_page;
static unsigned long swap_error_rs_time;
if (!uptodate) {
SetPageError(page);
/*
* We failed to write the page out to swap-space.
* Re-dirty the page in order to avoid it being reclaimed.
* Also print a dire warning that things will go BAD (tm)
* very quickly.
*
* Also clear PG_reclaim to avoid rotate_reclaimable_page()
*/
set_page_dirty(page);
if (printk_timed_ratelimit(&swap_error_rs_time,
SWAP_ERROR_LOG_RATE_MS))
printk(KERN_ALERT "Write-error on swap-device (%u:%u:%Lu)\n",
imajor(bio->bi_bdev->bd_inode),
iminor(bio->bi_bdev->bd_inode),
(unsigned long long)bio->bi_sector);
ClearPageReclaim(page);
}
end_page_writeback(page);
bio_put(bio);
}
void end_swap_bio_read(struct bio *bio, int err)
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct page *page = bio->bi_io_vec[0].bv_page;
if (!uptodate) {
SetPageError(page);
ClearPageUptodate(page);
printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n",
imajor(bio->bi_bdev->bd_inode),
iminor(bio->bi_bdev->bd_inode),
(unsigned long long)bio->bi_sector);
} else {
SetPageUptodate(page);
}
unlock_page(page);
bio_put(bio);
}
/*
* We may have stale swap cache pages in memory: notice
* them here and get rid of the unnecessary final write.
*/
int swap_writepage(struct page *page, struct writeback_control *wbc)
{
struct bio *bio;
int ret = 0, rw = WRITE;
if (try_to_free_swap(page)) {
unlock_page(page);
goto out;
}
if (frontswap_put_page(page) == 0) {
set_page_writeback(page);
unlock_page(page);
end_page_writeback(page);
goto out;
}
bio = get_swap_bio(GFP_NOIO, page, end_swap_bio_write);
if (bio == NULL) {
set_page_dirty(page);
unlock_page(page);
ret = -ENOMEM;
goto out;
}
if (wbc->sync_mode == WB_SYNC_ALL)
rw |= REQ_SYNC;
count_vm_event(PSWPOUT);
set_page_writeback(page);
unlock_page(page);
submit_bio(rw, bio);
out:
return ret;
}
int swap_readpage(struct page *page)
{
struct bio *bio;
int ret = 0;
VM_BUG_ON(!PageLocked(page));
VM_BUG_ON(PageUptodate(page));
if (frontswap_get_page(page) == 0) {
SetPageUptodate(page);
unlock_page(page);
goto out;
}
bio = get_swap_bio(GFP_KERNEL, page, end_swap_bio_read);
if (bio == NULL) {
unlock_page(page);
ret = -ENOMEM;
goto out;
}
count_vm_event(PSWPIN);
submit_bio(READ, bio);
out:
return ret;
}
|
// VirtualDub - Video processing and capture application
// Copyright (C) 1998-2001 Avery Lee
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef f_LEVELCONTROL_H
#define f_LEVELCONTROL_H
#include <windows.h>
#define VIDEOLEVELCONTROLCLASS (g_szLevelControlName)
#ifndef f_LEVELCONTROL_CPP
extern const char g_szLevelControlName[];
#endif
#define VLCM_SETTABCOUNT (WM_USER+0x100)
#define VLCM_SETTABCOLOR (WM_USER+0x101)
#define VLCM_SETTABPOS (WM_USER+0x102)
#define VLCM_GETTABPOS (WM_USER+0x103)
#define VLCM_MOVETABPOS (WM_USER+0x104)
#define VLCM_SETGRADIENT (WM_USER+0x105)
#define VLCN_TABCHANGE (2)
typedef struct NMVLTABCHANGE {
NMHDR hdr;
int iTab;
int iNewPos;
} NMVLTABCHANGE;
ATOM RegisterLevelControl();
#endif
|
/* $Id: string_colours.h 27378 2015-08-10 10:04:14Z alberth $ */
/*
* 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 string_colours.h The colour translation of GRF's strings. */
/** Colour mapping for #TextColour. */
static const byte _string_colourmap[17] = {
150, // TC_BLUE
12, // TC_SILVER
189, // TC_GOLD
184, // TC_RED
174, // TC_PURPLE
30, // TC_LIGHT_BROWN
195, // TC_ORANGE
209, // TC_GREEN
68, // TC_YELLOW
95, // TC_DARK_GREEN
79, // TC_CREAM
116, // TC_BROWN
15, // TC_WHITE
152, // TC_LIGHT_BLUE
6, // TC_GREY
133, // TC_DARK_BLUE
1, // TC_BLACK
};
|
/*
* Copyright (c) 2008, Atheros Communications Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _ATHR_CONFIG_H
#define _ATHR_CONFIG_H
#include <linux/version.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31))
#include <linux/autoconf.h>
#else
#include <linux/config.h>
#endif
/*
* This defines the interconnects between old Kconfig definitions and the new
* definitions based on the new BSP.
*
* Eventually this file is meant to disappear.
*/
#if defined(CONFIG_MACH_AR7240)||defined(CONFIG_MACH_HORNET)
#define CONFIG_GMAC1_RXFCTL 1
#define CONFIG_GMAC1_TXFCTL 1
#define CONFIG_CHECK_DMA_STATUS 1
#ifndef CONFIG_ATHR_RX_TASK
#undef CONFIG_ATHR_RX_TASK
#endif
#ifdef CONFIG_AG7240_QOS
#define CONFIG_ATHRS_QOS 1
#endif
#if defined(CONFIG_AR7240_S26_VLAN_IGMP) || defined (CONFIG_AR7240_S27_VLAN_IGMP)
#define CONFIG_ATHR_VLAN_IGMP 1
#endif
#ifndef CONFIG_AG7240_NUMBER_TX_PKTS_1
#define CONFIG_AG7240_NUMBER_TX_PKTS_1 CONFIG_AG7240_NUMBER_TX_PKTS
#endif
#ifndef CONFIG_AG7240_NUMBER_RX_PKTS_1
#define CONFIG_AG7240_NUMBER_RX_PKTS_1 CONFIG_AG7240_NUMBER_RX_PKTS
#endif
#endif //CONFIG_MACH_AR7240
#ifdef CONFIG_MACH_AR934x
#include "config.h"
#if defined(CONFIG_AR7240_S26_VLAN_IGMP) || defined (CONFIG_AR7240_S27_VLAN_IGMP)
#define CONFIG_ATHR_VLAN_IGMP 1
#endif
#endif //CONFIG_MACH_AR934x
#endif //_ATHR_CONFIG_H
|
//=============================================================================
// MuseScore
// Music Composition & Notation
// $Id: palette.cpp 5576 2012-04-24 19:15:22Z wschweer $
//
// Copyright (C) 2011 Werner Schweer and others
//
// 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 and appearing in
// the file LICENSE.GPL
//=============================================================================
#ifndef __PALETTE_BOX__
#define __PALETTE_BOX__
namespace Ms {
class Xml;
class XmlReader;
class Palette;
//---------------------------------------------------------
// PaletteBox
//---------------------------------------------------------
class PaletteBox : public QDockWidget {
Q_OBJECT
QVBoxLayout* vbox;
Palette* newPalette(const QString& name, int slot);
private slots:
void paletteCmd(int, int);
void closeAll();
void displayMore(const QString& paletteName);
signals:
void changed();
public:
PaletteBox(QWidget* parent = 0);
void addPalette(Palette*);
void write(Xml&);
bool read(XmlReader&);
void clear();
QList<Palette*> palettes() const;
};
class PaletteBoxScrollArea : public QScrollArea {
Q_OBJECT
public:
virtual QSize sizeHint() const {return QSize(170,170);}
};
} // namespace Ms
#endif
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/icon.h
// Purpose: wxIcon class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: icon.h 56644 2008-11-02 02:39:52Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ICON_H_
#define _WX_ICON_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/msw/gdiimage.h"
// ---------------------------------------------------------------------------
// icon data
// ---------------------------------------------------------------------------
// notice that although wxIconRefData inherits from wxBitmapRefData, it is not
// a valid wxBitmapRefData
class WXDLLIMPEXP_CORE wxIconRefData : public wxGDIImageRefData
{
public:
wxIconRefData() { }
virtual ~wxIconRefData() { Free(); }
virtual void Free();
};
// ---------------------------------------------------------------------------
// Icon
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIcon : public wxGDIImage
{
public:
// ctors
// default
wxIcon() { }
// from raw data
wxIcon(const char bits[], int width, int height);
// from XPM data
wxIcon(const char* const* data) { CreateIconFromXpm(data); }
#ifdef wxNEEDS_CHARPP
wxIcon(char **data) { CreateIconFromXpm(const_cast<const char* const*>(data)); }
#endif
// from resource/file
wxIcon(const wxString& name,
wxBitmapType type = wxICON_DEFAULT_TYPE,
int desiredWidth = -1, int desiredHeight = -1);
wxIcon(const wxIconLocation& loc);
virtual ~wxIcon();
virtual bool LoadFile(const wxString& name,
wxBitmapType type = wxICON_DEFAULT_TYPE,
int desiredWidth = -1, int desiredHeight = -1);
// implementation only from now on
wxIconRefData *GetIconData() const { return (wxIconRefData *)m_refData; }
void SetHICON(WXHICON icon) { SetHandle((WXHANDLE)icon); }
WXHICON GetHICON() const { return (WXHICON)GetHandle(); }
// create from bitmap (which should have a mask unless it's monochrome):
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
protected:
virtual wxGDIImageRefData *CreateData() const
{
return new wxIconRefData;
}
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
// create from XPM data
void CreateIconFromXpm(const char* const* data);
private:
DECLARE_DYNAMIC_CLASS(wxIcon)
};
#endif
// _WX_ICON_H_
|
/*
* Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <errno.h>
#include <asm/io.h>
#include <asm/mrccache.h>
#include <asm/post.h>
#include <asm/processor.h>
#include <asm/fsp/fsp_support.h>
DECLARE_GLOBAL_DATA_PTR;
int print_cpuinfo(void)
{
post_code(POST_CPU_INFO);
return default_print_cpuinfo();
}
int fsp_init_phase_pci(void)
{
u32 status;
/* call into FspNotify */
debug("Calling into FSP (notify phase INIT_PHASE_PCI): ");
status = fsp_notify(NULL, INIT_PHASE_PCI);
if (status)
debug("fail, error code %x\n", status);
else
debug("OK\n");
return status ? -EPERM : 0;
}
void board_final_cleanup(void)
{
u32 status;
/* call into FspNotify */
debug("Calling into FSP (notify phase INIT_PHASE_BOOT): ");
status = fsp_notify(NULL, INIT_PHASE_BOOT);
if (status)
debug("fail, error code %x\n", status);
else
debug("OK\n");
return;
}
static __maybe_unused void *fsp_prepare_mrc_cache(void)
{
struct mrc_data_container *cache;
struct mrc_region entry;
int ret;
ret = mrccache_get_region(NULL, &entry);
if (ret)
return NULL;
cache = mrccache_find_current(&entry);
if (!cache)
return NULL;
debug("%s: mrc cache at %p, size %x checksum %04x\n", __func__,
cache->data, cache->data_size, cache->checksum);
return cache->data;
}
int x86_fsp_init(void)
{
void *nvs;
if (!gd->arch.hob_list) {
#ifdef CONFIG_ENABLE_MRC_CACHE
nvs = fsp_prepare_mrc_cache();
#else
nvs = NULL;
#endif
/*
* The first time we enter here, call fsp_init().
* Note the execution does not return to this function,
* instead it jumps to fsp_continue().
*/
fsp_init(CONFIG_FSP_TEMP_RAM_ADDR, BOOT_FULL_CONFIG, nvs);
} else {
/*
* The second time we enter here, adjust the size of malloc()
* pool before relocation. Given gd->malloc_base was adjusted
* after the call to board_init_f_mem() in arch/x86/cpu/start.S,
* we should fix up gd->malloc_limit here.
*/
gd->malloc_limit += CONFIG_FSP_SYS_MALLOC_F_LEN;
}
return 0;
}
|
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef __XMIT_OSDEP_H_
#define __XMIT_OSDEP_H_
struct pkt_file {
_pkt *pkt;
SIZE_T pkt_len; //the remainder length of the open_file
_buffer *cur_buffer;
u8 *buf_start;
u8 *cur_addr;
SIZE_T buf_len;
};
#define NR_XMITFRAME 256
struct xmit_priv;
struct pkt_attrib;
struct sta_xmit_priv;
struct xmit_frame;
struct xmit_buf;
extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
void rtw_os_xmit_schedule(_adapter *padapter);
int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag);
void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag);
extern void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib);
extern uint rtw_remainder_len(struct pkt_file *pfile);
extern void _rtw_open_pktfile(_pkt *pkt, struct pkt_file *pfile);
extern uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen);
extern sint rtw_endofpktfile (struct pkt_file *pfile);
extern void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt);
extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe);
#endif //__XMIT_OSDEP_H_
|
/* Test accepting a connection to a server socket.
Copyright (C) 2011-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <sys/socket.h>
#include "signature.h"
SIGNATURE_CHECK (accept, int, (int, struct sockaddr *, socklen_t *));
#include <errno.h>
#include <netinet/in.h>
#include <unistd.h>
#include "sockets.h"
#include "macros.h"
int
main (void)
{
(void) gl_sockets_startup (SOCKETS_1_1);
/* Test behaviour for invalid file descriptors. */
{
struct sockaddr_in addr;
socklen_t addrlen = sizeof (addr);
errno = 0;
ASSERT (accept (-1, (struct sockaddr *) &addr, &addrlen) == -1);
ASSERT (errno == EBADF);
}
{
struct sockaddr_in addr;
socklen_t addrlen = sizeof (addr);
close (99);
errno = 0;
ASSERT (accept (99, (struct sockaddr *) &addr, &addrlen) == -1);
ASSERT (errno == EBADF);
}
return 0;
}
|
/* $Id: setup.c,v 1.10 1999/01/04 16:03:59 ralf Exp $
*
* Setup pointers to hardware-dependent routines.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996, 1997, 1998 by Ralf Baechle
*/
#include <asm/ptrace.h>
#include <linux/config.h>
#include <linux/hdreg.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <linux/pci.h>
#include <linux/mc146818rtc.h>
#include <linux/console.h>
#include <linux/fb.h>
#include <linux/pc_keyb.h>
#include <asm/bcache.h>
#include <asm/bootinfo.h>
#include <asm/keyboard.h>
#include <asm/ide.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/processor.h>
#include <asm/reboot.h>
#include <asm/sni.h>
#include <asm/pci.h>
/*
* Initial irq handlers.
*/
static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
/*
* IRQ2 is cascade interrupt to second interrupt controller
*/
static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
extern asmlinkage void sni_rm200_pci_handle_int(void);
extern void sni_machine_restart(char *command);
extern void sni_machine_halt(void);
extern void sni_machine_power_off(void);
extern struct ide_ops std_ide_ops;
extern struct rtc_ops std_rtc_ops;
extern struct kbd_ops std_kbd_ops;
__initfunc(static void sni_irq_setup(void))
{
set_except_vector(0, sni_rm200_pci_handle_int);
request_region(0x20,0x20, "pic1");
request_region(0xa0,0x20, "pic2");
i8259_setup_irq(2, &irq2);
/*
* IRQ0 seems to be the irq for PC style stuff.
* I don't know how to handle the debug button interrupt, so
* don't use this button yet or bad things happen ...
*/
set_cp0_status(ST0_IM, IE_IRQ1 | IE_IRQ3 | IE_IRQ4);
}
void (*board_time_init)(struct irqaction *irq);
__initfunc(static void sni_rm200_pci_time_init(struct irqaction *irq))
{
/* set the clock to 100 Hz */
outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
outb_p(LATCH & 0xff , 0x40); /* LSB */
outb(LATCH >> 8 , 0x40); /* MSB */
i8259_setup_irq(0, irq);
}
unsigned char aux_device_present;
extern struct pci_ops sni_pci_ops;
extern unsigned char sni_map_isa_cache;
/*
* A bit more gossip about the iron we're running on ...
*/
static inline void sni_pcimt_detect(void)
{
char boardtype[80];
unsigned char csmsr;
char *p = boardtype;
unsigned int asic;
csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
p += sprintf(p, "%s PCI", (csmsr & 0x80) ? "RM200" : "RM300");
if ((csmsr & 0x80) == 0)
p += sprintf(p, ", board revision %s",
(csmsr & 0x20) ? "D" : "C");
asic = csmsr & 0x80;
asic = (csmsr & 0x08) ? asic : !asic;
p += sprintf(p, ", ASIC PCI Rev %s", asic ? "1.0" : "1.1");
printk("%s.\n", boardtype);
}
__initfunc(void sni_rm200_pci_setup(void))
{
tag *atag;
/*
* We just check if a tag_screen_info can be gathered
* in setup_arch(), if yes we don't proceed futher...
*/
atag = bi_TagFind(tag_screen_info);
if (!atag) {
/*
* If no, we try to find the tag_arc_displayinfo which is
* always created by Milo for an ARC box (for now Milo only
* works on ARC boxes :) -Stoned.
*/
atag = bi_TagFind(tag_arcdisplayinfo);
if (atag) {
screen_info.orig_x =
((mips_arc_DisplayInfo*)TAGVALPTR(atag))->cursor_x;
screen_info.orig_y =
((mips_arc_DisplayInfo*)TAGVALPTR(atag))->cursor_y;
screen_info.orig_video_cols =
((mips_arc_DisplayInfo*)TAGVALPTR(atag))->columns;
screen_info.orig_video_lines =
((mips_arc_DisplayInfo*)TAGVALPTR(atag))->lines;
}
}
sni_pcimt_detect();
sni_pcimt_sc_init();
irq_setup = sni_irq_setup;
mips_io_port_base = SNI_PORT_BASE;
/*
* Setup (E)ISA I/O memory access stuff
*/
isa_slot_offset = 0xb0000000;
// sni_map_isa_cache = 0;
EISA_bus = 1;
request_region(0x00,0x20,"dma1");
request_region(0x40,0x20,"timer");
/* XXX FIXME: CONFIG_RTC */
request_region(0x70,0x10,"rtc");
request_region(0x80,0x10,"dma page reg");
request_region(0xc0,0x20,"dma2");
board_time_init = sni_rm200_pci_time_init;
_machine_restart = sni_machine_restart;
_machine_halt = sni_machine_halt;
_machine_power_off = sni_machine_power_off;
aux_device_present = 0xaa;
/*
* Some cluefull person has placed the PCI config data directly in
* the I/O port space ...
*/
request_region(0xcfc,0x04,"PCI config data");
pci_ops = &sni_pci_ops;
#ifdef CONFIG_BLK_DEV_IDE
ide_ops = &std_ide_ops;
#endif
conswitchp = &vga_con;
rtc_ops = &std_rtc_ops;
kbd_ops = &std_kbd_ops;
#ifdef CONFIG_PSMOUSE
aux_device_present = 0xaa;
#endif
}
|
/*
* Copyright (C) 2003-2010 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.
*/
/*
* This program is a command line interface to MPD's software volume
* library (pcm_volume.c).
*
*/
#include "config.h"
#include "pcm_volume.h"
#include "audio_parser.h"
#include "audio_format.h"
#include "stdbin.h"
#include <glib.h>
#include <stddef.h>
#include <unistd.h>
int main(int argc, char **argv)
{
GError *error = NULL;
struct audio_format audio_format;
bool ret;
static char buffer[4096];
ssize_t nbytes;
if (argc > 2) {
g_printerr("Usage: software_volume [FORMAT] <IN >OUT\n");
return 1;
}
if (argc > 1) {
ret = audio_format_parse(&audio_format, argv[1],
false, &error);
if (!ret) {
g_printerr("Failed to parse audio format: %s\n",
error->message);
return 1;
}
} else
audio_format_init(&audio_format, 48000, SAMPLE_FORMAT_S16, 2);
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
if (!pcm_volume(buffer, nbytes, &audio_format,
PCM_VOLUME_1 / 2)) {
g_printerr("pcm_volume() has failed\n");
return 2;
}
write(1, buffer, nbytes);
}
}
|
#ifndef FONTPICKERDLG_H
#define FONTPICKERDLG_H
#include "wxcrafter.h"
class FontPickerDlg : public FontPickerDlgBaseClass
{
wxString m_fontname;
protected:
virtual void OnUseCustomFont(wxCommandEvent& event);
virtual void OnUseCustomFontUI(wxUpdateUIEvent& event);
virtual void OnUsePreDefinedFontUI(wxUpdateUIEvent& event);
virtual void OnSystemFontSelected(wxCommandEvent& event);
virtual void OnFontSelected(wxFontPickerEvent& event);
virtual void OnUsePreDefinedFont(wxCommandEvent& event);
protected:
void DoUpdateSelectionToPreDefinedFont();
void DoUpdateSelectionToCustomFont();
public:
FontPickerDlg(wxWindow* parent, const wxString& font);
virtual ~FontPickerDlg();
const wxString& GetFontName() const
{
static wxString EMPTY_STRING;
if(m_checkBoxCustomFont->IsChecked() == false && m_checkBoxPreDefinedFont->IsChecked() == false)
return EMPTY_STRING;
return m_fontname;
}
};
#endif // FONTPICKERDLG_H
|
/*
* Copyright (c) 2010 Cyrille Berger <cberger@cberger.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 _KIS_NODE_QUERY_PATH_TEST_H_
#define _KIS_NODE_QUERY_PATH_TEST_H_
#include <QtTest>
#include "kis_types.h"
class KisNodeQueryPathTest : public QObject
{
Q_OBJECT
public:
KisNodeQueryPathTest();
private slots:
void testCurrentLayerFromRelativeString();
void testCurrentLayerFromAbsoluteString();
void testCurrentLayerFromAbsolutePath();
void testChild1LayerFromRelativeString();
void testChild1LayerFromAbsoluteString();
void testChild1LayerFromAbsolutePath();
void testChild2LayerFromRelativeString();
void testChild2LayerFromAbsoluteString();
void testChild2LayerFromAbsolutePath();
void testBrother1LayerFromRelativeString();
void testBrother1LayerFromAbsoluteString();
void testBrother1LayerFromAbsolutePath();
void testBrother2LayerFromRelativeString();
void testBrother2LayerFromAbsoluteString();
void testBrother2LayerFromAbsolutePath();
void testParentLayerFromRelativeString();
void testParentLayerFromAbsoluteString();
void testParentLayerFromAbsolutePath();
void testRootLayerFromRelativeString();
void testRootLayerFromAbsoluteString();
void testRootLayerFromAbsolutePath();
void testPathCompression();
private:
KisImageSP image;
KisNodeSP current;
KisNodeSP parent;
KisNodeSP child1, child2;
KisNodeSP brother1, brother2;
};
#endif
|
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/i2c_simple.h>
#include <stdint.h>
int i2c_read_field(unsigned int bus, uint8_t chip, uint8_t reg, uint8_t *data,
uint8_t mask, uint8_t shift)
{
int ret;
uint8_t buf = 0;
ret = i2c_readb(bus, chip, reg, &buf);
buf &= (mask << shift);
*data = (buf >> shift);
return ret;
}
int i2c_write_field(unsigned int bus, uint8_t chip, uint8_t reg, uint8_t data,
uint8_t mask, uint8_t shift)
{
int ret;
uint8_t buf = 0;
ret = i2c_readb(bus, chip, reg, &buf);
buf &= ~(mask << shift);
buf |= (data << shift);
ret |= i2c_writeb(bus, chip, reg, buf);
return ret;
}
|
#ifndef __BACKPORT_LINUX_IF_ETHER_H_TO_2_6_21__
#define __BACKPORT_LINUX_IF_ETHER_H_TO_2_6_21__
#include_next <linux/if_ether.h>
#define ETH_FCS_LEN 4 /* Octets in the FCS */
#endif
|
#include "24c16.h"
#include "ult.h"
#include "config.h"
void at24c16_init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
//Port B bidirection SDA
GPIO_InitStructure.GPIO_Pin = I2C_SDA;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;
GPIO_Init(GPIOB, &GPIO_InitStructure);
//Port B output
GPIO_InitStructure.GPIO_Pin = I2C_SCK;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOB, &GPIO_InitStructure);
}
void at24c16_start(void)
{
GPIO_SetBits(GPIOB, I2C_SDA);
GPIO_SetBits(GPIOB, I2C_SCK);
Delay_us(1);
GPIO_ResetBits(GPIOB, I2C_SDA);
GPIO_ResetBits(GPIOB, I2C_SCK);
}
void at24c16_stop(void)
{
GPIO_ResetBits(GPIOB, I2C_SDA);
GPIO_SetBits(GPIOB, I2C_SCK);
Delay_us(1);
GPIO_SetBits(GPIOB, I2C_SDA);
}
void write_1byte(unsigned char val)
{
unsigned char i, tmp;
tmp=val;
for (i=0;i<8;i++)
{
GPIO_ResetBits(GPIOB, I2C_SCK);
Delay_us(1);
if (((tmp<<i) & 0x80)==0x80)
GPIO_SetBits(GPIOB, I2C_SDA);
else
GPIO_ResetBits(GPIOB, I2C_SDA);
Delay_us(1);
GPIO_SetBits(GPIOB, I2C_SCK);
Delay_us(1);
}
GPIO_ResetBits(GPIOB, I2C_SCK);
Delay_us(1);
GPIO_SetBits(GPIOB, I2C_SDA);
Delay_us(1);
}
unsigned char read_1byte(void)
{
unsigned char i,j,k=0;
GPIO_ResetBits(GPIOB, I2C_SCK);Delay_us(1);GPIO_SetBits(GPIOB, I2C_SDA);
for (i=0;i<8;i++)
{
Delay_us(1);
GPIO_SetBits(GPIOB, I2C_SCK);
Delay_us(1);
if(GPIO_ReadInputDataBit(GPIOB, I2C_SDA)==1) j=1; //???SDA becoms inout pin from output pin;
else j=0;
k=(k<<1) | j;
GPIO_ResetBits(GPIOB, I2C_SCK);
}
Delay_us(1);
return (k);
}
void clock(void)
{
uint16 i=0;
GPIO_SetBits(GPIOB, I2C_SCK);
Delay_us(1);
while((GPIO_ReadInputDataBit(GPIOB, I2C_SDA)==1) && (i<255))
i++;
GPIO_ResetBits(GPIOB, I2C_SCK);
Delay_us(1);
}
void at24c16_write(uint16 addr, uint8 val)
{
uint8 l_addr;
__disable_irq();
at24c16_start();
//write_1byte(0xa0);
//clock();
//uint8 h_addr=addr>>8;
//write_1byte(h_addr);
write_1byte(0xa0 | ((addr>>7 & 0xfe)));
clock();
l_addr=(addr%256);
write_1byte(l_addr);
clock();
write_1byte(val);
clock();
at24c16_stop();
__enable_irq();
Delay_ms(5);
}
unsigned char at24c16_read(uint16 addr)
{
//uint8 high,low;
uint8 i;
uint8 low;
low = addr & 0x00ff;
//high=(addr & 0xff00)>>8;
__disable_irq();
at24c16_start();
//write_1byte(0xa0);
//clock();
//write_1byte(high);
write_1byte(0xa0 | ((addr>>7 & 0xfe)));
clock();
write_1byte(low);
clock();
at24c16_start();
write_1byte(0xa1);
clock();
i=read_1byte();
at24c16_stop();
//Delay_us(5);
__enable_irq();
return(i);
}
//eep block write
//eepAddr: eeprom start address
//dat: data array to be saved to eeprom
//index: data array start index
//len: how long to be write
void eep_block_write(uint16 eepAddr, uint8* dat, uint16 index, uint16 len)
{
uint16 i;
for(i=0; i<len; i++)
{
at24c16_write(eepAddr+i, dat[index+i]);
}
}
void erase_eeprom(uint16 startAddr, uint16 len)
{
uint16 i;
for(i=startAddr;i<startAddr+len;i++)
{
at24c16_write(i,0xff);
}
}
|
void test_postscript_comment_entities(){
test_parser_verify_entity(
test_parser_sourcefile("postscript", "%comment"),
"comment", "%comment"
);
}
void all_postscript_tests(){
test_postscript_comment_entities();
}
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2020 Neal Gompa <ngompa13@gmail.com>
* based on dnf-backend-vendor-mageia.c
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* 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
*/
#include "dnf-backend-vendor.h"
gboolean
dnf_validate_supported_repo (const gchar *id)
{
guint i, j, k, l;
const gchar *valid_sourcesect[] = { "",
"-contrib",
"-restricted",
"-non-free",
NULL };
const gchar *valid_sourcetype[] = { "",
"-debuginfo",
"-source",
NULL };
const gchar *valid_arch[] = { "x86_64",
"i586",
NULL };
const gchar *valid[] = { "rosa",
"updates",
"testing",
NULL };
/* Iterate over the ID arrays to find a matching identifier */
for (i = 0; valid[i] != NULL; i++) {
for (j = 0; valid_arch[j] != NULL; j++) {
for (k = 0; valid_sourcesect[k] != NULL; k++) {
for (l = 0; valid_sourcetype[l] != NULL; l++) {
g_autofree gchar *source_entry = g_strconcat(valid[i], "-", valid_arch[j], valid_sourcesect[k], valid_sourcetype[l], NULL);
if (g_strcmp0 (id, source_entry) == 0) {
return TRUE;
}
}
}
}
}
return FALSE;
}
|
#ifndef _METHNUM_H_
#define _METHNUM_H_
// Derivation
double deriv( double f(double) , double x , double step );
// Integration
double integ_qags ( double f(double),double lo,double hi);
// singtab : tableau des singularité trié par ordre croissant
// nbsing : nombre de singularité
double integ_qagp ( double f(double),double lo,double hi,
double *singtab,int nbsing) ;
double integ_qagiu(double f(double),double lo) ;
double integ_dp ( double f(double),double lo,double hi, bool cut);
double integ_d3p ( double f(double),double lo,double hi, bool cut);
// 1D root finding
double root1D_brent(double f(double),double lo,double hi);
double root1D_steff(double f(double),double df(double),double lo,
double hi,double xg) ;
// 1D localisation des zeros dans un intervalle
bool root1D_zerloc ( double f(double) , double *b , size_t N ,
gsl_matrix * z , size_t *nbzer );
// 1D min finding
double minim1D_brent ( double f(double), double lo,double hi,double gu );
// Random number generator
gsl_rng * rng_mt19_alloc ( unsigned long int seed );
// ND root finding
void print_state (size_t iter, gsl_multiroot_fsolver * s, size_t n) ;
void fprint_state (FILE * f, size_t iter, gsl_multiroot_fsolver * s, size_t n) ;
void rootND ( int func ( const gsl_vector *, void * , gsl_vector * ) ,
gsl_vector * x , gsl_vector * zeros , const size_t n ,
double epsabs ) ;
void rootND_print_state ( FILE *f, int func ( const gsl_vector *, void * , gsl_vector * ) ,
gsl_vector * x , gsl_vector * zeros , const size_t n ,
double epsabs ) ;
void fprint_state_rootND_der (FILE * f, size_t iter, gsl_multiroot_fdfsolver * s, size_t n) ;
void rootND_der ( int func ( const gsl_vector * , void * , gsl_vector * ) ,
int dfunc ( const gsl_vector * , void * , gsl_matrix * ) ,
gsl_vector *x , gsl_vector *zeros , const size_t n , double epsabs );
void rootND_der_print_state (FILE *f, int func ( const gsl_vector * , void * , gsl_vector * ) ,
int dfunc ( const gsl_vector * , void * , gsl_matrix * ) ,
gsl_vector *x , gsl_vector *zeros , const size_t n , double epsabs );
// ND min finding
//
// Func is the function to be minimized
// x contains the guesses in input
// min contains the size of first step in input
// min contains the minima in output
// n is the size of the system
// epsabs is the stopping parameter such that | Nabla func | < epsabs
void fprint_state_minND(FILE *f, size_t iter, gsl_multimin_fminimizer * s , size_t n );
void minND ( double func( const gsl_vector *, void *), gsl_vector *x, gsl_vector *min, const size_t n, double epsabs );
void minND_print_state ( FILE * F, double func( const gsl_vector *, void *), gsl_vector *x, gsl_vector *min, const size_t n, double epsabs );
void fprint_state_minND_der(FILE *f, size_t iter, gsl_multimin_fdfminimizer * s , size_t n );
void minND_der ( double func ( const gsl_vector *, void * ),
void dfunc ( const gsl_vector *, void *, gsl_vector *),
gsl_vector *x, gsl_vector *min, const size_t n, double epsabs);
void minND_der_print_state (FILE *f,
double func ( const gsl_vector *, void * ),
void dfunc ( const gsl_vector *, void *, gsl_vector *),
gsl_vector *x, gsl_vector *min, const size_t n, double epsabs);
// Testing derivatives
void testderiv ( double f(double) , double df ( double ) , double low ,
double high , int n , double eps , char * namefile ,
char * gnucmd );
#endif // _METHNUM_H_
|
#ifndef AUXILIARYFUNCS_H_
#define AUXILIARYFUNCS_H_
string intToStr(int tmp);
#endif /* AUXILIARYFUNCS_H_ */
|
//
// YCProblem.h
// YCML
//
// Created by Ioannis (Yannis) Chatzikonstantinou on 19/3/15.
// Copyright (c) 2015 Ioannis (Yannis) Chatzikonstantinou. All rights reserved.
//
// This file is part of YCML.
//
// YCML 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.
//
// YCML 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 YCML. If not, see <http://www.gnu.org/licenses/>.
@import Foundation;
#import "YCProblem.h"
@protocol YCDerivativeProblem <YCProblem>
- (void)derivatives:(Matrix *)target parameters:(Matrix *)parameters;
@end
|
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
*
* 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.
*
* In addition, as a special exception, the copyright holders of this
* program give permission to link the code of its release with the
* OpenSSL project's "OpenSSL" library (or with modified versions of it
* that use the same license as the "OpenSSL" library), and distribute
* the linked executables. You must obey the GNU General Public License
* in all respects for all of the code used other than "OpenSSL". If you
* modify file(s) with this exception, you may extend this exception to
* your version of the file(s), but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source files
* in the program, then also delete it here.
*
* 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/>.
**/
#pragma once
#include "IHttpOutputStream.h"
#include "../ChunkedBuffer.h"
namespace Orthanc
{
class StringHttpOutput : public IHttpOutputStream
{
private:
ChunkedBuffer buffer_;
public:
virtual void OnHttpStatusReceived(HttpStatus status);
virtual void Send(bool isHeader, const void* buffer, size_t length);
void GetOutput(std::string& output)
{
buffer_.Flatten(output);
}
};
}
|
#ifndef _GCPAD_
#define _GCPAD_
typedef struct
{
union
{
struct
{
bool ErrorStatus :1;
bool ErrorLatch :1;
u32 Reserved :1;
bool Start :1;
bool Y :1;
bool X :1;
bool B :1;
bool A :1;
u32 AlwaysSet :1;
bool R :1;
bool L :1;
bool Z :1;
bool Up :1;
bool Down :1;
bool Left :1;
bool Right :1;
s16 StickX :8;
s16 StickY :8;
};
u32 Buttons;
};
union
{
struct
{
s16 CStickX;
s16 CStickY;
s16 LShoulder;
s16 RShoulder;
};
u32 Sticks;
};
} GCPadStatus;
#endif
|
/*
* Copyright 2011-2012 Jason Rush and John Flanagan. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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/>.
*/
#import "TextFieldCell.h"
@interface UrlFieldCell : TextFieldCell
@end
|
/*******************************************************************************
Copyright (C) The University of Auckland
OpenCOR 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.
OpenCOR 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 <https://gnu.org/licenses>.
*******************************************************************************/
//==============================================================================
// macOS utilities
//==============================================================================
#pragma once
//==============================================================================
namespace OpenCOR {
//==============================================================================
void removeMacosSpecificMenuItems();
//==============================================================================
} // namespace OpenCOR
//==============================================================================
// End of file
//==============================================================================
|
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the XIPHOPHORUS Company http://www.xiph.org/ *
* *
********************************************************************
function: LPC low level routines
last mod: $Id$
********************************************************************/
#ifndef _V_LPC_H_
#define _V_LPC_H_
#include "vorbis/codec.h"
/* simple linear scale LPC code */
extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m);
extern void vorbis_lpc_predict(float *coeff,float *prime,int m,
float *data,long n);
#endif
|
/*
Copyright 2005-2009 Last.fm Ltd.
- Primarily authored by Max Howell, Jono Cole, Erik Jaelevik,
Christian Muehlhaeuser
This file is part of the Last.fm Desktop Application Suite.
lastfm-desktop 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.
lastfm-desktop 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 lastfm-desktop. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ITUNES_PLAYS_DATABASE_H
#define ITUNES_PLAYS_DATABASE_H
#ifdef WIN32
#include "ITunesTrack.h"
#endif
#include <string>
extern "C"
{
typedef struct sqlite3 sqlite3;
}
#define TABLE_NAME "playcounts"
/** @author Christian Muehlhaeuser <chris@last.fm>
* @contributor Jono Cole <jono@last.fm>
* @contributor Max Howell <max@last.fm>
* @contributor <erik@last.fm>
*/
class ITunesPlaysDatabase
{
public:
ITunesPlaysDatabase();
~ITunesPlaysDatabase();
/** @returns false if the tables aren't valid or created */
bool isValid();
/** @returns true if the db has no valid bootstrap */
bool needsBootstrap();
/** tracks unknown to us return -1, which means you should verify the
* playCount with iTunes before doing anything with that track generally */
int playCount( const class ITunesTrack& track );
/** tracks unknown to us return -1, which means you should verify the
* playCount with iTunes before doing anything with that track generally */
int playCountOld( const class ITunesTrack& track );
/** call to sync the just finished playing track, NOTE the implementation
* stores what is playing now for the next call to sync() so always call
* this every new track
*/
static void sync();
#ifndef WIN32
/** general init, and if necessary, creates tables, bootstraps db, etc. */
static void init();
/** cleans up, call when plugin is unloaded */
static void finit();
#else
bool sync( const ExtendedITunesTrack& );
bool syncOld( const ExtendedITunesTrack& );
#endif
protected:
/** prepares us for iPod scrobbling, ie creates the tables and bootstraps
* the database */
void prepare();
bool query( /* utf-8 */ const char* statement, std::string* result = 0 );
sqlite3* m_db;
#ifndef WIN32
static void* onPlayStateChanged( void* );
static void* sync( void* );
static void* syncOld( void* );
static pthread_mutex_t s_mutex;
#endif
};
#endif //ITUNES_PLAYS_DATABASE_H
|
/****************************************************************
The author of this software is David M. Gay.
Copyright (C) 1998, 2000 by Lucent Technologies
All Rights Reserved
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of Lucent or any of its entities
not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* Please send bug reports to David M. Gay (dmg at acm dot org,
* with " at " changed at "@" and " dot " changed to "."). */
#include "gdtoaimp.h"
void
#ifdef KR_headers
ULtod(L, bits, exp, k) ULong *L; ULong *bits; Long exp; int k;
#else
ULtod(ULong *L, ULong *bits, Long exp, int k)
#endif
{
switch(k & STRTOG_Retmask) {
case STRTOG_NoNumber:
case STRTOG_Zero:
L[0] = L[1] = 0;
break;
case STRTOG_Denormal:
L[_1] = bits[0];
L[_0] = bits[1];
break;
case STRTOG_Normal:
case STRTOG_NaNbits:
L[_1] = bits[0];
L[_0] = (bits[1] & ~0x100000) | ((exp + 0x3ff + 52) << 20);
break;
case STRTOG_Infinite:
L[_0] = 0x7ff00000;
L[_1] = 0;
break;
case STRTOG_NaN:
L[0] = d_QNAN0;
L[1] = d_QNAN1;
}
if (k & STRTOG_Neg)
L[_0] |= 0x80000000L;
}
|
// This file is part of SilentEye.
//
// SilentEye 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.
//
// SilentEye 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 SilentEye. If not, see <http://www.gnu.org/licenses/>.
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <QtGui>
#include "ui_mainwindow.h"
#include "aboutdialog.h"
#include "encodedialog.h"
#include "propertydialog.h"
#include "preferencedialog.h"
#include "updatedialog.h"
#include "decodedialog.h"
#include "mediawidget.h"
using namespace SilentEyeFramework;
//! SilentEye application GUI
namespace SilentEye {
//! The main window of SilentEye
class MainWindow : public QMainWindow, public Ui::MainWindow
{
Q_OBJECT;
private:
EncodeDialog encodeDialog;
PropertyDialog propertyDialog;
DecodeDialog decodeDialog;
PreferenceDialog preferenceDialog;
AboutDialog aboutDialog;
UpdateDialog updateDialog;
QMenu* contextMenu;
QPushButton* closeTabButton;
QMap<QString, QPointer<Media> > m_mediaMap;
bool m_hasMediaLoaded;
QPointer<QSound> m_currentSound;
QPointer<Logger> m_logger;
public:
MainWindow(QString url = "", QWidget *parent = 0);
~MainWindow();
private:
void connectSignals();
void setEnabledImageActions(const bool value);
QPointer<Media> currentMedia();
void closeTabByPath(QString);
private slots:
void dragEnterEvent(QDragEnterEvent*);
void dropEvent(QDropEvent*);
void closeCurrentTab();
void addMediaTab(QPointer<Media>);
void paste();
void copy();
void execDecodeDialog();
void execEncodeDialog();
void execPropertyDialog();
void execUpdateDialog();
void newMedia(QString);
void openFile();
void playMedia();
void stopMedia();
};
}
#endif
|
#pragma once
#include "DomoticzHardware.h"
#include "hardwaretypes.h"
class csocket;
class Action
{
public:
std::string m_strCommand;
std::string m_strName;
std::string m_strLabel;
std::string toString()
{
return m_strCommand;
}
};
class Function
{
public:
std::string m_strName;
std::vector< Action > m_vecActions;
std::string toString()
{
std::string ret = " Function: ";
ret.append(m_strName);
ret.append("\n Commands:");
std::vector<Action>::iterator it = m_vecActions.begin();
std::vector<Action>::iterator ite = m_vecActions.end();
for(; it != ite; ++it)
{
ret.append("\n\t");
ret.append(it->toString());
}
ret.append("\n");
return ret;
}
};
class Device
{
public:
std::string m_strID;
std::string m_strLabel;
std::string m_strManufacturer;
std::string m_strModel;
std::string m_strType;
std::vector< Function > m_vecFunctions;
std::string toString()
{
std::string ret = m_strType;
ret.append(": ");
ret.append(m_strLabel);
ret.append(" (ID = ");
ret.append(m_strID);
ret.append(")\n");
ret.append(m_strManufacturer);
ret.append(" - ");
ret.append(m_strModel);
ret.append("\nFunctions: \n");
std::vector<Function>::iterator it = m_vecFunctions.begin();
std::vector<Function>::iterator ite = m_vecFunctions.end();
for(; it != ite; ++it)
{
ret.append(it->toString());
}
return ret;
}
};
class CHarmonyHub : public CDomoticzHardwareBase
{
enum _eConnectionStatus
{
DISCONNECTED=0,
CONNECTED,
INITIALIZED,
AUTHENTICATED,
BOUND
};
public:
CHarmonyHub(const int ID, const std::string &IPAddress, const unsigned int port);
~CHarmonyHub(void);
bool WriteToHardware(const char *pdata, const unsigned char length) override;
private:
bool StartHardware() override;
bool StopHardware() override;
void Do_Work();
// Init and cleanup
void Init();
void Logout();
// Helper functions for changing switch status in Domoticz
void CheckSetActivity(const std::string &activityID, const bool on);
void UpdateSwitch(const unsigned char idx, const char * szIdx, const bool bOn, const std::string &defaultname);
// Raw socket functions
bool ConnectToHarmony(const std::string &szHarmonyIPAddress, const int HarmonyPortNumber, csocket* connection);
bool SetupCommunicationSocket();
void ResetCommunicationSocket();
int WriteToSocket(std::string *szReq);
std::string ReadFromSocket(csocket *connection);
std::string ReadFromSocket(csocket *connection, float waitTime);
// XMPP Stream initialization
int StartStream(csocket *connection);
int SendAuth(csocket *connection, const std::string &szUserName, const std::string &szPassword);
int SendPairRequest(csocket *connection);
int CloseStream(csocket *connection);
// XMPP commands
int SendPing();
int SubmitCommand(const std::string &szCommand);
int SubmitCommand(const std::string &szCommand, const std::string &szActivityId);
// XMPP reading
bool CheckForHarmonyData();
void ParseHarmonyTransmission(std::string *szHarmonyData);
void ProcessHarmonyConnect(std::string *szHarmonyData);
void ProcessHarmonyMessage(std::string *szMessageBlock);
void ProcessQueryResponse(std::string *szQueryResponse);
// Helper function for XMPP reading
bool IsTransmissionComplete(std::string *szHarmonyData);
private:
// hardware parameters
std::string m_szHarmonyAddress;
unsigned short m_usHarmonyPort;
// vars
volatile bool m_stoprequested;
std::shared_ptr<std::thread> m_thread;
std::mutex m_mutex;
csocket * m_connection;
_eConnectionStatus m_connectionstatus;
bool m_bNeedMoreData;
bool m_bWantAnswer;
bool m_bNeedEcho;
bool m_bReceivedMessage;
bool m_bLoginNow;
bool m_bIsChangingActivity;
bool m_bShowConnectError;
std::string m_szHubSwVersion;
std::string m_szHarmonyData;
std::string m_szAuthorizationToken;
std::string m_szCurActivityID;
std::map<std::string, std::string> m_mapActivities;
};
|
/*
Copyright 2011 Last.fm Ltd.
- Primarily authored by Michael Coffey
This file is part of the Last.fm Desktop Application Suite.
lastfm-desktop 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.
lastfm-desktop 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 lastfm-desktop. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PUSHBUTTON_H
#define PUSHBUTTON_H
#include <QPushButton>
class PushButton : public QPushButton
{
Q_OBJECT
public:
Q_PROPERTY(bool dark READ dark WRITE setDark)
explicit PushButton(QWidget *parent = 0);
bool dark() const;
void setDark( bool dark );
private:
bool event(QEvent *e);
void paintEvent(QPaintEvent *);
private:
bool m_hovered;
bool m_dark;
};
#endif // PUSHBUTTON_H
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "InformationElements"
* found in "../asn/InformationElements.asn"
* `asn1c -fcompound-names -fnative-types`
*/
#include "SynchronisationParameters-r4.h"
static int
memb_sync_UL_CodesBitmap_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
size_t size;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if(st->size > 0) {
/* Size in bits */
size = 8 * st->size - (st->bits_unused & 0x07);
} else {
size = 0;
}
if((size == 8)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_prxUpPCHdes_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 62)) {
/* Constraint check succeeded */
return 0;
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_per_constraints_t asn_PER_memb_sync_UL_CodesBitmap_constr_2 = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 0, 0, 8, 8 } /* (SIZE(8..8)) */,
0, 0 /* No PER value map */
};
static asn_per_constraints_t asn_PER_memb_prxUpPCHdes_constr_12 = {
{ APC_CONSTRAINED, 6, 6, 0, 62 } /* (0..62) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_SynchronisationParameters_r4_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SynchronisationParameters_r4, sync_UL_CodesBitmap),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_BIT_STRING,
memb_sync_UL_CodesBitmap_constraint_1,
&asn_PER_memb_sync_UL_CodesBitmap_constr_2,
0,
"sync-UL-CodesBitmap"
},
{ ATF_NOFLAGS, 0, offsetof(struct SynchronisationParameters_r4, fpach_Info),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_FPACH_Info_r4,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"fpach-Info"
},
{ ATF_NOFLAGS, 0, offsetof(struct SynchronisationParameters_r4, prxUpPCHdes),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NativeInteger,
memb_prxUpPCHdes_constraint_1,
&asn_PER_memb_prxUpPCHdes_constr_12,
0,
"prxUpPCHdes"
},
{ ATF_POINTER, 1, offsetof(struct SynchronisationParameters_r4, sync_UL_Procedure),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_SYNC_UL_Procedure_r4,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"sync-UL-Procedure"
},
};
static int asn_MAP_SynchronisationParameters_r4_oms_1[] = { 3 };
static ber_tlv_tag_t asn_DEF_SynchronisationParameters_r4_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_SynchronisationParameters_r4_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* sync-UL-CodesBitmap at 11355 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* fpach-Info at 11364 */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* prxUpPCHdes at 11366 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* sync-UL-Procedure at 11367 */
};
static asn_SEQUENCE_specifics_t asn_SPC_SynchronisationParameters_r4_specs_1 = {
sizeof(struct SynchronisationParameters_r4),
offsetof(struct SynchronisationParameters_r4, _asn_ctx),
asn_MAP_SynchronisationParameters_r4_tag2el_1,
4, /* Count of tags in the map */
asn_MAP_SynchronisationParameters_r4_oms_1, /* Optional members */
1, 0, /* Root/Additions */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_SynchronisationParameters_r4 = {
"SynchronisationParameters-r4",
"SynchronisationParameters-r4",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
0, /* Use generic outmost tag fetcher */
asn_DEF_SynchronisationParameters_r4_tags_1,
sizeof(asn_DEF_SynchronisationParameters_r4_tags_1)
/sizeof(asn_DEF_SynchronisationParameters_r4_tags_1[0]), /* 1 */
asn_DEF_SynchronisationParameters_r4_tags_1, /* Same as above */
sizeof(asn_DEF_SynchronisationParameters_r4_tags_1)
/sizeof(asn_DEF_SynchronisationParameters_r4_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_SynchronisationParameters_r4_1,
4, /* Elements count */
&asn_SPC_SynchronisationParameters_r4_specs_1 /* Additional specs */
};
|
/*
FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS 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 >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS 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. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/*-----------------------------------------------------------
* Simple IO routines to control the LEDs.
*-----------------------------------------------------------*/
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo includes. */
#include "partest.h"
#define partestNUM_LEDS ( 6 )
#define partestALL_LEDS ( usLEDMasks[ 0 ] | usLEDMasks[ 1 ] | usLEDMasks[ 2 ] | usLEDMasks[ 3 ] | usLEDMasks[ 4 ] | usLEDMasks[ 5 ] )
static const unsigned short usLEDMasks[ partestNUM_LEDS ] = { ( 1 << 9 ), ( 1 << 11 ), ( 1 << 12 ), ( 1 << 13 ), ( 1 << 14 ), ( 1 << 15 ) };
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
/* Select port functions for PE9 to PE15. */
PFC.PECRL3.WORD &= ( unsigned short ) ~partestALL_LEDS;
/* Turn all LEDs off. */
PE.DR.WORD &= ( unsigned short ) ~partestALL_LEDS;
/* Set all LEDs to output. */
PFC.PEIORL.WORD |= ( unsigned short ) partestALL_LEDS;
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED < partestNUM_LEDS )
{
if( xValue )
{
/* Turn the LED on. */
taskENTER_CRITICAL();
{
PE.DR.WORD |= usLEDMasks[ uxLED ];
}
taskEXIT_CRITICAL();
}
else
{
/* Turn the LED off. */
taskENTER_CRITICAL();
{
PE.DR.WORD &= ( unsigned short ) ~usLEDMasks[ uxLED ];
}
taskEXIT_CRITICAL();
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED < partestNUM_LEDS )
{
taskENTER_CRITICAL();
{
if( ( PE.DR.WORD & usLEDMasks[ uxLED ] ) != 0x00 )
{
PE.DR.WORD &= ( unsigned short ) ~usLEDMasks[ uxLED ];
}
else
{
PE.DR.WORD |= usLEDMasks[ uxLED ];
}
}
taskEXIT_CRITICAL();
}
}
/*-----------------------------------------------------------*/
long lParTestGetLEDState( void )
{
/* Returns the state of the fifth LED. */
return !( PE.DR.WORD & usLEDMasks[ 4 ] );
}
/*-----------------------------------------------------------*/
|
/*! @file RoboPedestrianState.h
@brief RoboPedestrian State
@author Jason Kulk, Aaron Wong
Copyright (c) 2010 Jason Kulk
This file 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 file 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 NUbot. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ROBOPEDESTRIANSTATE_H
#define ROBOPEDESTRIANSTATE_H
#include "Behaviour/BehaviourState.h"
class RoboPedestrianProvider;
#include "debug.h"
class RoboPedestrianState : public BehaviourState
{
public:
RoboPedestrianState(RoboPedestrianProvider* parent) : m_parent(parent) {};
virtual ~RoboPedestrianState() {};
virtual BehaviourState* nextState() = 0;
virtual void doState() = 0;
protected:
RoboPedestrianProvider* m_parent;
};
#endif
|
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2015 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ----------------------------------------------------------------------------
* TV output capability on STM32 devices
* ----------------------------------------------------------------------------
*/
JsVar *tv_setup_pal(Pin pinVideo, Pin pinSync, int width, int height);
JsVar *tv_setup_vga(Pin pinVideo, Pin pinSync, Pin pinSyncV, int width, int height);
|
/*
* Copyright (C) 1994-2016 Altair Engineering, Inc.
* For more information, contact Altair at www.altair.com.
*
* This file is part of the PBS Professional ("PBS Pro") software.
*
* Open Source License Information:
*
* PBS Pro is free software. You can redistribute it and/or modify it under the
* terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* PBS Pro 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Commercial License Information:
*
* The PBS Pro software is licensed under the terms of the GNU Affero General
* Public License agreement ("AGPL"), except where a separate commercial license
* agreement for PBS Pro version 14 or later has been executed in writing with Altair.
*
* Altair’s dual-license business model allows companies, individuals, and
* organizations to create proprietary derivative works of PBS Pro and distribute
* them - whether embedded or bundled with other software - under a commercial
* license agreement.
*
* Use of Altair’s trademarks, including but not limited to "PBS™",
* "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
* trademark licensing policies.
*
*/
/*
* @file req_locate.c
* @brief
* Functions relating to the Locate Job Batch Request.
*
* Included funtions are:
* req_locatejob()
*
*/
#include <pbs_config.h> /* the master config generated by configure */
#include <sys/types.h>
#include "libpbs.h"
#include <signal.h>
#include <string.h>
#include "server_limits.h"
#include "list_link.h"
#include "attribute.h"
#include "server.h"
#include "credential.h"
#include "batch_request.h"
#include "job.h"
#include "work_task.h"
#include "tracking.h"
#include "pbs_error.h"
#include "log.h"
/* Global Data Items: */
extern struct server server;
extern char server_name[];
extern char *pbs_server_name;
/* External functions */
extern int svr_chk_histjob(job *);
extern int is_job_array(char *);
/**
* @brief
* req_locatejob - service the Locate Job Request
*
* This request attempts to locate a job.
*
* @param[in] preq - Job Request
*/
void
req_locatejob(struct batch_request *preq)
{
char *at;
int i;
job *pjob;
char *location = (char *)0;
if ((at = strchr(preq->rq_ind.rq_locate, (int)'@')) != NULL)
*at = '\0'; /* strip off @server_name */
pjob = find_job(preq->rq_ind.rq_locate);
/*
* Reject request for history jobs:
* i) jobs with state FINISHED
* ii) jobs with state MOVED and substate FINISHED
*/
if (pjob && svr_chk_histjob(pjob) == PBSE_HISTJOBID) {
req_reject(PBSE_HISTJOBID, 0, preq);
return;
}
/*
* return the location if job is not history (i.e. state is not
* JOB_STATE_MOVED) else search in tracking table.
*/
if (pjob && (pjob->ji_qs.ji_state != JOB_STATE_MOVED)) {
location = pbs_server_name;
} else {
int job_array_ret;
job_array_ret = is_job_array(preq->rq_ind.rq_locate);
if ((job_array_ret == IS_ARRAY_Single) || (job_array_ret == IS_ARRAY_Range)) {
int i;
char idbuf[PBS_MAXSVRJOBID+1]={'\0'};
char *pc;
for (i=0; i<PBS_MAXSVRJOBID; i++) {
idbuf[i] = *(preq->rq_ind.rq_locate + i);
if (idbuf[i] == '[')
break;
}
idbuf[++i] = ']';
idbuf[++i] = '\0';
pc = strchr(preq->rq_ind.rq_locate,(int)'.');
if (pc)
strcat(idbuf, pc);
strncpy(preq->rq_ind.rq_locate,idbuf,sizeof(preq->rq_ind.rq_locate));
}
for (i=0; i < server.sv_tracksize; i++) {
if ((server.sv_track+i)->tk_mtime &&
!strcmp((server.sv_track+i)->tk_jobid, preq->rq_ind.rq_locate)) {
location = (server.sv_track+i)->tk_location;
break;
}
}
}
if (location) {
preq->rq_reply.brp_code = 0;
preq->rq_reply.brp_auxcode = 0;
preq->rq_reply.brp_choice = BATCH_REPLY_CHOICE_Locate;
(void)strcpy(preq->rq_reply.brp_un.brp_locate, location);
reply_send(preq);
} else
req_reject(PBSE_UNKJOBID, 0, preq);
return;
}
|
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef RY_DAMAGE_SHIELD_EFFECT_H
#define RY_DAMAGE_SHIELD_EFFECT_H
//
#include "phrase_manager/s_effect.h"
#include "entity_manager/entity_base.h"
/**
* class for damage shields
* \author David Fleury
* \author Nevrax France
* \date 2003
*/
class CDamageShieldEffect : public CSTimedEffect
{
public:
NLMISC_DECLARE_CLASS(CDamageShieldEffect)
///\ctor
CDamageShieldEffect( const TDataSetRow & creatorRowId,
const TDataSetRow & targetRowId,
EFFECT_FAMILIES::TEffectFamily family,
sint32 damagePerHit,
NLMISC::TGameCycle endDate,
float drainFactor
)
: CSTimedEffect(creatorRowId, targetRowId, family, true, damagePerHit, damagePerHit, endDate),
_DrainFactor(drainFactor)
{
}
/**
* apply the effects of the... effect
*/
virtual bool update(CTimerEvent * event, bool applyEffect) { return false; }
/// callback called when the effect is actually removed
virtual void removed();
/// get drain factor
inline float getDrainFactor() const { return _DrainFactor; }
/// set drain factor
inline void setDrainFactor(float f) { _DrainFactor = f; }
private:
/// factor of inflicted damage recovered by the effect creator
float _DrainFactor;
CDamageShieldEffect() {}
};
#endif // RY_DAMAGE_SHIELD_EFFECT_H
/* End of damage_shield_effect.h */
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef CLANG_SEMANTICMARKER_H
#define CLANG_SEMANTICMARKER_H
#include "clang_global.h"
#include "diagnostic.h"
#include "fastindexer.h"
#include "sourcemarker.h"
#include "utils.h"
#include <texteditor/itexteditor.h>
#include <QMutex>
#include <QScopedPointer>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
namespace ClangCodeModel {
class CLANG_EXPORT SemanticMarker
{
Q_DISABLE_COPY(SemanticMarker)
public:
typedef QSharedPointer<SemanticMarker> Ptr;
public:
SemanticMarker();
~SemanticMarker();
QMutex *mutex() const
{ return &m_mutex; }
QString fileName() const;
void setFileName(const QString &fileName);
void setCompilationOptions(const QStringList &options);
void reparse(const Internal::UnsavedFiles &unsavedFiles);
QList<Diagnostic> diagnostics() const;
QList<TextEditor::BlockRange> ifdefedOutBlocks() const;
QList<SourceMarker> sourceMarkersInRange(unsigned firstLine,
unsigned lastLine);
Internal::Unit::Ptr unit() const;
private:
mutable QMutex m_mutex;
Internal::Unit::Ptr m_unit;
};
} // namespace ClangCodeModel
#endif // CLANG_SEMANTICMARKER_H
|
/* Generated from /home/skimo/git/cloog/test/./reservoir/mg-psinv.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.02s. */
if ((M >= 1) && (N >= 3) && (O >= 3)) {
if (M >= 3) {
for (c2=2;c2<=O-1;c2++) {
for (c6=1;c6<=M;c6++) {
S1(c2,2,c6);
S2(c2,2,c6);
}
for (c4=4;c4<=2*N-3;c4++) {
for (c6=1;c6<=M;c6++) {
if ((c4+1)%2 == 0) {
S1(c2,(c4+1)/2,c6);
S2(c2,(c4+1)/2,c6);
}
}
for (c6=2;c6<=M-1;c6++) {
if (c4%2 == 0) {
S3(c2,c4/2,c6);
}
}
}
for (c6=2;c6<=M-1;c6++) {
S3(c2,N-1,c6);
}
}
}
if (M <= 2) {
for (c2=2;c2<=O-1;c2++) {
for (c4=3;c4<=2*N-3;c4++) {
for (c6=1;c6<=M;c6++) {
if ((c4+1)%2 == 0) {
S1(c2,(c4+1)/2,c6);
S2(c2,(c4+1)/2,c6);
}
}
}
}
}
}
|
/**************************************************************************
**
** Copyright (C) 2015 Lorenz Haas
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H
#define BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H
#include <coreplugin/dialogs/ioptionspage.h>
#include <QPointer>
#include <QWidget>
namespace Beautifier {
namespace Internal {
namespace Uncrustify {
class UncrustifySettings;
namespace Ui { class UncrustifyOptionsPage; }
class UncrustifyOptionsPageWidget : public QWidget
{
Q_OBJECT
public:
explicit UncrustifyOptionsPageWidget(UncrustifySettings *settings, QWidget *parent = 0);
virtual ~UncrustifyOptionsPageWidget();
void restore();
void apply();
private:
Ui::UncrustifyOptionsPage *ui;
UncrustifySettings *m_settings;
};
class UncrustifyOptionsPage : public Core::IOptionsPage
{
Q_OBJECT
public:
explicit UncrustifyOptionsPage(UncrustifySettings *settings, QObject *parent = 0);
QWidget *widget() Q_DECL_OVERRIDE;
void apply() Q_DECL_OVERRIDE;
void finish() Q_DECL_OVERRIDE;
private:
QPointer<UncrustifyOptionsPageWidget> m_widget;
UncrustifySettings *m_settings;
};
} // namespace Uncrustify
} // namespace Internal
} // namespace Beautifier
#endif // BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H
|
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2012 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SPICE_URI_H__
#define __SPICE_URI_H__
#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
#warning "Only <spice-client.h> can be included directly"
#endif
#include <glib-object.h>
G_BEGIN_DECLS
#define SPICE_TYPE_URI (spice_uri_get_type ())
#define SPICE_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_URI, SpiceURI))
#define SPICE_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_URI, SpiceURIClass))
#define SPICE_IS_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_URI))
#define SPICE_IS_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_URI))
#define SPICE_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_URI, SpiceURIClass))
/**
* SpiceURI:
*
* The #SpiceURI struct is opaque and cannot be accessed directly.
*/
typedef struct _SpiceURI SpiceURI;
/**
* SpiceURIClass:
*
* The #SpiceURIClass struct is opaque and cannot be accessed directly.
* It is class structure for #SpiceURI.
*/
typedef struct _SpiceURIClass SpiceURIClass;
typedef struct _SpiceURIPrivate SpiceURIPrivate;
GType spice_uri_get_type(void) G_GNUC_CONST;
const gchar* spice_uri_get_scheme(SpiceURI* uri);
void spice_uri_set_scheme(SpiceURI* uri, const gchar* scheme);
const gchar* spice_uri_get_hostname(SpiceURI* uri);
void spice_uri_set_hostname(SpiceURI* uri, const gchar* hostname);
guint spice_uri_get_port(SpiceURI* uri);
void spice_uri_set_port(SpiceURI* uri, guint port);
gchar *spice_uri_to_string(SpiceURI* uri);
const gchar* spice_uri_get_user(SpiceURI* uri);
void spice_uri_set_user(SpiceURI* uri, const gchar* user);
const gchar* spice_uri_get_password(SpiceURI* uri);
void spice_uri_set_password(SpiceURI* uri, const gchar* password);
G_END_DECLS
#endif /* __SPICE_URI_H__ */
|
// The libMesh Finite Element Library.
// Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef LIBMESH_LIBMESH_VERSION_H
#define LIBMESH_LIBMESH_VERSION_H
#include "libmesh_config.h"
// C++ includes
#include <string>
// You can use this macro to guard pieces of your application code
// against use in incorrect versions of libmesh. For example:
// #if LIBMESH_VERSION_LESS_THAN(1,0,0)
// ...
// #elif LIBMESH_VERSION_LESS_THAN(1,1,0)
// ...
// #endif
#define LIBMESH_VERSION_LESS_THAN(major,minor,micro) \
((LIBMESH_MAJOR_VERSION < (major) || \
(LIBMESH_MAJOR_VERSION == (major) && (LIBMESH_MINOR_VERSION < (minor) || \
(LIBMESH_MINOR_VERSION == (minor) && \
LIBMESH_MICRO_VERSION < (micro))))) ? 1 : 0)
namespace libMesh
{
void libmesh_version_stdout();
int get_libmesh_version();
/**
* Specifier for I/O file compatibility features.
* This only needs to be changed when new restart file
* functionality is added.
*/
std::string get_io_compatibility_version();
}
#endif // LIBMESH_LIBMESH_VERSION_H
|
/*
* AuthenTec AES4000 driver for libfprint
*
* AES4000 is a press-typed sensor, which captures image in 96x96
* pixels.
*
* This work is derived from Daniel Drake's AES4000 driver.
*
* Copyright (C) 2013 Juvenn Woo <machese@gmail.com>
* Copyright (C) 2007-2008 Daniel Drake <dsd@gentoo.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
*/
#define FP_COMPONENT "aes4000"
#include <errno.h>
#include <glib.h>
#include <libusb.h>
#include <aeslib.h>
#include <fp_internal.h>
#include "aes3k.h"
#include "driver_ids.h"
#define DATA_BUFLEN 0x1259
/* image size = FRAME_WIDTH x FRAME_WIDTH */
#define FRAME_WIDTH 96
#define FRAME_SIZE (FRAME_WIDTH * AES3K_FRAME_HEIGHT / 2)
#define FRAME_NUMBER (FRAME_WIDTH / AES3K_FRAME_HEIGHT)
#define ENLARGE_FACTOR 3
static struct aes_regwrite init_reqs[] = {
/* master reset */
{ 0x80, 0x01 },
{ 0, 0 },
{ 0x80, 0x00 },
{ 0, 0 },
{ 0x81, 0x00 },
{ 0x80, 0x00 },
{ 0, 0 },
/* scan reset */
{ 0x80, 0x02 },
{ 0, 0 },
{ 0x80, 0x00 },
{ 0, 0 },
/* disable register buffering */
{ 0x80, 0x04 },
{ 0, 0 },
{ 0x80, 0x00 },
{ 0, 0 },
{ 0x81, 0x00 },
{ 0, 0 },
/* windows driver reads registers now (81 02) */
{ 0x80, 0x00 },
{ 0x81, 0x00 },
/* set excitation bias current: 2mhz drive ring frequency,
* 4V drive ring voltage, 16.5mA excitation bias */
{ 0x82, 0x04 },
/* continuously sample drive ring for finger detection,
* 62.50ms debounce delay */
{ 0x83, 0x13 },
{ 0x84, 0x07 }, /* set calibration resistance to 12 kiloohms */
{ 0x85, 0x3d }, /* set calibration capacitance */
{ 0x86, 0x03 }, /* detect drive voltage */
{ 0x87, 0x01 }, /* set detection frequency to 125khz */
{ 0x88, 0x02 }, /* set column scan period */
{ 0x89, 0x02 }, /* set measure drive */
{ 0x8a, 0x33 }, /* set measure frequency and sense amplifier bias */
{ 0x8b, 0x33 }, /* set matrix pattern */
{ 0x8c, 0x0f }, /* set demodulation phase 1 */
{ 0x8d, 0x04 }, /* set demodulation phase 2 */
{ 0x8e, 0x23 }, /* set sensor gain */
{ 0x8f, 0x07 }, /* set image parameters */
{ 0x90, 0x00 }, /* carrier offset null */
{ 0x91, 0x1c }, /* set A/D reference high */
{ 0x92, 0x08 }, /* set A/D reference low */
{ 0x93, 0x00 }, /* set start row to 0 */
{ 0x94, 0x05 }, /* set end row to 5 */
{ 0x95, 0x00 }, /* set start column to 0 */
{ 0x96, 0x18 }, /* set end column to 24*4=96 */
{ 0x97, 0x04 }, /* data format and thresholds */
{ 0x98, 0x28 }, /* image data control */
{ 0x99, 0x00 }, /* disable general purpose outputs */
{ 0x9a, 0x0b }, /* set initial scan state */
{ 0x9b, 0x00 }, /* clear challenge word bits */
{ 0x9c, 0x00 }, /* clear challenge word bits */
{ 0x9d, 0x09 }, /* set some challenge word bits */
{ 0x9e, 0x53 }, /* clear challenge word bits */
{ 0x9f, 0x6b }, /* set some challenge word bits */
{ 0, 0 },
{ 0x80, 0x00 },
{ 0x81, 0x00 },
{ 0, 0 },
{ 0x81, 0x04 },
{ 0, 0 },
{ 0x81, 0x00 },
};
static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
{
int r;
struct aes3k_dev *aesdev;
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}
aesdev = dev->priv = g_malloc0(sizeof(struct aes3k_dev));
if (!aesdev)
return -ENOMEM;
aesdev->data_buflen = DATA_BUFLEN;
aesdev->frame_width = FRAME_WIDTH;
aesdev->frame_size = FRAME_SIZE;
aesdev->frame_number = FRAME_NUMBER;
aesdev->enlarge_factor = ENLARGE_FACTOR;
aesdev->init_reqs = init_reqs;
aesdev->init_reqs_len = G_N_ELEMENTS(init_reqs);
fpi_imgdev_open_complete(dev, 0);
return r;
}
static void dev_deinit(struct fp_img_dev *dev)
{
struct aes3k_dev *aesdev = dev->priv;
g_free(aesdev);
libusb_release_interface(dev->udev, 0);
fpi_imgdev_close_complete(dev);
}
static const struct usb_id id_table[] = {
{ .vendor = 0x08ff, .product = 0x5501 },
{ 0, 0, 0, },
};
struct fp_img_driver aes4000_driver = {
.driver = {
.id = AES4000_ID,
.name = FP_COMPONENT,
.full_name = "AuthenTec AES4000",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_PRESS,
},
.flags = 0,
.img_height = FRAME_WIDTH * ENLARGE_FACTOR,
.img_width = FRAME_WIDTH * ENLARGE_FACTOR,
/* temporarily lowered until image quality improves */
.bz3_threshold = 9,
.open = dev_init,
.close = dev_deinit,
.activate = aes3k_dev_activate,
.deactivate = aes3k_dev_deactivate,
};
|
/* SERIAL CONSOLE
* For PIC24F
*
* Copyright 2012, Francisco Reyes Aspe, komodotas@gmail.com
* Copyright 2012, Carlos Gonzalez Cortes, carlgonz@ug.uchile.cl
*
* 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 CONSOLE_H
#define CONSOLE_H
//#include <string.h>
#include <stdlib.h>
#include "DebugIncludes.h" //para printf
/* Add commands definitions*/
#include "cmdTCM.h"
#include "cmdCON.h"
#include "cmdPPC.h"
#include "cmdTRX.h"
#include "cmdEPS.h"
#include "cmdRTC.h"
#include "cmdDRP.h"
#include "cmdSRP.h"
#include "cmdTHK.h"
#define CON_BUF_WIDTH 32
#define CON_ARG_WIDTH 8
#define CON_ARG_QTY 8
void con_init(void);
void con_char_handler(char newchar);
void con_cmd_from_entry(char *entry);
DispCmd con_cmd_handler(void);
BOOL con_set_active(BOOL on_off);
BOOL StrIsInt(char *str);
#endif //CONSOLE_H
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef COMPUTEFULLJACOBIANTHREAD_H
#define COMPUTEFULLJACOBIANTHREAD_H
#include "ComputeJacobianThread.h"
// Forward declarations
class FEProblem;
class NonlinearSystem;
class ComputeFullJacobianThread : public ComputeJacobianThread
{
public:
ComputeFullJacobianThread(FEProblem & fe_problem, NonlinearSystem & sys, SparseMatrix<Number> & jacobian);
// Splitting Constructor
ComputeFullJacobianThread(ComputeFullJacobianThread & x, Threads::split split);
virtual ~ComputeFullJacobianThread();
void join(const ComputeJacobianThread & /*y*/)
{}
protected:
virtual void computeJacobian();
virtual void computeFaceJacobian(BoundaryID bnd_id);
virtual void computeInternalFaceJacobian(const Elem * neighbor);
virtual void computeInternalInterFaceJacobian(BoundaryID bnd_id);
// Reference to BC storage structures
const MooseObjectWarehouse<IntegratedBC> & _integrated_bcs;
// Reference to DGKernel storage
const MooseObjectWarehouse<DGKernel> & _dg_kernels;
// Reference to interface kernel storage
const MooseObjectWarehouse<InterfaceKernel> & _interface_kernels;
// Reference to Kernel storage
const KernelWarehouse & _kernels;
};
#endif //COMPUTEFULLJACOBIANTHREAD_H
|
//************************************************
//¡ó×÷ÕߣºCUCKOO0615
//¡óÈÕÆÚ£º2014Äê8ÔÂ14ÈÕ
//¡ó˵Ã÷£ºSocket¹¤¾ß
//*************************************************
#pragma once
#ifndef CUCKOO0615_UTILS_MACRO
#define CUCKOO0615_UTILS_MACRO
#ifndef MAX_PATH
#define MAX_PATH 260
#endif
#ifndef ERRMSG_LENGTH
#define ERRMSG_LENGTH 256
#endif
#endif
#include <windows.h>
#pragma comment(lib,"ws2_32.lib")
#ifndef ERRMSGTABLE_LENGTH
#define ERRMSGTABLE_LENGTH 36
#endif
typedef struct
{
long lRetVal;
const char* szErrMsg;
}ERRMSG_TABLE;
static const ERRMSG_TABLE ErrMsgTable[ERRMSGTABLE_LENGTH] =
{
//socket
{ WSANOTINITIALISED, "WSANOTINITIALISED" },
{ WSAENETDOWN, "WSAENETDOWN" },
{ WSAEAFNOSUPPORT, "WSAEAFNOSUPPORT" },
{ WSAEINPROGRESS, "WSAEINPROGRESS" },
{ WSAEMFILE, "WSAEMFILE" },
{ WSAENOBUFS, "WSAENOBUFS" },
{ WSAEPROTONOSUPPORT, "WSAEPROTONOSUPPORT" },
{ WSAEPROTOTYPE, "WSAEPROTOTYPE" },
{ WSAESOCKTNOSUPPORT, "WSAESOCKTNOSUPPORT" },
//connect
{ WSANOTINITIALISED, "WSANOTINITIALISED" },
{ WSAENETDOWN, "WSAENETDOWN" },
{ WSAEADDRINUSE, "WSAEADDRINUSE" },
{ WSAEINTR, "WSAEINTR" },
{ WSAEINPROGRESS, "WSAEINPROGRESS" },
{ WSAEADDRNOTAVAIL, "WSAEADDRNOTAVAIL" },
{ WSAEAFNOSUPPORT, "WSAEAFNOSUPPORT" },
{ WSAECONNREFUSED, "WSAECONNREFUSED" },
{ WSAEDESTADDRREQ, "WSAEDESTADDRREQ" },
{ WSAEFAULT, "WSAEFAULT" },
{ WSAEINVAL, "WSAEINVAL" },
{ WSAEISCONN, "WSAEISCONN" },
{ WSAEMFILE, "WSAEMFILE" },
{ WSAENETUNREACH, "WSAENETUNREACH" },
{ WSAENOBUFS, "WSAENOBUFS" },
{ WSAENOTSOCK, "WSAENOTSOCK" },
{ WSAETIMEDOUT, "WSAETIMEDOUT" },
{ WSAEWOULDBLOCK, "WSAEWOULDBLOCK" },
//bind
{ WSANOTINITIALISED, "WSANOTINITIALISED" },
{ WSAENETDOWN, "WSAENETDOWN" },
{ WSAEADDRINUSE, "WSAEADDRINUSE" },
{ WSAEFAULT, "WSAEFAULT" },
{ WSAEINPROGRESS, "WSAEINPROGRESS" },
{ WSAEAFNOSUPPORT, "WSAEAFNOSUPPORT" },
{ WSAEINVAL, "WSAEINVAL" },
{ WSAENOBUFS, "WSAENOBUFS" },
{ WSAENOTSOCK, "WSAENOTSOCK" }
};
class SocketUtils
{
static bool m_bIsInited;
public:
static const char* QueryErrMsg(size_t nErrCode);
/*
** ³õʼ»¯WinSocket, ³õʼ»¯WSA×ÊÔ´
** @Param nErrCode:
** @Ret : ²Ù×÷³É¹¦·µ»Øtrue,ʧ°Ü·µ»Øfalse
** @ErrCode: WSASYSNOTREADY/WSAVERNOTSUPPORTED/WSAEINPROGRESS/WSAEPROCLIM/WSAEFAULT
*/
static bool InitSocketUtils(int& nErrCode);
/*
** ÊÍ·ÅWSA×ÊÔ´µÈ
** µ÷ÓúóÈçÐè¼ÌÐøÊ¹ÓÃsocket,±ØÐëÖØÐµ÷ÓÃInitSocketUtils()½øÐгõʼ»¯
** @Ret : ²Ù×÷³É¹¦·µ»Øtrue,ʧ°Ü·µ»Øfalse
*/
static bool ReleaseSocketUtils();
/*
** ´´½¨Ò»¸öTCP¿Í»§¶ËÁ¬½Ó
** @Param nErrCode: ÓÉWSAGetLastError()·µ»ØµÄ´íÎóÂë
** @param szServerAddr£º ·þÎñÆ÷IPµØÖ·
** @param usPort£º ·þÎñÆ÷¶Ë¿ÚºÅ
** @Ret : Á¬½Ó³É¹¦£¬·µ»ØÓÐЧµÄSOCKET£¬·ñÔò£¬·µ»ØINVALID_SOCKET
*/
static SOCKET CreateClientSocket_TCP(int& nErrCode, const char* szServerAddr = "127.0.0.1", u_short usPort = 10086);
/*
** ´´½¨Ò»¸öTCP·þÎñ¶ËÁ¬½Ó
** @Param nErrCode: ÓÉWSAGetLastError()·µ»ØµÄ´íÎóÂë
** @param usPort£º Òª°ó¶¨µÄ¶Ë¿Ú
** @return£º ½¨Á¢³É¹¦£¬·µ»ØÓÐЧµÄSOCKET£¬·ñÔò£¬·µ»ØINVALID_SOCKET
*/
static SOCKET CreateServerSocket_TCP(int& nErrCode, u_short usPort = 10086);
/*
** ÔÚÖ¸¶¨µÄ¶Ë¿ÚºÅ·¶Î§ÄÚ³¢ÊÔ½¨Á¢Ò»¸öTCP·þÎñ¶ËÁ¬½Ó
** @Param nErrCode: ÓÉWSAGetLastError()·µ»ØµÄ´íÎóÂë
** @Param usPortMin: ×îС¶Ë¿ÚºÅ
** @Param usPortMax: ×î´ó¶Ë¿ÚºÅ
** @Param usPort: ²Ù×÷³É¹¦Ê±·µ»Øµ±Ç°ÕýÔÚ¼àÌýµÄ¶Ë¿ÚºÅ
** @Ret: ½¨Á¢³É¹¦£¬·µ»ØÓÐЧµÄSOCKET£¬·ñÔò£¬·µ»ØINVALID_SOCKET
*/
static SOCKET CreateServerSocket_TCP_Ex(int& nErrCode, u_short usPortMin, u_short usPortMax, u_short & usPort);
/*
** ÔÚÖ¸¶¨µÄsocketÉÏ¿ªÊ¼¼àÌý
** @Param nErrCode: ÓÉWSAGetLastError()·µ»ØµÄ´íÎóÂë
** @Param skSrvSock:
** @Param nBackLog:
** @Ret: ²Ù×÷³É¹¦·µ»Øtrue,ʧ°Ü·µ»Øfalse
*/
static bool ListenAt(int& nErrCode, SOCKET skSrvSock, int nBackLog);
/*
** ÏòÖ¸¶¨µÄSocketÁ¬½Ó·¢ËÍÖ¸¶¨µÄ×Ö½ÚÊý
** @Param s: Ö¸¶¨µÄSocketÁ¬½Ó
** @Param pBuffer: ·¢ËÍ»º³åÇø,´óС²»Ð¡ÓÚnSpecLength
** @Param nSpecLength: Ö¸¶¨µÄ×Ö½ÚÊý
** @Param nErrCode: ÓÉWSAGetLastError()·µ»ØµÄ´íÎóÂë
** @Ret : socketÁ¬½Ó·µ»ØSOCKET_ERRORʱ·µ»Øfalse
*/
static bool SendToSocket(SOCKET s, char* pBuffer, int nSpecLength, int& nErrCode);
/*
** ´ÓÖ¸¶¨µÄSocketÁ¬½Ó½ÓÊÕÖ¸¶¨×Ö½ÚÊý,
** Èç¹û´ÓSocketÖжÁÈ¡µÄ×Ö½ÚÊýÎÞ·¨´ïµ½Ö¸±ê,Ôò×èÈû¹ÒÆð,
** Ö±µ½½ÓÊÕµ½Ö¸¶¨µÄ×Ö½ÚÊýºó, º¯Êý·µ»Ø.
** @Param s: Ö¸¶¨µÄSocketÁ¬½Ó
** @Param pBuffer: ½ÓÊÕ»º³åÇø, ´óС²»Ð¡ÓÚnSpecLength
** @Param nSpecLength: Ö¸¶¨µÄ×Ö½ÚÊý
** @Param nErrCode: ÓÉWSAGetLastError()·µ»ØµÄ´íÎóÂë
** @Ret : socketÁ¬½Ó·µ»ØSOCKET_ERRORʱ·µ»Øfalse
*/
static bool RecvFromSocket(SOCKET s, char* pBuffer, int nSpecLength, int& nErrCode);
/*
** »ñȡָ¶¨socketµÄIPÐÅÏ¢
** @Param s: Ö¸¶¨µÄsocket¾ä±ú
** @Param addr: SOCKADDR_IN½á¹¹Ìå
** @Param nErrCode: ÓÉWSAGetLastError()·µ»ØµÄ´íÎóÂë
** @Ret : ²Ù×÷³É¹¦·µ»Øtrue,ʧ°Ü·µ»Øfalse
*/
static bool GetAddressBySocket(SOCKET s, SOCKADDR_IN & addr, int& nErrCode);
};
|
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2014-2021 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed.org for more information.
This file is part of plumed, version 2.
plumed 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 3 of the License, or
(at your option) any later version.
plumed 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 plumed. If not, see <http://www.gnu.org/licenses/>.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#ifndef __PLUMED_tools_OpenMP_h
#define __PLUMED_tools_OpenMP_h
#include <vector>
namespace PLMD {
class OpenMP {
public:
/// Set number of threads that can be used by openMP
static void setNumThreads(const unsigned nt);
/// Get number of threads that can be used by openMP
static unsigned getNumThreads();
/// Returns a unique thread identification number within the current team
static unsigned getThreadNum();
/// get cacheline size
static unsigned getCachelineSize();
/// Get a reasonable number of threads so as to access to an array of size s located at x
template<typename T>
static unsigned getGoodNumThreads(const T*x,unsigned s);
/// Get a reasonable number of threads so as to access to vector v;
template<typename T>
static unsigned getGoodNumThreads(const std::vector<T> & v);
};
template<typename T>
unsigned OpenMP::getGoodNumThreads(const T*x,unsigned n) {
unsigned long p=(unsigned long) x;
(void) p; // this is not to have warnings. notice that the pointer location is not used actually.
// a factor two is necessary since there is no guarantee that x is aligned
// to cache line boundary
unsigned m=n*sizeof(T)/(2*getCachelineSize());
unsigned numThreads=getNumThreads();
if(m>=numThreads) m=numThreads;
else m=1;
return m;
}
template<typename T>
unsigned OpenMP::getGoodNumThreads(const std::vector<T> & v) {
if(v.size()==0) return 1;
else return getGoodNumThreads(&v[0],v.size());
}
}
#endif
|
/*! \file */
#ifndef GDB_CLIENT_CORE_H
#define GDB_CLIENT_CORE_H
#include "r_types.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "../libgdbr.h"
#include "../utils.h"
#include "../arch.h"
#define CMD_ATTACH "vAttach;"
#define CMD_DETACH_MP "D;"
#define CMD_KILL_MP "vKill;"
#define CMD_READREGS "g"
#define CMD_WRITEREGS "G"
#define CMD_READREG "p"
#define CMD_WRITEREG "P"
#define CMD_WRITEMEM "M"
#define CMD_READMEM "m"
#define CMD_BP "Z0"
#define CMD_RBP "z0"
#define CMD_HBP "Z1"
#define CMD_RHBP "z1"
#define CMD_QRCMD "qRcmd,"
#define CMD_C "vCont"
#define CMD_C_CONT "c"
#define CMD_C_STEP "s"
enum Breakpoint {
BREAKPOINT,
HARDWARE_BREAKPOINT,
WRITE_WATCHPOINT,
READ_WATCHPOINT,
ACCESS_WATCHPOINT
};
/*!
* \brief Function sends a vCont command to the gdbserver
* \param g thre "instance" of the current libgdbr session
* \param command the command that will be sent (i.e. 's,S,c,C...')
* \returns -1 if something went wrong
*/
int send_vcont(libgdbr_t* g, const char* command, int thread_id);
int set_bp(libgdbr_t* g, ut64 address, const char* conditions, enum Breakpoint type);
int remove_bp(libgdbr_t* g, ut64 address, enum Breakpoint type);
#endif // GDB_CLIENT_CORE_H
|
/*
* This file is part of nanocoop.
*
* Copyright (C) 2014 Nenad Radulovic
*
* nanocoop 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 3 of the License, or
* (at your option) any later version.
*
* nanocoop 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 nanocoop. If not, see <http://www.gnu.org/licenses/>.
*
* web site: http://github.com/nradulovic
* e-mail : nenad.b.radulovic@gmail.com
*//***********************************************************************//**
* @file
* @author Nenad Radulovic
* @brief Port Implementation
* @addtogroup port
*********************************************************************//** @{ */
/*========================================================= INCLUDE FILES ==*/
#include "nc_port.h"
/*========================================================= LOCAL MACRO's ==*/
/*====================================================== LOCAL DATA TYPES ==*/
/*============================================= LOCAL FUNCTION PROTOTYPES ==*/
/*======================================================= LOCAL VARIABLES ==*/
/*====================================================== GLOBAL VARIABLES ==*/
const nc_cpu_reg g_exp2_lookup[8] =
{
(1u << 0), (1u << 1), (1u << 2), (1u << 3),
(1u << 4), (1u << 5), (1u << 6), (1u << 7)
};
const uint_fast8_t g_log2_lookup[256] =
{
0u, 0u, 1u, 1u, 2u, 2u, 2u, 2u, 3u, 3u, 3u, 3u, 3u, 3u, 3u, 3u,
4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u, 4u,
5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u,
5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u, 5u,
6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u,
6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u,
6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u,
6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u, 6u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u,
7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u, 7u
};
/*============================================ LOCAL FUNCTION DEFINITIONS ==*/
/*=================================== GLOBAL PRIVATE FUNCTION DEFINITIONS ==*/
/*==================================== GLOBAL PUBLIC FUNCTION DEFINITIONS ==*/
/*================================*//** @cond *//*== CONFIGURATION ERRORS ==*/
/** @endcond *//** @} *//******************************************************
* END of ncport.c
******************************************************************************/
|
/******************************************************************************
* FileName: spi_flash.h
* Description: FLASH
* Alternate SDK
* Author: PV`
* (c) PV` 2015
*******************************************************************************/
#ifndef SPI_FLASH_H
#define SPI_FLASH_H
#include "sdk_config.h"
#include "hw/esp8266.h"
#include "bios/spiflash.h"
#define SPI_FLASH_SEC_SIZE (4*1024)
#ifdef FIX_SDK_FLASH_SIZE // использовать 'песочницу' для SDK (262144..FLASH_MAX_SIZE, шаг SPI_FLASH_SEC_SIZE)
#if FIX_SDK_FLASH_SIZE > FLASH_CACHE_MAX_SIZE
#error 'FIX_SDK_FLASH_SIZE > FLASH_CACHE_MAX_SIZE !'
#endif
#define flashchip_sector_size SPI_FLASH_SEC_SIZE
#define sdk_flashchip_size FIX_SDK_FLASH_SIZE // размер 'песочницы' для SDK (стандарт = 512 килобайт)
#define open_16m() flashchip->chip_size = FLASH_MAX_SIZE
#define close_16m() flashchip->chip_size = FIX_SDK_FLASH_SIZE
#else
#define flashchip_sector_size flashchip->sector_size
#define sdk_flashchip_size flashchip->chip_size
#define open_16m()
#define close_16m()
#endif
#define fsec_esp_init_data_default (sdk_flashchip_size / flashchip_sector_size - 4)
#define faddr_esp_init_data_default (sdk_flashchip_size - 4 * flashchip_sector_size)
#define fsec_sdk_wifi_cfg (sdk_flashchip_size / flashchip_sector_size - 3)
#define fsec_sdk_wifi_cfg_head (sdk_flashchip_size / flashchip_sector_size - 1)
#define faddr_sdk_wifi_cfg (sdk_flashchip_size - 3 * flashchip_sector_size)
#define faddr_sdk_wifi_cfg_head (sdk_flashchip_size - 1 * flashchip_sector_size)
#if DEF_SDK_VERSION >= 2000
#define fsec_rf_cal (sdk_flashchip_size / flashchip_sector_size - 5)
#define faddr_rf_cal (sdk_flashchip_size - 5 * flashchip_sector_size)
#define SDK_CFG_FLASH_SEC 5 // SDK с v2.0.0 использует 5 последних секторов во Flash для сохранения установок
#else
#define SDK_CFG_FLASH_SEC 4 // SDK до v2.0.0 использует 4 последних сектора во Flash для сохранения установок
#endif
uint32 spi_flash_get_id(void);
SpiFlashOpResult spi_flash_read_status(uint32_t * sta);
SpiFlashOpResult spi_flash_write_status(uint32_t sta);
SpiFlashOpResult spi_flash_erase_sector(uint16 sec);
SpiFlashOpResult spi_flash_write(uint32 faddr, uint32 *src_addr, uint32 size);
SpiFlashOpResult spi_flash_read(uint32 faddr, void *des, uint32 size);
SpiFlashOpResult spi_flash_erase_block(uint32 blk);
uint32 spi_flash_real_size(void) ICACHE_FLASH_ATTR; // реальный размер Flash
#ifdef USE_OVERLAP_MODE
typedef SpiFlashOpResult (* user_spi_flash_read)(
SpiFlashChip *spi,
uint32 src_addr,
uint32 *des_addr,
uint32 size);
extern user_spi_flash_read flash_read;
void spi_flash_set_read_func(user_spi_flash_read read);
#endif
#define spi_flash_read_byte(faddr, dest) spi_flash_read(faddr, dest, 1);
#endif
|
/**
@file ComboBoxMap.h
@brief Class for integer input using slider or text field
@author Lime Microsystems (www.limemicro.com)
*/
#ifndef NUMERIC_SLIDER_H
#define NUMERIC_SLIDER_H
#include <wx/wx.h>
#include <wx/panel.h>
class wxSpinCtrl;
class wxScrollBar;
class NumericSlider : public wxPanel
{
public:
NumericSlider();
NumericSlider(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxString &value = wxEmptyString,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0,
int max = 100,
int initial = 0,
const wxString &name = "numericSlider"
);
~NumericSlider();
void SetValue(int integer);
int GetValue();
virtual void SetToolTip(const wxString &tipString);
protected:
void OnSpinnerChangeEnter(wxSpinEvent &event);
void OnSpinnerChange(wxSpinEvent &event);
void OnScrollChange(wxScrollEvent &event);
wxSpinCtrl* mSpinner;
wxScrollBar* mScroll;
private:
DECLARE_DYNAMIC_CLASS(NumericSlider)
DECLARE_EVENT_TABLE()
};
#endif
|
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "apr_strings.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
typedef struct {
int authoritative;
} authz_user_config_rec;
static void *create_authz_user_dir_config(apr_pool_t *p, char *d)
{
authz_user_config_rec *conf = apr_palloc(p, sizeof(*conf));
conf->authoritative = 1; /* keep the fortress secure by default */
return conf;
}
static const command_rec authz_user_cmds[] =
{
AP_INIT_FLAG("AuthzUserAuthoritative", ap_set_flag_slot,
(void *)APR_OFFSETOF(authz_user_config_rec, authoritative),
OR_AUTHCFG,
"Set to 'Off' to allow access control to be passed along to "
"lower modules if the 'require user' or 'require valid-user' "
"statement is not met. (default: On)."),
{NULL}
};
module AP_MODULE_DECLARE_DATA authz_user_module;
static int check_user_access(request_rec *r)
{
authz_user_config_rec *conf = ap_get_module_config(r->per_dir_config,
&authz_user_module);
char *user = r->user;
int m = r->method_number;
int required_user = 0;
register int x;
const char *t, *w;
const apr_array_header_t *reqs_arr = ap_requires(r);
require_line *reqs;
/* BUG FIX: tadc, 11-Nov-1995. If there is no "requires" directive,
* then any user will do.
*/
if (!reqs_arr) {
return DECLINED;
}
reqs = (require_line *)reqs_arr->elts;
for (x = 0; x < reqs_arr->nelts; x++) {
if (!(reqs[x].method_mask & (AP_METHOD_BIT << m))) {
continue;
}
t = reqs[x].requirement;
w = ap_getword_white(r->pool, &t);
if (!strcasecmp(w, "valid-user")) {
return OK;
}
if (!strcasecmp(w, "user")) {
/* And note that there are applicable requirements
* which we consider ourselves the owner of.
*/
required_user = 1;
while (t[0]) {
w = ap_getword_conf(r->pool, &t);
if (!strcmp(user, w)) {
return OK;
}
}
}
}
if (!required_user) {
/* no applicable requirements */
return DECLINED;
}
if (!conf->authoritative) {
return DECLINED;
}
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"access to %s failed, reason: user '%s' does not meet "
"'require'ments for user/valid-user to be allowed access",
r->uri, user);
ap_note_auth_failure(r);
return HTTP_UNAUTHORIZED;
}
static void register_hooks(apr_pool_t *p)
{
ap_hook_auth_checker(check_user_access, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA authz_user_module =
{
STANDARD20_MODULE_STUFF,
create_authz_user_dir_config, /* dir config creater */
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
authz_user_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};
|
// Copyright © Microsoft Open Technologies, Inc.
//
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
// ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
// PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
//
// See the Apache License, Version 2.0 for the specific language
// governing permissions and limitations under the License.
#import "BVTestFlipsideViewController.h"
@class BVSettings;
@class BVTestInstance;
@interface BVTestMainViewController : UIViewController <BVTestFlipsideViewControllerDelegate, UIPopoverControllerDelegate>
{
@protected
BVSettings* mTestData;
BVTestInstance* mAADInstance;
}
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (strong, nonatomic) UIPopoverController *flipsidePopoverController;
@end
|
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include "Layer.h"
#include "paddle/math/Matrix.h"
namespace paddle {
/**
* A base layer for SequenceLastInstanceLayer/AverageLayer/MaxLayer.
*
* Input: one or more sequences. Each sequence contains some instances.
* If SequenceLevel = kNonSeq:
* Output: output size is the number of input sequences (NOT input instances)
* output[i] = seqlastin/average/max_{for each instance in this
* sequence}{input[i]}
* If SequenceLevel = kSeq:
* Check input sequence must has sub-sequence
* Output: output size is the number of input sub-sequences
* output[i] = seqlastin/average/max_{for each instance in this
* sub-sequence}{input[i]}
*
* The config file api is pooling_layer.
*/
class SequencePoolLayer : public Layer {
protected:
int type_;
std::unique_ptr<Weight> biases_;
enum SequenceLevel { kNonSeq = 0, kSeq = 1 };
size_t newBatchSize_;
ICpuGpuVectorPtr startPositions_;
public:
explicit SequencePoolLayer(const LayerConfig& config) : Layer(config) {}
bool init(const LayerMap& layerMap,
const ParameterMap& parameterMap) override;
void forward(PassType passType) override;
void backward(const UpdateCallback& callback = nullptr) override;
};
} // namespace paddle
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/servicecatalog/ServiceCatalog_EXPORTS.h>
#include <aws/servicecatalog/ServiceCatalogRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace ServiceCatalog
{
namespace Model
{
/**
*/
class AWS_SERVICECATALOG_API DescribeTagOptionRequest : public ServiceCatalogRequest
{
public:
DescribeTagOptionRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DescribeTagOption"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The TagOption identifier.</p>
*/
inline const Aws::String& GetId() const{ return m_id; }
/**
* <p>The TagOption identifier.</p>
*/
inline bool IdHasBeenSet() const { return m_idHasBeenSet; }
/**
* <p>The TagOption identifier.</p>
*/
inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }
/**
* <p>The TagOption identifier.</p>
*/
inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }
/**
* <p>The TagOption identifier.</p>
*/
inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }
/**
* <p>The TagOption identifier.</p>
*/
inline DescribeTagOptionRequest& WithId(const Aws::String& value) { SetId(value); return *this;}
/**
* <p>The TagOption identifier.</p>
*/
inline DescribeTagOptionRequest& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
/**
* <p>The TagOption identifier.</p>
*/
inline DescribeTagOptionRequest& WithId(const char* value) { SetId(value); return *this;}
private:
Aws::String m_id;
bool m_idHasBeenSet;
};
} // namespace Model
} // namespace ServiceCatalog
} // namespace Aws
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/workmail/WorkMail_EXPORTS.h>
#include <aws/workmail/WorkMailRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace WorkMail
{
namespace Model
{
/**
*/
class AWS_WORKMAIL_API CreateAliasRequest : public WorkMailRequest
{
public:
CreateAliasRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "CreateAlias"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline const Aws::String& GetOrganizationId() const{ return m_organizationId; }
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline bool OrganizationIdHasBeenSet() const { return m_organizationIdHasBeenSet; }
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline void SetOrganizationId(const Aws::String& value) { m_organizationIdHasBeenSet = true; m_organizationId = value; }
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline void SetOrganizationId(Aws::String&& value) { m_organizationIdHasBeenSet = true; m_organizationId = std::move(value); }
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline void SetOrganizationId(const char* value) { m_organizationIdHasBeenSet = true; m_organizationId.assign(value); }
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline CreateAliasRequest& WithOrganizationId(const Aws::String& value) { SetOrganizationId(value); return *this;}
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline CreateAliasRequest& WithOrganizationId(Aws::String&& value) { SetOrganizationId(std::move(value)); return *this;}
/**
* <p>The organization under which the member (user or group) exists.</p>
*/
inline CreateAliasRequest& WithOrganizationId(const char* value) { SetOrganizationId(value); return *this;}
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline const Aws::String& GetEntityId() const{ return m_entityId; }
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline bool EntityIdHasBeenSet() const { return m_entityIdHasBeenSet; }
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline void SetEntityId(const Aws::String& value) { m_entityIdHasBeenSet = true; m_entityId = value; }
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline void SetEntityId(Aws::String&& value) { m_entityIdHasBeenSet = true; m_entityId = std::move(value); }
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline void SetEntityId(const char* value) { m_entityIdHasBeenSet = true; m_entityId.assign(value); }
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline CreateAliasRequest& WithEntityId(const Aws::String& value) { SetEntityId(value); return *this;}
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline CreateAliasRequest& WithEntityId(Aws::String&& value) { SetEntityId(std::move(value)); return *this;}
/**
* <p>The member (user or group) to which this alias is added.</p>
*/
inline CreateAliasRequest& WithEntityId(const char* value) { SetEntityId(value); return *this;}
/**
* <p>The alias to add to the member set.</p>
*/
inline const Aws::String& GetAlias() const{ return m_alias; }
/**
* <p>The alias to add to the member set.</p>
*/
inline bool AliasHasBeenSet() const { return m_aliasHasBeenSet; }
/**
* <p>The alias to add to the member set.</p>
*/
inline void SetAlias(const Aws::String& value) { m_aliasHasBeenSet = true; m_alias = value; }
/**
* <p>The alias to add to the member set.</p>
*/
inline void SetAlias(Aws::String&& value) { m_aliasHasBeenSet = true; m_alias = std::move(value); }
/**
* <p>The alias to add to the member set.</p>
*/
inline void SetAlias(const char* value) { m_aliasHasBeenSet = true; m_alias.assign(value); }
/**
* <p>The alias to add to the member set.</p>
*/
inline CreateAliasRequest& WithAlias(const Aws::String& value) { SetAlias(value); return *this;}
/**
* <p>The alias to add to the member set.</p>
*/
inline CreateAliasRequest& WithAlias(Aws::String&& value) { SetAlias(std::move(value)); return *this;}
/**
* <p>The alias to add to the member set.</p>
*/
inline CreateAliasRequest& WithAlias(const char* value) { SetAlias(value); return *this;}
private:
Aws::String m_organizationId;
bool m_organizationIdHasBeenSet;
Aws::String m_entityId;
bool m_entityIdHasBeenSet;
Aws::String m_alias;
bool m_aliasHasBeenSet;
};
} // namespace Model
} // namespace WorkMail
} // namespace Aws
|
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file 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.
*/
#undef memcpy
#include <cbmc_proof/nondet.h>
#include <stdint.h>
/**
* Overrides the version of memcpy used by CBMC. Users may not want to pay
* for the cost of performing the computation of memcpy in proofs.
* In that case, this stub at least checks for the preconditions and
* assigns arbitrary values to *dst.
*/
void *memcpy_impl(void *dst, const void *src, size_t n) {
__CPROVER_precondition(
__CPROVER_POINTER_OBJECT(dst) != __CPROVER_POINTER_OBJECT(src) ||
((const char *)src >= (const char *)dst + n) || ((const char *)dst >= (const char *)src + n),
"memcpy src/dst overlap");
__CPROVER_precondition(src != NULL && __CPROVER_r_ok(src, n), "memcpy source region readable");
__CPROVER_precondition(dst != NULL && __CPROVER_w_ok(dst, n), "memcpy destination region writeable");
__CPROVER_havoc_object(dst);
return dst;
}
void *memcpy(void *dst, const void *src, size_t n) {
return memcpy_impl(dst, src, n);
}
void *__builtin___memcpy_chk(void *dst, const void *src, __CPROVER_size_t n, __CPROVER_size_t size) {
(void)size;
return memcpy_impl(dst, src, n);
}
|
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file
* @brief Defines the Factory class.
*/
#pragma once
#include <map>
#include <memory>
#include <utility>
#include "cyber/common/macros.h"
#include "cyber/common/log.h"
/**
* @namespace apollo::common::util
* @brief apollo::common::util
*/
namespace apollo {
namespace common {
namespace util {
/**
* @class Factory
* @brief Implements a Factory design pattern with Register and Create methods
*
* The objects created by this factory all implement the same interface
* (namely, AbstractProduct). This design pattern is useful in settings where
* multiple implementations of an interface are available, and one wishes to
* defer the choice of the implementation in use.
*
* @param IdentifierType Type used for identifying the registered classes,
* typically std::string.
* @param AbstractProduct The interface implemented by the registered classes
* @param ProductCreator Function returning a pointer to an instance of
* the registered class
* @param MapContainer Internal implementation of the function mapping
* IdentifierType to ProductCreator, by default std::unordered_map
*/
template <typename IdentifierType, class AbstractProduct,
class ProductCreator = AbstractProduct *(*)(),
class MapContainer = std::map<IdentifierType, ProductCreator>>
class Factory {
public:
/**
* @brief Registers the class given by the creator function, linking it to id.
* Registration must happen prior to calling CreateObject.
* @param id Identifier of the class being registered
* @param creator Function returning a pointer to an instance of
* the registered class
* @return True iff the key id is still available
*/
bool Register(const IdentifierType &id, ProductCreator creator) {
return producers_.insert(std::make_pair(id, creator)).second;
}
bool Contains(const IdentifierType &id) {
return producers_.find(id) != producers_.end();
}
/**
* @brief Unregisters the class with the given identifier
* @param id The identifier of the class to be unregistered
*/
bool Unregister(const IdentifierType &id) {
return producers_.erase(id) == 1;
}
void Clear() { producers_.clear(); }
bool Empty() const { return producers_.empty(); }
/**
* @brief Creates and transfers membership of an object of type matching id.
* Need to register id before CreateObject is called. May return nullptr
* silently.
* @param id The identifier of the class we which to instantiate
* @param args the object construction arguments
*/
template <typename... Args>
std::unique_ptr<AbstractProduct> CreateObjectOrNull(const IdentifierType &id,
Args &&... args) {
auto id_iter = producers_.find(id);
if (id_iter != producers_.end()) {
return std::unique_ptr<AbstractProduct>(
(id_iter->second)(std::forward<Args>(args)...));
}
return nullptr;
}
/**
* @brief Creates and transfers membership of an object of type matching id.
* Need to register id before CreateObject is called.
* @param id The identifier of the class we which to instantiate
* @param args the object construction arguments
*/
template <typename... Args>
std::unique_ptr<AbstractProduct> CreateObject(const IdentifierType &id,
Args &&... args) {
auto result = CreateObjectOrNull(id, std::forward<Args>(args)...);
AERROR_IF(!result) << "Factory could not create Object of type : " << id;
return result;
}
private:
MapContainer producers_;
};
} // namespace util
} // namespace common
} // namespace apollo
|
//
// SPSubject.h
// Snowplow
//
// Copyright (c) 2013-2015 Snowplow Analytics Ltd. All rights reserved.
//
// This program is licensed to you under the Apache License Version 2.0,
// and you may not use this file except in compliance with the Apache License
// Version 2.0. You may obtain a copy of the Apache License Version 2.0 at
// http://www.apache.org/licenses/LICENSE-2.0.
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the Apache License Version 2.0 is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the Apache License Version 2.0 for the specific
// language governing permissions and limitations there under.
//
// Authors: Joshua Beemster
// Copyright: Copyright (c) 2015 Snowplow Analytics Ltd
// License: Apache License Version 2.0
//
#import <Foundation/Foundation.h>
@class SPPayload;
@interface SPSubject : NSObject
/**
* Initializes a newly allocated SnowplowSubject object.
* @return a new SnowplowSubject
*/
- (id) init;
/**
* Creates a subject which also creates all Platform specific pairs.
* @param whether to create platform dictionary
* @return a new SnowplowSubject
*/
- (id) initWithPlatformContext:(BOOL)platformContext andGeoContext:(BOOL)geoContext;
/**
* Gets all standard dictionary pairs to decorate the event with.
* @return a SnowplowPayload with all standard pairs
*/
- (SPPayload *) getStandardDict;
/**
* Gets all platform dictionary pairs to decorate event with.
* @return a SnowplowPayload with all platform specific pairs
*/
- (SPPayload *) getPlatformDict;
/**
* Gets the Geo-Location dictionary if the required keys are available.
* @return the NSDictionary or nil
*/
- (NSDictionary *) getGeoLocationDict;
/**
* Sets the User ID
* @param uid as a String
*/
- (void) setUserId:(NSString *)uid;
/**
* Sets the Screen Resolution
* @param width as an Int
* @param height as an Int
*/
- (void) setResolutionWithWidth:(NSInteger)width andHeight:(NSInteger)height;
/**
* Sets the View Port dimensions
* @param width as an Int
* @param height as an Int
*/
- (void) setViewPortWithWidth:(NSInteger)width andHeight:(NSInteger)height;
/**
* Sets the Color Depth
* @param depth as an Int
*/
- (void) setColorDepth:(NSInteger)depth;
/**
* Sets the Timezone
* @param timezone as a String
*/
- (void) setTimezone:(NSString *)timezone;
/**
* Sets the Language
* @param lang the language as a String
*/
- (void) setLanguage:(NSString *)lang;
/**
* Sets the IP Address
* @param ip as a String
*/
- (void) setIpAddress:(NSString *)ip;
/**
* Sets the Useragent
* @param useragent as a String
*/
- (void) setUseragent:(NSString *)useragent;
/**
* Sets the Network User ID
* @param nuid as a String
*/
- (void) setNetworkUserId:(NSString *)nuid;
/**
* Sets the Domain User ID
* @param duid as a String
*/
- (void) setDomainUserId:(NSString *)duid;
/**
* Sets the standard pairs for the Subject, called automatically on object creation.
*/
- (void) setStandardDict;
/**
* Optional mobile/desktop context, if selected will be automatically populated on object creation.
*/
- (void) setPlatformDict;
/**
* Optional geo context, if run will allocate memory for the geo-location context
*/
- (void) setGeoDict;
/**
* Sets the latitude value for the geo context
* @param latitude A non-nil number
*/
- (void) setGeoLatitude:(float)latitude;
/**
* Sets the longitude value for the geo context
* @param longitude A non-nil number
*/
- (void) setGeoLongitude:(float)longitude;
/**
* Sets the latitudeLongitudeAccuracy value for the geo context
* @param latitudeLongitudeAccuracy A non-nil number
*/
- (void) setGeoLatitudeLongitudeAccuracy:(float)latitudeLongitudeAccuracy;
/**
* Sets the altitude value for the geo context
* @param altitude A non-nil number
*/
- (void) setGeoAltitude:(float)altitude;
/**
* Sets the altitudeAccuracy value for the geo context
* @param altitudeAccuracy A non-nil number
*/
- (void) setGeoAltitudeAccuracy:(float)altitudeAccuracy;
/**
* Sets the bearing value for the geo context
* @param bearing A non-nil number
*/
- (void) setGeoBearing:(float)bearing;
/**
* Sets the speed value for the geo context
* @param speed A non-nil number
*/
- (void) setGeoSpeed:(float)speed;
/**
* Sets the timestamp value for the geo context
* @param timestamp An NSInteger value
*/
- (void) setGeoTimestamp:(NSInteger)timestamp;
@end
|
/* This file contains the implementation of the VBFS file system server. */
/*
* The architecture of VBFS can be sketched as follows:
*
* +-------------+
* | VBFS | This file
* +-------------+
* |
* +-------------+
* | libsffs | Shared Folder File System library
* +-------------+
* |
* +-------------+
* | libvboxfs | VirtualBox File System library
* +-------------+
* |
* +-------------+
* | libsys/vbox | VBOX driver interfacing library
* +-------------+
* -------- | -------- (process boundary)
* +-------------+
* | VBOX driver | VirtualBox backdoor driver
* +-------------+
* ======== | ======== (system boundary)
* +-------------+
* | VirtualBox | The host system
* +-------------+
*
* The interfaces between the layers are defined in the following header files:
* minix/sffs.h: shared between VBFS, libsffs, and libvboxfs
* minix/vboxfs.h: shared between VBFS and libvboxfs
* minix/vbox.h: shared between libvboxfs and libsys/vbox
* minix/vboxtype.h: shared between libvboxfs, libsys/vbox, and VBOX
* minix/vboxif.h: shared between libsys/vbox and VBOX
*/
#include <minix/drivers.h>
#include <minix/sffs.h>
#include <minix/vboxfs.h>
#include <minix/optset.h>
static char share[PATH_MAX];
static struct sffs_params params;
static struct optset optset_table[] = {
{ "share", OPT_STRING, share, sizeof(share) },
{ "prefix", OPT_STRING, params.p_prefix, sizeof(params.p_prefix) },
{ "uid", OPT_INT, ¶ms.p_uid, 10 },
{ "gid", OPT_INT, ¶ms.p_gid, 10 },
{ "fmask", OPT_INT, ¶ms.p_file_mask, 8 },
{ "dmask", OPT_INT, ¶ms.p_dir_mask, 8 },
{ NULL, 0, NULL, 0 }
};
/*
* Initialize this file server. Called at startup time.
*/
static int
init(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
const struct sffs_table *table;
int i, r, roflag;
/* Set defaults. */
share[0] = 0;
params.p_prefix[0] = 0;
params.p_uid = 0;
params.p_gid = 0;
params.p_file_mask = 0755;
params.p_dir_mask = 0755;
params.p_case_insens = FALSE;
/* We must have been given an options string. Parse the options. */
for (i = 1; i < env_argc - 1; i++)
if (!strcmp(env_argv[i], "-o"))
optset_parse(optset_table, env_argv[++i]);
/* A share name is required. */
if (!share[0]) {
printf("VBFS: no shared folder share name specified\n");
return EINVAL;
}
/* Initialize the VBOXFS library. If this fails, exit immediately. */
r = vboxfs_init(share, &table, ¶ms.p_case_insens, &roflag);
if (r != OK) {
if (r == ENOENT)
printf("VBFS: the given share does not exist\n");
else
printf("VBFS: unable to initialize VBOXFS (%d)\n", r);
return r;
}
/* Now initialize the SFFS library. */
if ((r = sffs_init("VBFS", table, ¶ms)) != OK) {
vboxfs_cleanup();
return r;
}
return OK;
}
/*
* Local SEF initialization.
*/
static void
sef_local_startup(void)
{
/* Register initialization callback. */
sef_setcb_init_fresh(init);
/* Register signal callback. SFFS handles this. */
sef_setcb_signal_handler(sffs_signal);
sef_startup();
}
/*
* The main function of this file server.
*/
int
main(int argc, char **argv)
{
/* Start up. */
env_setargs(argc, argv);
sef_local_startup();
/* Let SFFS do the actual work. */
sffs_loop();
/* Clean up. */
vboxfs_cleanup();
return EXIT_SUCCESS;
}
|
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef JERRY_SNAPSHOT_H
#define JERRY_SNAPSHOT_H
#include "ecma-globals.h"
/**
* Snapshot header
*/
typedef struct
{
/* The size of this structure is recommended to be divisible by
* JMEM_ALIGNMENT. Otherwise some bytes after the header are wasted. */
uint32_t version; /**< version number */
uint32_t lit_table_offset; /**< offset of the literal table */
uint32_t lit_table_size; /**< size of literal table */
uint32_t is_run_global; /**< flag, indicating whether the snapshot
* was saved as 'Global scope'-mode code (true)
* or as eval-mode code (false) */
} jerry_snapshot_header_t;
/**
* Jerry snapshot format version
*/
#define JERRY_SNAPSHOT_VERSION (6u)
#endif /* !JERRY_SNAPSHOT_H */
|
/*
* Copyright (c) 2017 Florian Vaussard, HEIG-VD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel.h>
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>
/* pin assignments for NUCLEO-F412ZG board */
static const struct pin_config pinconf[] = {
#ifdef CONFIG_UART_STM32_PORT_3
{STM32_PIN_PD8, STM32F4_PINMUX_FUNC_PD8_USART3_TX},
{STM32_PIN_PD9, STM32F4_PINMUX_FUNC_PD9_USART3_RX},
#endif /* #ifdef CONFIG_UART_STM32_PORT_3 */
#ifdef CONFIG_PWM_STM32_2
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */
#ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},
#endif /* CONFIG_USB_DC_STM32 */
#ifdef CONFIG_I2C_1
{STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL},
{STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA},
#endif
};
static int pinmux_stm32_init(struct device *port)
{
ARG_UNUSED(port);
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
return 0;
}
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
|
#pragma once
#include "GuiElement.h"
class Button : public GuiElement {
public:
char filler [96 - 46]; // 46
std::string msg; // 96
int id; // 100
bool flip; // 104
bool pressed; // 105
bool overrideScreenRendering; // 106
virtual ~Button();
virtual void render(MinecraftGame*, int, int);
virtual void pointerReleased(MinecraftGame*, int, int);
virtual void drawPressed(int);
virtual void clicked(MinecraftGame*, int, int);
virtual void released(int, int);
virtual void setPressed();
virtual void setPressed(bool);
virtual void setMsg(std::string const&);
virtual void getYImage(bool);
virtual void renderBg(MinecraftGame*, int, int);
virtual void renderFace(MinecraftGame*, int, int);
Button(int, int, int, int, int, std::string const&, bool);
Button(int, int, int, std::string const&);
Button(int, std::string const&, bool);
int _getWidth(MinecraftGame*, std::string const&, int);
void hovered(MinecraftGame*, int, int);
bool isInside(int, int);
bool isOveridingScreenRendering();
bool isPressed(int, int);
void setOverrideScreenRendering(bool);
};
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/mediaconvert/MediaConvert_EXPORTS.h>
#include <aws/mediaconvert/model/Queue.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace MediaConvert
{
namespace Model
{
class AWS_MEDIACONVERT_API UpdateQueueResult
{
public:
UpdateQueueResult();
UpdateQueueResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
UpdateQueueResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* You can use queues to manage the resources that are available to your AWS
* account for running multiple transcoding jobs at the same time. If you don't
* specify a queue, the service sends all jobs through the default queue. For more
* information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html.
*/
inline const Queue& GetQueue() const{ return m_queue; }
/**
* You can use queues to manage the resources that are available to your AWS
* account for running multiple transcoding jobs at the same time. If you don't
* specify a queue, the service sends all jobs through the default queue. For more
* information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html.
*/
inline void SetQueue(const Queue& value) { m_queue = value; }
/**
* You can use queues to manage the resources that are available to your AWS
* account for running multiple transcoding jobs at the same time. If you don't
* specify a queue, the service sends all jobs through the default queue. For more
* information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html.
*/
inline void SetQueue(Queue&& value) { m_queue = std::move(value); }
/**
* You can use queues to manage the resources that are available to your AWS
* account for running multiple transcoding jobs at the same time. If you don't
* specify a queue, the service sends all jobs through the default queue. For more
* information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html.
*/
inline UpdateQueueResult& WithQueue(const Queue& value) { SetQueue(value); return *this;}
/**
* You can use queues to manage the resources that are available to your AWS
* account for running multiple transcoding jobs at the same time. If you don't
* specify a queue, the service sends all jobs through the default queue. For more
* information, see
* https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html.
*/
inline UpdateQueueResult& WithQueue(Queue&& value) { SetQueue(std::move(value)); return *this;}
private:
Queue m_queue;
};
} // namespace Model
} // namespace MediaConvert
} // namespace Aws
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/waf/WAF_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace WAF
{
namespace Model
{
class AWS_WAF_API UpdateGeoMatchSetResult
{
public:
UpdateGeoMatchSetResult();
UpdateGeoMatchSetResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
UpdateGeoMatchSetResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The <code>ChangeToken</code> that you used to submit the
* <code>UpdateGeoMatchSet</code> request. You can also use this value to query the
* status of the request. For more information, see
* <a>GetChangeTokenStatus</a>.</p>
*/
inline const Aws::String& GetChangeToken() const{ return m_changeToken; }
/**
* <p>The <code>ChangeToken</code> that you used to submit the
* <code>UpdateGeoMatchSet</code> request. You can also use this value to query the
* status of the request. For more information, see
* <a>GetChangeTokenStatus</a>.</p>
*/
inline void SetChangeToken(const Aws::String& value) { m_changeToken = value; }
/**
* <p>The <code>ChangeToken</code> that you used to submit the
* <code>UpdateGeoMatchSet</code> request. You can also use this value to query the
* status of the request. For more information, see
* <a>GetChangeTokenStatus</a>.</p>
*/
inline void SetChangeToken(Aws::String&& value) { m_changeToken = std::move(value); }
/**
* <p>The <code>ChangeToken</code> that you used to submit the
* <code>UpdateGeoMatchSet</code> request. You can also use this value to query the
* status of the request. For more information, see
* <a>GetChangeTokenStatus</a>.</p>
*/
inline void SetChangeToken(const char* value) { m_changeToken.assign(value); }
/**
* <p>The <code>ChangeToken</code> that you used to submit the
* <code>UpdateGeoMatchSet</code> request. You can also use this value to query the
* status of the request. For more information, see
* <a>GetChangeTokenStatus</a>.</p>
*/
inline UpdateGeoMatchSetResult& WithChangeToken(const Aws::String& value) { SetChangeToken(value); return *this;}
/**
* <p>The <code>ChangeToken</code> that you used to submit the
* <code>UpdateGeoMatchSet</code> request. You can also use this value to query the
* status of the request. For more information, see
* <a>GetChangeTokenStatus</a>.</p>
*/
inline UpdateGeoMatchSetResult& WithChangeToken(Aws::String&& value) { SetChangeToken(std::move(value)); return *this;}
/**
* <p>The <code>ChangeToken</code> that you used to submit the
* <code>UpdateGeoMatchSet</code> request. You can also use this value to query the
* status of the request. For more information, see
* <a>GetChangeTokenStatus</a>.</p>
*/
inline UpdateGeoMatchSetResult& WithChangeToken(const char* value) { SetChangeToken(value); return *this;}
private:
Aws::String m_changeToken;
};
} // namespace Model
} // namespace WAF
} // namespace Aws
|
/* $NetBSD: cdefs.h,v 1.3 2012/01/20 14:08:05 joerg Exp $ */
#ifndef _X86_64_CDEFS_H_
#define _X86_64_CDEFS_H_
#define __ALIGNBYTES (sizeof(long) - 1)
#endif /* !_X86_64_CDEFS_H_ */
|
//
// CXMLNode.h
// TouchCode
//
// Created by Jonathan Wight on 03/07/08.
// Copyright 2011 toxicsoftware.com. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``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 TOXICSOFTWARE.COM 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.
//
// The views and conclusions contained in the software and documentation are those of the
// authors and should not be interpreted as representing official policies, either expressed
// or implied, of toxicsoftware.com.
#import <Foundation/Foundation.h>
#include <libxml/tree.h>
typedef enum {
CXMLInvalidKind = 0,
CXMLElementKind = XML_ELEMENT_NODE,
CXMLAttributeKind = XML_ATTRIBUTE_NODE,
CXMLTextKind = XML_TEXT_NODE,
CXMLProcessingInstructionKind = XML_PI_NODE,
CXMLCommentKind = XML_COMMENT_NODE,
CXMLNotationDeclarationKind = XML_NOTATION_NODE,
CXMLDTDKind = XML_DTD_NODE,
CXMLElementDeclarationKind = XML_ELEMENT_DECL,
CXMLAttributeDeclarationKind = XML_ATTRIBUTE_DECL,
CXMLEntityDeclarationKind = XML_ENTITY_DECL,
CXMLNamespaceKind = XML_NAMESPACE_DECL,
CXMLEntityReferenceKind = XML_ENTITY_REF_NODE
} CXMLNodeKind;
@class CXMLDocument;
// NSXMLNode
@interface CXMLNode : NSObject <NSCopying> {
xmlNodePtr _node;
BOOL _freeNodeOnRelease;
}
- (CXMLNodeKind)kind;
- (NSString *)name;
- (NSString *)stringValue;
- (NSUInteger)index;
- (NSUInteger)level;
- (CXMLDocument *)rootDocument;
- (CXMLNode *)parent;
- (NSUInteger)childCount;
- (NSArray *)children;
- (CXMLNode *)childAtIndex:(NSUInteger)index;
- (CXMLNode *)previousSibling;
- (CXMLNode *)nextSibling;
//- (CXMLNode *)previousNode;
//- (CXMLNode *)nextNode;
//- (NSString *)XPath;
- (NSString *)localName;
- (NSString *)prefix;
- (NSString *)URI;
+ (NSString *)localNameForName:(NSString *)name;
+ (NSString *)prefixForName:(NSString *)name;
+ (CXMLNode *)predefinedNamespaceForPrefix:(NSString *)name;
- (NSString *)description;
- (NSString *)XMLString;
- (NSString *)XMLStringWithOptions:(NSUInteger)options;
//- (NSString *)canonicalXMLStringPreservingComments:(BOOL)comments;
- (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error;
@end
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/ec2/model/FpgaDeviceInfo.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace EC2
{
namespace Model
{
/**
* <p>Describes the FPGAs for the instance type.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/FpgaInfo">AWS API
* Reference</a></p>
*/
class AWS_EC2_API FpgaInfo
{
public:
FpgaInfo();
FpgaInfo(const Aws::Utils::Xml::XmlNode& xmlNode);
FpgaInfo& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
void OutputToStream(Aws::OStream& oStream, const char* location) const;
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline const Aws::Vector<FpgaDeviceInfo>& GetFpgas() const{ return m_fpgas; }
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline bool FpgasHasBeenSet() const { return m_fpgasHasBeenSet; }
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline void SetFpgas(const Aws::Vector<FpgaDeviceInfo>& value) { m_fpgasHasBeenSet = true; m_fpgas = value; }
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline void SetFpgas(Aws::Vector<FpgaDeviceInfo>&& value) { m_fpgasHasBeenSet = true; m_fpgas = std::move(value); }
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline FpgaInfo& WithFpgas(const Aws::Vector<FpgaDeviceInfo>& value) { SetFpgas(value); return *this;}
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline FpgaInfo& WithFpgas(Aws::Vector<FpgaDeviceInfo>&& value) { SetFpgas(std::move(value)); return *this;}
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline FpgaInfo& AddFpgas(const FpgaDeviceInfo& value) { m_fpgasHasBeenSet = true; m_fpgas.push_back(value); return *this; }
/**
* <p>Describes the FPGAs for the instance type.</p>
*/
inline FpgaInfo& AddFpgas(FpgaDeviceInfo&& value) { m_fpgasHasBeenSet = true; m_fpgas.push_back(std::move(value)); return *this; }
/**
* <p>The total memory of all FPGA accelerators for the instance type.</p>
*/
inline int GetTotalFpgaMemoryInMiB() const{ return m_totalFpgaMemoryInMiB; }
/**
* <p>The total memory of all FPGA accelerators for the instance type.</p>
*/
inline bool TotalFpgaMemoryInMiBHasBeenSet() const { return m_totalFpgaMemoryInMiBHasBeenSet; }
/**
* <p>The total memory of all FPGA accelerators for the instance type.</p>
*/
inline void SetTotalFpgaMemoryInMiB(int value) { m_totalFpgaMemoryInMiBHasBeenSet = true; m_totalFpgaMemoryInMiB = value; }
/**
* <p>The total memory of all FPGA accelerators for the instance type.</p>
*/
inline FpgaInfo& WithTotalFpgaMemoryInMiB(int value) { SetTotalFpgaMemoryInMiB(value); return *this;}
private:
Aws::Vector<FpgaDeviceInfo> m_fpgas;
bool m_fpgasHasBeenSet;
int m_totalFpgaMemoryInMiB;
bool m_totalFpgaMemoryInMiBHasBeenSet;
};
} // namespace Model
} // namespace EC2
} // namespace Aws
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ___xmldomxmldecl_h___
#define ___xmldomxmldecl_h___
#include <xercesc/dom/DOMProcessingInstruction.hpp>
#include "IXMLDOMNodeImpl.h"
XERCES_CPP_NAMESPACE_USE
class ATL_NO_VTABLE CXMLDOMXMLDecl :
public CComObjectRootEx<CComSingleThreadModel>,
public IXMLDOMNodeImpl<IXMLDOMProcessingInstruction, &IID_IXMLDOMProcessingInstruction>
{
public:
CXMLDOMXMLDecl()
{}
void FinalRelease()
{
ReleaseOwnerDoc();
}
virtual DOMNode* get_DOMNode() { return xmlDecl;}
virtual DOMNodeType get_DOMNodeType() const { return NODE_PROCESSING_INSTRUCTION; }
DECLARE_NOT_AGGREGATABLE(CXMLDOMXMLDecl)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CXMLDOMXMLDecl)
COM_INTERFACE_ENTRY(IXMLDOMProcessingInstruction)
COM_INTERFACE_ENTRY(IXMLDOMNode)
COM_INTERFACE_ENTRY(IIBMXMLDOMNodeIdentity)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
// IXMLDOMProcessingInstruction methods
STDMETHOD(get_target)(BSTR *pVal);
STDMETHOD(get_data)(BSTR *pVal);
STDMETHOD(put_data)(BSTR newVal);
DOMProcessingInstruction* xmlDecl;
};
typedef CComObject<CXMLDOMXMLDecl> CXMLDOMXMLDeclObj;
#endif // ___xmldomprocessinginstruction_h___
|
/****************************************************************************
*
* Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd. All rights reserved
*
****************************************************************************/
#ifndef __SAP_MLME_H__
#define __SAP_MLME_H__
int sap_mlme_init(void);
int sap_mlme_deinit(void);
/* MLME signal handlers in rx.c */
void slsi_rx_scan_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_scan_done_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_connect_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_connected_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_received_frame_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_disconnect_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_disconnected_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_procedure_started_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_frame_transmission_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_mic_failure_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
void slsi_rx_blockack_ind(struct slsi_dev *sdev, struct netif *dev, struct max_buff *mbuf);
#endif
|
//
// MOBFHttpService.h
// MOBFoundation
//
// Created by vimfung on 15-1-20.
// Copyright (c) 2015年 MOB. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MOBFHttpService;
/**
* GET方式
*/
extern NSString *const kMOBFHttpMethodGet;
/**
* POST方式
*/
extern NSString *const kMOBFHttpMethodPost;
/**
* DELETE方式
*/
extern NSString *const kMOBFHttpMethodDelete;
/**
* HEAD方式
*/
extern NSString *const kMOBFHttpMethodHead;
/**
* HTTP返回事件
*
* @param response 回复对象
* @param responseData 回复数据
*/
typedef void(^MOBFHttpResultEvent) (NSHTTPURLResponse *response, NSData *responseData);
/**
* HTTP错误事件
*
* @param error 错误信息
*/
typedef void(^MOBFHttpFaultEvent) (NSError *error);
/**
* HTTP上传数据事件
*
* @param totalBytes 总字节数
* @param loadedBytes 上传字节数据
*/
typedef void(^MOBFHttpUploadProgressEvent) (NSInteger totalBytes, NSInteger loadedBytes);
/**
* HTTP服务类
*/
@interface MOBFHttpService : NSObject
/**
* @brief 提交方式,默认为GET
*/
@property (nonatomic, copy) NSString *method;
/**
* @brief 是否缓存回复对象,默认为YES
*/
@property (nonatomic) BOOL isCacheResponse;
/**
* 初始化HTTP服务
*
* @param urlString URL地址字符串
*
* @return HTTP服务对象
*/
- (id)initWithURLString:(NSString *)urlString;
/**
* 初始化HTTP服务
*
* @param URL URL地址对象
*
* @return HTTP服务对象
*/
- (id)initWithURL:(NSURL *)URL;
/**
* 初始化HTTP服务
*
* @param request 请求对象
*
* @return HTTP服务对象
*/
- (id)initWithRequest:(NSURLRequest *)request;
/**
* 添加HTTP头
*
* @param header 名称
* @param value 值
*/
- (void)addHeader:(NSString *)header value:(NSString *)value;
/**
* 添加参数
*
* @param value 参数值
* @param key 参数名字
*/
- (void)addParameter:(id)value forKey:(NSString *)key;
/**
* 添加上传文件参数
*
* @param fileData 文件数据
* @param fileName 文件名称
* @param mimeType MIME类型
* @param transferEncoding 传输编码
* @param key 参数名字
*/
- (void)addFileParameter:(NSData *)fileData
fileName:(NSString *)fileName
mimeType:(NSString *)mimeType
transferEncoding:(NSString *)transferEncoding
forKey:(NSString *)key;
/**
* 发送请求
*
* @param resultHandler 返回回调
* @param faultHandler 错误回调
* @param uploadProgressHandler 上传数据进度回调
*/
- (void)sendRequestOnResult:(MOBFHttpResultEvent)resultHandler
onFault:(MOBFHttpFaultEvent)faultHandler
onUploadProgress:(MOBFHttpUploadProgressEvent)uploadProgressHandler;
/**
* 取消请求
*/
- (void)cancelRequest;
/**
* 发送HTTP请求
*
* @param urlString 请求地址
* @param method 请求方式
* @param parameters 请求参数
* @param headers 请求头集合
* @param resultHandler 返回回调
* @param faultHandler 错误回调
* @param uploadProgressHandler 上传数据进度回调
*
* @return HTTP服务对象
*/
+ (MOBFHttpService *)sendHttpRequestByURLString:(NSString *)urlString
method:(NSString *)method
parameters:(NSDictionary *)parameters
headers:(NSDictionary *)headers
onResult:(MOBFHttpResultEvent)resultHandler
onFault:(MOBFHttpFaultEvent)faultHandler
onUploadProgress:(MOBFHttpUploadProgressEvent)uploadProgressHandler;
@end
|
#ifndef _SERIAL_H_
#define _SERIAL_H_
#include <inttypes.h>
#ifndef PORTNAME
#define PORTNAME "/dev/ttyAMA0"
#endif
void serial_init(void);
void serial_config(void);
void serial_println(const char *, int);
void serial_readln(char *, int);
void serial_close(void);
#endif
|
../radeon/radeon_texture.h
|
/* SPDX-License-Identifier: BSD-2-Clause */
/***********************************************************************
* Copyright 2017-2018, Fraunhofer SIT sponsored by Infineon Technologies AG
* Copyright (c) 2017-2018, Intel Corporation
*
* All rights reserved.
***********************************************************************/
#include "tss2_esys.h"
#define TSSWG_INTEROP 1
#define TSS_SAPI_FIRST_FAMILY 2
#define TSS_SAPI_FIRST_LEVEL 1
#define TSS_SAPI_FIRST_VERSION 108
#define EXIT_SKIP 77
#define EXIT_XFAIL 99
#define goto_error_if_not_failed(rc,msg,label) \
if (rc == TSS2_RC_SUCCESS) { \
LOG_ERROR("Error %s (%x) in Line %i: \n", msg, __LINE__, rc); \
goto label; }
/*
* This is the prototype for all integration tests in the tpm2-tss
* project. Integration tests are intended to exercise the combined
* components in the software stack. This typically means executing some
* SYS function using the socket TCTI to communicate with a software
* TPM2 simulator.
* Return values:
* A successful test will return 0, any other value indicates failure.
*/
int test_invoke_esys(ESYS_CONTEXT * sys_context);
|
// 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 CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_
#define CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_
#include "base/memory/scoped_ptr.h"
#include "base/task.h"
#include "content/browser/geolocation/location_provider.h"
#include "content/browser/geolocation/win7_location_api_win.h"
#include "content/common/geoposition.h"
// Location provider for Windows 7 that uses the Location and Sensors platform
// to obtain position fixes.
// TODO(allanwoj): Remove polling and let the api signal when a new location.
// TODO(allanwoj): Possibly derive this class and the linux gps provider class
// from a single SystemLocationProvider class as their implementation is very
// similar.
class Win7LocationProvider : public LocationProviderBase {
public:
Win7LocationProvider(Win7LocationApi* api);
virtual ~Win7LocationProvider();
// LocationProvider.
virtual bool StartProvider(bool high_accuracy);
virtual void StopProvider();
virtual void GetPosition(Geoposition* position);
virtual void UpdatePosition();
virtual void OnPermissionGranted(const GURL& requesting_frame);
private:
// Task which runs in the child thread.
void DoPollTask();
// Will schedule a poll; i.e. enqueue DoPollTask deferred task.
void ScheduleNextPoll(int interval);
scoped_ptr<Win7LocationApi> api_;
Geoposition position_;
// Holder for the tasks which run on the thread; takes care of cleanup.
ScopedRunnableMethodFactory<Win7LocationProvider> task_factory_;
};
#endif // CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_
|
// Copyright 2016 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 BASE_THREADING_THREAD_TASK_RUNNER_HANDLE_H_
#define BASE_THREADING_THREAD_TASK_RUNNER_HANDLE_H_
#include "base/base_export.h"
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h"
namespace base {
// ThreadTaskRunnerHandle stores a reference to a thread's TaskRunner
// in thread-local storage. Callers can then retrieve the TaskRunner
// for the current thread by calling ThreadTaskRunnerHandle::Get().
// At most one TaskRunner may be bound to each thread at a time.
// Prefer SequencedTaskRunnerHandle to this unless thread affinity is required.
class BASE_EXPORT ThreadTaskRunnerHandle {
public:
// Gets the SingleThreadTaskRunner for the current thread.
static scoped_refptr<SingleThreadTaskRunner> Get();
// Returns true if the SingleThreadTaskRunner is already created for
// the current thread.
static bool IsSet();
// Overrides ThreadTaskRunnerHandle::Get()'s |task_runner_| to point at
// |overriding_task_runner| until the returned ScopedClosureRunner goes out of
// scope (instantiates a ThreadTaskRunnerHandle for that scope if |!IsSet()|).
// Nested overrides are allowed but callers must ensure the
// ScopedClosureRunners expire in LIFO (stack) order. Note: nesting
// ThreadTaskRunnerHandles isn't generally desired but it's useful in unit
// tests where multiple task runners can share the main thread for simplicity
// and determinism.
static ScopedClosureRunner OverrideForTesting(
scoped_refptr<SingleThreadTaskRunner> overriding_task_runner)
WARN_UNUSED_RESULT;
// Binds |task_runner| to the current thread. |task_runner| must belong
// to the current thread for this to succeed.
explicit ThreadTaskRunnerHandle(
scoped_refptr<SingleThreadTaskRunner> task_runner);
~ThreadTaskRunnerHandle();
private:
scoped_refptr<SingleThreadTaskRunner> task_runner_;
DISALLOW_COPY_AND_ASSIGN(ThreadTaskRunnerHandle);
};
} // namespace base
#endif // BASE_THREADING_THREAD_TASK_RUNNER_HANDLE_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GL_ANGLE_PLATFORM_IMPL_H_
#define UI_GL_ANGLE_PLATFORM_IMPL_H_
// Implements the ANGLE platform interface, for functionality like
// histograms and trace profiling.
#include "base/macros.h"
#include "third_party/angle/include/platform/Platform.h"
namespace gfx {
// Derives the base ANGLE platform and provides implementations
class ANGLEPlatformImpl : public angle::Platform {
public:
ANGLEPlatformImpl();
~ANGLEPlatformImpl() override;
// angle::Platform:
double currentTime() override;
double monotonicallyIncreasingTime() override;
const unsigned char* getTraceCategoryEnabledFlag(
const char* category_group) override;
TraceEventHandle addTraceEvent(char phase,
const unsigned char* category_group_enabled,
const char* name,
unsigned long long id,
double timestamp,
int num_args,
const char** arg_names,
const unsigned char* arg_types,
const unsigned long long* arg_values,
unsigned char flags) override;
void updateTraceEventDuration(const unsigned char* category_group_enabled,
const char* name,
TraceEventHandle handle) override;
void histogramCustomCounts(const char* name,
int sample,
int min,
int max,
int bucket_count) override;
void histogramEnumeration(const char* name,
int sample,
int boundary_value) override;
void histogramSparse(const char* name, int sample) override;
private:
DISALLOW_COPY_AND_ASSIGN(ANGLEPlatformImpl);
};
} // namespace gfx
#endif // UI_GL_ANGLE_PLATFORM_IMPL_H_
|
//
// SLSOpenGLES11Renderer.h
// Molecules
//
// The source code for Molecules is available under a BSD license. See License.txt for details.
//
// Created by Brad Larson on 4/12/2011.
//
// This is the old renderer, split out into a separate class for OpenGL ES 1.1 devices
#import "SLSOpenGLESRenderer.h"
@interface SLSOpenGLES11Renderer : SLSOpenGLESRenderer
{
}
// Molecule 3-D geometry generation
- (void)addNormal:(GLfloat *)newNormal forAtomType:(SLSAtomType)atomType;
- (void)addBondNormal:(GLfloat *)newNormal;
@end
|
/*** Copyright (c), The Unregents of the University of California ***
*** For more information please refer to files in the COPYRIGHT directory ***/
/* unregDataObj.c
*/
#include "modDataObjMeta.h"
#include "icatHighLevelRoutines.h"
#include "objMetaOpr.h"
#include "dataObjOpr.h"
#include "miscServerFunct.h"
int
rsModDataObjMeta (rsComm_t *rsComm, modDataObjMeta_t *modDataObjMetaInp)
{
int status;
rodsServerHost_t *rodsServerHost = NULL;
dataObjInfo_t *dataObjInfo;
keyValPair_t *regParam;
regParam = modDataObjMetaInp->regParam;
dataObjInfo = modDataObjMetaInp->dataObjInfo;
status = getAndConnRcatHost (rsComm, MASTER_RCAT, dataObjInfo->objPath,
&rodsServerHost);
if (status < 0) {
return(status);
}
if (rodsServerHost->localFlag == LOCAL_HOST) {
#ifdef RODS_CAT
status = _rsModDataObjMeta (rsComm, modDataObjMetaInp);
#else
status = SYS_NO_RCAT_SERVER_ERR;
#endif
} else {
status = rcModDataObjMeta (rodsServerHost->conn, modDataObjMetaInp);
if (getIrodsErrno (status) == SYS_HEADER_READ_LEN_ERR ||
getIrodsErrno (status) == SYS_HEADER_WRITE_LEN_ERR) {
/* this connection may be broken. try again */
int status1 = svrToSvrReConnect (rsComm, rodsServerHost);
if (status1 >= 0) {
status = rcModDataObjMeta (rodsServerHost->conn,
modDataObjMetaInp);
}
}
}
return (status);
}
int
_rsModDataObjMeta (rsComm_t *rsComm, modDataObjMeta_t *modDataObjMetaInp)
{
#ifdef RODS_CAT
int status;
dataObjInfo_t *dataObjInfo;
keyValPair_t *regParam;
int i;
ruleExecInfo_t rei2;
memset ((char*)&rei2, 0, sizeof (ruleExecInfo_t));
rei2.rsComm = rsComm;
if (rsComm != NULL) {
rei2.uoic = &rsComm->clientUser;
rei2.uoip = &rsComm->proxyUser;
}
rei2.doi = modDataObjMetaInp->dataObjInfo;
rei2.condInputData = modDataObjMetaInp->regParam;
regParam = modDataObjMetaInp->regParam;
dataObjInfo = modDataObjMetaInp->dataObjInfo;
if (regParam->len == 0) {
rodsLog(LOG_NOTICE, "Warning, _rsModDataObjMeta called with empty regParam, returning success");
return (0);
}
/* In dataObjInfo, need just dataId. But it will accept objPath too,
* but less efficient
*/
/** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
rei2.doi = dataObjInfo;
i = applyRule("acPreProcForModifyDataObjMeta",NULL, &rei2, NO_SAVE_REI);
if (i < 0) {
if (rei2.status < 0) {
i = rei2.status;
}
rodsLog (LOG_ERROR,
"_rsModDataObjMeta:acPreProcForModifyDataObjMeta error stat=%d", i);
return i;
}
/** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
if (getValByKey (regParam, ALL_KW) != NULL) {
/* all copies */
dataObjInfo_t *dataObjInfoHead = NULL;
dataObjInfo_t *tmpDataObjInfo;
dataObjInp_t dataObjInp;
bzero (&dataObjInp, sizeof (dataObjInp));
rstrcpy (dataObjInp.objPath, dataObjInfo->objPath, MAX_NAME_LEN);
status = getDataObjInfoIncSpecColl (rsComm, &dataObjInp,
&dataObjInfoHead);
if (status < 0) return status;
tmpDataObjInfo = dataObjInfoHead;
while (tmpDataObjInfo != NULL) {
if (tmpDataObjInfo->specColl != NULL) break;
status = chlModDataObjMeta (rsComm, tmpDataObjInfo, regParam);
if (status < 0) {
rodsLog (LOG_ERROR,
"_rsModDataObjMeta:chlModDataObjMeta %s error stat=%d",
tmpDataObjInfo->objPath, status);
}
tmpDataObjInfo = tmpDataObjInfo->next;
}
freeAllDataObjInfo (dataObjInfoHead);
} else {
status = chlModDataObjMeta (rsComm, dataObjInfo, regParam);
}
/** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
if (status >= 0) {
i = applyRule("acPostProcForModifyDataObjMeta",NULL, &rei2, NO_SAVE_REI);
if (i < 0) {
if (rei2.status < 0) {
i = rei2.status;
}
rodsLog (LOG_ERROR,
"_rsModDataObjMeta:acPostProcForModifyDataObjMeta error stat=%d",i);
return i;
}
}
/** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
return (status);
#else
return (SYS_NO_RCAT_SERVER_ERR);
#endif
}
|
/*
* Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ReplaceSelectionCommand_h
#define ReplaceSelectionCommand_h
#include "core/dom/NodeTraversal.h"
#include "core/editing/commands/CompositeEditCommand.h"
namespace blink {
class DocumentFragment;
class ReplacementFragment;
class ReplaceSelectionCommand final : public CompositeEditCommand {
public:
enum CommandOption {
SelectReplacement = 1 << 0,
SmartReplace = 1 << 1,
MatchStyle = 1 << 2,
PreventNesting = 1 << 3,
MovingParagraph = 1 << 4,
SanitizeFragment = 1 << 5
};
typedef unsigned CommandOptions;
static PassRefPtrWillBeRawPtr<ReplaceSelectionCommand> create(Document& document, PassRefPtrWillBeRawPtr<DocumentFragment> fragment, CommandOptions options, EditAction action = EditActionPaste)
{
return adoptRefWillBeNoop(new ReplaceSelectionCommand(document, fragment, options, action));
}
EphemeralRange insertedRange() const;
DECLARE_VIRTUAL_TRACE();
private:
ReplaceSelectionCommand(Document&, PassRefPtrWillBeRawPtr<DocumentFragment>, CommandOptions, EditAction);
void doApply(EditingState*) override;
EditAction editingAction() const override;
bool isReplaceSelectionCommand() const override;
class InsertedNodes {
STACK_ALLOCATED();
public:
void respondToNodeInsertion(Node&);
void willRemoveNodePreservingChildren(Node&);
void willRemoveNode(Node&);
void didReplaceNode(Node&, Node& newNode);
Node* firstNodeInserted() const { return m_firstNodeInserted.get(); }
Node* lastLeafInserted() const { return m_lastNodeInserted ? &NodeTraversal::lastWithinOrSelf(*m_lastNodeInserted) : 0; }
Node* pastLastLeaf() const { return m_lastNodeInserted ? NodeTraversal::next(NodeTraversal::lastWithinOrSelf(*m_lastNodeInserted)) : 0; }
private:
RefPtrWillBeMember<Node> m_firstNodeInserted;
RefPtrWillBeMember<Node> m_lastNodeInserted;
};
Node* insertAsListItems(PassRefPtrWillBeRawPtr<HTMLElement> listElement, Element* insertionBlock, const Position&, InsertedNodes&, EditingState*);
void updateNodesInserted(Node*);
bool shouldRemoveEndBR(HTMLBRElement*, const VisiblePosition&);
bool shouldMergeStart(bool, bool, bool);
bool shouldMergeEnd(bool selectionEndWasEndOfParagraph);
bool shouldMerge(const VisiblePosition&, const VisiblePosition&);
void mergeEndIfNeeded(EditingState*);
void removeUnrenderedTextNodesAtEnds(InsertedNodes&);
void removeRedundantStylesAndKeepStyleSpanInline(InsertedNodes&, EditingState*);
void makeInsertedContentRoundTrippableWithHTMLTreeBuilder(const InsertedNodes&, EditingState*);
void moveElementOutOfAncestor(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<Element> ancestor, EditingState*);
void handleStyleSpans(InsertedNodes&, EditingState*);
VisiblePosition positionAtStartOfInsertedContent() const;
VisiblePosition positionAtEndOfInsertedContent() const;
bool shouldPerformSmartReplace() const;
void addSpacesForSmartReplace(EditingState*);
void completeHTMLReplacement(const Position& lastPositionToSelect, EditingState*);
void mergeTextNodesAroundPosition(Position&, Position& positionOnlyToBeUpdated, EditingState*);
bool performTrivialReplace(const ReplacementFragment&, EditingState*);
Position m_startOfInsertedContent;
Position m_endOfInsertedContent;
RefPtrWillBeMember<EditingStyle> m_insertionStyle;
bool m_selectReplacement;
bool m_smartReplace;
bool m_matchStyle;
RefPtrWillBeMember<DocumentFragment> m_documentFragment;
bool m_preventNesting;
bool m_movingParagraph;
EditAction m_editAction;
bool m_sanitizeFragment;
bool m_shouldMergeEnd;
Position m_startOfInsertedRange;
Position m_endOfInsertedRange;
};
DEFINE_TYPE_CASTS(ReplaceSelectionCommand, CompositeEditCommand, command, command->isReplaceSelectionCommand(), command.isReplaceSelectionCommand());
} // namespace blink
#endif // ReplaceSelectionCommand_h
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_CLUSTER_SERVICE_H_
#define COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_CLUSTER_SERVICE_H_
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "components/enhanced_bookmarks/bookmark_server_service.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "components/sync_driver/sync_service_observer.h"
#include "net/url_request/url_fetcher.h"
class PrefService;
namespace sync_driver {
class SyncService;
}
namespace enhanced_bookmarks {
// Manages requests to the bookmark server to retrieve the current clustering
// state for the bookmarks. A cluster is simply a named set of bookmarks related
// to each others. Invalidates its data when a sync operation finishes.
class BookmarkServerClusterService : public KeyedService,
public BookmarkServerService,
public SigninManagerBase::Observer,
public sync_driver::SyncServiceObserver {
public:
// Maps a cluster name to the stars.id of the bookmarks.
typedef std::map<std::string, std::vector<std::string>> ClusterMap;
// |application_language_code| should be a ISO 639-1 compliant string. Aka
// 'en' or 'en-US'. Note that this code should only specify the language, not
// the locale, so 'en_US' (english language with US locale) and 'en-GB_US'
// (British english person in the US) are not language code.
BookmarkServerClusterService(
const std::string& application_language_code,
scoped_refptr<net::URLRequestContextGetter> request_context_getter,
ProfileOAuth2TokenService* token_service,
SigninManagerBase* signin_manager,
EnhancedBookmarkModel* enhanced_bookmark_model,
sync_driver::SyncService* sync_service,
PrefService* pref_service);
~BookmarkServerClusterService() override;
// KeyedService methods.
void Shutdown() override;
// Retrieves all the bookmarks associated with a cluster. The returned
// BookmarkNodes are owned by the bookmark model, and one must listen to the
// model observer notification to clear them.
const std::vector<const bookmarks::BookmarkNode*> BookmarksForClusterNamed(
const std::string& cluster_name) const;
// Returns the clusters in which the passed bookmark is in, if any.
const std::vector<std::string> ClustersForBookmark(
const bookmarks::BookmarkNode* bookmark) const;
// Dynamically generates a vector of all clusters names.
const std::vector<std::string> GetClusters() const;
// BookmarkServerService methods.
void AddObserver(BookmarkServerServiceObserver* observer) override;
// Registers server cluster service prefs.
static void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry);
protected:
// BookmarkServerService methods.
scoped_ptr<net::URLFetcher> CreateFetcher() override;
bool ProcessResponse(const std::string& response,
bool* should_notify) override;
void CleanAfterFailure() override;
// EnhancedBookmarkModelObserver methods.
void EnhancedBookmarkModelLoaded() override;
void EnhancedBookmarkAdded(const bookmarks::BookmarkNode* node) override;
void EnhancedBookmarkRemoved(const bookmarks::BookmarkNode* node) override;
void EnhancedBookmarkNodeChanged(
const bookmarks::BookmarkNode* node) override;
void EnhancedBookmarkAllUserNodesRemoved() override;
void EnhancedBookmarkRemoteIdChanged(const bookmarks::BookmarkNode* node,
const std::string& old_remote_id,
const std::string& remote_id) override;
private:
// Overriden from SigninManagerBase::Observer.
void GoogleSignedOut(const std::string& account_id,
const std::string& username) override;
// Updates |cluster_data_| with the |cluster_map| and saves the result to
// profile prefs. All changes to |cluster_data_| should go through this method
// to ensure profile prefs is always up to date.
// TODO(noyau): This is probably a misuse of profile prefs. While the expected
// amount of data is small (<1kb), it can theoretically reach megabytes in
// size.
void SwapModel(ClusterMap* cluster_map);
// Updates |cluster_data_| from profile prefs.
void LoadModel();
// sync_driver::SyncServiceObserver methods.
void OnStateChanged() override;
void OnSyncCycleCompleted() override;
// This sets an internal flag to fetch new clusters.
void InvalidateCache();
// Serialize the |cluster_map| into the returned dictionary value.. The
// |auth_id| uniquely identify the signed in user, to avoid deserializing data
// for a different one.
static scoped_ptr<base::DictionaryValue> Serialize(
const ClusterMap& cluster_map,
const std::string& auth_id);
// Returns true on success.
// The result is swapped into |out_map|.
// |auth_id| must match the serialized auth_id for this method to succeed.
static bool Deserialize(const base::DictionaryValue& value,
const std::string& auth_id,
ClusterMap* out_map);
// The ISO 639-1 code of the language used by the application.
const std::string application_language_code_;
// This class observes the sync service for changes.
sync_driver::SyncService* sync_service_;
// The preferences services associated with the relevant profile.
PrefService* pref_service_;
// The cluster data, a map from cluster name to a vector of stars.id.
ClusterMap cluster_data_;
bool sync_refresh_skipped_;
// This holds the number of cluster refreshes needed.
int refreshes_needed_;
DISALLOW_COPY_AND_ASSIGN(BookmarkServerClusterService);
};
} // namespace enhanced_bookmarks
#endif // COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_SERVER_CLUSTER_SERVICE_H_
|
/*-
* Copyright (c) 2014 Juniper Networks, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _MKIMG_MKIMG_H_
#define _MKIMG_MKIMG_H_
#include <sys/queue.h>
struct part {
STAILQ_ENTRY(part) link;
char *alias; /* Partition type alias. */
char *contents; /* Contents/size specification. */
u_int kind; /* Content kind. */
#define PART_UNDEF 0
#define PART_KIND_FILE 1
#define PART_KIND_PIPE 2
#define PART_KIND_SIZE 3
u_int index; /* Partition index (0-based). */
uintptr_t type; /* Scheme-specific partition type. */
lba_t block; /* Block-offset of partition in image. */
lba_t size; /* Size in blocks of partition. */
char *label; /* Partition label. */
};
extern STAILQ_HEAD(partlisthead, part) partlist;
extern u_int nparts;
extern u_int unit_testing;
extern u_int verbose;
extern u_int ncyls;
extern u_int nheads;
extern u_int nsecs;
extern u_int secsz; /* Logical block size. */
extern u_int blksz; /* Physical block size. */
static inline lba_t
round_block(lba_t n)
{
lba_t b = blksz / secsz;
return ((n + b - 1) & ~(b - 1));
}
static inline lba_t
round_cylinder(lba_t n)
{
u_int cyl = nsecs * nheads;
u_int r = n % cyl;
return ((r == 0) ? n : n + cyl - r);
}
static inline lba_t
round_track(lba_t n)
{
u_int r = n % nsecs;
return ((r == 0) ? n : n + nsecs - r);
}
#if !defined(SPARSE_WRITE)
#define sparse_write write
#else
ssize_t sparse_write(int, const void *, size_t);
#endif
void mkimg_chs(lba_t, u_int, u_int *, u_int *, u_int *);
struct uuid;
void mkimg_uuid(struct uuid *);
#endif /* _MKIMG_MKIMG_H_ */
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_H_
#define MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_H_
#include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
#include "third_party/skia/include/core/SkRegion.h"
namespace media {
typedef uint8 DiffInfo;
// TODO: Simplify differ now that we are working with SkRegions.
// diff_info_ should no longer be needed, as we can put our data directly into
// the region that we are calculating.
// http://crbug.com/92379
// TODO(sergeyu): Rename this class to something more sensible, e.g.
// ScreenCaptureFrameDifferencer.
class MEDIA_EXPORT Differ {
public:
// Create a differ that operates on bitmaps with the specified width, height
// and bytes_per_pixel.
Differ(int width, int height, int bytes_per_pixel, int stride);
~Differ();
int width() { return width_; }
int height() { return height_; }
int bytes_per_pixel() { return bytes_per_pixel_; }
int bytes_per_row() { return bytes_per_row_; }
// Given the previous and current screen buffer, calculate the dirty region
// that encloses all of the changed pixels in the new screen.
void CalcDirtyRegion(const void* prev_buffer, const void* curr_buffer,
SkRegion* region);
private:
// Allow tests to access our private parts.
friend class DifferTest;
// Identify all of the blocks that contain changed pixels.
void MarkDirtyBlocks(const void* prev_buffer, const void* curr_buffer);
// After the dirty blocks have been identified, this routine merges adjacent
// blocks into a region.
// The goal is to minimize the region that covers the dirty blocks.
void MergeBlocks(SkRegion* region);
// Check for diffs in upper-left portion of the block. The size of the portion
// to check is specified by the |width| and |height| values.
// Note that if we force the capturer to always return images whose width and
// height are multiples of kBlockSize, then this will never be called.
DiffInfo DiffPartialBlock(const uint8* prev_buffer, const uint8* curr_buffer,
int stride, int width, int height);
// Dimensions of screen.
int width_;
int height_;
// Number of bytes for each pixel in source and dest bitmap.
// (Yes, they must match.)
int bytes_per_pixel_;
// Number of bytes in each row of the image (AKA: stride).
int bytes_per_row_;
// Diff information for each block in the image.
scoped_array<DiffInfo> diff_info_;
// Dimensions and total size of diff info array.
int diff_info_width_;
int diff_info_height_;
int diff_info_size_;
DISALLOW_COPY_AND_ASSIGN(Differ);
};
} // namespace media
#endif // MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_H_
|
//
// MCOAddress+Private.h
// mailcore2
//
// Created by DINH Viêt Hoà on 3/11/13.
// Copyright (c) 2013 MailCore. All rights reserved.
//
#ifndef __MAILCORE_MCOADDRESS_PRIVATE_H_
#define __MAILCORE_MCOADDRESS_PRIVATE_H_
#ifdef __cplusplus
namespace mailcore {
class Address;
}
@interface MCOAddress (Private)
- (id) initWithMCAddress:(mailcore::Address *)address;
+ (MCOAddress *) addressWithMCAddress:(mailcore::Address *)address;
@end
#endif
#endif
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_TOOLBAR_WRENCH_ICON_PAINTER_H_
#define CHROME_BROWSER_UI_TOOLBAR_WRENCH_ICON_PAINTER_H_
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/image/image_skia.h"
namespace gfx {
class Canvas;
class MultiAnimation;
class Rect;
}
namespace ui {
class ThemeProvider;
}
// This class is used to draw the wrench icon. It can signify severity levels
// by changing the wrench icon to different colors.
class WrenchIconPainter : gfx::AnimationDelegate {
public:
enum BezelType {
BEZEL_NONE,
BEZEL_HOVER,
BEZEL_PRESSED,
};
enum Severity {
SEVERITY_NONE,
SEVERITY_INFO,
SEVERITY_LOW,
SEVERITY_MEDIUM,
SEVERITY_HIGH,
};
class Delegate {
public:
virtual void ScheduleWrenchIconPaint() = 0;
protected:
virtual ~Delegate() {}
};
explicit WrenchIconPainter(Delegate* delegate);
~WrenchIconPainter() override;
// If |severity| is not |SEVERITY_NONE| then the wrench icon is colored to
// match the severity level.
void SetSeverity(Severity severity, bool animate);
// A badge drawn on the top left.
void set_badge(const gfx::ImageSkia& badge) { badge_ = badge; }
void Paint(gfx::Canvas* canvas,
ui::ThemeProvider* theme_provider,
const gfx::Rect& rect,
BezelType bezel_type);
private:
FRIEND_TEST_ALL_PREFIXES(WrenchIconPainterTest, PaintCallback);
// AnimationDelegate:
void AnimationProgressed(const gfx::Animation* animation) override;
// Gets the image ID used to draw bars for the current severity level.
int GetCurrentSeverityImageID() const;
Delegate* delegate_;
Severity severity_;
gfx::ImageSkia badge_;
scoped_ptr<gfx::MultiAnimation> animation_;
DISALLOW_COPY_AND_ASSIGN(WrenchIconPainter);
};
#endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_ICON_PAINTER_H_
|
//
// SKNotesDocument.h
// Skim
//
// Created by Christiaan Hofman on 4/10/07.
/*
This software is Copyright (c) 2007-2014
Christiaan Hofman. 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 Christiaan Hofman nor the names of any
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import <Quartz/Quartz.h>
#import "SKNoteOutlineView.h"
#import "SKNoteTypeSheetController.h"
@class SKNoteOutlineView, SKStatusBar, SKFloatMapTable;
@interface SKNotesDocument : NSDocument <NSWindowDelegate, NSToolbarDelegate, SKNoteOutlineViewDelegate, NSOutlineViewDataSource, SKNoteTypeSheetControllerDelegate> {
SKNoteOutlineView *outlineView;
NSArrayController *arrayController;
NSSearchField *searchField;
SKStatusBar *statusBar;
NSDictionary *toolbarItems;
NSArray *notes;
PDFDocument *pdfDocument;
NSURL *sourceFileURL;
SKFloatMapTable *rowHeights;
SKNoteTypeSheetController *noteTypeSheetController;
NSRect windowRect;
BOOL exportUsingPanel;
BOOL caseInsensitiveSearch;
BOOL settingUpWindow;
}
@property (nonatomic, retain) IBOutlet SKNoteOutlineView *outlineView;
@property (nonatomic, retain) IBOutlet NSArrayController *arrayController;
@property (nonatomic, retain) IBOutlet NSSearchField *searchField;
@property (nonatomic, readonly) NSArray *notes;
@property (nonatomic, readonly) PDFDocument *pdfDocument;
@property (nonatomic, retain) NSURL *sourceFileURL;
- (IBAction)openPDF:(id)sender;
- (IBAction)searchNotes:(id)sender;
- (IBAction)toggleStatusBar:(id)sender;
- (IBAction)toggleCaseInsensitiveSearch:(id)sender;
- (void)setupToolbarForWindow:(NSWindow *)aWindow;
@end
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_BASE_UPLOAD_ELEMENT_H_
#define NET_BASE_UPLOAD_ELEMENT_H_
#include <vector>
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/time.h"
#include "net/base/net_export.h"
namespace net {
// A class representing an element contained by UploadData.
class NET_EXPORT UploadElement {
public:
enum Type {
TYPE_BYTES,
TYPE_FILE,
};
UploadElement();
~UploadElement();
Type type() const { return type_; }
const char* bytes() const { return bytes_start_ ? bytes_start_ : &buf_[0]; }
uint64 bytes_length() const { return buf_.size() + bytes_length_; }
const FilePath& file_path() const { return file_path_; }
uint64 file_range_offset() const { return file_range_offset_; }
uint64 file_range_length() const { return file_range_length_; }
// If NULL time is returned, we do not do the check.
const base::Time& expected_file_modification_time() const {
return expected_file_modification_time_;
}
void SetToBytes(const char* bytes, int bytes_len) {
type_ = TYPE_BYTES;
buf_.assign(bytes, bytes + bytes_len);
}
// This does not copy the given data and the caller should make sure
// the data is secured somewhere else (e.g. by attaching the data
// using SetUserData).
void SetToSharedBytes(const char* bytes, int bytes_len) {
type_ = TYPE_BYTES;
bytes_start_ = bytes;
bytes_length_ = bytes_len;
}
void SetToFilePath(const FilePath& path) {
SetToFilePathRange(path, 0, kuint64max, base::Time());
}
// If expected_modification_time is NULL, we do not check for the file
// change. Also note that the granularity for comparison is time_t, not
// the full precision.
void SetToFilePathRange(const FilePath& path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
type_ = TYPE_FILE;
file_path_ = path;
file_range_offset_ = offset;
file_range_length_ = length;
expected_file_modification_time_ = expected_modification_time;
}
private:
Type type_;
std::vector<char> buf_;
const char* bytes_start_;
uint64 bytes_length_;
FilePath file_path_;
uint64 file_range_offset_;
uint64 file_range_length_;
base::Time expected_file_modification_time_;
};
#if defined(UNIT_TEST)
inline bool operator==(const UploadElement& a,
const UploadElement& b) {
if (a.type() != b.type())
return false;
if (a.type() == UploadElement::TYPE_BYTES)
return a.bytes_length() == b.bytes_length() &&
memcmp(a.bytes(), b.bytes(), b.bytes_length()) == 0;
if (a.type() == UploadElement::TYPE_FILE) {
return a.file_path() == b.file_path() &&
a.file_range_offset() == b.file_range_offset() &&
a.file_range_length() == b.file_range_length() &&
a.expected_file_modification_time() ==
b.expected_file_modification_time();
}
return false;
}
inline bool operator!=(const UploadElement& a,
const UploadElement& b) {
return !(a == b);
}
#endif // defined(UNIT_TEST)
} // namespace net
#endif // NET_BASE_UPLOAD_ELEMENT_H_
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkTransmitRectilinearGridPiece.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkTransmitRectilinearGridPiece - Redistributes data produced
// by serial readers
//
// .SECTION Description
// This filter can be used to redistribute data from producers that can't
// produce data in parallel. All data is produced on first process and
// the distributed to others using the multiprocess controller.
//
// Note that this class is legacy. The superclass does all the work and
// can be used directly instead.
#ifndef __vtkTransmitRectilinearGridPiece_h
#define __vtkTransmitRectilinearGridPiece_h
#include "vtkFiltersParallelModule.h" // For export macro
#include "vtkTransmitStructuredDataPiece.h"
class vtkMultiProcessController;
class VTKFILTERSPARALLEL_EXPORT vtkTransmitRectilinearGridPiece : public vtkTransmitStructuredDataPiece
{
public:
static vtkTransmitRectilinearGridPiece *New();
vtkTypeMacro(vtkTransmitRectilinearGridPiece, vtkTransmitStructuredDataPiece);
void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkTransmitRectilinearGridPiece();
~vtkTransmitRectilinearGridPiece();
private:
vtkTransmitRectilinearGridPiece(const vtkTransmitRectilinearGridPiece&); // Not implemented
void operator=(const vtkTransmitRectilinearGridPiece&); // Not implemented
};
#endif
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"
/**
*
*/
UCLASS()
class SQLITE_API AMyActor : public AActor
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "My Actor")
bool GetMyStats();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Actor")
FString Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Actor")
int32 Age;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Actor")
FString Gender;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Actor")
float Height;
};
|
#include "platform.h"
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Entities\0.19.3\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Entities.TriangleMeshIntersecter.h>
namespace g{namespace Fuse{namespace Entities{struct ModelMeshCollision__Indexed;}}}
namespace g{namespace Uno{namespace Content{namespace Models{struct IndexArray;}}}}
namespace g{namespace Uno{namespace Content{namespace Models{struct VertexAttributeArray;}}}}
namespace g{namespace Uno{namespace Geometry{struct Triangle;}}}
namespace g{
namespace Fuse{
namespace Entities{
// private sealed class ModelMeshCollision.Indexed :1582
// {
::g::Fuse::Entities::TriangleMeshIntersecter_type* ModelMeshCollision__Indexed_typeof();
void ModelMeshCollision__Indexed__ctor_1_fn(ModelMeshCollision__Indexed* __this, ::g::Uno::Content::Models::VertexAttributeArray* positions, ::g::Uno::Content::Models::IndexArray* indices, int* indexCount);
void ModelMeshCollision__Indexed__GetTriangle_fn(ModelMeshCollision__Indexed* __this, int* t, ::g::Uno::Geometry::Triangle* __retval);
void ModelMeshCollision__Indexed__New1_fn(::g::Uno::Content::Models::VertexAttributeArray* positions, ::g::Uno::Content::Models::IndexArray* indices, int* indexCount, ModelMeshCollision__Indexed** __retval);
struct ModelMeshCollision__Indexed : ::g::Fuse::Entities::TriangleMeshIntersecter
{
uStrong< ::g::Uno::Content::Models::IndexArray*> _indices;
uStrong< ::g::Uno::Content::Models::VertexAttributeArray*> _positions;
void ctor_1(::g::Uno::Content::Models::VertexAttributeArray* positions, ::g::Uno::Content::Models::IndexArray* indices, int indexCount);
static ModelMeshCollision__Indexed* New1(::g::Uno::Content::Models::VertexAttributeArray* positions, ::g::Uno::Content::Models::IndexArray* indices, int indexCount);
};
// }
}}} // ::g::Fuse::Entities
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int x,i,n,y;
printf("n=");scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(y=0, x=n-i;y<=2*n;y++)
{
if(y>=x && y<=n+i)
{
printf("0");
}
else
{
printf("");
}
}
printf("\n");
}
}
|
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// 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.
//
//******************************************************************************
// WindowsApplicationModelDataTransferShareTarget.h
// Generated from winmd2objc
#pragma once
#include "interopBase.h"
@class WADSQuickLink, WADSShareOperation;
@protocol WADSIQuickLink
, WADSIShareOperation, WADSIShareOperation2;
#include "WindowsApplicationModelDataTransfer.h"
#include "WindowsFoundationCollections.h"
#include "WindowsStorageStreams.h"
#import <Foundation/Foundation.h>
// Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink
#ifndef __WADSQuickLink_DEFINED__
#define __WADSQuickLink_DEFINED__
WINRT_EXPORT
@interface WADSQuickLink : RTObject
+ (instancetype)create ACTIVATOR;
@property (copy) NSString* title;
@property (copy) WSSRandomAccessStreamReference* thumbnail;
@property (copy) NSString* id;
@property (readonly) NSMutableArray* supportedDataFormats;
@property (readonly) NSMutableArray* supportedFileTypes;
@end
#endif // __WADSQuickLink_DEFINED__
// Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation
#ifndef __WADSShareOperation_DEFINED__
#define __WADSShareOperation_DEFINED__
WINRT_EXPORT
@interface WADSShareOperation : RTObject
@property (readonly) WADDataPackageView* data;
@property (readonly) NSString* quickLinkId;
- (void)removeThisQuickLink;
- (void)reportStarted;
- (void)reportDataRetrieved;
- (void)reportSubmittedBackgroundTask;
- (void)reportCompletedWithQuickLink:(WADSQuickLink*)quicklink;
- (void)reportCompleted;
- (void)reportError:(NSString*)value;
- (void)dismissUI;
@end
#endif // __WADSShareOperation_DEFINED__
|
//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains functions used to do a variety of low-level, often
// system-specific, tasks.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_SUPPORT_SYSTEMUTILS_H
#define LLVM_SUPPORT_SYSTEMUTILS_H
#include <string>
namespace llvm {
class raw_ostream;
namespace sys { class Path; }
/// Determine if the raw_ostream provided is connected to the outs() and
/// displayed or not (to a console window). If so, generate a warning message
/// advising against display of bitcode and return true. Otherwise just return
/// false
/// @brief Check for output written to a console
bool CheckBitcodeOutputToConsole(
raw_ostream &stream_to_check, ///< The stream to be checked
bool print_warning = true ///< Control whether warnings are printed
);
/// FindExecutable - Find a named executable, giving the argv[0] of program
/// being executed. This allows us to find another LLVM tool if it is built in
/// the same directory. If the executable cannot be found, return an
/// empty string.
/// @brief Find a named executable.
sys::Path FindExecutable(const std::string &ExeName,
const char *Argv0, void *MainAddr);
} // End llvm namespace
#endif
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Scripting.V8\0.19.3\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Scripting.V8.Internal.Debug.h>
#include <include/v8-debug.h>
#include <Uno.IDisposable.h>
#include <Uno.Object.h>
namespace g{namespace Fuse{namespace Scripting{namespace V8{struct Debugger;}}}}
namespace g{namespace Fuse{namespace Scripting{namespace V8{struct Debugger__Disconnected;}}}}
namespace g{namespace Uno{namespace Collections{struct List;}}}
namespace g{namespace Uno{namespace Net{namespace Sockets{struct Socket;}}}}
namespace g{
namespace Fuse{
namespace Scripting{
namespace V8{
// internal sealed extern class Debugger :361
// {
struct Debugger_type : uType
{
::g::Uno::IDisposable interface0;
};
Debugger_type* Debugger_typeof();
void Debugger__ctor__fn(Debugger* __this, uObject* dispatcher, int* port);
void Debugger__Connect_fn(Debugger* parent, ::g::Uno::Net::Sockets::Socket* communicationSocket, uObject** __retval);
void Debugger__Disconnect_fn(Debugger* parent, Debugger__Disconnected** __retval);
void Debugger__DisconnectedMessageHandler_fn(Debugger* __this, ::v8::Debug::Message** message);
void Debugger__Dispose_fn(Debugger* __this);
void Debugger__MessageHandler_fn(Debugger* __this, ::v8::Debug::Message** message);
void Debugger__MessageToString_fn(::v8::Debug::Message** message, uString** __retval);
void Debugger__New1_fn(uObject* dispatcher, int* port, Debugger** __retval);
void Debugger__ProcessDebugMessages_fn();
void Debugger__SetMessageHandler_fn(Debugger* __this, uDelegate* handler);
void Debugger__StateMachine_fn(Debugger* __this);
struct Debugger : uObject
{
static uSStrong<uString*> _contentLengthString_;
static uSStrong<uString*>& _contentLengthString() { return Debugger_typeof()->Init(), _contentLengthString_; }
uStrong<uObject*> _dispatcher;
uStrong< ::g::Uno::Net::Sockets::Socket*> _listenSocket;
uStrong<uDelegate*> _messageHandler;
uStrong< ::g::Uno::Collections::List*> _offlineMessages;
int _port;
bool _shutdown;
void ctor_(uObject* dispatcher, int port);
void DisconnectedMessageHandler(::v8::Debug::Message* message);
void Dispose();
void MessageHandler(::v8::Debug::Message* message);
void SetMessageHandler(uDelegate* handler);
void StateMachine();
static uObject* Connect(Debugger* parent, ::g::Uno::Net::Sockets::Socket* communicationSocket);
static Debugger__Disconnected* Disconnect(Debugger* parent);
static uString* MessageToString(::v8::Debug::Message* message);
static Debugger* New1(uObject* dispatcher, int port);
static void ProcessDebugMessages();
};
// }
}}}} // ::g::Fuse::Scripting::V8
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.