text stringlengths 4 6.14k |
|---|
/*
Copyright (C) 2014 by Igor Duarte Cardoso <igordcard@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor appro-
ved by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef PREFERENCES_H
#define PREFERENCES_H
#include "sessionsettings.h"
#include "settings.h"
class Ignore;
class Highlight;
struct PreferencesSingleton;
class QTreeView;
class Preferences : public Settings
{
Q_OBJECT
friend struct PreferencesSingleton;
protected:
Preferences();
public:
static Preferences *self();
~Preferences();
enum Pages
{
NotifyPage,
ChatWinAppearancePage
};
static const Yakuake::SessionHash sessionHash();
static void setSessionHash(const Yakuake::SessionHash& hash);
static void addSession(Yakuake::SessionSettingsPtr session);
static const Yakuake::SessionSettingsPtr sessionById(int id);
static const QList<Yakuake::SessionSettingsPtr> sessionsByTerminal(const QString& terminal);
static QList<int> sessionIdsByName(const QString& session);
static bool isSession(const QString& terminal);
static void removeSession(int id);
static void saveColumnState(QTreeView *treeView, QString name);
static void restoreColumnState(QTreeView *treeView, QString name, int defaultColumn = 0,
Qt::SortOrder defaultSortOrder = Qt::AscendingOrder);
public slots:
signals:
void notifyListStarted(int sessionId);
void updateTrayIcon();
protected:
Yakuake::SessionHash mSessionHash;
QString mSortingOrder;
};
#endif
|
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2018 NXP
*/
#ifndef _RTE_PMD_DPAA2_H
#define _RTE_PMD_DPAA2_H
/**
* @file rte_pmd_dpaa2.h
*
* NXP dpaa2 PMD specific functions.
*
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior notice
*
*/
#include <rte_flow.h>
enum pmd_dpaa2_ts {
PMD_DPAA2_DISABLE_TS,
PMD_DPAA2_ENABLE_TS
};
/**
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior notice
*
* Enable/Disable timestamping update in mbuf for LX2160 kind of devices.
* For LS2088/LS1088 devices, timestamping will be updated in mbuf without
* calling this API.
*
* @param pmd_dpaa2_ts
* Enum to enable/disable timestamp update in mbuf for LX2160 devices.
*/
__rte_experimental
void rte_pmd_dpaa2_set_timestamp(enum pmd_dpaa2_ts);
/**
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior notice
*
* Create a flow rule to demultiplex ethernet traffic to separate network
* interfaces.
*
* @param dpdmux_id
* ID of the DPDMUX MC object.
* @param[in] pattern
* Pattern specification.
* @param[in] actions
* Associated actions.
*
* @return
* A valid handle in case of success, NULL otherwise.
*/
__rte_experimental
struct rte_flow *
rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
struct rte_flow_item *pattern[],
struct rte_flow_action *actions[]);
/**
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior notice
*
* Create a custom hash key on basis of offset of start of packet and size.
* for e.g. if we need GRE packets (non-vlan and without any extra headers)
* to be hashed on basis of inner IP header, we will provide offset as:
* 14 (eth) + 20 (IP) + 4 (GRE) + 12 (Inner Src offset) = 50 and size
* as 8 bytes.
*
* @param port_id
* The port identifier of the Ethernet device.
* @param offset
* Offset from the start of packet which needs to be included to
* calculate hash
* @param size
* Size of the hash input key
*
* @return
* - 0 if successful.
* - Negative in case of failure.
*/
__rte_experimental
int
rte_pmd_dpaa2_set_custom_hash(uint16_t port_id,
uint16_t offset,
uint8_t size);
#endif /* _RTE_PMD_DPAA2_H */
|
/****************************************************************************/
/*
* coldfire.h -- Motorola ColdFire CPU sepecific defines
*
* (C) Copyright 1999-2005, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo (www.lineo.com)
*/
/****************************************************************************/
#ifndef coldfire_h
#define coldfire_h
/****************************************************************************/
#include <linux/config.h>
/*
* Define the processor support peripherals base address.
* This is generally setup by the boards start up code.
*/
#define MCF_MBAR 0x10000000
#define MCF_MBAR2 0x80000000
#define MCF_IPSBAR 0x40000000
#if defined(CONFIG_M5235) || defined(CONFIG_M527x) || \
defined(CONFIG_M5282) || defined(CONFIG_M5280)
#undef MCF_MBAR
#define MCF_MBAR MCF_IPSBAR
#endif
#if defined(CONFIG_M5208)
#undef MCF_MBAR
#undef MCF_IPSBAR
#define MCF_IPSBAR 0xFC000000
#define MCF_MBAR MCF_IPSBAR
#endif
/*
* Define master clock frequency.
*/
#if defined(CONFIG_CLOCK_11MHz)
#define MCF_CLK 11289600
#elif defined(CONFIG_CLOCK_16MHz)
#define MCF_CLK 16000000
#elif defined(CONFIG_CLOCK_20MHz)
#define MCF_CLK 20000000
#elif defined(CONFIG_CLOCK_24MHz)
#define MCF_CLK 24000000
#elif defined(CONFIG_CLOCK_25MHz)
#define MCF_CLK 25000000
#elif defined(CONFIG_CLOCK_29_5MHz)
#define MCF_CLK 29500000
#elif defined(CONFIG_CLOCK_33MHz)
#define MCF_CLK 33000000
#elif defined(CONFIG_CLOCK_40MHz)
#define MCF_CLK 40000000
#elif defined(CONFIG_CLOCK_45MHz)
#define MCF_CLK 45000000
#elif defined(CONFIG_CLOCK_48MHz)
#define MCF_CLK 48000000
#elif defined(CONFIG_CLOCK_50MHz)
#define MCF_CLK 50000000
#elif defined(CONFIG_CLOCK_54MHz)
#define MCF_CLK 54000000
#elif defined(CONFIG_CLOCK_60MHz)
#define MCF_CLK 60000000
#elif defined(CONFIG_CLOCK_62_5MHz)
#define MCF_CLK 62500000
#elif defined(CONFIG_CLOCK_64MHz)
#define MCF_CLK 64000000
#elif defined(CONFIG_CLOCK_66MHz)
#define MCF_CLK 66000000
#elif defined(CONFIG_CLOCK_70MHz)
#define MCF_CLK 70000000
#elif defined(CONFIG_CLOCK_80MHz)
#define MCF_CLK 80000000
#elif defined(CONFIG_CLOCK_100MHz)
#define MCF_CLK 100000000
#elif defined(CONFIG_CLOCK_140MHz)
#define MCF_CLK 140000000
#elif defined(CONFIG_CLOCK_150MHz)
#define MCF_CLK 150000000
#elif defined(CONFIG_CLOCK_166MHz)
#define MCF_CLK 166000000
#else
#error "Don't know what your ColdFire CPU clock frequency is??"
#endif
/*
* On some ColdFire family members the bus clock (used by internal
* peripherals) is not the same as the CPU clock.
*/
#if defined(CONFIG_M547x)
#define MCF_BUSCLK (MCF_CLK * 2)
#elif defined(CONFIG_M5208) || defined(CONFIG_M5235) || \
defined(CONFIG_M5249) || defined(CONFIG_M527x)
#define MCF_BUSCLK (MCF_CLK / 2)
#else
#define MCF_BUSCLK MCF_CLK
#endif
/****************************************************************************/
#endif /* coldfire_h */
|
/* Public domain */
#include <agar/gui/begin.h>
/* Begin generated block */
__BEGIN_DECLS
extern DECLSPEC AG_Surface *AG_ReadSurface(AG_DataSource *, AG_PixelFormat *);
extern DECLSPEC void AG_WriteSurface(AG_DataSource *, AG_Surface *);
__END_DECLS
/* Close generated block */
#include <agar/gui/close.h>
|
/****************************************************************
* *
* Copyright 2001, 2004 Sanchez Computer Associates, Inc. *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
#include "mdef.h"
#include "gtm_string.h"
#include "stringpool.h"
#include "op.h"
#include "matchc.h"
GBLREF spdesc stringpool;
/*
* ----------------------------------------------------------
* NOTE:
* Following code is a transliteration of VAX macro.
* No attempts to convert this code to native C
* style was performed. Goto's were reduced to minimum
* without modifying the original code structure.
* Labels of format lnn in the comments are those of the
* original code.
* ----------------------------------------------------------
*/
/*
* ----------------------------------------------------------
* Set piece procedure.
* Set pieces first through last to expr.
*
* Arguments:
* src - source mval
* del - delimiter string mval
* expr - expression string mval
* first - starting index in source mval to be set
* last - last index
* dst - destination mval where the result is saved.
*
* Return:
* none
* ----------------------------------------------------------
*/
void op_setpiece(mval *src, mval *del, mval *expr, int4 first, int4 last, mval *dst)
{
int match_res, len, src_len, str_len, delim_cnt;
int first_src_ind, second_src_ind;
unsigned char *match_ptr, *src_str, *str_addr, *tmp_str;
error_def(ERR_MAXSTRLEN);
/* --- code start --- */
if (--first < 0)
first = 0;
second_src_ind = last - first;
MV_FORCE_STR(del);
/* Null delimiter */
if (del->str.len == 0)
{
if (first && src->mvtype)
{
/* concat src & expr to dst */
op_cat(VARLSTCNT(3) dst, src, expr);
return;
}
MV_FORCE_STR(expr);
*dst = *expr;
return;
}
/* Valid delimiter */
MV_FORCE_STR(expr);
if (! MV_DEFINED(src))
{
first_src_ind = 0;
second_src_ind = -1;
goto moveit;
}
/* We have a valid src with something in it */
MV_FORCE_STR(src);
src_str = (unsigned char *)src->str.addr;
src_len = src->str.len;
match_ptr = src_str;
/* skip all pieces before start one */
while (first > 0)
{
match_ptr = matchc(del->str.len, (uchar_ptr_t)del->str.addr,
src_len, src_str, &match_res);
src_len -= (match_ptr - src_str);
src_str = match_ptr;
/* if match not found */
if (match_res)
goto l80;
first--;
}
/*
* skip # delimiters this piece will replace, e.g. if we are setting
* pieces 2 - 4, then the pieces 2-4 will be replaced by one piece - expr.
*/
first_src_ind = match_ptr - (unsigned char *)src->str.addr;
do {
match_ptr = matchc(del->str.len, (uchar_ptr_t)del->str.addr,
src_len, src_str, &match_res);
src_len -= (match_ptr - src_str);
src_str = match_ptr;
/* if match not found */
if (match_res)
goto l90;
} while (--second_src_ind > 0);
second_src_ind = match_ptr - (unsigned char *)src->str.addr - del->str.len;
goto moveit;
l80:
first_src_ind = match_ptr - (unsigned char *)src->str.addr;
l90:
second_src_ind = -1;
moveit:
delim_cnt = first;
/* Calculate total string len. */
str_len = expr->str.len + (first_src_ind + del->str.len * delim_cnt);
/* add len. of trailing chars past insertion point */
if (second_src_ind >= 0)
str_len += (src->str.len - second_src_ind);
if (str_len > MAX_STRLEN)
{
rts_error(VARLSTCNT(1) ERR_MAXSTRLEN);
return;
}
if (str_len > (stringpool.top - stringpool.free))
stp_gcol(str_len);
str_addr = stringpool.free;
/* copy prefix */
if (first_src_ind)
{
memcpy(str_addr, src->str.addr, first_src_ind);
str_addr += first_src_ind;
}
/* copy delimiters */
while (delim_cnt-- > 0)
{
memcpy(str_addr, del->str.addr, del->str.len);
str_addr += del->str.len;
}
/* copy expression */
memcpy(str_addr, expr->str.addr, expr->str.len);
str_addr += expr->str.len;
/* copy trailing pieces */
if (second_src_ind >= 0)
{
len = src->str.len - second_src_ind;
tmp_str = (unsigned char *)src->str.addr + second_src_ind;
memcpy(str_addr, tmp_str, len);
str_addr += len;
}
assert(str_addr - stringpool.free == str_len);
dst->mvtype = MV_STR;
dst->str.len = str_addr - stringpool.free;
dst->str.addr = (char *)stringpool.free;
stringpool.free = str_addr;
return;
}
|
// =====================================================================================================================
// PDFAnnotation.h
// =====================================================================================================================
#import <AppKit/AppKit.h>
#import <PDFKit/PDFPage.h>
@class PDFAction, PDFBorder, PDFPage, PDFAnnotationPopup, PDFAnnotationPrivateVars;
@interface PDFAnnotation : NSObject
{
@private
PDFAnnotationPrivateVars *_pdfPriv;
}
// This is the base class for all annotations. A PDFAnnotation object by itself is not useful, only subclasses (like
// PDFAnnotationCircle, PDFAnnotationText) are interesting. In parsing a PDF however, any unknown or unsupported
// annotations will be represented as this base class.
// -------- initializer
// You should only call this method for the subclasses, otherwise you will get a type of NULL Ñ which is not a legal
// annotation.
- (id) initWithBounds: (NSRect) bounds;
// -------- accessors
// Returns the page the annotation is associated with (may return NULL if annotation not associated with a page).
- (PDFPage *) page;
// Returns the annotation type (called "Subtype" in the PDF specification since "Annot" is the type). Examples include:
// "Text", "Link", "Line", etc. Required.
- (NSString *) type;
// Required for all annotations. The bounding box in page-space of the annotation.
- (NSRect) bounds;
- (void) setBounds: (NSRect) bounds;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
// Optional (-[modificationDate] may return NULL). Modification date of the annotation.
- (NSDate *) modificationDate;
- (void) setModificationDate: (NSDate *) date;
// Optional (-[userName] may return NULL). Name of the user who created the annotation.
- (NSString *) userName;
- (void) setUserName: (NSString *) name;
// Optional (-[popup] may return NULL). Not used with links or widgets, a popup annotation associated with this
// annotation. The bounds and open state of the popup indicate the placement and open state of the popup window.
- (PDFAnnotationPopup *) popup;
- (void) setPopup: (PDFAnnotationPopup *) popup;
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
// Indicates whether the annotation should be displayed on screen (depending upon -[shouldPrint] it may still print).
- (BOOL) shouldDisplay;
- (void) setShouldDisplay: (BOOL) display;
// Indicates whether the annotation should be printed or not.
- (BOOL) shouldPrint;
- (void) setShouldPrint: (BOOL) print;
// Optional border or border style that describes how to draw the annotation border (if any). For the "geometry"
// annotations (Circle, Ink, Line, Square), the border indicates the line width and whether to draw with a dash pattern
// or solid pattern. PDFAnnotationMarkup ignores the border.
- (PDFBorder *) border;
- (void) setBorder: (PDFBorder *) border;
// For many annotations ("Circle", "Square") the stroke color. Used for other annotations as well.
- (NSColor *) color;
- (void) setColor: (NSColor *) color;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
// Optional action performed when a user releases the mouse within an annotation. PDF readers ignore actions except
// for those associated with Link or button Widget annotations.
- (PDFAction *) mouseUpAction;
- (void) setMouseUpAction: (PDFAction *) action;
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
// A string of text associated with an annotation. Often displayed in a window when the annotation is clicked on
// ("FreeText" and "Text" especially).
- (NSString *) contents;
- (void) setContents: (NSString *) contents;
// String used for tooltips. The base class returns [self contents], sub-classes may override as appropriate.
- (NSString *) toolTip;
// Returns YES if the annotation has an appearance stream. Annotations with appearance streams are drawn using their
// stream. As a result setting many parameters (like -[setColor:] above) will have no visible effect.
- (BOOL) hasAppearanceStream;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
// All appearance streams for the target annotation are removed. Without an appearance stream, annotations are drawn
// strictly according to their parameters (color, border, font, etc.). When a PDF is saved, PDF Kit will always
// write out an appearance stream(s) for each annotation. If the PDF is reloaded, you will need to remove the
// appearance streams in order to continue to edit the annotations parameters.
- (void) removeAllAppearanceStreams;
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
// -------- drawing
// Draw method. Draws in page-space relative to origin of "box" passed in.
- (void) drawWithBox: (PDFDisplayBox) box;
@end
|
/*
* Copyright (C) 2015 Freek van Tienen <freek.v.tienen@gmail.com>
*
* This file is part of Paparazzi.
*
* Paparazzi 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.
*
* Paparazzi 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 Paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* @file modules/computer_vision/lib/vision/image.h
* Image helper functions like resizing, color filter, converters...
*/
#ifndef _CV_LIB_VISION_IMAGE_H
#define _CV_LIB_VISION_IMAGE_H
#include "std.h"
#include <sys/time.h>
/* The different type of images we currently support */
enum image_type {
IMAGE_YUV422, //< UYVY format (uint16 per pixel)
IMAGE_GRAYSCALE, //< Grayscale image with only the Y part (uint8 per pixel)
IMAGE_JPEG, //< An JPEG encoded image (not per pixel encoded)
IMAGE_GRADIENT //< An image gradient (int16 per pixel)
};
/* Main image structure */
struct image_t {
enum image_type type; //< The image type
uint16_t w; //< Image width
uint16_t h; //< Image height
struct timeval ts; //< The timestamp of creation
uint8_t buf_idx; //< Buffer index for V4L2 freeing
uint32_t buf_size; //< The buffer size
void *buf; //< Image buffer (depending on the image_type)
};
/* Image point structure */
struct point_t {
uint16_t x; //< The x coordinate of the point
uint16_t y; //< The y coordinate of the point
};
/* Vector structure for point differences */
struct flow_t {
struct point_t pos; //< The original position the flow comes from
int16_t flow_x; //< The x direction flow in subpixels
int16_t flow_y; //< The y direction flow in subpixels
};
/* Usefull image functions */
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type);
void image_free(struct image_t *img);
void image_copy(struct image_t *input, struct image_t *output);
void image_switch(struct image_t *a, struct image_t *b);
void image_to_grayscale(struct image_t *input, struct image_t *output);
uint16_t image_yuv422_colorfilt(struct image_t *input, struct image_t *output, uint8_t y_m, uint8_t y_M, uint8_t u_m, uint8_t u_M, uint8_t v_m, uint8_t v_M);
void image_yuv422_downsample(struct image_t *input, struct image_t *output, uint16_t downsample);
void image_subpixel_window(struct image_t *input, struct image_t *output, struct point_t *center, uint16_t subpixel_factor);
void image_gradients(struct image_t *input, struct image_t *dx, struct image_t *dy);
void image_calculate_g(struct image_t *dx, struct image_t *dy, int32_t *g);
uint32_t image_difference(struct image_t *img_a, struct image_t *img_b, struct image_t *diff);
int32_t image_multiply(struct image_t *img_a, struct image_t *img_b, struct image_t *mult);
void image_show_points(struct image_t *img, struct point_t *points, uint16_t points_cnt);
void image_show_flow(struct image_t *img, struct flow_t *vectors, uint16_t points_cnt, uint8_t subpixel_factor);
void image_draw_line(struct image_t *img, struct point_t *from, struct point_t *to);
#endif
|
/*
* z88dk RS232 Function
*
* z88 version
*
* unsigned char rs232_params(unsigned char param, unsigned char parity)
*
* Specify the serial interface parameters
*
* Later on, this should set panel values
*/
#include <rs232.h>
#if 0
#asm
INCLUDE "director.def"
#endasm
#endif
u8_t __FASTCALL__ rs232_params(unsigned char param, unsigned char parity)
{
#if 0
{
/* Unfinished code */
unsigned u16_t baud;
switch ( param & 0x0F ) {
case RS_BAUD_300:
baud = 300;
break;
case RS_BAUD_600:
baud = 600;
break;
case RS_BAUD_1200:
baud = 1200;
break;
case RS_BAUD_2400:
baud = 2400;
break;
case RS_BAUD_9600:
baud = 9600;
break;
case RS_BAUD_19200: /* Available but broken */
case RS_BAUD_38400: /* Availabe but broken */
case RS_BAUD_57600:
case RS_BAUD_115200:
case RS_BAUD_230400:
return RS_ERR_BAUD_TOO_FAST;
case RS_BAUD_50:
case RS_BAUD_110:
case RS_BAUD_134_5:
case RS_BAUD_4800:
default:
return RS_ERR_BAUD_NOT_AVAIL;
}
rs232_setbaud(&baud);
}
{
u8_t par;
switch ( parity ) {
case RS_PAR_NONE:
par = 'N';
break;
case RS_PAR_ODD:
par = 'O';
break;
case RS_PAR_EVEN:
par = 'E';
break;
case RS_PAR_MARK:
par = 'M';
break;
case RS_PAR_SPACE:
par = 'S';
break;
}
rs232_setparity(&par);
}
#endif
return RS_ERR_OK;
}
#if 0
static void rs232_setbaud(u16_t *baud)
{
#asm
pop bc
pop hl
push hl
push bc
push hl
ld bc,PA_Txb
ld a,2
call_oz(os_sp)
pop hl
ld a,2
ld bc,PA_Rxb
call_oz(os_sp)
#endasm
static void rs232_setparity(u8_t *baud)
{
#asm
pop bc
pop hl
push hl
push bc
ld bc,PA_Par
ld a,1
call_oz(os_sp)
#endasm
}
#endif
|
/*
* Common ioctl functions.
* Copyright (C) 1997, 98 Kunihiro Ishiguro
*
* 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 GNU Zebra; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include <zebra.h>
#include "linklist.h"
#include "if.h"
#include "prefix.h"
#include "ioctl.h"
#include "log.h"
#include "zebra/rib.h"
#include "zebra/rt.h"
/* clear and set interface name string */
void
ifreq_set_name (struct ifreq *ifreq, struct interface *ifp)
{
strncpy (ifreq->ifr_name, ifp->name, IFNAMSIZ);
}
/* call ioctl system call */
int
if_ioctl (u_long request, caddr_t buffer)
{
int sock;
int ret = 0;
int err = 0;
sock = socket (AF_INET, SOCK_DGRAM, 0);
if (sock < 0)
{
perror ("socket");
exit (1);
}
ret = ioctl (sock, request, buffer);
if (ret < 0)
{
err = errno;
}
close (sock);
if (ret < 0)
{
errno = err;
return ret;
}
return 0;
}
/*
* get interface metric
* -- if value is not avaliable set -1
*/
void
if_get_metric (struct interface *ifp)
{
#ifdef SIOCGIFMETRIC
struct ifreq ifreq;
ifreq_set_name (&ifreq, ifp);
if (if_ioctl (SIOCGIFMETRIC, (caddr_t) &ifreq) < 0)
return;
ifp->metric = ifreq.ifr_metric;
if (ifp->metric == 0)
ifp->metric = 1;
#else /* SIOCGIFMETRIC */
ifp->metric = -1;
#endif /* SIOCGIFMETRIC */
}
/* get interface MTU */
void
if_get_mtu (struct interface *ifp)
{
struct ifreq ifreq;
ifreq_set_name (&ifreq, ifp);
#if defined(SIOCGIFMTU)
if (if_ioctl (SIOCGIFMTU, (caddr_t) & ifreq) < 0)
{
zlog_info ("Can't lookup mtu by ioctl(SIOCGIFMTU)");
ifp->mtu = -1;
return;
}
#ifdef SUNOS_5
ifp->mtu = ifreq.ifr_metric;
#else
ifp->mtu = ifreq.ifr_mtu;
#endif /* SUNOS_5 */
#else
zlog (NULL, LOG_INFO, "Can't lookup mtu on this system");
ifp->mtu = -1;
#endif
}
/* Interface address setting via netlink interface. */
int
if_set_prefix (struct interface *ifp, struct connected *ifc)
{
return kernel_address_add_ipv4 (ifp, ifc);
}
/* Interface address is removed using netlink interface. */
int
if_unset_prefix (struct interface *ifp, struct connected *ifc)
{
return kernel_address_delete_ipv4 (ifp, ifc);
}
/* get interface flags */
void
if_get_flags (struct interface *ifp)
{
int ret;
struct ifreq ifreq;
ifreq_set_name (&ifreq, ifp);
ret = if_ioctl (SIOCGIFFLAGS, (caddr_t) &ifreq);
if (ret < 0)
{
perror ("ioctl");
return;
}
ifp->flags = ifreq.ifr_flags & 0x0000ffff;
}
/* Set interface flags */
int
if_set_flags (struct interface *ifp, unsigned long flags)
{
int ret;
struct ifreq ifreq;
ifreq_set_name (&ifreq, ifp);
ifreq.ifr_flags = ifp->flags;
ifreq.ifr_flags |= flags;
ret = if_ioctl (SIOCSIFFLAGS, (caddr_t) &ifreq);
if (ret < 0)
{
zlog_info ("can't set interface flags");
return ret;
}
return 0;
}
/* Unset interface's flag. */
int
if_unset_flags (struct interface *ifp, unsigned long flags)
{
int ret;
struct ifreq ifreq;
ifreq_set_name (&ifreq, ifp);
ifreq.ifr_flags = ifp->flags;
ifreq.ifr_flags &= ~flags;
ret = if_ioctl (SIOCSIFFLAGS, (caddr_t) &ifreq);
if (ret < 0)
{
zlog_info ("can't unset interface flags");
return ret;
}
return 0;
}
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/GMM.framework/GMM
*/
#import <GMM/XXUnknownSuperclass.h>
#import <GMM/NSURLConnectionDelegate.h>
@class NSURLConnection, NSMutableData;
@interface GMMGeoTileRequester : XXUnknownSuperclass <NSURLConnectionDelegate> {
NSURLConnection *_conn; // 24 = 0x18
NSMutableData *_data; // 28 = 0x1c
BOOL _readPreamble; // 32 = 0x20
BOOL _readTileHeader; // 33 = 0x21
int _lastGoodOffset; // 36 = 0x24
unsigned short _numTilesToRead; // 40 = 0x28
unsigned short _numTilesRead; // 42 = 0x2a
unsigned _tileEdition; // 44 = 0x2c
unsigned _tilesLoaded; // 48 = 0x30
}
+ (id)hostname; // 0x38ae9
+ (unsigned char)tileProviderIdentifier; // 0x38ae5
- (void)connection:(id)connection didFailWithError:(id)error; // 0x3a031
- (void)connectionDidFinishLoading:(id)connection; // 0x39fa9
- (void)connection:(id)connection didReceiveData:(id)data; // 0x39f29
- (void)_tryReadTiles; // 0x39a25
- (void)_tryReadPreamble; // 0x396cd
- (void)connection:(id)connection didReceiveResponse:(id)response; // 0x39615
- (void)_cancelWithErrorCode:(int)errorCode; // 0x395e5
- (void)_failWithErrorCode:(int)errorCode; // 0x39561
- (void)_failWithError:(id)error; // 0x3952d
- (void)cancel; // 0x394f1
- (void)_cleanup; // 0x394a1
- (void)start; // 0x38b05
@end
|
//
// GameStart.h
//
#include "Music.h"
#include "ViewObject.h"
class GameStart : public df::ViewObject {
private:
df::Music *p_music;
void start();
public:
GameStart();
int eventHandler(const df::Event *p_e);
int draw();
void playMusic();
};
|
/*
* Model homogeneous half space
* last update 11.04.02, T. Bohlen
*/
#include "fd.h"
void model_elastic(float ** rho, float ** pi, float ** u){
/*--------------------------------------------------------------------------*/
/* extern variables */
extern int NX, NY, NXG, NYG, POS[3], L, MYID;
extern char MFILE[STRING_SIZE];
extern char INV_MODELFILE[STRING_SIZE];
extern float DH;
/* local variables */
float vp, vs, rhov, grad1, grad2, grad3, y;
int i, j, ii, jj;
char modfile[STRING_SIZE];
/* parameters for layer 1 */
const float vp1=3000.0, vs1=1730.0, rho1=2120.0;
/*-----------------------------------------------------------------------*/
/* loop over global grid */
for (i=1;i<=NXG;i++){
for (j=1;j<=NYG;j++){
vp=vp1;
vs=vs1;
rhov=rho1;
/* only the PE which belongs to the current global gridpoint
is saving model parameters in his local arrays */
if ((POS[1]==((i-1)/NX)) &&
(POS[2]==((j-1)/NY))){
ii=i-POS[1]*NX;
jj=j-POS[2]*NY;
u[jj][ii]=vs;
rho[jj][ii]=rhov;
pi[jj][ii]=vp;
}
}
}
/*sprintf(modfile,"%s_rho_it_0.bin",INV_MODELFILE);
writemod(modfile,rho,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(modfile,3);
sprintf(modfile,"%s_vs_it_0.bin",INV_MODELFILE);
writemod(modfile,u,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(modfile,3);
sprintf(modfile,"%s_vp_it_0.bin",INV_MODELFILE);
writemod(modfile,pi,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(modfile,3);*/
}
|
#ifndef LagrangeEnergyParentParticleFitter_H
#define LagrangeEnergyParentParticleFitter_H
#include "RecoVertex/KinematicFit/interface/ParentParticleFitter.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
/**
* This is duplicate of the LagrangeParentParticleFitter, which uses
* the energy instead of the mass as fit parameter
*/
class LagrangeEnergyParentParticleFitter:
public ParentParticleFitter
{
public:
LagrangeEnergyParentParticleFitter();
LagrangeEnergyParentParticleFitter(const edm::ParameterSet & parameters);
~LagrangeEnergyParentParticleFitter() {}
edm::ParameterSet parameterSet() {return theParameters;}
vector<RefCountedKinematicTree> fit(vector<RefCountedKinematicTree> trees,
KinematicConstraint * cs)const;
LagrangeEnergyParentParticleFitter * clone() const
{return new LagrangeEnergyParentParticleFitter(*this);}
private:
void configure(const edm::ParameterSet &);
edm::ParameterSet defaults();
//tunable parameters and their read method
edm::ParameterSet theParameters;
float theMaxDiff;
int theMaxStep;
};
#endif
|
#ifndef HEADER_Platform
#define HEADER_Platform
/*
htop - openbsd/Platform.h
(C) 2014 Hisham H. Muhammad
(C) 2015 Michael McConville
Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
#include <stdbool.h>
#include <sys/types.h>
#include "Action.h"
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
#include "Meter.h"
#include "Process.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
extern const ProcessField Platform_defaultFields[];
/* see /usr/include/sys/signal.h */
extern const SignalItem Platform_signals[];
extern const unsigned int Platform_numberOfSignals;
extern const MeterClass* const Platform_meterTypes[];
void Platform_init(void);
void Platform_done(void);
void Platform_setBindings(Htop_Action* keys);
int Platform_getUptime(void);
void Platform_getLoadAverage(double* one, double* five, double* fifteen);
int Platform_getMaxPid(void);
double Platform_setCPUValues(Meter* this, int cpu);
void Platform_setMemoryValues(Meter* this);
void Platform_setSwapValues(Meter* this);
char* Platform_getProcessEnv(pid_t pid);
char* Platform_getInodeFilename(pid_t pid, ino_t inode);
FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid);
bool Platform_getDiskIO(DiskIOData* data);
bool Platform_getNetworkIO(unsigned long int* bytesReceived,
unsigned long int* packetsReceived,
unsigned long int* bytesTransmitted,
unsigned long int* packetsTransmitted);
void Platform_getBattery(double* percent, ACPresence* isOnAC);
#endif
|
/***************************************************************************
* Copyright (C) 2013 by Daniel Nicoletti <dantti12@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; see the file COPYING. If not, write to *
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef AVAILABLECONNECTIONSMODEL_H
#define AVAILABLECONNECTIONSMODEL_H
#include <QStandardItemModel>
#include <NetworkManagerQt/Device>
#include <NetworkManagerQt/WirelessNetwork>
#include <NetworkManagerQt/WimaxNsp>
class AvailableConnectionsModel : public QStandardItemModel
{
Q_OBJECT
Q_ENUMS(ConnectionRoles)
Q_ENUMS(Kind)
Q_PROPERTY(QString device READ device WRITE setDevice NOTIFY deviceChanged)
Q_PROPERTY(QString icon READ icon NOTIFY iconChanged)
Q_PROPERTY(QString toolTip READ toolTip NOTIFY toolTipChanged)
public:
enum ConnectionRoles {
RoleConectionPath = Qt::UserRole + 1,
RoleKinds,
RoleNetworkID,
RoleSsid,
RoleBssid,
RoleMacAddress,
RoleSignalStrength,
RoleSignalStrengthIcon,
RoleSecurity,
RoleSecurityType,
RoleStatus,
RoleActive
};
enum Kind {
Connection = 1 << 0,
Network = 1 << 1,
NetworkWireless = 1 << 2,
NetworkNsp = 1 << 3
};
Q_DECLARE_FLAGS(Kinds, Kind)
explicit AvailableConnectionsModel(QObject *parent = 0);
QString device() const;
void setDevice(const QString &deviceUni);
void setDevicePtr(const NetworkManager::Device::Ptr &device);
QString icon() const;
QString toolTip() const;
Q_SIGNALS:
void deviceChanged();
void iconChanged();
void toolTipChanged();
private slots:
void availableConnectionChanged();
void activeConnectionChanged();
void connectionAdded(const QString &path);
void connectionRemoved(const QString &path);
void addConnection(const NetworkManager::Connection::Ptr &connection);
void accessPointAppeared(const QString &uni);
void accessPointDisappeared(const QString &uni);
void activeAccessPointChanged();
void signalStrengthChanged(int strength);
void nspAppeared(const QString &uni);
void nspDisappeared(const QString &name);
void addNspNetwork(const NetworkManager::WimaxNsp::Ptr &nsp);
void signalQualityChanged(uint quality);
private:
void updateDeviceStatus();
void updateAccessPointConnections(QStandardItem *stdItem);
QStandardItem *findConnectionItem(const QString &path);
QStandardItem *findNetworkItem(const QString &id);
QStandardItem *findActiveItem();
QString signalToString(int strength) const;
NetworkManager::Device::Ptr m_device;
QString m_deviceUni;
QString m_icon;
QString m_toolTip;
};
#endif // AVAILABLECONNECTIONSMODEL_H
|
/*
* Copyright (C) 2012 Spreadtrum Communications Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __GPIO_CORSICA_VE_H__
#define __GPIO_CORSICA_VE_H__
#ifndef __ASM_ARCH_BOARD_H
#error "Don't include this file directly, include <mach/board.h>"
#endif
#define GPIO_TOUCH_RESET 53
#define GPIO_TOUCH_IRQ 52
#define GPIO_SENSOR_RESET 162
#define GPIO_MAIN_SENSOR_PWN 164
#define GPIO_SUB_SENSOR_PWN 163
#define SPRD_FLASH_OFST 0x890
#define SPRD_FLASH_CTRL_BIT 0x8000
#define SPRD_FLASH_LOW_VAL 0x3
#define SPRD_FLASH_HIGH_VAL 0xF
#define SPRD_FLASH_LOW_CUR 110
#define SPRD_FLASH_HIGH_CUR 470
#define SPRD_FLASH_ON 1
#define SPRD_FLASH_OFF 0
#define GPIO_CAM_FLASH_EN 117
#define GPIO_CAM_FLASH_TORCH 25
#define USB_OTG_CABLE_DETECT 72
#define EIC_CHARGER_DETECT (A_EIC_START + 0)
#define EIC_POWER_PBINT2 (A_EIC_START + 1)
#define EIC_POWER_PBINT (A_EIC_START + 2)
#define EIC_AUD_HEAD_BUTTON (A_EIC_START + 3)
#define EIC_CHG_CV_STATE (A_EIC_START + 4)
#define EIC_AUD_HEAD_INST2 (A_EIC_START + 5)
#define EIC_VCHG_OVI (A_EIC_START + 6)
#define EIC_VBAT_OVI (A_EIC_START + 7)
#define HEADSET_DETECT_GPIO_ACTIVE_LOW 0
#define HEADSET_BUTTVOL_MEDIA_MIN 0
#define HEADSET_BUTTVOL_MEDIA_MAX 125
#define HEADSET_BUTTVOL_VOLUP_MIN 125
#define HEADSET_BUTTVOL_VOLUP_MAX 271
#define HEADSET_BUTTVOL_VOLDOWN_MIN 271
#define HEADSET_BUTTVOL_VOLDOWN_MAX 620
#define HEADSET_TYPEVOL_NOMIC_MIN 0
#define HEADSET_TYPEVOL_NOMIC_MAX 930
#define EIC_KEY_POWER (EIC_POWER_PBINT)
#define HEADSET_BUTTON_GPIO (EIC_AUD_HEAD_BUTTON)
#ifdef CONFIG_EAR_USE_IIS0MCK_DETGPIO
#define HEADSET_DETECT_GPIO 180
#else
#define HEADSET_DETECT_GPIO (EIC_AUD_HEAD_INST2)
#endif
#define HEADSET_SWITCH_GPIO 0
#define SPI0_CMMB_CS_GPIO 156
#define SPI1_WIFI_CS_GPIO 44
#define GPIO_BK 136
#define GPIO_CMMB_26M_CLK_EN 197
#define GPIO_BT_RESET 189
#define GPIO_BT_POWER 125
#define GPIO_BT2AP_WAKE 192
#define GPIO_AP2BT_WAKE 188
#define BOARD_DEFAULT_REV 1
#define GPIO_WIFI_SHUTDOWN 186
#define GPIO_WIFI_IRQ 191
#define GPIO_PROX_INT 192
//SBSIM : temp
#if 0
#define GPIO_GYRO_INT1 191
#endif
#define GPIO_M_RSTN 188
#define GPIO_M_DRDY 189
#define GPIO_SDIO_DETECT 75
/* ION config info
LCD:
960x540
*/
#define SPRD_ION_OVERLAY_SIZE (7 * SZ_1M)
#define GPIO_GPS_RESET 143
#define GPIO_GPS_ONOFF 144
#endif
|
/*-------------------------------------------------------------------------
SDCCgen51.h - header file for code generation for 8051
Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-------------------------------------------------------------------------*/
#ifndef Z80GEN_H
#define Z80GEN_H
#include "../SDCCicode.h"
#include "../SDCCval.h"
#include "ralloc.h"
typedef enum {
AOP_INVALID,
/* Is a literal */
AOP_LIT = 1,
/* Is in a register */
AOP_REG,
/* Is in direct space */
AOP_DIR,
/* SFR space ($FF00 and above) */
AOP_SFR,
/* Is on the stack */
AOP_STK,
/* Is an immediate value */
AOP_IMMD,
/* Is a string (?) */
AOP_STR,
/* Is in the carry register */
AOP_CRY,
/* Is pointed to by IY */
AOP_IY,
/* Is pointed to by HL */
AOP_HL,
/* Is in A */
AOP_ACC,
/* Is in H and L */
AOP_HLREG,
/* Simple literal. */
AOP_SIMPLELIT,
/* Is in the extended stack pointer (IY on the Z80) */
AOP_EXSTK,
/* Is referenced by a pointer in a register pair. */
AOP_PAIRPTR,
/* Read undefined, discard writes */
AOP_DUMMY
} AOP_TYPE;
/* type asmop : a homogenised type for
all the different spaces an operand can be
in */
typedef struct asmop {
AOP_TYPE type;
short coff; /* current offset */
short size; /* total size */
unsigned code : 1; /* is in Code space */
unsigned paged : 1; /* in paged memory */
unsigned freed : 1; /* already freed */
unsigned bcInUse : 1; /* for banked I/O, which uses bc for the I/O address */
union {
value *aop_lit; /* if literal */
reg_info *aop_reg[4]; /* array of registers */
char *aop_dir; /* if direct */
char *aop_immd; /* if immediate others are implied */
int aop_stk; /* stack offset when AOP_STK */
const char *aop_str[4]; /* just a string array containing the location */
unsigned long aop_simplelit; /* Just the value. */
int aop_pairId; /* The pair ID */
} aopu;
} asmop;
void genZ80Code(iCode *);
void z80_emitDebuggerSymbol(const char *);
extern bool z80_assignment_optimal;
extern bool should_omit_frame_ptr;
#endif
|
#include <stdint.h>
#include <stdio.h> // printf
#include "vm_run_thread.h"
#define DEBUG(x) x
#define c(data) ({ \
DEBUG(printf("%02x ", data & 0xff)); \
thread->flash[here++] = (uint8_t)(data); \
})
#define c16(data) c(data); c((data) >> 8);
#define c32(data) c16(data); c16((data) >> 16);
#define add_r_i(r, i) ({ \
c(add_m_i); c(r << 2); c(i); \
})
#if 0
#define call(addr) ({ \
c(call_x_m); resolve_label(addr);
})
#else
#define call(x)
#endif
#define mov_r_r(d, s) ({ \
c(mov_m_mi); c(d << 2); c(s << 2); \
})
#define mov_r_i32(d, i) ({ \
c(mov_m_i32); c(d << 2); c32(i); \
})
#define mov_r_ri(d, s) ({ \
c(mov_m_mmi); c(d << 2); c(s << 2); \
})
#define mov_ri_r(d, s) ({ \
c(mov_mm_mi); c(d << 2); c(s << 2); \
})
#define push(r) ({ \
sub_r_i(rESP, 4); \
SET_TOS(r); \
})
#define pop(r) ({ \
TOS(r); \
add_r_i(rESP, 4); \
})
#define sub_r_i(r, i) ({ \
c(sub_m_i); c(r << 2); c(i); \
})
#define begin() rstk[rsp++] = (uint32_t)here;
#define again() ({ \
c(branch_x_i); \
uint32_t branch_pc = rstk[--rsp] - ((uint32_t)here + 1); \
c(branch_pc); \
})
#define if_eq(r) ({ \
c(branch_ne_x_m_i); c(r); \
begin(); \
c(0); \
})
#define if_ne(r) ({ \
c(branch_eq_x_m_i); c(r); \
begin(); \
c(0); \
})
#define then() ({ \
uint8_t *saved_here = here; \
here = (uint8_t *)rstk[--rsp]; \
uint32_t branch_pc = (uint32_t)saved_here - ((uint32_t)here + 1); \
c(branch_pc); \
here = saved_here; \
})
enum {
rEAX = 0,
rEBX,
rECX,
rEDX,
rESI,
rEDI,
rEBP,
rESP
};
#define IJMP(r) ({ \
c(branch_x_mi); c(rEAX); \
})
#define LODSL ({ \
mov_r_ri(rEAX, rESI); \
add_r_i(rESI, sizeof(uint32_t)); \
})
#define NEXT ({ \
LODSL; \
IJMP(EAX); \
})
#define NOS(r) ({ \
mov_r_r(r, rESP); \
add_r_i(r, 4); \
mov_r_ri(r, r); \
})
#define PUSHRSP(r) ({ \
sub_r_i(rESP, 4); \
SET_TOS(r); \
})
#define POPRSP(r) ({ \
TOS(r); \
add_r_i(rESP, 4); \
})
#define SET_TOS(r) ({ \
mov_ri_r(rESP, r); \
})
#define TOS(r) ({ \
mov_r_ri(r, rESP); \
})
#define label(x) uint32_t x = here;
#define defcode(name, name_len, flags, code_label)
void vm_thread_flash_init(vm_thread_p thread)
{
uint32_t rstk[32];
int rsp = 0;
DEBUG(printf("\n\n\n\nbegin: %s\n\n\n\n", __FUNCTION__));
uint32_t here = 0;
mov_r_i32(rESP, M_ADDR_SIZE - 1);
label(DOCOL);
PUSHRSP(rESI);
add_r_i(rEAX, 4);
mov_r_r(rESI, rEAX);
NEXT;
uint32_t var_S0 = 0xff;
uint32_t return_stack_top = 0xfe;
label(cold_start);
// c32(0);
label(start);
mov_r_r(var_S0, rESP);
mov_r_r(rEBP, return_stack_top);
call(setup_data_segment);
mov_r_i32(rESI, cold_start);
NEXT;
defcode("DROP", 4, 0, DROP);
pop(rEAX);
NEXT;
defcode("SWAP", 4, 0, SWAP);
pop(rEAX);
pop(rEBX);
push(rEAX);
push(rEBX);
NEXT;
defcode("DUP", 3, 0, DUP);
TOS(rEAX);
push(rEAX);
NEXT;
defcode("OVER", 4, 0, OVER);
#if 0
pop(rEAX);
pop(rEBX);
push(rEAX);
push(rEBX);
push(rEAX);
#else
NOS(rEAX);
push(rEAX);
#endif
NEXT;
defcode("ROT", 3, 0, ROT)
pop(rEAX);
pop(rEBX);
pop(rECX);
push(rEBX);
push(rEAX);
push(rECX);
NEXT;
defcode("-ROT", 3, 0, NROT)
pop(rEAX);
pop(rEBX);
pop(rECX);
push(rEAX);
push(rECX);
push(rEBX);
NEXT;
defcode("2DROP", 5, 0, TWODROP)
pop(rEAX);
pop(rEAX);
NEXT;
defcode("2DUP", 4, 0, TWODUP)
TOS(rEAX);
NOS(rEBX);
push(rEBX);
push(rEAX);
NEXT;
defcode("2SWAP", 5, 0, TWOSWAP)
pop(rEAX);
pop(rEBX);
pop(rECX);
pop(rEDX);
push(rEBX);
push(rEAX);
push(rEDX);
push(rECX);
NEXT;
defcode("?DUP", 4, 0, QDUP)
TOS(rEAX);
if_ne(rEAX << 2);
push(rEAX);
then();
NEXT;
defcode("1+", 2, 0, INCR)
TOS(rEAX);
add_r_i(rEAX, 1);
SET_TOS(rEAX);
defcode("1-", 2, 0, DECR)
TOS(rEAX);
sub_r_i(rEAX, 1);
SET_TOS(rEAX);
defcode("4+", 2, 0, INCR4)
TOS(rEAX);
add_r_i(rEAX, 4);
SET_TOS(rEAX);
defcode("4-", 2, 0, DECR4)
TOS(rEAX);
sub_r_i(rEAX, 4);
SET_TOS(rEAX);
defcode("+", 1, 0, ADD)
pop(rEAX);
TOS(rEBX);
add_r_i(rEBX, rEAX);
SET_TOS(rEBX);
defcode("-", 1, 0, SUB)
pop(rEAX);
TOS(rEBX);
sub_r_i(rEBX, rEAX);
SET_TOS(rEBX);
DEBUG(printf("\n\n\n\nend: %s\n\n\n\n", __FUNCTION__));
}
|
/* linux/arch/arm/plat-s5pc11x/include/plat/dma.h
*
* Copyright (C) 2006 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* Samsung S5PC1XX DMA support
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <plat/s3c-dma.h>
|
/*
* Point to Point Protocol (PPP) RFC1331
*
* Copyright 1989 by Carnegie Mellon.
*
* Permission to use, copy, modify, and distribute this program for any
* purpose and without fee is hereby granted, provided that this copyright
* and permission notice appear on all copies and supporting documentation,
* the name of Carnegie Mellon not be used in advertising or publicity
* pertaining to distribution of the program without specific prior
* permission, and notice be given in supporting documentation that copying
* and distribution is by permission of Carnegie Mellon and Stanford
* University. Carnegie Mellon makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
#define PPP_HDRLEN 4
#define PPP_ADDRESS 0xff
#define PPP_CONTROL 0x03
#define PPP_WITHDIRECTION_IN 0x00
#define PPP_WITHDIRECTION_OUT 0x01
#define PPP_IP 0x0021
#define PPP_OSI 0x0023
#define PPP_NS 0x0025
#define PPP_DECNET 0x0027
#define PPP_APPLE 0x0029
#define PPP_IPX 0x002b
#define PPP_VJC 0x002d
#define PPP_VJNC 0x002f
#define PPP_BRPDU 0x0031
#define PPP_STII 0x0033
#define PPP_VINES 0x0035
#define PPP_ML 0x003d
#define PPP_IPV6 0x0057
#define PPP_COMP 0x00fd
#define PPP_HELLO 0x0201
#define PPP_LUXCOM 0x0231
#define PPP_SNS 0x0233
#define PPP_MPLS_UCAST 0x0281
#define PPP_MPLS_MCAST 0x0283
#define PPP_IPCP 0x8021
#define PPP_OSICP 0x8023
#define PPP_NSCP 0x8025
#define PPP_DECNETCP 0x8027
#define PPP_APPLECP 0x8029
#define PPP_IPXCP 0x802b
#define PPP_STIICP 0x8033
#define PPP_VINESCP 0x8035
#define PPP_IPV6CP 0x8057
#define PPP_CCP 0x80fd
#define PPP_MPLSCP 0x8281
#define PPP_LCP 0xc021
#define PPP_PAP 0xc023
#define PPP_LQM 0xc025
#define PPP_SPAP 0xc027
#define PPP_CHAP 0xc223
#define PPP_BACP 0xc02b
#define PPP_BAP 0xc02d
#define PPP_MPCP 0xc03d
#define PPP_SPAP_OLD 0xc123
#define PPP_EAP 0xc227
extern struct tok ppptype2str[];
|
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:40 2014 */
/* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/i2c/algobit.h */
|
/*
* taphist.c, show histogram of pulses in a TAP file
* Copyright (C) 2010 Christopher Williams
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "tap.h"
char *argv0;
int main(int argc, char **argv)
{
struct tap tapfile;
long pulse;
long pulsehist[256];
long max;
const float logmin = -7.;
int i;
FILE *infile;
int width = 80;
argv0 = argv[0];
for (i = 0; i < 256; ++i) pulsehist[i] = 0;
if (argc == 2) {
infile = fopen(argv[1], "rb");
if (!infile) {
perror(argv[1]);
return 1;
}
} else if (argc == 1) {
infile = stdin;
} else {
fprintf(stderr, "%s: too many arguments\n", argv0);
return 1;
}
if (tap_read_header(&tapfile, infile)) {
fprintf(stderr, "%s: error reading TAP file\n", argv0);
return 1;
}
while ((pulse = tap_get_pulse(&tapfile)) >= 0) {
//printf("pulse: %6ld (%04lx)\n", pulse, pulse);
if (pulse < 8*256)
++pulsehist[pulse/8];
}
max = 0;
for (i = 0; i < 256; ++i) {
if (pulsehist[i] > max)
max = pulsehist[i];
}
for (i = 0; i < 256; ++i) {
int j;
float x;
//printf("%4d: %ld\n", i, pulsehist[i]);
printf("%4d: ", i*8);
x = logf((float)pulsehist[i] / max);
/* -inf <= x <= 0 */
if (x < logmin) x = logmin;
for (j = (x - logmin) / -logmin * (width - 6); j; --j)
putchar('#');
putchar('\n');
}
return 0;
}
|
/*
*************************************************************************
ArmageTron -- Just another Tron Lightcycle Game in 3D.
Copyright (C) 2000 Manuel Moos (manuel@moosnet.de)
**************************************************************************
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
***************************************************************************
*/
#ifndef ArmageTron_ARENA_H
#define ArmageTron_ARENA_H
#include "tList.h"
#include "eCoord.h"
class eGrid;
class gSpawnPoint;
class gParser;
// the fighting arena
class gArena{
friend class gSpawnPoint;
friend class gParser;
public:
void NewSpawnPoint(const eCoord &loc,const eCoord &dir);
gArena();
virtual ~gArena();
// draw the gArena
virtual void PrepareGrid(eGrid *grid, gParser *aParser);
// get a random position
virtual eCoord GetRandomPos( REAL factor ) const;
// find the best gSpawnPoint
gSpawnPoint * LeastDangerousSpawnPoint();
// access the size multiplier
static float SizeMultiplier();
static void SetSizeMultiplier(float mult);
static float GetSizeMultiplier();
void RemoveAllSpawn();
private:
tList<gSpawnPoint> spawnPoints; //!< the list of active spawn points
};
#endif
|
/*
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2009 Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of the BSD License("BSD")(the "License").
You can obtain a copy of the License at: http://www.opensparc.net/pubs/t1/licenses/BSD+_License.txt
The BSD License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistribution of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistribution 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 Sun Microsystems, Inc. or the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
This software is provided "AS IS," without a warranty of any kind. ALL
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND
ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that this software is not designed, licensed or intended for
use in the design, construction, operation or maintenance of any nuclear facility.
*/
#include <stdio.h>
#include <stdlib.h>
#ifdef _OPENMP
#include <omp.h>
#define TRUE 1
#define FALSE 0
#else
#define omp_get_thread_num() 0
#define omp_get_num_threads() 1
#endif
int main()
{
int i, TID, n = 9;
int a[n];
#ifdef _OPENMP
(void) omp_set_dynamic(FALSE);
if (omp_get_dynamic()) {printf("Warning: dynamic adjustment of threads has been set\n");}
(void) omp_set_num_threads(4);
#endif
for (i=0; i<n; i++)
a[i] = i;
#pragma omp parallel for default(none) ordered schedule(runtime) \
private(i,TID) shared(n,a)
for (i=0; i<n; i++)
{
TID = omp_get_thread_num();
printf("Thread %d updates a[%d]\n",TID,i);
a[i] += i;
#pragma omp ordered
{printf("Thread %d prints value of a[%d] = %d\n",TID,i,a[i]);}
} /*-- End of parallel for --*/
return(0);
}
|
/*
* imx-iomux-v3.c - i.MX iomux-v3 pinctrl support
*
* Copyright (c) 2013 Sascha Hauer <s.hauer@pengutronix.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <common.h>
#include <init.h>
#include <io.h>
#include <of.h>
#include <pinctrl.h>
#include <malloc.h>
#include <mach/iomux-v3.h>
struct imx_iomux_v3 {
void __iomem *base;
struct pinctrl_device pinctrl;
};
static void __iomem *iomuxv3_base;
static struct device_d *iomuxv3_dev;
static void imx_iomuxv3_setup_single(void __iomem *base, struct device_d *dev,
u32 mux_reg, u32 conf_reg, u32 input_reg,
u32 mux_val, u32 conf_val, u32 input_val)
{
dev_dbg(dev,
"mux: 0x%08x -> 0x%04x, conf: 0x%08x -> 0x%04x input: 0x%08x -> 0x%04x\n",
mux_val, mux_reg, conf_val, conf_reg, input_val, input_reg);
if (mux_reg)
writel(mux_val, base + mux_reg);
if (conf_reg)
writel(conf_val, base + conf_reg);
if (input_reg)
writel(input_val, base + input_reg);
}
/*
* configures a single pad in the iomuxer
*/
int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
{
u32 mux_reg = (pad & MUX_CTRL_OFS_MASK) >> MUX_CTRL_OFS_SHIFT;
u32 mux_val = (pad & MUX_MODE_MASK) >> MUX_MODE_SHIFT;
u32 input_reg = (pad & MUX_SEL_INPUT_OFS_MASK) >> MUX_SEL_INPUT_OFS_SHIFT;
u32 input_val = (pad & MUX_SEL_INPUT_MASK) >> MUX_SEL_INPUT_SHIFT;
u32 conf_reg = (pad & MUX_PAD_CTRL_OFS_MASK) >> MUX_PAD_CTRL_OFS_SHIFT;
u32 conf_val = (pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT;
if (!iomuxv3_base)
return -EINVAL;
if (conf_val & NO_PAD_CTRL)
conf_reg = 0;
imx_iomuxv3_setup_single(iomuxv3_base, iomuxv3_dev,
mux_reg, conf_reg, input_reg,
mux_val, conf_val, input_val);
return 0;
}
EXPORT_SYMBOL(mxc_iomux_v3_setup_pad);
int mxc_iomux_v3_setup_multiple_pads(const iomux_v3_cfg_t *pad_list, unsigned count)
{
const iomux_v3_cfg_t *p = pad_list;
int i;
int ret;
for (i = 0; i < count; i++) {
ret = mxc_iomux_v3_setup_pad(*p);
if (ret)
return ret;
p++;
}
return 0;
}
EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads);
/*
* Each pin represented in fsl,pins consists of 5 u32 PIN_FUNC_ID and
* 1 u32 CONFIG, so 24 types in total for each pin.
*/
#define FSL_PIN_SIZE 24
#define IMX_DT_NO_PAD_CTL (1 << 31)
#define IMX_PAD_SION (1 << 30)
#define IOMUXC_CONFIG_SION (0x1 << 4)
static int imx_iomux_v3_set_state(struct pinctrl_device *pdev, struct device_node *np)
{
struct imx_iomux_v3 *iomux = container_of(pdev, struct imx_iomux_v3, pinctrl);
const __be32 *list;
int npins, size, i;
dev_dbg(iomux->pinctrl.dev, "set state: %s\n", np->full_name);
list = of_get_property(np, "fsl,pins", &size);
if (!list)
return -EINVAL;
if (!size || size % FSL_PIN_SIZE) {
dev_err(iomux->pinctrl.dev, "Invalid fsl,pins property\n");
return -EINVAL;
}
npins = size / FSL_PIN_SIZE;
for (i = 0; i < npins; i++) {
u32 mux_reg = be32_to_cpu(*list++);
u32 conf_reg = be32_to_cpu(*list++);
u32 input_reg = be32_to_cpu(*list++);
u32 mux_val = be32_to_cpu(*list++);
u32 input_val = be32_to_cpu(*list++);
u32 conf_val = be32_to_cpu(*list++);
if (conf_val & IMX_PAD_SION)
mux_val |= IOMUXC_CONFIG_SION;
if (conf_val & IMX_DT_NO_PAD_CTL)
conf_reg = 0;
imx_iomuxv3_setup_single(iomux->base, iomux->pinctrl.dev,
mux_reg, conf_reg, input_reg,
mux_val, conf_val, input_val);
}
return 0;
}
static struct pinctrl_ops imx_iomux_v3_ops = {
.set_state = imx_iomux_v3_set_state,
};
static int imx_pinctrl_dt(struct device_d *dev, void __iomem *base)
{
struct imx_iomux_v3 *iomux;
int ret;
iomux = xzalloc(sizeof(*iomux));
iomux->base = base;
iomux->pinctrl.dev = dev;
iomux->pinctrl.ops = &imx_iomux_v3_ops;
ret = pinctrl_register(&iomux->pinctrl);
if (ret)
free(iomux);
return ret;
}
static int imx_iomux_v3_probe(struct device_d *dev)
{
int ret = 0;
if (iomuxv3_base)
return -EBUSY;
iomuxv3_base = dev_request_mem_region(dev, 0);
iomuxv3_dev = dev;
if (IS_ENABLED(CONFIG_PINCTRL) && dev->device_node)
ret = imx_pinctrl_dt(dev, iomuxv3_base);
return ret;
}
static __maybe_unused struct of_device_id imx_iomux_v3_dt_ids[] = {
{
.compatible = "fsl,imx25-iomuxc",
}, {
.compatible = "fsl,imx35-iomuxc",
}, {
.compatible = "fsl,imx51-iomuxc",
}, {
.compatible = "fsl,imx53-iomuxc",
}, {
.compatible = "fsl,imx6q-iomuxc",
}, {
.compatible = "fsl,imx6dl-iomuxc",
}, {
/* sentinel */
}
};
static struct driver_d imx_iomux_v3_driver = {
.name = "imx-iomuxv3",
.probe = imx_iomux_v3_probe,
.of_compatible = DRV_OF_COMPAT(imx_iomux_v3_dt_ids),
};
static int imx_iomux_v3_init(void)
{
return platform_driver_register(&imx_iomux_v3_driver);
}
postcore_initcall(imx_iomux_v3_init);
|
#ifndef SQLITECONNECTOR_H
#define SQLITECONNECTOR_H
#include "../engine/engine.h"
#include "savedGame.h"
#include "Achievement.h"
#include "sqlite3.h"
#include <string.h>
class SQLiteConnector
{
public:
SQLiteConnector();
virtual ~SQLiteConnector();
bool createGame(savedGame saved);
bool deleteGame(char *name);
vector<savedGame> listGames();
savedGame getGame(char* name);
Achievement getAch(char* name);
vector<Achievement> listAchievements();
bool createAchievement(Achievement saved);
private:
const char* sentence;
char a[21];
sqlite3 *db;
sqlite3_stmt* stmt_result;
//bool findGame(savedGame save);
int msg;
bool dbConnect();
void dbDisconnect();
const char* next;
char* error;
};
#endif // SQLITECONNECTOR_H
|
// -*- Mode: c++ -*-
#ifndef _UTIL_XV_H_
#define _UTIL_XV_H_
#include <qmap.h>
#include "videobuffers.h"
#include "exitcodes.h"
class port_info
{
public:
Display *disp;
int port;
};
extern QMap<int,port_info> open_xv_ports;
extern void close_all_xv_ports_signal_handler(int sig);
extern void add_open_xv_port(Display *disp, int port);
extern void del_open_xv_port(int port);
extern bool has_open_xv_port(int port);
extern uint cnt_open_xv_port(void);
extern QString xvflags2str(int flags);
extern bool xv_is_attrib_supported(
Display *disp, int port, const char *name,
int *current_value = NULL, int *min_val = NULL, int *max_val = NULL);
extern bool xv_set_attrib(Display *disp, int port, const char *name, int val);
extern bool xv_get_attrib(Display *disp, int port, const char *name, int &val);
#endif // _UTIL_XV_H_
|
#ifndef ICHAR_TRAITS_H
#define ICHAR_TRAITS_H
#include <string>
#include <cctype>
struct ichar_traits : std::char_traits<char>{
static bool eq(char c1st, char c2nd){
return std::toupper(c1st) == std::toupper(c2nd);
}
static bool ne(char c1st, char c2nd){
return std::toupper(c1st) != std::toupper(c2nd);
}
static bool lt(char c1st, char c2nd){
return std::toupper(c1st) < std::toupper(c2nd);
}
static int compare(const char* str1, const char* str2, size_t n){
for(int i = 0; i < n; i++){
if (std::tolower(*str1)>std::tolower(*str2)) {
return 1;
}
if (std::tolower(*str1)<std::tolower(*str2)) {
return -1;
}
if(*str1 ==0 || *str2 == 0){
return 0;
}
str1++; str2++;
}
return 0;
}
static const char* find(const char* s1, int n, char c){
while(n-- > 0 && std::toupper(*s1) != std::toupper(c))
s1++;
return s1;
}
};
#endif
typedef basic_string<char, ichar_traits, allocator<char>> istring;
int main(){
istring first = "tHis";
istring second = "ThIs";
cout<< first.compare(second)<<endl;
return 0;
}
|
/**
* SECTION:tester
* @short_description: module for gtk-doc unit test
*
* This file contains non-sense code for the sole purpose of testing the docs.
*
* As described in http://bugzilla.gnome.org/show_bug.cgi?id=457077 it
* returns nothing.
*
* Some special characters need escaping. The tests should pass 100\%.
* Try a <ulink url="http://www.gtk.org/gtk-doc/#Top">link containing a # char</ulink>.
*
* <refsect2 id="dummy-id">
* <title>more details</title>
* <para>
* Second paragraph inside subsection.
* </para>
* </refsect2>
*/
#include <glib.h>
#include "tester.h"
/**
* bug_141869_a:
* @pid: arg
*
* http://bugzilla.gnome.org/show_bug.cgi?id=141869
*/
void bug_141869_a (unsigned pid) {
/* just silence a compiler warning */
bug_481811((double)pid);
}
/**
* bug_141869_b:
* @pid: arg
*
* http://bugzilla.gnome.org/show_bug.cgi?id=141869
*/
void bug_141869_b (signed pid) {
}
/**
* bug_379466:
* @pid: arg
*
* http://bugzilla.gnome.org/show_bug.cgi?id=379466
*/
void bug_379466 (int
pid) {
}
/**
* bug_380824:
* @arg: arg
*
* Returns a value.
* http://bugzilla.gnome.org/show_bug.cgi?id=380824
*
* Since: 0.1
*
* Returns: result
*/
int bug_380824 (int arg) {
return 0;
}
/**
* bug_411739:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=411739
*
* Returns: result
*/
struct bug *
bug_411739 (void) {
return NULL;
}
/**
* bug_419997:
* @const_values: arg
*
* http://bugzilla.gnome.org/show_bug.cgi?id=419997
*/
void bug_419997 (int const_values) {
}
/**
* bug_445693:
* @pid: arg
*
* http://bugzilla.gnome.org/show_bug.cgi?id=445693
*/
void bug_445693 (unsigned long pid) {
}
/**
* bug_471014:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=471014
*
* Returns: result
*/
G_CONST_RETURN gchar* G_CONST_RETURN * bug_471014 (void) {
return NULL;
}
/**
* Bug446648:
* @BUG_446648_FOO: foo
*
* http://bugzilla.gnome.org/show_bug.cgi?id=446648
**/
/**
* bug_552602:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=552602
*
* Returns: result
*/
const char* const * bug_552602 (void) {
return NULL;
}
/**
* bug_574654a:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=574654
*
* Returns: result
*/
/**
* bug_574654b:
* @offset: skip this many items
*
* http://bugzilla.gnome.org/show_bug.cgi?id=574654
*/
int bug_574654a(void) {
return 0;
}
void bug_574654b(double offset) { }
/**
* bug_580300a_get_type:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=580300
*/
void bug_580300a_get_type(void) { }
/**
* bug_580300b_get_type:
* @a: value
*
* http://bugzilla.gnome.org/show_bug.cgi?id=580300
*/
void bug_580300b_get_type(gint a) { }
/**
* bug_580300c_get_type:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=580300
*/
void bug_580300c_get_type() { }
/**
* bug_580300d_get_type:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=580300
*
* Returns: result
*/
int bug_580300d_get_type() { return 0; }
/**
* bug_597937:
* @function_arg: value
*
* http://bugzilla.gnome.org/show_bug.cgi?id=597937
*/
void bug_597937(void (*function_arg)(int arg1, char arg2, void *)) { }
/**
* bug_602518a:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=602518
*
* Returns: result
*/
long int bug_602518a(void) {
return (long int)0;
}
/**
* bug_602518b:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=602518
*
* Returns: result
*/
unsigned long int bug_602518b(void) {
return (unsigned long int)0;
}
/**
* bug_602518c:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=602518
*
* Returns: result
*/
unsigned int bug_602518c(void) {
return (unsigned int)0;
}
/**
* bug_607445:
* @a: parameter
* @n: parameter
*
* http://bugzilla.gnome.org/show_bug.cgi?id=607445
*/
long double bug_607445(long double **a, int n) {
return 2.0*n;
}
/**
* bug_610257:
* @der: parameter
* @len: parameter
*
* http://bugzilla.gnome.org/show_bug.cgi?id=610257
*/
signed long
bug_610257(const unsigned char *der, int *len)
{
return 1L;
}
/**
* bug_623968a:
*
* <para>test</para>
* <refsect3>
* <title>subsect</title>
* <para>test</para>
* </refsect3>
**/
void
bug_623968a(void)
{
}
/**
* bug_623968b:
*
* test
*
* <refsect3>
* <title>subsect</title>
* <para>test</para>
* </refsect3>
**/
void
bug_623968b(void)
{
}
/**
* bug_623968c:
*
* <para>test</para>
**/
void
bug_623968c(void)
{
}
/**
* bug_624200a:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=624200
*
* Returns: result
*/
const char * const *
bug_624200a(void)
{
return NULL;
}
/**
* bug_624200b:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=624200
*
* Returns: result
*/
const char ** const
bug_624200b(void)
{
return NULL;
}
/**
* bug_638330:
* @arg1: arg1
* @data: data
* @length: length
*
* http://bugzilla.gnome.org/show_bug.cgi?id=638330
*/
void (*bug_638330) (void *arg1,
const unsigned char *data,
unsigned int length) = NULL;
/* internal function */
gchar *
_bug_000000a (const gchar *name)
{
return NULL;
}
/* varargs */
/**
* bug_000000_va1:
* @name: a name
* @...: A printf-style message to output
*
* Outputs a message.
*/
void bug_000000_va1 (gchar name, ...)
{
}
/**
* bug_624001a:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=624001
*/
void bug_624001a(void)
{
}
/**
* bug_624001b:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=624001
*/
void bug_624001b(void)
{
}
/**
* bug_624001c:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=624001
*/
void bug_624001c(void)
{
}
/**
* bug_624001d:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=624001
*/
void bug_624001d(void)
{
}
/**
* bug_624001e:
*
* http://bugzilla.gnome.org/show_bug.cgi?id=624001
*/
void bug_624001e(void)
{
}
|
#if !defined(__MP_T_SPRING_CONTACT_H)
#define __MP_T_SPRING_CONTACT_H
/*!
* @file
* @brief File contains mp_task class declaration
* @author twiniars <twiniars@ia.pw.edu.pl>, Warsaw University of Technology
*
* @ingroup spring_contact
*/
namespace mrrocpp {
namespace mp {
namespace task {
/*!
* @brief Task that executes motion of manipulator and its gripper to follow an unknown contour
*
* @author twiniars <twiniars@ia.pw.edu.pl>, Warsaw University of Technology
* @ingroup edge_follow
*/
class spring_contact : public task
{
protected:
public:
/**
* @brief Constructor
* @param _config configurator object reference.
*/
spring_contact(lib::configurator &_config);
void create_robots(void);
void main_task_algorithm(void);
};
} // namespace task
} // namespace mp
} // namespace mrrocpp
#endif
|
/* mailbox.h */
#ifndef MAILBOX_H
#define MAILBOX_H
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/kfifo.h>
#include <linux/pm_qos.h>
typedef u32 mbox_msg_t;
struct omap_mbox;
typedef int __bitwise omap_mbox_irq_t;
#define IRQ_TX ((__force omap_mbox_irq_t) 1)
#define IRQ_RX ((__force omap_mbox_irq_t) 2)
typedef int __bitwise omap_mbox_type_t;
#define OMAP_MBOX_TYPE1 ((__force omap_mbox_type_t) 1)
#define OMAP_MBOX_TYPE2 ((__force omap_mbox_type_t) 2)
extern const struct dev_pm_ops mbox_pm_ops;
struct omap_mbox_ops {
omap_mbox_type_t type;
int (*startup)(struct omap_mbox *mbox);
void (*shutdown)(struct omap_mbox *mbox);
/* fifo */
mbox_msg_t (*fifo_read)(struct omap_mbox *mbox);
void (*fifo_write)(struct omap_mbox *mbox, mbox_msg_t msg);
int (*fifo_empty)(struct omap_mbox *mbox);
int (*fifo_full)(struct omap_mbox *mbox);
/* irq */
void (*enable_irq)(struct omap_mbox *mbox,
omap_mbox_irq_t irq);
void (*disable_irq)(struct omap_mbox *mbox,
omap_mbox_irq_t irq);
void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
/* ctx */
void (*save_ctx)(struct omap_mbox *mbox);
void (*restore_ctx)(struct omap_mbox *mbox);
};
struct omap_mbox_queue {
spinlock_t lock;
struct kfifo fifo;
struct work_struct work;
struct tasklet_struct tasklet;
struct omap_mbox *mbox;
bool full;
};
struct omap_mbox {
char *name;
unsigned int irq;
struct omap_mbox_queue *txq, *rxq;
struct omap_mbox_ops *ops;
struct device *dev;
void *priv;
int use_count;
struct blocking_notifier_head notifier;
struct dev_pm_qos_request qos_request;
unsigned int pm_constraint;
};
int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
void omap_mbox_init_seq(struct omap_mbox *);
struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb);
void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb);
int omap_mbox_register(struct device *parent, struct omap_mbox **);
int omap_mbox_unregister(struct device *parent);
int omap_mbox_enable(struct omap_mbox *mbox);
int omap_mbox_disable(struct omap_mbox *mbox);
static inline void omap_mbox_enable_irq(struct omap_mbox *mbox,
omap_mbox_irq_t irq)
{
mbox->ops->enable_irq(mbox, irq);
}
static inline void omap_mbox_disable_irq(struct omap_mbox *mbox,
omap_mbox_irq_t irq)
{
mbox->ops->disable_irq(mbox, irq);
}
#endif /* MAILBOX_H */
|
#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include "../../config.h"
#ifndef HAVE_BUILTIN_ATOMIC
#error Sorry, but this test program can only be compiled by a compiler that\
has built-in functions for atomic memory access.
#endif
static __inline__
int sync_add_and_fetch(int* p, int i)
{
return __sync_add_and_fetch(p, i);
}
static int s_x = 0;
char g_dummy[512];
static int s_y = 0;
static void* thread_func_1(void* arg)
{
s_y = 1;
(void) sync_add_and_fetch(&s_x, 1);
return 0;
}
static void* thread_func_2(void* arg)
{
while (sync_add_and_fetch(&s_x, 0) == 0)
;
fprintf(stderr, "y = %d\n", s_y);
return 0;
}
int main(int argc, char** argv)
{
int i;
const int n_threads = 2;
pthread_t tid[n_threads];
fprintf(stderr, "Start of test.\n");
pthread_create(&tid[0], 0, thread_func_1, 0);
pthread_create(&tid[1], 0, thread_func_2, 0);
for (i = 0; i < n_threads; i++)
pthread_join(tid[i], 0);
fprintf(stderr, "Test finished.\n");
return 0;
}
|
#ifndef PLAYER_H
#define PLAYER_H
#include <QObject>
#include <memory>
#include <vector>
#include "ClientSocket.h"
#include "places/BoardPlace.h"
class Visitor;
class Player : public QObject, public std::enable_shared_from_this<Player>
{
Q_OBJECT
public:
explicit Player(const int& id,
QPointer<ClientSocket> socketInp, QObject *parent = 0);
virtual void accept(std::unique_ptr<Visitor> visitor);
void testCommunication();
QPointer<ClientSocket> getSocketPointer();
int getPlayerId()const;
void sendMessageToAll(const QString& inp);
void sendMessageToThisPlayer(const QString& inp);
void payMoney(const double& payment);
void collectMoney(const double& income);
void addPrisonFreeCard();
void takeMoneyFromOthers(const double& amount, const QString& message2others);
int getNumberOfHouses() const;
int getNumberOfHotels() const;
void askToBuyHouse(const int& placeId, const QString& question, const double& payment);
void askToBuyHotel(const int& placeId, const QString& question, const double &payment);
void askToBuyPlace(const QString& question, std::shared_ptr<BoardPlace> placePtr, const double &payment);
int giveNumberOfRailwaysOwned() const;
virtual ~Player();
signals:
void playerClickedDice();
public slots:
void requestForDice();
private slots:
void handlePlayerDiceClick();
private:
QPointer<ClientSocket> socket;
const int playerId;
double money;
int prisonFreeCardsNumber;
QVector< std::shared_ptr<BoardPlace> > places;
};
#endif // PLAYER_H
|
/* SPDX-License-Identifier: GPL-2.0-only */
#include <boot/coreboot_tables.h>
#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
}
int get_ec_is_trusted(void)
{
/* Do not have a Chrome EC involved in entering recovery mode;
Always return trusted. */
return 1;
}
|
#ifndef FILTERCOMMON_H
#define FILTERCOMMON_H
#define FILTERARRAYSIZE 8192
#endif
|
/*
* Generated by asn1c-0.9.22 (http://lionet.info/asn1c)
* From ASN.1 module "ListaDePAsAprovadasV2"
* found in "lpa2.asn1"
* `asn1c -S/skeletons`
*/
#include <asn_internal.h>
#include "PolicyInfo.h"
static asn_TYPE_member_t asn_MBR_PolicyInfo_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PolicyInfo, signingPeriod),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_SigningPeriod,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"signingPeriod"
},
{ ATF_POINTER, 1, offsetof(struct PolicyInfo, revocationDate),
(ASN_TAG_CLASS_UNIVERSAL | (24 << 2)),
0,
&asn_DEF_GeneralizedTime,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"revocationDate"
},
{ ATF_NOFLAGS, 0, offsetof(struct PolicyInfo, policyOID),
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
0,
&asn_DEF_OBJECT_IDENTIFIER,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"policyOID"
},
{ ATF_NOFLAGS, 0, offsetof(struct PolicyInfo, policyURI),
(ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
0,
&asn_DEF_IA5String,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"policyURI"
},
{ ATF_NOFLAGS, 0, offsetof(struct PolicyInfo, policyDigest),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_OtherHashAlgAndValue,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
"policyDigest"
},
};
static ber_tlv_tag_t asn_DEF_PolicyInfo_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_PolicyInfo_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 2, 0, 0 }, /* policyOID at 31 */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* signingPeriod at 29 */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -1, 0 }, /* policyDigest at 33 */
{ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 3, 0, 0 }, /* policyURI at 32 */
{ (ASN_TAG_CLASS_UNIVERSAL | (24 << 2)), 1, 0, 0 } /* revocationDate at 30 */
};
static asn_SEQUENCE_specifics_t asn_SPC_PolicyInfo_specs_1 = {
sizeof(struct PolicyInfo),
offsetof(struct PolicyInfo, _asn_ctx),
asn_MAP_PolicyInfo_tag2el_1,
5, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_PolicyInfo = {
"PolicyInfo",
"PolicyInfo",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
0, 0, /* No PER support, use "-gen-PER" to enable */
0, /* Use generic outmost tag fetcher */
asn_DEF_PolicyInfo_tags_1,
sizeof(asn_DEF_PolicyInfo_tags_1)
/sizeof(asn_DEF_PolicyInfo_tags_1[0]), /* 1 */
asn_DEF_PolicyInfo_tags_1, /* Same as above */
sizeof(asn_DEF_PolicyInfo_tags_1)
/sizeof(asn_DEF_PolicyInfo_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_PolicyInfo_1,
5, /* Elements count */
&asn_SPC_PolicyInfo_specs_1 /* Additional specs */
};
|
#ifndef FILEZILLA_XML_STRING_WRITER_HEADER
#define FILEZILLA_XML_STRING_WRITER_HEADER
#include "libfilezilla_engine.h"
#ifdef HAVE_LIBPUGIXML
#include <pugixml.hpp>
#else
#include "../pugixml/pugixml.hpp"
#endif
struct xml_string_writer : pugi::xml_writer
{
std::string result_;
virtual void write(const void* data, size_t size) override
{
result_.append(static_cast<const char*>(data), size);
}
};
#endif
|
#include "format.h"
static bstring strfmt(uint64_t arg, struct st_tracer *tracer);
static bstring astrfmt(uint64_t arg, struct st_tracer *tracer);
static bstring intfmt(uint64_t arg, struct st_tracer *tracer);
typedef bstring (*arg_formatter)(uint64_t, struct st_tracer *);
struct syscall_format {
int syscall;
char *name;
arg_formatter arg_formatters[6];
};
struct syscall_format syscall_formats[] = {
{1, "exit", {intfmt, 0}},
{2, "fork", {intfmt, 0}},
{3, "read", {intfmt, 0}},
{4, "write", {intfmt, 0}},
{5, "open", {intfmt, 0}},
{6, "close", {intfmt, 0}},
{7, "waitpid", {intfmt, 0}},
{8, "creat", {intfmt, 0}},
{9, "link", {intfmt, 0}},
{10, "unlink", {intfmt, 0}},
{11, "execve", {strfmt, astrfmt, astrfmt, 0}},
{63, "dup2", {intfmt, intfmt, 0}},
{102, "socketcall", {intfmt, intfmt, 0}},
};
struct syscall_format default_format = {
-1, "<syscall(%d)>", {intfmt, intfmt, intfmt, intfmt, intfmt, 0}};
static struct syscall_format* find_syscall_formatter(int syscall) {
int imin=0;
int imax = sizeof(syscall_formats)/sizeof(syscall_formats[0]);
while(imin <= imax) {
int imid = (imin+imax)/2;
if(syscall_formats[imid].syscall == syscall) {
return &syscall_formats[imid];
} else if(syscall_formats[imid].syscall < syscall) {
imin = imid + 1;
} else {
imax = imid - 1;
}
}
return &default_format;
}
bstring st_format_syscall(struct st_syscall_args *syscall_args,
struct st_tracer *tracer) {
bstring formatted_syscall;
struct syscall_format *formatter =
find_syscall_formatter(syscall_args->syscall);
formatted_syscall = bformat(formatter->name, syscall_args->syscall);
bconchar(formatted_syscall, '(');
arg_formatter* arg_formatter_it = formatter->arg_formatters;
uint64_t *arg_it = syscall_args->args;
while (*arg_formatter_it) {
bstring arg_str = (*arg_formatter_it)(*arg_it, tracer);
bconcat(formatted_syscall, arg_str);
bdestroy(arg_str);
arg_formatter_it++;
arg_it++;
if (*arg_formatter_it) {
bcatcstr(formatted_syscall, ", ");
}
}
bconchar(formatted_syscall, ')');
return formatted_syscall;
}
bstring strfmt(uint64_t arg, struct st_tracer *tracer) {
char mem_buf[256];
uc_err err = uc_mem_read(tracer->uc, arg, mem_buf, sizeof(mem_buf));
if(mem_buf[sizeof(mem_buf)-1]) {
memcpy(mem_buf + sizeof(mem_buf) - 4, "...", 4);
}
if(err) {
return bformat("0x%llx => <invalid string>");
} else {
return bformat("0x%llx => \"%s\"", arg, mem_buf);
}
}
bstring astrfmt(uint64_t arg, struct st_tracer *tracer) {
if(!arg) {
return intfmt(arg, tracer);
}
bstring formatted_array = bformat("0x%llx => [", arg);
uint64_t item = 0;
// TODO: assumes 32 bits, make it arch/mode independant
uc_mem_read(tracer->uc, arg, &item, 4);
while(item) {
bstring formatted_item = strfmt(item, tracer);
bconcat(formatted_array, formatted_item);
bdestroy(formatted_item);
arg += 4;
uc_mem_read(tracer->uc, arg, &item, 4);
if(item) {
bcatcstr(formatted_array, ", ");
}
}
bconchar(formatted_array, ']');
return formatted_array;
}
bstring intfmt(uint64_t arg, struct st_tracer *tracer) {
bstring formatted_arg = bformat("0x%llx", arg);
return formatted_arg;
}
|
/*
* Xournal++
*
* The about dialog
*
* @author Xournal++ Team
* https://github.com/xournalpp/xournalpp
*
* @license GNU GPLv2 or later
*/
#pragma once
#include "gui/GladeGui.h"
#include <vector>
class ColorEntry;
class Control;
class SelectBackgroundColorDialog : public GladeGui
{
public:
SelectBackgroundColorDialog(GladeSearchpath* gladeSearchPath, Control* control);
virtual ~SelectBackgroundColorDialog();
public:
virtual void show(GtkWindow* parent);
int getSelectedColor();
void showColorchooser();
private:
void updateLastUsedColors();
static void buttonSelectedCallback(GtkButton* button, ColorEntry* e);
static void buttonCustomCallback(GtkButton* button, SelectBackgroundColorDialog* dlg);
private:
XOJ_TYPE_ATTRIB;
Control* control;
int selected;
std::vector<ColorEntry*> colors;
GtkWidget* colorDlg;
};
|
/* ***** BEGIN LICENSE BLOCK *****
* Source last modified: $Id: cwinfile.h,v 1.6 2006/02/07 19:21:16 ping Exp $
*
* Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
*
* The contents of this file, and the files included with this file,
* are subject to the current version of the RealNetworks Public
* Source License (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the current version of the RealNetworks Community
* Source License (the "RCSL") available at
* http://www.helixcommunity.org/content/rcsl, in which case the RCSL
* will apply. You may also obtain the license terms directly from
* RealNetworks. You may not use this file except in compliance with
* the RPSL or, if you have a valid RCSL with RealNetworks applicable
* to this file, the RCSL. Please see the applicable RPSL or RCSL for
* the rights, obligations and limitations governing use of the
* contents of the file.
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL") in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your version of
* this file only under the terms of the GPL, and not to allow others
* to use your version of this file under the terms of either the RPSL
* or RCSL, indicate your decision by deleting the provisions above
* and replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient may
* use your version of this file under the terms of any one of the
* RPSL, the RCSL or the GPL.
*
* This file is part of the Helix DNA Technology. RealNetworks is the
* developer of the Original Code and owns the copyrights in the
* portions it created.
*
* This file, and the files included with this file, is distributed
* and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
* ENJOYMENT OR NON-INFRINGEMENT.
*
* Technology Compatibility Kit Test Suite(s) Location:
* http://www.helixcommunity.org/content/tck
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#ifndef _CWINFILE
#define _CWINFILE
class CWinFile : public CHXDataFile {
public:
CWinFile (IUnknown* pContext);
~CWinFile (void);
virtual HXBOOL GetTemporaryFileName(const char *tag, char* name, UINT32 ulBufLen);
/* Create creates a file using the specified mode
returns HXR_OK or -1 if an error occurred */
virtual HX_RESULT Create(const char *filename, UINT16 mode, HXBOOL textflag = 0);
/* Open will open a file with the specified mode
returns HXR_OK or -1 if an error occurred */
virtual HX_RESULT Open(const char *filename, UINT16 mode, HXBOOL textflag = 0);
/* Open will open a file for sharing with the specified permissions
returns HXR_OK or -1 if an error occurred */
virtual HX_RESULT OpenShared(const char *filename, UINT16 mode, UINT16 sharedmode, HXBOOL textflag = 0);
/* Close closes a file */
virtual HX_RESULT Close(void);
/* Seek moves the current file position to the offset from the
fromWhere specifier returns HXR_OK or -1 if an error occurred */
virtual HX_RESULT Seek(ULONG32 offset, UINT16 fromWhere);
/* Tell returns the current file position in the file */
virtual ULONG32 Tell(void);
/* Read reads up to count bytes of data into buf.
returns the number of bytes read, EOF, or -1 if the read failed */
virtual ULONG32 Read(char *buf, ULONG32 count);
/* Write writes up to count bytes of data from buf.
returns the number of bytes written, or -1 if the write failed */
virtual ULONG32 Write(const char *buf, ULONG32 count);
/* Rewind sets the file position to the start of file
returns HXR_OK or -1 if an error occurred */
virtual HX_RESULT Rewind(void);
/* Returns the size of the file in bytes */
virtual ULONG32 GetSize (void);
/* Changes the size of the file to the newSize */
virtual HX_RESULT ChangeSize (ULONG32 newSize) ;
/* Return the file descriptor */
virtual INT16 GetFd(void) { return (INT16)mFD; };
/* Delete deletes a file. */
virtual HX_RESULT Delete(const char *filename);
protected:
#if !defined(WIN32_PLATFORM_PSPC)
int mFD; // file descriptor of open file
#else
HANDLE mFD;
#endif
};
#endif // _CWINFILE
|
#pragma once
class timing_c
{
private:
int64_t start;
int64_t end;
int reset;
public:
timing_c(void)
{
}
void Start()
{
const int64_t *s = &start;
#ifdef _WIN32
__asm
{
push eax
push ebx
push edx
rdtsc
mov ebx, s
mov [ebx], eax
mov [ebx + 4], edx
pop edx
pop ebx
pop eax
}
#endif
}
int End()
{
const int64_t *e = &end;
int64_t time;
#ifdef _WIN32
__asm
{
push eax
push ebx
push edx
rdtsc
mov ebx, e
mov [ebx], eax
mov [ebx + 4], edx
pop edx
pop ebx
pop eax
}
#endif
time = end - start;
if (time < 0)
{
time = 0;
}
return((int)time);
}
};
// end
|
/*
The contents of this file are subject to the Mozilla Public License
Version 1.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.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is expat.
The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998
James Clark. All Rights Reserved.
Contributor(s):
$Id$
*/
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
|
#ifndef GENERICUDPAPPLICATIONCLIENTTHREAD_H_
#define GENERICUDPAPPLICATIONCLIENTTHREAD_H_
#include <omnetpp.h>
#include "GenericUDPApplication.h"
/**
* @brief A client thread implements the endpoint of a client/server connection.
*
* The client opens a socket and starts the communication by sending the first request.
* Such a request, however, must be fragmented before sending. The last fragment contains
* all data necessary for the server to generate a reply.
* The UDPApplication gives only the last fragment of the replies to the client for
* processing.
* After a maximum number of requests has been sent, the socket is closed and the
* thread removed.
*
* @class GenericUDPApplicationClientThread
*/
class REASE_API GenericUDPApplicationClientThread : public GenericUDPApplicationThreadBase
{
private:
/// Traffic profile used by this thread
TrafficProfile curProfile;
/// Communication partner of this thread
TargetInfo curTarget;
/// Connection statistics of this thread
/// @{
int noRequestsToSend, noBytesSend, noBytesReceived, noPacketSend, noPacketReceived;
/// @}
/// Self message for UDP state transitions
cMessage *selfMsg;
/// state variables required due to fragmentation
/// @{
int packetsPerRequest;
int packetSize;
int curPacketsPerRequest;
/// @}
/// Necessary for static inter-packet wait time
double curResponseTime;
public:
GenericUDPApplicationClientThread(TrafficProfile &p, TargetInfo &i);
virtual ~GenericUDPApplicationClientThread();
virtual void init(GenericUDPApplication *owner, UDPSocket *sock);
virtual void timerExpired(cMessage *msg);
protected:
//
// Interface Methods
//
virtual void socketDatagramArrived(int sockId, void *yourPtr, cMessage *msg, UDPControlInfo *ctrl);
virtual void socketPeerClosed(int sockId, void *yourPtr) {};
/// @brief Create a request message and send it to the server
void sendRequest();
};
#endif /*GENERICUDPAPPLICATIONCLIENTTHREAD_H_*/
|
/* { dg-do compile } */
/* { dg-require-weak "" } */
/* { dg-require-alias "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f1" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f2" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f3" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f4" } } */
/* { dg-final { scan-assembler "notf1" } } */
/* { dg-final { scan-assembler "notf2" } } */
/* { dg-final { scan-assembler "notf3" } } */
/* { dg-final { scan-assembler "notf4" } } */
void f1() __attribute__((weak, alias("notf1")));
void f2() __attribute__((alias("notf2"), weak));
#pragma weak f3=notf3
void f3();
void f4();
#pragma weak f4=notf4
|
#ifndef _ASM_X86_PAGE_DEFS_H
#define _ASM_X86_PAGE_DEFS_H
#include <linux/const.h>
#define PAGE_SHIFT 12
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#define __PHYSICAL_MASK ((phys_addr_t)(1ULL << __PHYSICAL_MASK_SHIFT) - 1)
#define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1)
#define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK)
#define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT)
#define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1))
#define HPAGE_SHIFT PMD_SHIFT
#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
#define HPAGE_MASK (~(HPAGE_SIZE - 1))
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
#define HUGE_MAX_HSTATE 2
#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
#define VM_DATA_DEFAULT_FLAGS \
(((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
#ifdef CONFIG_X86_64
#include <asm/page_64_types.h>
#else
#include <asm/page_32_types.h>
#endif
#ifndef __ASSEMBLY__
extern int page_is_ram(unsigned long pagenr);
extern int devmem_is_allowed(unsigned long pagenr);
extern unsigned long max_low_pfn_mapped;
extern unsigned long max_pfn_mapped;
extern unsigned long init_memory_mapping(unsigned long start,
unsigned long end);
extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
extern void free_initmem(void);
#endif
#endif
|
/*
* This file is part of KDevelop
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This 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 KDEVPLATFORM_PROJECTMANAGERVIEW_DEBUG_H
#define KDEVPLATFORM_PROJECTMANAGERVIEW_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(PLUGIN_PROJECTMANAGERVIEW)
#endif
|
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does
not cause the resulting executable to be covered by the GNU General
Public License. This exception does not however invalidate any
other reasons why the executable file might be covered by the GNU
General Public License. */
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/* Slightly modified from glibc/libio/iofwide.c */
#include <libio.h>
#ifdef _GLIBCPP_USE_WCHAR_T
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result
do_out(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, char *to_end,
char **to_stop);
static enum __codecvt_result
do_unshift(struct _IO_codecvt *codecvt, __c_mbstate_t *statep, char *to_start,
char *to_end, char **to_stop);
static enum __codecvt_result
do_in(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, const char **from_stop,
wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop);
static int
do_encoding(struct _IO_codecvt *codecvt);
static int
do_length(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, _IO_size_t max);
static int
do_max_length(struct _IO_codecvt *codecvt);
static int
do_always_noconv(struct _IO_codecvt *codecvt);
/* The functions used in `codecvt' for libio are always the same. */
struct _IO_codecvt __c_libio_codecvt =
{
.__codecvt_destr = NULL, /* Destructor, never used. */
.__codecvt_do_out = do_out,
.__codecvt_do_unshift = do_unshift,
.__codecvt_do_in = do_in,
.__codecvt_do_encoding = do_encoding,
.__codecvt_do_always_noconv = do_always_noconv,
.__codecvt_do_length = do_length,
.__codecvt_do_max_length = do_max_length
};
static enum __codecvt_result
do_out(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end,
const wchar_t **from_stop, char *to_start, char *to_end,
char **to_stop)
{
enum __codecvt_result res = __codecvt_ok;
while (from_start < from_end)
{
if (to_start >= to_end)
{
res = __codecvt_partial;
break;
}
*to_start++ = (char) *from_start++;
}
*from_stop = from_start;
*to_stop = to_start;
return res;
}
static enum __codecvt_result
do_unshift(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
char *to_start, char *to_end, char **to_stop)
{
*to_stop = to_start;
return __codecvt_ok;
}
static enum __codecvt_result
do_in(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, const char **from_stop,
wchar_t *to_start, wchar_t *to_end, wchar_t **to_stop)
{
enum __codecvt_result res = __codecvt_ok;
while (from_start < from_end)
{
if (to_start >= to_end)
{
res = __codecvt_partial;
break;
}
*to_start++ = (wchar_t) *from_start++;
}
*from_stop = from_start;
*to_stop = to_start;
return res;
}
static int
do_encoding(struct _IO_codecvt *codecvt)
{ return 1; }
static int
do_always_noconv(struct _IO_codecvt *codecvt)
{ return 0; }
static int
do_length(struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
const char *from_start, const char *from_end, _IO_size_t max)
{ return from_end - from_start; }
static int
do_max_length(struct _IO_codecvt *codecvt)
{ return 1; }
#endif /* _GLIBCPP_USE_WCHAR_T */
|
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <jeroen@spritesmods.com> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/
/*
This is example code for the esphttpd library. It's a small-ish demo showing off
the server, including WiFi connection management capabilities, some IO and
some pictures of cats.
*/
#include <esp8266.h>
#include "httpd.h"
#include "io.h"
#include "httpdespfs.h"
#include "cgi.h"
#include "cgiwifi.h"
#include "cgiflash.h"
#include "stdout.h"
#include "auth.h"
#include "espfs.h"
#include "captdns.h"
#include "webpages-espfs.h"
#include "cgiwebsocket.h"
//The example can print out the heap use every 3 seconds. You can use this to catch memory leaks.
//#define SHOW_HEAP_USE
//Function that tells the authentication system what users/passwords live on the system.
//This is disabled in the default build; if you want to try it, enable the authBasic line in
//the builtInUrls below.
int myPassFn(HttpdConnData *connData, int no, char *user, int userLen, char *pass, int passLen) {
if (no==0) {
os_strcpy(user, "admin");
os_strcpy(pass, "s3cr3t");
return 1;
//Add more users this way. Check against incrementing no for each user added.
// } else if (no==1) {
// os_strcpy(user, "user1");
// os_strcpy(pass, "something");
// return 1;
}
return 0;
}
static ETSTimer websockTimer;
//Broadcast the uptime in seconds every second over connected websockets
static void ICACHE_FLASH_ATTR websockTimerCb(void *arg) {
static int ctr=0;
char buff[128];
ctr++;
os_sprintf(buff, "Up for %d minutes %d seconds!\n", ctr/60, ctr%60);
cgiWebsockBroadcast("/websocket/ws.cgi", buff, os_strlen(buff), WEBSOCK_FLAG_NONE);
}
//On reception of a message, send "You sent: " plus whatever the other side sent
void myWebsocketRecv(Websock *ws, char *data, int len, int flags) {
int i;
char buff[128];
os_sprintf(buff, "You sent: ");
for (i=0; i<len; i++) buff[i+10]=data[i];
buff[i+10]=0;
cgiWebsocketSend(ws, buff, os_strlen(buff), WEBSOCK_FLAG_NONE);
}
//Websocket connected. Install reception handler and send welcome message.
void myWebsocketConnect(Websock *ws) {
ws->recvCb=myWebsocketRecv;
cgiWebsocketSend(ws, "Hi, Websocket!", 14, WEBSOCK_FLAG_NONE);
}
#ifdef ESPFS_POS
CgiUploadFlashDef uploadParams={
.type=CGIFLASH_TYPE_ESPFS,
.fw1Pos=ESPFS_POS,
.fw2Pos=0,
.fwSize=ESPFS_SIZE,
};
#define INCLUDE_FLASH_FNS
#endif
#ifdef OTA_FLASH_SIZE_K
CgiUploadFlashDef uploadParams={
.type=CGIFLASH_TYPE_FW,
.fw1Pos=0x1000,
.fw2Pos=((OTA_FLASH_SIZE_K*1024)/2)+0x1000,
.fwSize=((OTA_FLASH_SIZE_K*1024)/2)-0x1000,
};
#define INCLUDE_FLASH_FNS
#endif
/*
This is the main url->function dispatching data struct.
In short, it's a struct with various URLs plus their handlers. The handlers can
be 'standard' CGI functions you wrote, or 'special' CGIs requiring an argument.
They can also be auth-functions. An asterisk will match any url starting with
everything before the asterisks; "*" matches everything. The list will be
handled top-down, so make sure to put more specific rules above the more
general ones. Authorization things (like authBasic) act as a 'barrier' and
should be placed above the URLs they protect.
*/
HttpdBuiltInUrl builtInUrls[]={
{"*", cgiRedirectApClientToHostname, "esp8266.nonet"},
{"/", cgiRedirect, "/index.tpl"},
{"/flash.bin", cgiReadFlash, NULL},
{"/led.tpl", cgiEspFsTemplate, tplLed},
{"/index.tpl", cgiEspFsTemplate, tplCounter},
{"/led.cgi", cgiLed, NULL},
{"/flash/download", cgiReadFlash, NULL},
#ifdef INCLUDE_FLASH_FNS
{"/flash/next", cgiGetFirmwareNext, &uploadParams},
{"/flash/upload", cgiUploadFirmware, &uploadParams},
#endif
{"/flash/reboot", cgiRebootFirmware, NULL},
//Routines to make the /wifi URL and everything beneath it work.
//Enable the line below to protect the WiFi configuration with an username/password combo.
// {"/wifi/*", authBasic, myPassFn},
{"/wifi", cgiRedirect, "/wifi/wifi.tpl"},
{"/wifi/", cgiRedirect, "/wifi/wifi.tpl"},
{"/wifi/wifiscan.cgi", cgiWiFiScan, NULL},
{"/wifi/wifi.tpl", cgiEspFsTemplate, tplWlan},
{"/wifi/connect.cgi", cgiWiFiConnect, NULL},
{"/wifi/connstatus.cgi", cgiWiFiConnStatus, NULL},
{"/wifi/setmode.cgi", cgiWiFiSetMode, NULL},
{"/websocket/ws.cgi", cgiWebsocket, myWebsocketConnect},
{"*", cgiEspFsHook, NULL}, //Catch-all cgi function for the filesystem
{NULL, NULL, NULL}
};
#ifdef SHOW_HEAP_USE
static ETSTimer prHeapTimer;
static void ICACHE_FLASH_ATTR prHeapTimerCb(void *arg) {
os_printf("Heap: %ld\n", (unsigned long)system_get_free_heap_size());
}
#endif
//Main routine. Initialize stdout, the I/O, filesystem and the webserver and we're done.
void user_init(void) {
stdoutInit();
ioInit();
captdnsInit();
// 0x40200000 is the base address for spi flash memory mapping, ESPFS_POS is the position
// where image is written in flash that is defined in Makefile.
#ifdef ESPFS_POS
espFsInit((void*)(0x40200000 + ESPFS_POS));
#else
espFsInit((void*)(webpages_espfs_start));
#endif
httpdInit(builtInUrls, 80);
#ifdef SHOW_HEAP_USE
os_timer_disarm(&prHeapTimer);
os_timer_setfn(&prHeapTimer, prHeapTimerCb, NULL);
os_timer_arm(&prHeapTimer, 3000, 1);
#endif
os_timer_disarm(&websockTimer);
os_timer_setfn(&websockTimer, websockTimerCb, NULL);
os_timer_arm(&websockTimer, 1000, 1);
os_printf("\nReady\n");
}
void user_rf_pre_init() {
//Not needed, but some SDK versions want this defined.
}
|
/*
* Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.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, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLACK_TEMPLE_H_
#define BLACK_TEMPLE_H_
#include "CreatureAIImpl.h"
#define BTScriptName "instance_black_temple"
#define DataHeader "BT"
uint32 const EncounterCount = 9;
enum BTDataTypes
{
// Encounter States
DATA_HIGH_WARLORD_NAJENTUS = 0,
DATA_SUPREMUS = 1,
DATA_SHADE_OF_AKAMA = 2,
DATA_TERON_GOREFIEND = 3,
DATA_GURTOGG_BLOODBOIL = 4,
DATA_RELIQUARY_OF_SOULS = 5,
DATA_MOTHER_SHAHRAZ = 6,
DATA_ILLIDARI_COUNCIL = 7,
DATA_ILLIDAN_STORMRAGE = 8,
// Additional Data
DATA_AKAMA_SHADE = 9,
DATA_AKAMA = 10,
DATA_MAIEV = 11,
DATA_GO_ILLIDAN_GATE = 12,
DATA_BLACK_TEMPLE_TRIGGER = 13,
DATA_GATHIOS_THE_SHATTERER = 14,
DATA_HIGH_NETHERMANCER_ZEREVOR = 15,
DATA_LADY_MALANDE = 16,
DATA_VERAS_DARKSHADOW = 17,
DATA_BLOOD_ELF_COUNCIL_VOICE = 18,
DATA_GO_DEN_OF_MORTAL_DOOR = 19,
DATA_ESSENCE_OF_SUFFERING = 20,
DATA_ESSENCE_OF_DESIRE = 21,
DATA_ESSENCE_OF_ANGER = 22,
DATA_ILLIDAN_MUSIC_CONTROLLER = 23,
DATA_TERON_GOREFIEND_INTRO = 24,
DATA_AKAMA_ILLIDAN_INTRO = 25
};
enum TriggerEmotes
{
EMOTE_HIGH_WARLORD_NAJENTUS_DIED = 0,
EMOTE_DEN_OF_MORTAL_DOOR_OPEN = 1
};
enum BTCreatureIds
{
//Bosses
NPC_HIGH_WARLORD_NAJENTUS = 22887,
NPC_SUPREMUS = 22898,
NPC_SHADE_OF_AKAMA = 22841,
NPC_TERON_GOREFIEND = 22871,
NPC_GURTOGG_BLOODBOIL = 22948,
NPC_RELIQUARY_OF_SOULS = 22856,
NPC_MOTHER_SHAHRAZ = 22947,
NPC_ILLIDARI_COUNCIL = 23426,
NPC_ILLIDAN_STORMRAGE = 22917,
//Misc
NPC_GATHIOS_THE_SHATTERER = 22949,
NPC_HIGH_NETHERMANCER_ZEREVOR = 22950,
NPC_LADY_MALANDE = 22951,
NPC_VERAS_DARKSHADOW = 22952,
NPC_BLOOD_ELF_COUNCIL_VOICE = 23499,
NPC_AKAMA = 23089, // This is the Akama that starts the Illidan encounter.
NPC_AKAMA_SHADE = 23191, // This is the Akama that starts the Shade of Akama encounter.
NPC_SUPREMUS_VOLCANO = 23085,
NPC_BLACK_TEMPLE_TRIGGER = 22984,
NPC_RELIQUARY_WORLD_TRIGGER = 23472,
NPC_ENSLAVED_SOUL = 23469,
NPC_ASHTONGUE_STALKER = 23374,
NPC_ASHTONGUE_BATTLELORD = 22844,
NPC_ASHTONGUE_MYSTIC = 22845,
NPC_ASHTONGUE_PRIMALIST = 22847,
NPC_ASHTONGUE_STORMCALLER = 22846,
NPC_ASHTONGUE_FERAL_SPIRIT = 22849,
NPC_STORM_FURY = 22848,
NPC_SPIRIT_OF_UDALO = 23410,
NPC_SPIRIT_OF_OLUM = 23411,
NPC_FLAME_OF_AZZINOTH = 22997,
NPC_BLADE_OF_AZZINOTH = 22996,
NPC_MAIEV_SHADOWSONG = 23197,
NPC_ILLIDAN_DB_TARGET = 23070,
NPC_ILLIDARI_ELITE = 23226,
NPC_GLAIVE_TARGET = 23448,
NPC_GLAIVE_WORLD_TRIGGER = 22515,
NPC_DEMON_FIRE = 23069,
NPC_PARASITIC_SHADOWFIEND = 23498,
NPC_BLAZE = 23259,
NPC_FLAME_CRASH = 23336
};
enum BTGameObjectIds
{
GO_NAJENTUS_GATE = 185483,
GO_NAJENTUS_SPINE = 185584,
GO_SUPREMUS_GATE = 185882,
GO_SHADE_OF_AKAMA_DOOR = 185478,
GO_TERON_DOOR_1 = 185480,
GO_TERON_DOOR_2 = 186153,
GO_GURTOGG_DOOR = 185892,
GO_DEN_OF_MORTAL_DOOR = 185479,
GO_MOTHER_SHAHRAZ_DOOR = 185482,
GO_COUNCIL_DOOR_1 = 185481,
GO_COUNCIL_DOOR_2 = 186152,
GO_ILLIDAN_GATE = 185905,
GO_ILLIDAN_DOOR_R = 186261,
GO_ILLIDAN_DOOR_L = 186262,
GO_ILLIDAN_CAGE_TRAP = 185916,
GO_ILLIDAN_MUSIC_CONTROLLER = 185966
};
enum BlackTempleMisc
{
AKAMA_INTRO = 1,
AKAMA_FIGHT = 2,
ACTION_ACTIVE_AKAMA_INTRO = 3,
ACTION_OPEN_DOOR = 4
};
template <class AI, class T>
inline AI* GetBlackTempleAI(T* obj)
{
return GetInstanceAI<AI>(obj, BTScriptName);
}
#define RegisterBlackTempleCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetBlackTempleAI)
#endif // BLACK_TEMPLE_H_
|
/*
* This file is part of LiSA Switch
*
* LiSA Switch 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.
*
* LiSA Switch 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 LiSA Switch; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include "socket_api.h"
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
int register_filter(pcap_t **pcap, const char* filter, const char *if_name)
{
int ret;
char errbuf[PCAP_ERRBUF_SIZE];
bpf_u_int32 netp;
bpf_u_int32 maskp;
struct bpf_program fp;
/* get network address and mask of the device */
ret = pcap_lookupnet(if_name, &netp, &maskp, errbuf);
if (ret < 0) {
printf("Error pcap_lookupnet(): %s\n", errbuf);
return -1;
}
/* open device for monitoring */
*pcap = pcap_open_live(if_name, PACKET_SIZE, 1, 0, errbuf);
if (NULL == *pcap) {
printf("Error pcap_open_live(): %s\n", errbuf);
return -1;
}
/* if filter is empty no filter will be applied */
if (strcmp(filter, NO_FILTER) == 0) {
printf("No filter registered\n");
goto out;
}
/* compile the program */
ret = pcap_compile(*pcap, &fp, filter, 0, netp);
if (ret < 0) {
printf("Error pcap_compile()");
return -1;
}
/* set compiled program as filter */
ret = pcap_setfilter(*pcap, &fp);
if (ret < 0) {
printf("Error pcap_setfilter()");
return -1;
}
out:
return 0;
}
u_char* recv_packet(pcap_t *pcap)
{
struct pcap_pkthdr header;
return (u_char*)pcap_next(pcap, &header);
}
int send_packet(int sock_fd, unsigned char *packet, int size)
{
return send(sock_fd, packet, size, 0);
}
|
/*
* Copyright (c) 2000 Silicon Graphics, Inc. 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 would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan/
*
*/
/* $Id: chdir02.c,v 1.6 2009/08/28 11:32:19 vapier Exp $ */
/**********************************************************
*
* OS Test - Silicon Graphics, Inc.
*
* TEST IDENTIFIER : chdir02
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for chdir(2)
*
* PARENT DOCUMENT : usctpl01
*
* TEST CASE TOTAL : 1
*
* WALL CLOCK TIME : 1
*
* CPU TYPES : ALL
*
* AUTHOR : William Roske
*
* CO-PILOT : Dave Fenner
*
* DATE STARTED : 03/30/92
*
* INITIAL RELEASE : UNICOS 7.0
*
* TEST CASES
*
* 1.) chdir(2) returns...(See Description)
*
* INPUT SPECIFICATIONS
* The standard options for system call tests are accepted.
* (See the parse_opts(3) man page).
*
* OUTPUT SPECIFICATIONS
*
* DURATION
* Terminates - with frequency and infinite modes.
*
* SIGNALS
* Uses SIGUSR1 to pause before test if option set.
* (See the parse_opts(3) man page).
*
* RESOURCES
* None
*
* ENVIRONMENTAL NEEDS
* No run-time environmental needs.
*
* SPECIAL PROCEDURAL REQUIREMENTS
* None
*
* INTERCASE DEPENDENCIES
* None
*
* DETAILED DESCRIPTION
* This is a Phase I test for the chdir(2) system call. It is intended
* to provide a limited exposure of the system call, for now. It
* should/will be extended when full functional tests are written for
* chdir(2).
*
* Setup:
* Setup signal handling.
* Pause for SIGUSR1 if option specified.
*
* Test:
* Loop if the proper options are given.
* Execute system call
* Check return code, if system call failed (return=-1)
* Log the errno and Issue a FAIL message.
* Otherwise, Issue a PASS message.
*
* Cleanup:
* Print errno log and/or timing stats if options given
*
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#include <errno.h>
#include <string.h>
#include <signal.h>
#include "test.h"
#include "usctest.h"
void setup();
void cleanup();
char *TCID = "chdir02"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
int exp_enos[] = { 0, 0 };
char *dirs[2] = { "/", "/tmp" };
int main(int ac, char **av)
{
int lc;
char *msg;
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
setup();
TEST_EXP_ENOS(exp_enos);
for (lc = 0; TEST_LOOPING(lc); lc++) {
Tst_count = 0;
TEST(chdir(dirs[lc % 2]));
if (TEST_RETURN == -1) {
tst_resm(TFAIL|TTERRNO, "chdir(%s) failed",
dirs[lc % 2]);
} else {
if (STD_FUNCTIONAL_TEST) {
tst_resm(TPASS, "chdir(%s) returned %ld",
dirs[lc % 2], TEST_RETURN);
}
}
}
cleanup();
tst_exit();
}
void setup()
{
tst_sig(NOFORK, DEF_HANDLER, cleanup);
TEST_PAUSE;
}
void cleanup()
{
TEST_CLEANUP;
} |
/*
Q Light Controller
vcxypadarea.h
Copyright (c) Stefan Krumm, Heikki Junnila
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. The license is
in the file "COPYING".
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef VCXYPADAREA_H
#define VCXYPADAREA_H
#include <QPixmap>
#include <QString>
#include <QMutex>
#include <QFrame>
#include "doc.h"
class QPaintEvent;
class QMouseEvent;
class VCXYPadArea : public QFrame
{
Q_OBJECT
Q_DISABLE_COPY(VCXYPadArea)
/*************************************************************************
* Initialization
*************************************************************************/
public:
VCXYPadArea(QWidget* parent);
virtual ~VCXYPadArea();
void setMode(Doc::Mode mode);
private:
Doc::Mode m_mode;
/*************************************************************************
* Current position
*************************************************************************/
public:
/** Get the pad's current position (i.e. where the point is) */
QPoint position();
/** Set the pad's current position (i.e. move the point) */
void setPosition(const QPoint& point);
/** Check if the position has changed since the last currentXYPosition() call */
bool hasPositionChanged();
signals:
void positionChanged(const QPoint& point);
private:
QPoint m_pos;
bool m_changed;
QMutex m_mutex;
QPixmap m_pixmap;
/*************************************************************************
* Event handlers
*************************************************************************/
protected:
/** @reimp */
void paintEvent(QPaintEvent* e);
/** @reimp */
void mousePressEvent(QMouseEvent* e);
/** @reimp */
void mouseReleaseEvent(QMouseEvent* e);
/** @reimp */
void mouseMoveEvent(QMouseEvent* e);
};
#endif
|
/*
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __BATTLEGROUNDAA_H
#define __BATTLEGROUNDAA_H
class BattleGround;
class BattleGroundAAScore : public BattleGroundScore
{
public:
BattleGroundAAScore() {};
virtual ~BattleGroundAAScore() {};
//TODO fix me
};
class BattleGroundAA : public BattleGround
{
friend class BattleGroundMgr;
public:
BattleGroundAA();
~BattleGroundAA();
void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
void HandleKillPlayer(Player* player, Player *killer);
};
#endif
|
#define LIBSSH_STATIC
#include "torture.h"
#include "sftp.c"
static void setup(void **state) {
ssh_session session;
struct torture_sftp *t;
const char *host;
const char *user;
const char *password;
host = getenv("TORTURE_HOST");
if (host == NULL) {
host = "localhost";
}
user = getenv("TORTURE_USER");
password = getenv("TORTURE_PASSWORD");
session = torture_ssh_session(host, user, password);
assert_false(session == NULL);
t = torture_sftp_session(session);
assert_false(t == NULL);
*state = t;
}
static void teardown(void **state) {
struct torture_sftp *t = *state;
assert_false(t == NULL);
torture_rmdirs(t->testdir);
torture_sftp_close(t);
}
static void torture_sftp_mkdir(void **state) {
struct torture_sftp *t = *state;
char tmpdir[128];
int rc;
assert_false(t == NULL);
snprintf(tmpdir, sizeof(tmpdir), "%s/mkdir_test", t->testdir);
rc = sftp_mkdir(t->sftp, tmpdir, 0755);
if(rc != SSH_OK)
fprintf(stderr,"error:%s\n",ssh_get_error(t->sftp->session));
assert_true(rc == 0);
/* check if it really has been created */
assert_true(torture_isdir(tmpdir));
rc = sftp_rmdir(t->sftp, tmpdir);
assert_true(rc == 0);
/* check if it has been deleted */
assert_false(torture_isdir(tmpdir));
}
int torture_run_tests(void) {
int rc;
const UnitTest tests[] = {
unit_test_setup_teardown(torture_sftp_mkdir, setup, teardown)
};
ssh_init();
rc = run_tests(tests);
ssh_finalize();
return rc;
}
|
struct QRecStruct {
char *inPtr;
char *outPtr;
char *start;
char *end;
int capacity;
int stored;
};
int enqueue (struct QRecStruct*, char);
int dequeue (struct QRecStruct*, char);
struct QRecStruct* initQueue(int);
int deInitQueue(struct QRecStruct*);
|
#ifndef ERR_DIALOG_HANDLER_H
#define ERR_DIALOG_HANDLER_H
#include "common.h"
#include <stdexcept>
enum ErrorCodes
{
/* Error codes */
FORK_ERR,
PIPE_CREATION_ERR,
NULL_OPEN_ERR,
MALLOC_ERR,
FDOPEN_ERR,
PIPE_READ_ERR,
FILE_DELETE_ERR,
CONFIG_OPEN_ERR,
CONFIG_CREATION_ERR,
PTY_OPEN_ERR,
END_PERROR,
TOO_MANY_ARGS_ERR,
JOB_IN_PROGRESS_ERR,
NOTHING_TO_DO_ERR,
CD_PARANOIA_MISC_ERR,
TOO_LONG_FILE_NAME_ERR,
EMPTY_ENTRY_ERR,
CONFIG_PARSE_ERR,
CONFIG_EMPTY_ITEM_ERR,
INVALID_FILE_SELECTION_ERR,
/* CDDB Error Codes */
CDDB_NO_CONNECT_ERR,
CDDB_CONNECT_REFUSED_ERR,
CDDB_SERVER_ERR,
CDDB_NOT_FOUND_ERR,
/* Newly added ones */
RX_PARSING_ERR,
PLUGIN_NOT_PRESENT_ERR,
CREATING_FILE_ERROR,
WAV_PATH_NOT_WRITABLE_ERROR,
MP3_PATH_NOT_WRITABLE_ERROR,
WAV_PATH_CREATE_ERROR,
MP3_PATH_CREATE_ERROR,
/* more distinct cdparanoia error codes */
CD_PARANOIA_NO_DISC,
CD_PARANOIA_NO_PERMS,
/* catch any exceptions */
CPP_EXCEPTION_ERR
};
enum DialogCodes
{
/* Dialog codes */
DL_ABORT_CONFIRM,
DL_DELETE_ON_ABORT,
DL_OVERWRITE_CONFIRM,
DL_ENTER_FILE_NAME,
DL_CREATE_CONFIG_CONFIRM,
DL_WAV_PART_LOW,
DL_MP3_PART_LOW
};
enum StatusCodes
{
/* Status codes */
STAT_FINISH_WAV,
STAT_FINISH_MP3,
/* For dialog handler */
DL_OK_PRESSED = 100
};
/* Function Prototypes */
class ErrCode
{
public:
ErrCode(int x) :err_code(x)
{
*buf=0;
}
virtual const char * get_buf() const;
virtual const char * get_msg() const;
virtual bool has_perror() const;
private:
int err_code;
mutable char buf[20];
};
class ExcCode : public ErrCode
{
public:
ExcCode(std::exception &x) : ErrCode(CPP_EXCEPTION_ERR), e(x)
{
}
;
const char * get_buf() const;
const char * get_msg() const;
bool has_perror() const;
private:
std::exception & e;
};
void err_handler(const ErrCode &, const char *extra_msg);
int dialog_handler(int ops, int ok_or_yes, int dialog_code,
int with_entry, char *entry_default,
char *entered, int answer_length);
void status_handler(int status_code, const char *extra_msg);
#endif
|
/*
* Matrix Market I/O example program
*
* Read a real (non-complex) sparse matrix from a Matrix Market (v. 2.0) file.
* and copies it to stdout. This porgram does nothing useful, but
* illustrates common usage of the Matrix Matrix I/O routines.
* (See http://math.nist.gov/MatrixMarket for details.)
*
* Usage: a.out [filename] > output
*
*
* NOTES:
*
* 1) Matrix Market files are always 1-based, i.e. the index of the first
* element of a matrix is (1,1), not (0,0) as in C. ADJUST THESE
* OFFSETS ACCORDINGLY offsets accordingly when reading and writing
* to files.
*
* 2) ANSI C requires one to use the "l" format modifier when reading
* double precision floating point numbers in scanf() and
* its variants. For example, use "%lf", "%lg", or "%le"
* when reading doubles, otherwise errors will occur.
*/
#include "mm_in_matrix.h"
MatrixStruct mm_in_matrix(int argc, char *argv[])
{
int ret_code;
MM_typecode matcode;
FILE *f;
int nz; /* number of non-zero elemens i the matix */
// int i, *I, *J;
double val;
int i,j,k;
MatrixStruct mat;
if (argc < 2)
{
fprintf(stderr, "Usage: %s [martix-market-filename]\n", argv[0]);
exit(1);
}
else
{
if ((f = fopen(argv[1], "r")) == NULL)
exit(1);
}
if (mm_read_banner(f, &matcode) != 0)
{
printf("Could not process Matrix Market banner.\n");
exit(1);
}
/* This is how one can screen matrix types if their application */
/* only supports a subset of the Matrix Market data types. */
if (mm_is_complex(matcode) && mm_is_matrix(matcode) &&
mm_is_sparse(matcode) )
{
printf("Sorry, this application does not support ");
printf("Market Market type: [%s]\n", mm_typecode_to_str(matcode));
exit(1);
}
/* find out size of sparse matrix .... */
if ((ret_code = mm_read_mtx_crd_size(f, &mat.M, &mat.N, &nz)) !=0)
exit(1);
/* reseve memory for matrices */
mat.Matrice = ( double **) malloc (mat.M * sizeof(double*));
for( i = 0; i < mat.M; ++i){
mat.Matrice[i] = ( double *) malloc (mat.N * sizeof(double));
for(j = 0; j < mat.N; ++j){
mat.Matrice[i][j] = 0.;
}
}
/* NOTE: when reading in doubles, ANSI C requires the use of the "l" */
/* specifier as in "%lg", "%lf", "%le", otherwise errors will occur */
/* (ANSI C X3.159-1989, Sec. 4.9.6.2, p. 136 lines 13-15) */
for (i=0; i<nz; i++)
{
fscanf(f, "%d %d %lg\n", &j, &k, &val);
// I[i]--; /* adjust from 1-based to 0-based */
// J[i]--;
mat.Matrice[j-1][k-1] = val;
}
if (f !=stdin) fclose(f);
/************************/
/* now write out matrix */
/************************/
mm_write_banner(stdout, matcode);
mm_write_mtx_crd_size(stdout, mat.M, mat.N, nz);
// for (i=0; i<nz; i++)
// fprintf(stdout, "%d %d %20.19g\n", I[i]+1, J[i]+1, val[i]);
return mat;
}
|
/***************************************************************************
* Copyright (C) 2009-2015 by Savoir-Faire Linux *
* Author : Emmanuel Lepage Valle <emmanuel.lepage@savoirfairelinux.com >*
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 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 CONTACT_DOCK_H
#define CONTACT_DOCK_H
#include "ui_contactdock.h"
//Qt
#include <QtCore/QHash>
#include <QtGui/QDockWidget>
#include <QtGui/QSortFilterProxyModel>
#include <QtGui/QTreeWidgetItem>
//SFLPhone
#include "categorizedtreeview.h"
class PhoneNumber;
//Qt
class QMenu;
//KDE
class KAction;
namespace Akonadi {
namespace Contact {
}
}
namespace KABC {
}
///SFLPhone
class Contact;
class ContactProxyModel;
class CategorizedDelegate;
class PhoneNumberDelegate;
class ContactDelegate;
class KeyPressEaterC;
class ContactSortFilterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit ContactSortFilterProxyModel(QObject* parent) : QSortFilterProxyModel(parent) {
setDynamicSortFilter(true);
}
protected:
virtual bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const;
};
///ContactDock: Dock to access contacts
class ContactDock : public QDockWidget, public Ui_ContactDock
{
Q_OBJECT
public:
//Constructor
explicit ContactDock(QWidget* parent = nullptr);
virtual ~ContactDock();
private:
//Attributes
QMenu* m_pMenu ;
Contact* m_pCurrentContact;
QString m_PreselectedNb ;
QSortFilterProxyModel* m_pProxyModel ;
ContactProxyModel* m_pSourceModel ;
KeyPressEaterC* m_pKeyPressEater ;
//Actions
KAction* m_pCallAgain ;
KAction* m_pEditContact ;
KAction* m_pCopy ;
KAction* m_pEmail ;
KAction* m_pAddPhone ;
KAction* m_pBookmark ;
KAction* m_pRemove ;
//Delegates
CategorizedDelegate* m_pCategoryDelegate;
PhoneNumberDelegate* m_pPhoneNumberDelegate;
ContactDelegate* m_pContactDelegate;
//Helper
PhoneNumber* showNumberSelector(bool& ok);
enum SortingCategory {
Name,
Organization,
RecentlyUsed,
Group,
Department
};
public Q_SLOTS:
virtual void keyPressEvent(QKeyEvent* event);
private Q_SLOTS:
void setHistoryVisible ( bool visible );
void slotContextMenu ( QModelIndex index );
private Q_SLOTS:
///Menu actions
void showContext(const QModelIndex& index);
void sendEmail ();
void callAgain (const PhoneNumber* n = nullptr);
void copy ();
void editContact ();
void addPhone ();
void bookmark ();
void transferEvent( QMimeData* data );
void expandTree ();
void setCategory (int index);
void slotDoubleClick(const QModelIndex& index);
void slotDelete();
};
///KeyPressEaterC: keygrabber
class KeyPressEaterC : public QObject
{
Q_OBJECT
public:
explicit KeyPressEaterC(ContactDock* parent) : QObject(parent) {
m_pDock = parent;
}
protected:
bool eventFilter(QObject *obj, QEvent *event);
private:
ContactDock* m_pDock;
};
#endif //CONTACT_DOCK_H
|
/*
* arch/arm/mach-ns115/include/mach/hardware.h
*
* This file contains the hardware definitions of the NS115 boards.
*
* Copyright (C) 2010 NUFRONT Limited.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
#include <asm/sizes.h>
/* macro to get at IO space when running virtually */
#ifdef CONFIG_MMU
/*
* Statically mapped addresses:
*
* 10xx xxxx -> fbxx xxxx
* 1exx xxxx -> fdxx xxxx
* 1fxx xxxx -> fexx xxxx
*/
#define IO_ADDRESS(x) (((x) & 0x03ffffff) + 0xfb000000)
#else
#define IO_ADDRESS(x) (x)
#endif
#define __io_address(n) __io(IO_ADDRESS(n))
#endif
|
/***************************************************************************
* Copyright (C) 2009 by Kai Dombrowe <just89@gmx.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H
// own
#include "joschy_global.h"
#include "plugininfo.h"
#include "plugin.h"
// Qt
#include <QtCore/QObject>
namespace Joschy {
class PluginManager : public QObject
{
Q_OBJECT
friend class Plugin;
public:
explicit PluginManager(QObject *parent = 0);
QList<Joschy::PluginInfo> availableProvider() const;
QList<Joschy::PluginInfo> availableNetworkLayer() const;
template<typename T>
T loadPlugin(const Joschy::PluginInfo &info)
{
if (!m_pluginList.contains(info)) {
return 0;
}
Joschy::Plugin *plugin = loadPluginInternal(info);
if (plugin) {
return qobject_cast<T>(plugin);
}
return 0;
}
void unloadPlugin(Joschy::Plugin *plugin);
private:
QList<PluginInfo> m_pluginList;
QList<Joschy::Plugin*> m_loadedPlugins;
private slots:
void updatePluginList();
protected:
Joschy::Plugin *loadPluginInternal(const Joschy::PluginInfo &info);
};
} // namespace Joschy
#endif // PLUGINMANAGER_H
|
/*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
Copyright (C) 2001,2002,2003,2004,2005 Aymeric MOIZARD jack@atosc.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdlib.h>
#include <stdio.h>
#include <osipparser2/osip_port.h>
#include <osipparser2/osip_message.h>
#include <osipparser2/osip_parser.h>
/* adds the contact header to message. */
/* INPUT : const char *hvalue | value of header. */
/* OUTPUT: osip_message_t *sip | structure to save results. */
/* returns -1 on error. */
int
osip_message_set_contact (osip_message_t * sip, const char *hvalue)
{
int i;
osip_contact_t *contact;
if (hvalue == NULL || hvalue[0] == '\0')
return 0;
i = osip_contact_init (&contact);
if (i != 0)
return -1;
i = osip_contact_parse (contact, hvalue);
if (i != 0)
{
osip_contact_free (contact);
return -1;
}
sip->message_property = 2;
osip_list_add (sip->contacts, contact, -1);
return 0; /* ok */
}
/* parses a contact header. */
/* INPUT : const char *string | pointer to a contact string.*/
/* OUTPUT: osip_contact_t *contact | structure to save results. */
/* returns -1 on error. */
int
osip_contact_parse (osip_contact_t * contact, const char *hvalue)
{
if (contact == NULL)
return -1;
if (strncmp (hvalue, "*", 1) == 0)
{
contact->displayname = osip_strdup (hvalue);
return 0;
}
return osip_from_parse ((osip_from_t *) contact, hvalue);
}
int
osip_contact_init (osip_contact_t ** contact)
{
return osip_from_init ((osip_from_t **) contact);
}
/* returns the pos of contact header. */
/* INPUT : int pos | pos of contact header. */
/* INPUT : osip_message_t *sip | sip message. */
/* OUTPUT: osip_contact_t *contact | structure to save results. */
/* returns -1 on error. */
int
osip_message_get_contact (const osip_message_t * sip, int pos,
osip_contact_t ** dest)
{
*dest = NULL;
if (sip == NULL)
return -1;
if (osip_list_size (sip->contacts) <= pos)
return -1; /* does not exist */
*dest = (osip_contact_t *) osip_list_get (sip->contacts, pos);
return pos;
}
/* returns the contact header as a string.*/
/* INPUT : osip_contact_t *contact | contact. */
/* returns null on error. */
int
osip_contact_to_str (const osip_contact_t * contact, char **dest)
{
if (contact == NULL)
return -1;
if (contact->displayname != NULL)
{
if (strncmp (contact->displayname, "*", 1) == 0)
{
*dest = osip_strdup ("*");
return 0;
}
}
return osip_from_to_str ((osip_from_t *) contact, dest);
}
/* deallocates a osip_contact_t structure. */
/* INPUT : osip_contact_t *| contact. */
void
osip_contact_free (osip_contact_t * contact)
{
osip_from_free ((osip_from_t *) contact);
}
int
osip_contact_clone (const osip_contact_t * contact, osip_contact_t ** dest)
{
return osip_from_clone ((osip_from_t *) contact, (osip_from_t **) dest);
}
|
#ifndef _MACHINE_INSTR_H
#define _MACHINE_INSTR_H
static inline void
__attribute__ ((unused))
atomic_add (volatile int *mem, int val)
{
__asm__ __volatile__ ("lock; addl %1,%0"
: "=m" (*mem)
: "ir" (val), "m" (*mem));
}
/* compare_and_swap ********************************************************
Atomically do the following: Check if the location still contains
`oldval`. If so, replace it by `newval` and return `oldval`.
RETURN VALUE:
the old value at *p
***************************************************************************/
static inline long
__attribute__ ((unused))
compare_and_swap (volatile long *p, long oldval, long newval)
{
long ret;
__asm__ __volatile__ ("lock; cmpxchgl %2, %1"
: "=a" (ret), "=m" (*p)
: "r" (newval), "m" (*p), "0" (oldval));
return ret;
}
#define STORE_ORDER_BARRIER() __asm__ __volatile__ ("" : : : "memory");
#define MEMORY_BARRIER_BEFORE_ATOMIC() __asm__ __volatile__ ("" : : : "memory");
#define MEMORY_BARRIER_AFTER_ATOMIC() __asm__ __volatile__ ("" : : : "memory");
#define MEMORY_BARRIER() __asm__ __volatile__ ( \
"lock; add $0, 0(%%esp)" : : : "memory" );
#endif
|
/*
* GStreamer Daemon - Gst Launch under steroids
* Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __GSTD_PROPERTY_ARRAY_H__
#define __GSTD_PROPERTY_ARRAY_H__
#include <glib-object.h>
#include "gstd_property.h"
G_BEGIN_DECLS
/*
* Type declaration.
*/
#define GSTD_TYPE_PROPERTY_ARRAY \
(gstd_property_array_get_type())
#define GSTD_PROPERTY_ARRAY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GSTD_TYPE_PROPERTY_ARRAY,GstdPropertyArray))
#define GSTD_PROPERTY_ARRAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GSTD_TYPE_PROPERTY_ARRAY,GstdPropertyArrayClass))
#define GSTD_IS_PROPERTY_ARRAY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GSTD_TYPE_PROPERTY_ARRAY))
#define GSTD_IS_PROPERTY_ARRAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GSTD_TYPE_PROPERTY_ARRAY))
#define GSTD_PROPERTY_ARRAY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GSTD_TYPE_PROPERTY_ARRAY, GstdPropertyArrayClass))
typedef struct _GstdPropertyArray GstdPropertyArray;
typedef struct _GstdPropertyArrayClass GstdPropertyArrayClass;
GType gstd_property_array_get_type(void);
struct _GstdPropertyArray
{
GstdProperty parent;
};
struct _GstdPropertyArrayClass
{
GstdPropertyClass parent_class;
};
GstdReturnCode gstd_property_array_to_string (GstdObject * self, gchar ** outstring);
G_END_DECLS
#endif // __GSTD_PROPERTY_ARRAY_H__
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
#ifndef _SYS_ZIL_IMPL_H
#define _SYS_ZIL_IMPL_H
#include <sys/zil.h>
#include <sys/dmu_objset.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Log write buffer.
*/
typedef struct lwb {
zilog_t *lwb_zilog; /* back pointer to log struct */
blkptr_t lwb_blk; /* on disk address of this log blk */
boolean_t lwb_fastwrite; /* is blk marked for fastwrite? */
int lwb_nused; /* # used bytes in buffer */
int lwb_sz; /* size of block and buffer */
char *lwb_buf; /* log write buffer */
zio_t *lwb_zio; /* zio for this buffer */
dmu_tx_t *lwb_tx; /* tx for log block allocation */
uint64_t lwb_max_txg; /* highest txg in this lwb */
list_node_t lwb_node; /* zilog->zl_lwb_list linkage */
} lwb_t;
/*
* Intent log transaction lists
*/
typedef struct itxs {
list_t i_sync_list; /* list of synchronous itxs */
avl_tree_t i_async_tree; /* tree of foids for async itxs */
} itxs_t;
typedef struct itxg {
kmutex_t itxg_lock; /* lock for this structure */
uint64_t itxg_txg; /* txg for this chain */
uint64_t itxg_sod; /* total size on disk for this txg */
itxs_t *itxg_itxs; /* sync and async itxs */
} itxg_t;
/* for async nodes we build up an AVL tree of lists of async itxs per file */
typedef struct itx_async_node {
uint64_t ia_foid; /* file object id */
list_t ia_list; /* list of async itxs for this foid */
avl_node_t ia_node; /* AVL tree linkage */
} itx_async_node_t;
/*
* Vdev flushing: during a zil_commit(), we build up an AVL tree of the vdevs
* we've touched so we know which ones need a write cache flush at the end.
*/
typedef struct zil_vdev_node {
uint64_t zv_vdev; /* vdev to be flushed */
avl_node_t zv_node; /* AVL tree linkage */
} zil_vdev_node_t;
#define ZIL_PREV_BLKS 16
/*
* Stable storage intent log management structure. One per dataset.
*/
struct zilog {
kmutex_t zl_lock; /* protects most zilog_t fields */
struct dsl_pool *zl_dmu_pool; /* DSL pool */
spa_t *zl_spa; /* handle for read/write log */
const zil_header_t *zl_header; /* log header buffer */
objset_t *zl_os; /* object set we're logging */
zil_get_data_t *zl_get_data; /* callback to get object content */
zio_t *zl_root_zio; /* log writer root zio */
uint64_t zl_lr_seq; /* on-disk log record sequence number */
uint64_t zl_commit_lr_seq; /* last committed on-disk lr seq */
uint64_t zl_destroy_txg; /* txg of last zil_destroy() */
uint64_t zl_replayed_seq[TXG_SIZE]; /* last replayed rec seq */
uint64_t zl_replaying_seq; /* current replay seq number */
uint32_t zl_suspend; /* log suspend count */
kcondvar_t zl_cv_writer; /* log writer thread completion */
kcondvar_t zl_cv_suspend; /* log suspend completion */
uint8_t zl_suspending; /* log is currently suspending */
uint8_t zl_keep_first; /* keep first log block in destroy */
uint8_t zl_replay; /* replaying records while set */
uint8_t zl_stop_sync; /* for debugging */
uint8_t zl_writer; /* boolean: write setup in progress */
uint8_t zl_logbias; /* latency or throughput */
uint8_t zl_sync; /* synchronous or asynchronous */
int zl_parse_error; /* last zil_parse() error */
uint64_t zl_parse_blk_seq; /* highest blk seq on last parse */
uint64_t zl_parse_lr_seq; /* highest lr seq on last parse */
uint64_t zl_parse_blk_count; /* number of blocks parsed */
uint64_t zl_parse_lr_count; /* number of log records parsed */
uint64_t zl_next_batch; /* next batch number */
uint64_t zl_com_batch; /* committed batch number */
kcondvar_t zl_cv_batch[2]; /* batch condition variables */
itxg_t zl_itxg[TXG_SIZE]; /* intent log txg chains */
list_t zl_itx_commit_list; /* itx list to be committed */
uint64_t zl_itx_list_sz; /* total size of records on list */
uint64_t zl_cur_used; /* current commit log size used */
list_t zl_lwb_list; /* in-flight log write list */
kmutex_t zl_vdev_lock; /* protects zl_vdev_tree */
avl_tree_t zl_vdev_tree; /* vdevs to flush in zil_commit() */
taskq_t *zl_clean_taskq; /* runs lwb and itx clean tasks */
avl_tree_t zl_bp_tree; /* track bps during log parse */
clock_t zl_replay_time; /* lbolt of when replay started */
uint64_t zl_replay_blks; /* number of log blocks replayed */
zil_header_t zl_old_header; /* debugging aid */
uint_t zl_prev_blks[ZIL_PREV_BLKS]; /* size - sector rounded */
uint_t zl_prev_rotor; /* rotor for zl_prev[] */
txg_node_t zl_dirty_link; /* protected by dp_dirty_zilogs list */
};
typedef struct zil_bp_node {
dva_t zn_dva;
avl_node_t zn_node;
} zil_bp_node_t;
#define ZIL_MAX_LOG_DATA (SPA_MAXBLOCKSIZE - sizeof (zil_chain_t) - \
sizeof (lr_write_t))
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ZIL_IMPL_H */
|
#include <errno.h>
#include <libgen.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#include "encode.h"
#include "giles.h"
#include "misc.h"
#define directory "~/music/test"
struct encode_tracks_thread_arguments {
GtkWidget *progress_bar;
int num_tracks;
struct wav_to_encode **wav_list;
pthread_mutex_t *wav_list_mutex;
pthread_cond_t *new_wav_cond;
};
static void *encode_tracks_thread_func(void *data);
/**
* A function that launches a thread that encodes the requested tracks from the
* disc. Note that the function will launch the thread but will not wait for it
* to finish before returning.
*
* @param progress_bar a GtkProgressBar that the encoding thread should update
* as it encodes
* @param num_tracks the total number of tracks on the disc
* @param wav_list a list that WAV files ready for encoding will be stored in
* @param wav_list_mutex a mutex that must be locked before accessing wav_list
* @param new_wav_cond a cond that will be signalled when a new WAV is ready
*/
void encode_tracks_thread(GtkWidget *progress_bar, int num_tracks, struct wav_to_encode **wav_list, pthread_mutex_t *wav_list_mutex, pthread_cond_t *new_wav_cond) {
struct encode_tracks_thread_arguments *args = malloc(sizeof(struct encode_tracks_thread_arguments));
args->progress_bar = progress_bar;
args->num_tracks = num_tracks;
args->wav_list = wav_list;
args->wav_list_mutex = wav_list_mutex;
args->new_wav_cond = new_wav_cond;
pthread_t encoding_thread;
pthread_attr_t encoding_thread_attrs;
pthread_attr_init(&encoding_thread_attrs);
pthread_attr_setdetachstate(&encoding_thread_attrs, PTHREAD_CREATE_DETACHED);
pthread_create(&encoding_thread, &encoding_thread_attrs, encode_tracks_thread_func, args);
}
/**
* An entry function for a thread that encodes tracks from a disc.
*
* @param data a pointer to a struct encode_tracks_thread_arguments that
* contains the parameters for the thread
*
* @return NULL
*/
static void *encode_tracks_thread_func(void *data) {
struct encode_tracks_thread_arguments *args = (struct encode_tracks_thread_arguments *) data;
GtkWidget *progress_bar = args->progress_bar;
int num_tracks = args->num_tracks;
struct wav_to_encode **wav_list = args->wav_list;
pthread_mutex_t *wav_list_mutex = args->wav_list_mutex;
pthread_cond_t *new_wav_cond = args->new_wav_cond;
double frac_completed = 0.0;
char *progress_bar_text = malloc(BUFSIZ);
char mp3_filename_format[PATH_MAX];
char mp3_filename[PATH_MAX];
char expanded_directory[PATH_MAX];
if ((directory[0] == '~') && (directory[1] == '/')) {
snprintf(expanded_directory, PATH_MAX, "%s/%s", getenv("HOME"), directory + 1);
} else {
strcpy(expanded_directory, directory);
}
int i;
snprintf(mp3_filename_format, PATH_MAX, "%s/%%s/%%s/%%s - %%s.mp3", expanded_directory);
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), frac_completed);
snprintf(progress_bar_text, BUFSIZ, "0 of %d tracks encoded", num_tracks);
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress_bar), progress_bar_text);
struct wav_to_encode *encode_me;
for (i = 0; ; i++) {
pthread_mutex_lock(wav_list_mutex);
if (wav_list[i] == NULL) {
pthread_cond_wait(new_wav_cond, wav_list_mutex);
}
encode_me = wav_list[i];
pthread_mutex_unlock(wav_list_mutex);
if (encode_me->done) {
free(encode_me);
break;
}
char *artist_no_slash = replace_all(encode_me->artist, '/', '-');
char *album_no_slash = replace_all(encode_me->album, '/', '-');
char *track_num_no_slash = replace_all(encode_me->track_num, '/', '-');
char *track_title_no_slash = replace_all(encode_me->track_title, '/', '-');
char *dirname_str;
pid_t child_pid;
snprintf(mp3_filename, PATH_MAX, mp3_filename_format, artist_no_slash, album_no_slash, track_num_no_slash, track_title_no_slash);
dirname_str = strdup(mp3_filename);
dirname(dirname_str);
mkdir_p(dirname_str);
child_pid = fork();
if (child_pid < 0) {
perror("giles: Failed to fork to execute lame");
return NULL;
} else if (child_pid == 0) {
execlp("lame", "lame", "--tt", encode_me->track_title, "--ta", encode_me->artist, "--tl", encode_me->album, "--tn", encode_me->track_num, encode_me->wav_filename, mp3_filename, NULL);
perror("giles: Failed to execute lame");
return NULL;
} else {
waitpid(child_pid, NULL, 0);
}
/* Delete the source WAV file */
if (unlink(encode_me->wav_filename) != 0) {
fprintf(stderr, "giles: Failed to delete source file %s: %s\n", encode_me->wav_filename, strerror(errno));
}
/* Update progress */
frac_completed = (double) (i+1) / (double) num_tracks;
DPRINTF ("Fraction of work completed: %f\n", frac_completed);
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), frac_completed);
snprintf(progress_bar_text, BUFSIZ, "%d of %d tracks encoded", i+1, num_tracks);
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress_bar), progress_bar_text);
free(encode_me);
free(artist_no_slash);
free(album_no_slash);
free(track_num_no_slash);
free(track_title_no_slash);
}
return NULL;
}
|
/**
* @file sha384.c
* @brief SHA-384 (Secure Hash Algorithm 384)
*
* @section License
*
* Copyright (C) 2010-2013 Oryx Embedded. All rights reserved.
*
* This file is part of CycloneCrypto Open.
*
* 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.
*
* @section Description
*
* SHA-384 is a secure hash algorithm for computing a condensed representation
* of an electronic message. Refer to FIPS 180-4 for more details
*
* @author Oryx Embedded (www.oryx-embedded.com)
* @version 1.3.8
**/
//Switch to the appropriate trace level
#define TRACE_LEVEL CRYPTO_TRACE_LEVEL
//Dependencies
#include <string.h>
#include "crypto.h"
#include "sha384.h"
//Check crypto library configuration
#if (SHA384_SUPPORT == ENABLED)
//SHA-384 object identifier (2.16.840.1.101.3.4.2.2)
static const uint8_t sha384Oid[] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02};
//Common interface for hash algorithms
const HashAlgo sha384HashAlgo =
{
"SHA-384",
sha384Oid,
sizeof(sha384Oid),
sizeof(Sha384Context),
SHA384_BLOCK_SIZE,
SHA384_DIGEST_SIZE,
(HashAlgoCompute) sha384Compute,
(HashAlgoInit) sha384Init,
(HashAlgoUpdate) sha384Update,
(HashAlgoFinal) sha384Final
};
/**
* @brief Digest a message using SHA-384
* @param[in] data Pointer to the message being hashed
* @param[in] length Length of the message
* @param[out] digest Pointer to the calculated digest
* @return Error code
**/
error_t sha384Compute(const void *data, size_t length, uint8_t *digest)
{
//Allocate a memory buffer to hold the SHA-384 context
Sha384Context *context = osMemAlloc(sizeof(Sha384Context));
//Failed to allocate memory?
if(!context) return ERROR_OUT_OF_MEMORY;
//Initialize the SHA-384 context
sha384Init(context);
//Digest the message
sha384Update(context, data, length);
//Finalize the SHA-384 message digest
sha384Final(context, digest);
//Free previously allocated memory
osMemFree(context);
//Successful processing
return NO_ERROR;
}
/**
* @brief Initialize SHA-384 message digest context
* @param[in] context Pointer to the SHA-384 context to initialize
**/
void sha384Init(Sha384Context *context)
{
//Set initial hash value
context->h[0] = 0xCBBB9D5DC1059ED8;
context->h[1] = 0x629A292A367CD507;
context->h[2] = 0x9159015A3070DD17;
context->h[3] = 0x152FECD8F70E5939;
context->h[4] = 0x67332667FFC00B31;
context->h[5] = 0x8EB44A8768581511;
context->h[6] = 0xDB0C2E0D64F98FA7;
context->h[7] = 0x47B5481DBEFA4FA4;
//Number of bytes in the buffer
context->size = 0;
//Total length of the message
context->totalSize = 0;
}
/**
* @brief Update the SHA-384 context with a portion of the message being hashed
* @param[in] context Pointer to the SHA-384 context
* @param[in] data Pointer to the buffer being hashed
* @param[in] length Length of the buffer
**/
void sha384Update(Sha384Context *context, const void *data, size_t length)
{
//The function is defined in the exact same manner as SHA-512
sha512Update(context, data, length);
}
/**
* @brief Finish the SHA-384 message digest
* @param[in] context Pointer to the SHA-384 context
* @param[out] digest Calculated digest (optional parameter)
**/
void sha384Final(Sha384Context *context, uint8_t *digest)
{
//The function is defined in the exact same manner as SHA-512
sha512Final(context, NULL);
//Copy the resulting digest
if(digest != NULL)
memcpy(digest, context->digest, SHA384_DIGEST_SIZE);
}
#endif
|
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkInformationKeyVectorKey.h,v $
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 vtkInformationKeyVectorKey - Key for vector-of-keys values.
// .SECTION Description
// vtkInformationKeyVectorKey is used to represent keys for
// vector-of-keys values in vtkInformation.
#ifndef __vtkInformationKeyVectorKey_h
#define __vtkInformationKeyVectorKey_h
#include "vtkInformationKey.h"
#include "vtkCommonInformationKeyManager.h" // Manage instances of this type.
class VTK_COMMON_EXPORT vtkInformationKeyVectorKey : public vtkInformationKey
{
public:
vtkTypeRevisionMacro(vtkInformationKeyVectorKey,vtkInformationKey);
void PrintSelf(ostream& os, vtkIndent indent);
vtkInformationKeyVectorKey(const char* name, const char* location);
~vtkInformationKeyVectorKey();
// Description:
// Get/Set the value associated with this key in the given
// information object.
void Append(vtkInformation* info, vtkInformationKey* value);
void AppendUnique(vtkInformation* info, vtkInformationKey* value);
void Set(vtkInformation* info, vtkInformationKey** value, int length);
void RemoveItem(vtkInformation* info, vtkInformationKey* value);
vtkInformationKey** Get(vtkInformation* info);
vtkInformationKey* Get(vtkInformation* info, int idx);
void Get(vtkInformation* info, vtkInformationKey** value);
int Length(vtkInformation* info);
int Has(vtkInformation* info);
// Description:
// Copy the entry associated with this key from one information
// object to another. If there is no entry in the first information
// object for this key, the value is removed from the second.
virtual void ShallowCopy(vtkInformation* from, vtkInformation* to);
// Description:
// Print the key's value in an information object to a stream.
virtual void Print(ostream& os, vtkInformation* info);
private:
vtkInformationKeyVectorKey(const vtkInformationKeyVectorKey&); // Not implemented.
void operator=(const vtkInformationKeyVectorKey&); // Not implemented.
};
#endif
|
/* CS3 header file.
*
* Copyright 2007 CodeSourcery
* Version:Sourcery G++ 4.2-62
* BugURL:https://support.codesourcery.com/GNUToolchain/
*/
#ifndef CSL_CS3_H
#define CSL_CS3_H
#include <stddef.h>
#if __cplusplus
extern "C" {
#endif
typedef unsigned char __cs3_byte_align8 __attribute((aligned(8)));
struct __cs3_region {
unsigned flags; /* Flags for this region. None defined yet. */
__cs3_byte_align8 *init; /* Initial contents of this region. */
__cs3_byte_align8 *data; /* Start address of region. */
size_t init_size; /* Size of initial data. */
size_t zero_size; /* Additional size to be zeroed. */
};
/* number of elements in __cs3_regions */
extern const char __cs3_region_num __attribute__ ((weak));
#define __cs3_region_num ((size_t)&__cs3_region_num)
extern const struct __cs3_region __cs3_regions[];
extern void __cs3_start_c(void) __attribute((noreturn));
/* regions, some may not be present on particular boards or profiles */
/* We use weak on objects that might be at address zero.
The compiler is at liberty to presume that no non-weak
object resides at address zero (because that's
indistinguishable from the NULL pointer on the systems
we care about). */
/* ram region */
extern unsigned char __cs3_region_start_ram[]
__attribute__ ((weak, aligned(8)));
extern unsigned char __cs3_region_size_ram[]
__attribute__ ((aligned(8)));
/* __cs3_region_end_ram is deprecated */
extern unsigned char __cs3_region_end_ram[]
__attribute__ ((weak, aligned(8)));
extern const unsigned char __cs3_region_init_ram[]
__attribute__ ((weak, aligned(8)));
extern const char __cs3_region_init_size_ram
__attribute__ ((weak, aligned(8)));
#define __cs3_region_init_size_ram ((size_t)&__cs3_region_init_size_ram)
extern const char __cs3_region_zero_size_ram
__attribute__ ((weak, aligned(8)));
#define __cs3_region_zero_size_ram ((size_t)&__cs3_region_zero_size_ram)
/* rom region */
extern unsigned char __cs3_region_start_rom[]
__attribute__ ((weak, aligned(8)));
extern unsigned char __cs3_region_size_rom[]
__attribute__ ((aligned(8)));
/* __cs3_region_end_rom is deprecated */
extern unsigned char __cs3_region_end_rom[]
__attribute__ ((weak, aligned(8)));
extern const unsigned char __cs3_region_init_rom[]
__attribute__ ((weak, aligned(8)));
extern const char __cs3_region_init_size_rom
__attribute__ ((weak, aligned(8)));
#define __cs3_region_init_size_rom ((size_t)&__cs3_region_init_size_rom)
extern const char __cs3_region_zero_size_rom
__attribute__ ((weak, aligned(8)));
#define __cs3_region_zero_size_rom ((size_t)&__cs3_region_zero_size_rom)
#if __cplusplus
}
#endif
#endif /* CSL_CS3_H */
|
/*
* ntddscsi.h
*
* SCSI port IOCTL interface.
*
* This file is part of the w32api package.
*
* Contributors:
* Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef __NTDDSCSI_H
#define __NTDDSCSI_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include "ntddk.h"
#define DD_SCSI_DEVICE_NAME "\\Device\\ScsiPort"
#define DD_SCSI_DEVICE_NAME_U L"\\Device\\ScsiPort"
#define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
#define IOCTL_SCSI_GET_INQUIRY_DATA \
CTL_CODE(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCSI_GET_CAPABILITIES \
CTL_CODE(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCSI_GET_ADDRESS \
CTL_CODE(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCSI_MINIPORT \
CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_SCSI_PASS_THROUGH \
CTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_SCSI_PASS_THROUGH_DIRECT \
CTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_SCSI_RESCAN_BUS \
CTL_CODE(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS)
DEFINE_GUID(ScsiRawInterfaceGuid, \
0x53f56309L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(WmiScsiAddressGuid, \
0x53f5630fL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
typedef struct _SCSI_PASS_THROUGH {
USHORT Length;
UCHAR ScsiStatus;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
UCHAR CdbLength;
UCHAR SenseInfoLength;
UCHAR DataIn;
ULONG DataTransferLength;
ULONG TimeOutValue;
ULONG_PTR DataBufferOffset;
ULONG SenseInfoOffset;
UCHAR Cdb[16];
} SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH;
typedef struct _SCSI_PASS_THROUGH_DIRECT {
USHORT Length;
UCHAR ScsiStatus;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
UCHAR CdbLength;
UCHAR SenseInfoLength;
UCHAR DataIn;
ULONG DataTransferLength;
ULONG TimeOutValue;
PVOID DataBuffer;
ULONG SenseInfoOffset;
UCHAR Cdb[16];
} SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT;
typedef struct _SRB_IO_CONTROL {
ULONG HeaderLength;
UCHAR Signature[8];
ULONG Timeout;
ULONG ControlCode;
ULONG ReturnCode;
ULONG Length;
} SRB_IO_CONTROL, *PSRB_IO_CONTROL;
typedef struct _SCSI_ADDRESS {
ULONG Length;
UCHAR PortNumber;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
} SCSI_ADDRESS, *PSCSI_ADDRESS;
typedef struct _SCSI_BUS_DATA {
UCHAR NumberOfLogicalUnits;
UCHAR InitiatorBusId;
ULONG InquiryDataOffset;
}SCSI_BUS_DATA, *PSCSI_BUS_DATA;
typedef struct _SCSI_ADAPTER_BUS_INFO {
UCHAR NumberOfBuses;
SCSI_BUS_DATA BusData[1];
} SCSI_ADAPTER_BUS_INFO, *PSCSI_ADAPTER_BUS_INFO;
typedef struct _IO_SCSI_CAPABILITIES {
ULONG Length;
ULONG MaximumTransferLength;
ULONG MaximumPhysicalPages;
ULONG SupportedAsynchronousEvents;
ULONG AlignmentMask;
BOOLEAN TaggedQueuing;
BOOLEAN AdapterScansDown;
BOOLEAN AdapterUsesPio;
} IO_SCSI_CAPABILITIES, *PIO_SCSI_CAPABILITIES;
typedef struct _SCSI_INQUIRY_DATA {
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
BOOLEAN DeviceClaimed;
ULONG InquiryDataLength;
ULONG NextInquiryDataOffset;
UCHAR InquiryData[1];
} SCSI_INQUIRY_DATA, *PSCSI_INQUIRY_DATA;
#define SCSI_IOCTL_DATA_OUT 0
#define SCSI_IOCTL_DATA_IN 1
#define SCSI_IOCTL_DATA_UNSPECIFIED 2
typedef struct _DUMP_POINTERS {
PADAPTER_OBJECT AdapterObject;
PVOID MappedRegisterBase;
PVOID DumpData;
PVOID CommonBufferVa;
LARGE_INTEGER CommonBufferPa;
ULONG CommonBufferSize;
BOOLEAN AllocateCommonBuffers;
BOOLEAN UseDiskDump;
UCHAR Spare1[2];
PVOID DeviceObject;
} DUMP_POINTERS, *PDUMP_POINTERS;
#ifdef __cplusplus
}
#endif
#endif /* __NTDDSCSI_H */
|
/*
* dbcompat.h -- part of filesys.mod
* this header file contains old db formats which are
* needed or converting old dbs to the new format.
*
* Written for filedb3 by Fabian Knittel <fknittel@gmx.de>
*
* $Id: dbcompat.h,v 1.4 2000/01/17 22:36:08 fabian Exp $
*/
/*
* Copyright (C) 1999, 2000 Eggheads
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _EGG_MOD_FILESYS_DBCOMPAT_H
#define _EGG_MOD_FILESYS_DBCOMPAT_H
/*
* DB entry structures for v1 and v2
*/
/* Structure for file database (per directory) */
struct filler1 {
char xxx[1 + 61 + 301 + 10 + 11 + 61];
unsigned short int uuu[2];
time_t ttt[2];
unsigned int iii[2];
};
typedef struct {
char version;
unsigned short int stat; /* Misc */
time_t timestamp; /* Last time this db was updated */
char filename[61];
char desc[301]; /* Should be plenty */
char uploader[10]; /* Where this file came from */
unsigned char flags_req[11]; /* Access flags required */
time_t uploaded; /* Time it was uploaded */
unsigned int size; /* File length */
unsigned short int gots; /* Times the file was downloaded */
char sharelink[61]; /* Points to where? */
char unused[512 - sizeof(struct filler1)];
} filedb1;
struct filler2 {
char xxx[1 + 61 + 186 + 81 + 33 + 22 + 61];
unsigned short int uuu[2];
time_t ttt[2];
unsigned int iii[1];
};
typedef struct {
char version;
unsigned short int stat; /* Misc */
time_t timestamp; /* Last time this db was updated */
char filename[61];
char desc[186]; /* Should be plenty - shrink it, we
* Need the space :) */
char chname[81]; /* Channel for chan spec stuff */
char uploader[33]; /* Where this file came from */
char flags_req[22]; /* Access flags required */
time_t uploaded; /* Time it was uploaded */
unsigned int size; /* File length */
unsigned short int gots; /* Times the file was downloaded */
char sharelink[61]; /* Points to where? */
char unused[512 - sizeof(struct filler2)];
} filedb2;
/*
* Prototypes
*/
static int convert_old_db(FILE **fdb, char *s);
static int convert_old_files(char *npath, char *s);
#endif /* _EGG_MOD_FILESYS_DBCOMPAT.H */
|
/* This file is part of the KDE project
Copyright 2008 Johannes Simon <johannes.simon@gmail.com>
Copyright (C) 2010 Carlos Licea <carlos@kdab.com>
Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
Contact: Suresh Chande suresh.chande@nokia.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KCHART_KDCHARTMODEL_H
#define KCHART_KDCHARTMODEL_H
// Qt
#include <QAbstractItemModel>
// KChart
#include "ChartShape.h"
namespace KChart {
/**
* Takes a list of DataSet's and compiles them into a
* QAbstractItemModel for use with KDChart.
*
* Data sets in this model are aligned column-wise. Each column
* occupies dimension() columns. For example, for an X/Y chart,
* the data of this model would be structured as follows:
*
* Brush 0 Brush 1
* Pen 0 Pen 1
* Label 0 Label 1
* -----------|------|------|------|------|
* Category 1 | x0,0 | y0,0 | x1,0 | x1,0 |
* -----------|------|------|------|------|
* Category 2 | x0,1 | y0,1 | x1,1 | x1,1 |
* -----------|------|------|------|------|
* Category 3 | x0,2 | y0,2 | x1,2 | x1,2 |
* -----------|------|------|------|------|
*
*/
/**
* Note on data directions in KDChart's models:
*
* For circular (polar) charts, items shown in the legend should not be the
* data set labels, but the category labels instead. For example, a pie chart
* contains exactly one data set (if there's more series in the table, they are
* ignored). Obviously showing the title of the data set wouldn't be very useful
* in the legend. So the categories are shown instead.
*
* Since KDChart extracts the legend items from horizontal header data (the headers
* in each column) data sets have to be inserted row-wise instead of column-wise for
* these charts. To do so, KDChartModel::setDataDirection(Qt::Horizontal) is used.
*
* In all other cases, we show the data set labels in the legend. Therefore we insert
* data sets column-wise, which is done by calling setDataDirection(Qt::Vertical).
*/
class KDChartModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit KDChartModel(PlotArea *plotArea, QObject *parent = 0);
~KDChartModel();
enum DataRole {
XDataRole,
YDataRole,
ZDataRole,
LabelDataRole,
CategoryDataRole,
CustomDataRole,
BrushDataRole,
PenDataRole,
PieAttributesRole,
DataValueAttributesRole
};
/**
* Specifies in what direction a data set 'points'. More specifically,
* if the data direction is Qt::Vertical, a data set occupies one
* column (in case only one data dimension is being used).
*
* See "Note on data directions in KDChart's models" above.
*/
void setDataDirection(Qt::Orientation direction);
/**
* See \a setDataDirection
*/
Qt::Orientation dataDirection() const;
/**
* Returns the opposite of dataDirection().
*/
Qt::Orientation categoryDirection() const;
public Q_SLOTS:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
void slotColumnsInserted(const QModelIndex& parent, int start, int end);
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
void setDataDimensions(int dataDimensions);
int dataDimensions() const;
void addDataSet(DataSet *dataSet);
void removeDataSet(DataSet *dataSet, bool silent = false);
QList<DataSet*> dataSets() const;
/**
* Called by DataSet whenever a property that is global to all its data
* points changes, e.g. its label or its pen
*/
void dataSetChanged(DataSet *dataSet);
/**
* Called by DataSet whenever one or more of its data points changes,
* e.g. the x value of a data point.
*
* FIXME: @a role doesn't make sense here, it's not needed for emitting
* the dataChanged() signal. Removing it would conflict with
* dataSetChanged(DataSet*), that's why it's still there.
*
* @param first First data point that changed. If -1 it is assumed that
* all data points in this series changed.
* @param last Last data point that changed. If -1 it is assumed that
* only a single data point changed.
*/
void dataSetChanged(DataSet *dataSet, DataRole role, int first = -1, int last = -1);
/**
* Called by DataSet when the total number of data points it has changed.
*/
void dataSetSizeChanged(DataSet *dataSet, int newSize);
private:
class Private;
Private *const d;
};
} // namespace KChart
#endif // KCHART_KDCHARTMODEL_H
|
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2006 by Thom Johansen
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "config.h"
#include "system.h"
#include <stdio.h>
#include "lcd.h"
#include "font.h"
#include "gcc_extensions.h"
#include <get_sp.h>
#include <backtrace.h>
static const char* const uiename[] = {
"Undefined instruction",
"Prefetch abort",
"Data abort",
"Divide by zero",
"SWI"
};
void __attribute__((weak,naked)) data_abort_handler(void)
{
asm volatile(
"sub r0, lr, #8 \n"
"mov r1, #2 \n"
"b UIE \n"
);
}
void __attribute__((weak,naked)) software_int_handler(void)
{
asm volatile(
"sub r0, lr, #4 \n"
"mov r1, #4 \n"
"b UIE \n"
);
}
void __attribute__((weak,naked)) reserved_handler(void)
{
asm volatile(
"sub r0, lr, #4 \n"
"mov r1, #4 \n"
"b UIE \n"
);
}
void __attribute__((weak,naked)) prefetch_abort_handler(void)
{
asm volatile(
"sub r0, lr, #4 \n"
"mov r1, #1 \n"
"b UIE \n"
);
}
void __attribute__((weak,naked)) undef_instr_handler(void)
{
asm volatile(
"sub r0, lr, #4 \n"
#ifdef USE_THUMB
"mrs r1, spsr \n"
"tst r1, #(1 << 5) \n" // T bit set ?
"subne r0, lr, #2 \n" // if yes, offset to THUMB instruction
#endif
"mov r1, #0 \n"
"b UIE \n"
);
}
/* Unexpected Interrupt or Exception handler. Currently only deals with
exceptions, but will deal with interrupts later.
*/
void NORETURN_ATTR UIE(unsigned int pc, unsigned int num)
{
/* safe guard variable - we call backtrace() only on first
* UIE call. This prevent endless loop if backtrace() touches
* memory regions which cause abort
*/
static bool triggered = false;
#if LCD_DEPTH > 1
lcd_set_backdrop(NULL);
lcd_set_drawmode(DRMODE_SOLID);
lcd_set_foreground(LCD_BLACK);
lcd_set_background(LCD_WHITE);
#endif
unsigned line = 0;
lcd_setfont(FONT_SYSFIXED);
lcd_set_viewport(NULL);
lcd_clear_display();
lcd_putsf(0, line++, "%s at %08x" IF_COP(" (%d)"), uiename[num], pc IF_COP(, CURRENT_CORE));
#if !defined(CPU_ARM7TDMI) && (CONFIG_CPU != RK27XX) /* arm7tdmi has no MPU/MMU */
if(num == 1 || num == 2) /* prefetch / data abort */
{
register unsigned status;
#if ARM_ARCH >= 6
/* ARMv6 has 2 different registers for prefetch & data aborts */
if(num == 1) /* instruction prefetch abort */
asm volatile( "mrc p15, 0, %0, c5, c0, 1\n" : "=r"(status));
else
#endif
asm volatile( "mrc p15, 0, %0, c5, c0, 0\n" : "=r"(status));
lcd_putsf(0, line++, "FSR 0x%x", status);
unsigned int domain = (status >> 4) & 0xf;
unsigned int fault = status & 0xf;
#if ARM_ARCH >= 6
fault |= (status & (1<<10)) >> 6; /* fault is 5 bits on armv6 */
#endif
lcd_putsf(0, line++, "(domain %d, fault %d)", domain, fault);
if(num == 2) /* data abort */
{
register unsigned address;
/* read FAR (fault address register) */
asm volatile( "mrc p15, 0, %0, c6, c0\n" : "=r"(address));
lcd_putsf(0, line++, "address 0x%8x", address);
#if ARM_ARCH >= 6
lcd_putsf(0, line++, (status & (1<<11)) ? "(write)" : "(read)");
#endif
}
} /* num == 1 || num == 2 // prefetch/data abort */
#endif /* !defined(CPU_ARM7TDMI */
if (!triggered)
{
triggered = true;
backtrace(pc, __get_sp(), &line);
}
lcd_update();
disable_interrupt(IRQ_FIQ_STATUS);
system_exception_wait(); /* If this returns, try to reboot */
system_reboot();
while (1); /* halt */
}
/* Needs to be here or gcc won't find it */
void __attribute__((naked)) __div0(void)
{
asm volatile (
"ldr r0, [sp] \r\n"
"sub r0, r0, #4 \r\n"
"mov r1, #3 \r\n"
"b UIE \r\n"
);
}
|
/*
* filereader.h
* PhyC
*
* Created by Mathieu Fourment on 12/14/11.
* Copyright (C) 2016 Mathieu Fourment. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _FILE_READER_H_
#define _FILE_READER_H_
#include <stdio.h>
#include "mstring.h"
struct _FileReader;
typedef struct _FileReader FileReader;
struct _FileReader {
FILE *file;
StringBuffer *buffer;
char *line;
char b[513];
size_t index;
bool (*read_line)( FileReader * );
};
FileReader * new_FileReader( const char *filename, const unsigned buffer_size );
FileReader * new_FileReader_with_mode( const char *filename, const unsigned buffer_size, const char *mode );
void free_FileReader( FileReader *reader );
double ** FileReader_csv_double( const char *filename, int nrow, int ncol );
char* load_file(const char *filename);
#endif
|
/** \file src/arch/gtk3/widgets/plus4digiblasterwidget.h
* \brief Widget to control Plus 4 DigiBlaster - header
*
* Written by
* Bas Wassink <b.wassink@ziggo.nl>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#ifndef VICE_PLUS4DIGIBLASTERWIDGET_H
#define VICE_PLUS4DIGIBLASTERWIDGET_H
#include "vice.h"
#include <gtk/gtk.h>
GtkWidget *plus4_digiblaster_widget_create(GtkWidget *parent);
#endif
|
/* packet-ssl.h
*
* $Id: packet-ssl.h 45866 2012-11-02 08:48:13Z etxrab $
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __PACKET_SSL_H__
#define __PACKET_SSL_H__
WS_VAR_IMPORT GHashTable *ssl_session_hash;
extern void ssl_dissector_add(guint port, const gchar *protocol, gboolean tcp);
extern void ssl_dissector_delete(guint port, const gchar *protocol, gboolean tcp);
extern void ssl_set_master_secret(guint32 frame_num, address *addr_srv, address *addr_cli,
port_type ptype, guint32 port_srv, guint32 port_cli,
guint32 version, gint cipher, const guchar *_master_secret,
const guchar *_client_random, const guchar *_server_random,
guint32 client_seq, guint32 server_seq);
extern gboolean ssl_ignore_mac_failed;
gchar* ssl_association_info(void);
#endif /* __PACKET_SSL_H__ */
|
* vars.h
* variable declarations
* generated by FormCalc 19 Oct 2012 11:33
#include "decl.h"
double precision S, T, T14, U, T24, S34
common /U23Gkinvars/ S, T, T14, U, T24, S34
integer Hel(5)
common /U23Gkinvars/ Hel
double complex F7, F10, F1, F3, F4, F2, F5, F6, F8, F9, F11
double complex F12, F13, F14, Pair1, Pair2, Pair3, Abb9, Abb1
double complex Abb2, Abb10, Abb11, Abb3, Abb4, Abb12, Abb13
double complex Abb5, Abb6, Abb7, Abb8, Abb14, AbbSum9
double complex AbbSum11, AbbSum12, AbbSum4, AbbSum2, AbbSum3
double complex AbbSum10, AbbSum18, AbbSum14, AbbSum13
double complex AbbSum16, AbbSum8, AbbSum6, AbbSum1, AbbSum17
double complex AbbSum7, AbbSum15, AbbSum5
common /U23Gabbrev/ F7, F10, F1, F3, F4, F2, F5, F6, F8, F9
common /U23Gabbrev/ F11, F12, F13, F14, Pair1, Pair2, Pair3
common /U23Gabbrev/ Abb9, Abb1, Abb2, Abb10, Abb11, Abb3, Abb4
common /U23Gabbrev/ Abb12, Abb13, Abb5, Abb6, Abb7, Abb8
common /U23Gabbrev/ Abb14, AbbSum9, AbbSum11, AbbSum12
common /U23Gabbrev/ AbbSum4, AbbSum2, AbbSum3, AbbSum10
common /U23Gabbrev/ AbbSum18, AbbSum14, AbbSum13, AbbSum16
common /U23Gabbrev/ AbbSum8, AbbSum6, AbbSum1, AbbSum17
common /U23Gabbrev/ AbbSum7, AbbSum15, AbbSum5
integer ij
common /U23Gindices/ ij
double complex MatSUN(4,4), Ctree(4), Cloop(4)
common /U23Gformfactors/ MatSUN, Ctree, Cloop
|
/*
* ModelCounter.h
*
* Created on: Oct 31, 2016
* Author: baki
*/
#ifndef SRC_SOLVER_MODELCOUNTER_H_
#define SRC_SOLVER_MODELCOUNTER_H_
#include <functional>
#include <ostream>
#include <sstream>
#include <string>
#include <vector>
#include <glog/logging.h>
#include "../cereal/types/vector.hpp"
#include "../theory/SymbolicCounter.h"
#include "../utils/Serialize.h"
namespace Vlab {
namespace Solver {
class ModelCounter {
public:
ModelCounter();
virtual ~ModelCounter();
void set_use_sign_integers(bool value);
void set_count_bound_exact(bool value);
void set_num_of_unconstraint_int_vars(int n);
void set_num_of_unconstraint_str_vars(int n);
void add_constant(int c);
void add_symbolic_counter(const Theory::SymbolicCounter& counter);
Theory::BigInteger CountInts(const unsigned long bound);
Theory::BigInteger CountStrs(const unsigned long bound);
Theory::BigInteger Count(const unsigned long int_bound, const unsigned long str_bound);
template <class Archive>
void save(Archive& ar) const {
ar(use_signed_integers_);
ar(unconstraint_int_vars_);
ar(unconstraint_str_vars_);
ar(constant_ints_);
ar(symbolic_counters_);
}
template <class Archive>
void load(Archive& ar) {
ar(use_signed_integers_);
ar(unconstraint_int_vars_);
ar(unconstraint_str_vars_);
ar(constant_ints_);
ar(symbolic_counters_);
}
std::string str() const;
friend std::ostream& operator<<(std::ostream& os, const ModelCounter& mc);
protected:
bool use_signed_integers_;
bool count_bound_exact_;
int unconstraint_int_vars_;
int unconstraint_str_vars_;
std::vector<int> constant_ints_;
std::vector<Theory::SymbolicCounter> symbolic_counters_;
};
} /* namespace Solver */
} /* namespace Vlab */
#endif /* SRC_SOLVER_MODELCOUNTER_H_ */
|
/**
* (C) 2007-2010 Alibaba Group Holding Limited.
*
* 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.
*
* Version: $Id$
*
* ob_lsync_server_main.h
*
* Authors:
* yuanqi.xhf <yuanqi.xhf@taobao.com>
*
*/
#ifndef __OCEANBASE_LSYNC_OB_LSYNC_SERVER_MAIN_H__
#define __OCEANBASE_LSYNC_OB_LSYNC_SERVER_MAIN_H__
#include "common/base_main.h"
#include "ob_lsync_server_param.h"
#include "ob_lsync_server.h"
namespace sb {
namespace lsync {
class ObLsyncServerMain : public common::BaseMain {
protected:
ObLsyncServerMain() {}
~ObLsyncServerMain() {}
protected:
virtual int do_work();
virtual void do_signal(const int sig);
virtual const char* parse_cmd_line(const int argc, char* const argv[]);
virtual void print_usage(const char* prog_name);
virtual void print_version();
public:
static ObLsyncServerMain* get_instance();
public:
const ObLsyncServer& get_lsync_server() const {
return server_;
}
ObLsyncServer& get_lsync_server() {
return server_;
}
private:
const char* app_name_;
int log_level_;
ObLsyncServerParam cmd_line_param_;
ObLsyncServerParam param_;
ObLsyncServer server_;
};
}
}
#endif //__OCEANBASE_LSYNC_OB_LSYNC_SERVER_MAIN_H__
|
/*
* linux/arch/sh/boards/sh03/rtc.c -- CTP/PCI-SH03 on-chip RTC support
*
* Copyright (C) 2004 Saito.K & Jeanne(ksaito@interface.co.jp)
*
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/bcd.h>
#include <linux/rtc.h>
#include <linux/spinlock.h>
#include <asm/io.h>
#include <asm/rtc.h>
#define RTC_BASE 0xb0000000
#define RTC_SEC1 (RTC_BASE + 0)
#define RTC_SEC10 (RTC_BASE + 1)
#define RTC_MIN1 (RTC_BASE + 2)
#define RTC_MIN10 (RTC_BASE + 3)
#define RTC_HOU1 (RTC_BASE + 4)
#define RTC_HOU10 (RTC_BASE + 5)
#define RTC_WEE1 (RTC_BASE + 6)
#define RTC_DAY1 (RTC_BASE + 7)
#define RTC_DAY10 (RTC_BASE + 8)
#define RTC_MON1 (RTC_BASE + 9)
#define RTC_MON10 (RTC_BASE + 10)
#define RTC_YEA1 (RTC_BASE + 11)
#define RTC_YEA10 (RTC_BASE + 12)
#define RTC_YEA100 (RTC_BASE + 13)
#define RTC_YEA1000 (RTC_BASE + 14)
#define RTC_CTL (RTC_BASE + 15)
#define RTC_BUSY 1
#define RTC_STOP 2
static DEFINE_SPINLOCK(sh03_rtc_lock);
unsigned long get_cmos_time(void)
{
unsigned int year, mon, day, hour, min, sec;
spin_lock(&sh03_rtc_lock);
again:
do {
sec = (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10;
min = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10;
hour = (__raw_readb(RTC_HOU1) & 0xf) + (__raw_readb(RTC_HOU10) & 0xf) * 10;
day = (__raw_readb(RTC_DAY1) & 0xf) + (__raw_readb(RTC_DAY10) & 0xf) * 10;
mon = (__raw_readb(RTC_MON1) & 0xf) + (__raw_readb(RTC_MON10) & 0xf) * 10;
year = (__raw_readb(RTC_YEA1) & 0xf) + (__raw_readb(RTC_YEA10) & 0xf) * 10
+ (__raw_readb(RTC_YEA100 ) & 0xf) * 100
+ (__raw_readb(RTC_YEA1000) & 0xf) * 1000;
} while (sec != (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10);
if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 ||
hour > 23 || min > 59 || sec > 59) {
printk(KERN_ERR
"SH-03 RTC: invalid value, resetting to 1 Jan 2000\n");
printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n",
year, mon, day, hour, min, sec);
__raw_writeb(0, RTC_SEC1); __raw_writeb(0, RTC_SEC10);
__raw_writeb(0, RTC_MIN1); __raw_writeb(0, RTC_MIN10);
__raw_writeb(0, RTC_HOU1); __raw_writeb(0, RTC_HOU10);
__raw_writeb(6, RTC_WEE1);
__raw_writeb(1, RTC_DAY1); __raw_writeb(0, RTC_DAY10);
__raw_writeb(1, RTC_MON1); __raw_writeb(0, RTC_MON10);
__raw_writeb(0, RTC_YEA1); __raw_writeb(0, RTC_YEA10);
__raw_writeb(0, RTC_YEA100);
__raw_writeb(2, RTC_YEA1000);
__raw_writeb(0, RTC_CTL);
goto again;
}
spin_unlock(&sh03_rtc_lock);
return mktime(year, mon, day, hour, min, sec);
}
void sh03_rtc_gettimeofday(struct timespec *tv)
{
tv->tv_sec = get_cmos_time();
tv->tv_nsec = 0;
}
static int set_rtc_mmss(unsigned long nowtime)
{
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
int i;
/* gets recalled with irq locally disabled */
spin_lock(&sh03_rtc_lock);
for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
if (!(__raw_readb(RTC_CTL) & RTC_BUSY))
break;
cmos_minutes = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10;
real_seconds = nowtime % 60;
real_minutes = nowtime / 60;
if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
real_minutes += 30; /* correct for half hour time zone */
real_minutes %= 60;
if (abs(real_minutes - cmos_minutes) < 30) {
__raw_writeb(real_seconds % 10, RTC_SEC1);
__raw_writeb(real_seconds / 10, RTC_SEC10);
__raw_writeb(real_minutes % 10, RTC_MIN1);
__raw_writeb(real_minutes / 10, RTC_MIN10);
} else {
<<<<<<< HEAD
printk_once(KERN_NOTICE
=======
printk(KERN_WARNING
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
"set_rtc_mmss: can't update from %d to %d\n",
cmos_minutes, real_minutes);
retval = -1;
}
spin_unlock(&sh03_rtc_lock);
return retval;
}
int sh03_rtc_settimeofday(const time_t secs)
{
unsigned long nowtime = secs;
return set_rtc_mmss(nowtime);
}
void sh03_time_init(void)
{
rtc_sh_get_time = sh03_rtc_gettimeofday;
rtc_sh_set_time = sh03_rtc_settimeofday;
}
|
/***************************************************************************
* *
* copyright : (C) 2007 The University of Toronto *
* netterfield@astro.utoronto.ca *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef APPLICATION_H
#define APPLICATION_H
#include <QPointer>
#include <QApplication>
#include "mainwindow.h"
#define kstApp \
(static_cast<Kst::Application*>(QCoreApplication::instance()))
namespace Kst {
class Application : public QApplication
{
Q_OBJECT
public:
Application(int &argc, char **argv);
virtual ~Application();
MainWindow *mainWindow() const;
private:
QPointer<MainWindow> _mainWindow;
};
}
#endif
// vim: ts=2 sw=2 et
|
//
// This file is part of the Catcierge project.
//
// Copyright (c) Joakim Soderberg 2013-2015
//
// Catcierge 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.
//
// Catcierge 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 Catcierge. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef __CATCIERGE_TIMER_H__
#define __CATCIERGE_TIMER_H__
#include "catcierge_util.h"
#include <time.h>
#ifdef _WIN32
#include "win32/gettimeofday.h"
#else
#include <unistd.h>
#include <sys/time.h>
#endif
typedef struct catcierge_timer_s
{
struct timeval start;
struct timeval end;
double timeout;
} catcierge_timer_t;
void catcierge_timer_reset(catcierge_timer_t *t);
int catcierge_timer_isactive(catcierge_timer_t *t);
void catcierge_timer_start(catcierge_timer_t *t);
double catcierge_timer_get(catcierge_timer_t *t);
void catcierge_timer_set(catcierge_timer_t *t, double timeout);
int catcierge_timer_has_timed_out(catcierge_timer_t *t);
#endif // __CATCIERGE_TIMER_H__
|
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <mach/hardware.h>
#include <asm/io.h>
static struct mtd_info *mymtd;
static struct map_info h720x_map = {
.name = "H720X",
.bankwidth = 4,
.size = H720X_FLASH_SIZE,
.phys = H720X_FLASH_PHYS,
};
static struct mtd_partition h720x_partitions[] = {
{
.name = "ArMon",
.size = 0x00080000,
.offset = 0,
.mask_flags = MTD_WRITEABLE
},{
.name = "Env",
.size = 0x00040000,
.offset = 0x00080000,
.mask_flags = MTD_WRITEABLE
},{
.name = "Kernel",
.size = 0x00180000,
.offset = 0x000c0000,
.mask_flags = MTD_WRITEABLE
},{
.name = "Ramdisk",
.size = 0x00400000,
.offset = 0x00240000,
.mask_flags = MTD_WRITEABLE
},{
.name = "jffs2",
.size = MTDPART_SIZ_FULL,
.offset = MTDPART_OFS_APPEND
}
};
#define NUM_PARTITIONS ARRAY_SIZE(h720x_partitions)
static int nr_mtd_parts;
static struct mtd_partition *mtd_parts;
static const char *probes[] = { "cmdlinepart", NULL };
static int __init h720x_mtd_init(void)
{
char *part_type = NULL;
h720x_map.virt = ioremap(h720x_map.phys, h720x_map.size);
if (!h720x_map.virt) {
printk(KERN_ERR "H720x-MTD: ioremap failed\n");
return -EIO;
}
simple_map_init(&h720x_map);
// Probe for flash bankwidth 4
printk (KERN_INFO "H720x-MTD probing 32bit FLASH\n");
mymtd = do_map_probe("cfi_probe", &h720x_map);
if (!mymtd) {
printk (KERN_INFO "H720x-MTD probing 16bit FLASH\n");
// Probe for bankwidth 2
h720x_map.bankwidth = 2;
mymtd = do_map_probe("cfi_probe", &h720x_map);
}
if (mymtd) {
mymtd->owner = THIS_MODULE;
#ifdef CONFIG_MTD_PARTITIONS
nr_mtd_parts = parse_mtd_partitions(mymtd, probes, &mtd_parts, 0);
if (nr_mtd_parts > 0)
part_type = "command line";
#endif
if (nr_mtd_parts <= 0) {
mtd_parts = h720x_partitions;
nr_mtd_parts = NUM_PARTITIONS;
part_type = "builtin";
}
printk(KERN_INFO "Using %s partition table\n", part_type);
add_mtd_partitions(mymtd, mtd_parts, nr_mtd_parts);
return 0;
}
iounmap((void *)h720x_map.virt);
return -ENXIO;
}
static void __exit h720x_mtd_cleanup(void)
{
if (mymtd) {
del_mtd_partitions(mymtd);
map_destroy(mymtd);
}
/* Free partition info, if commandline partition was used */
if (mtd_parts && (mtd_parts != h720x_partitions))
kfree (mtd_parts);
if (h720x_map.virt) {
iounmap((void *)h720x_map.virt);
h720x_map.virt = 0;
}
}
module_init(h720x_mtd_init);
module_exit(h720x_mtd_cleanup);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>");
MODULE_DESCRIPTION("MTD map driver for Hynix evaluation boards");
|
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/cpufreq.h>
#include <linux/timex.h>
#include <linux/io.h>
#include <asm/msr.h>
#define MMCR_BASE 0xfffef000 /* The default base address */
#define OFFS_CPUCTL 0x2 /* CPU Control Register */
static __u8 __iomem *cpuctl;
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"sc520_freq", msg)
#define PFX "sc520_freq: "
static struct cpufreq_frequency_table sc520_freq_table[] = {
{0x01, 100000},
{0x02, 133000},
{0, CPUFREQ_TABLE_END},
};
static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
{
u8 clockspeed_reg = *cpuctl;
switch (clockspeed_reg & 0x03) {
default:
printk(KERN_ERR PFX "error: cpuctl register has unexpected "
"value %02x\n", clockspeed_reg);
case 0x01:
return 100000;
case 0x02:
return 133000;
}
}
static void sc520_freq_set_cpu_state(unsigned int state)
{
struct cpufreq_freqs freqs;
u8 clockspeed_reg;
freqs.old = sc520_freq_get_cpu_frequency(0);
freqs.new = sc520_freq_table[state].frequency;
freqs.cpu = 0; /* AMD Elan is UP */
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
dprintk("attempting to set frequency to %i kHz\n",
sc520_freq_table[state].frequency);
local_irq_disable();
clockspeed_reg = *cpuctl & ~0x03;
*cpuctl = clockspeed_reg | sc520_freq_table[state].index;
local_irq_enable();
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
};
static int sc520_freq_verify(struct cpufreq_policy *policy)
{
return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]);
}
static int sc520_freq_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
unsigned int newstate = 0;
if (cpufreq_frequency_table_target(policy, sc520_freq_table,
target_freq, relation, &newstate))
return -EINVAL;
sc520_freq_set_cpu_state(newstate);
return 0;
}
static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
{
struct cpuinfo_x86 *c = &cpu_data(0);
int result;
/* capability check */
if (c->x86_vendor != X86_VENDOR_AMD ||
c->x86 != 4 || c->x86_model != 9)
return -ENODEV;
/* cpuinfo and default policy values */
policy->cpuinfo.transition_latency = 1000000; /* 1ms */
policy->cur = sc520_freq_get_cpu_frequency(0);
result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table);
if (result)
return result;
cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu);
return 0;
}
static int sc520_freq_cpu_exit(struct cpufreq_policy *policy)
{
cpufreq_frequency_table_put_attr(policy->cpu);
return 0;
}
static struct freq_attr *sc520_freq_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static struct cpufreq_driver sc520_freq_driver = {
.get = sc520_freq_get_cpu_frequency,
.verify = sc520_freq_verify,
.target = sc520_freq_target,
.init = sc520_freq_cpu_init,
.exit = sc520_freq_cpu_exit,
.name = "sc520_freq",
.owner = THIS_MODULE,
.attr = sc520_freq_attr,
};
static int __init sc520_freq_init(void)
{
struct cpuinfo_x86 *c = &cpu_data(0);
int err;
/* Test if we have the right hardware */
if (c->x86_vendor != X86_VENDOR_AMD ||
c->x86 != 4 || c->x86_model != 9) {
dprintk("no Elan SC520 processor found!\n");
return -ENODEV;
}
cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1);
if (!cpuctl) {
printk(KERN_ERR "sc520_freq: error: failed to remap memory\n");
return -ENOMEM;
}
err = cpufreq_register_driver(&sc520_freq_driver);
if (err)
iounmap(cpuctl);
return err;
}
static void __exit sc520_freq_exit(void)
{
cpufreq_unregister_driver(&sc520_freq_driver);
iounmap(cpuctl);
}
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Sean Young <sean@mess.org>");
MODULE_DESCRIPTION("cpufreq driver for AMD's Elan sc520 CPU");
module_init(sc520_freq_init);
module_exit(sc520_freq_exit);
|
#ifndef EMULATORLAUNCHER_H
#define EMULATORLAUNCHER_H
#include <QObject>
#include <QString>
#include <QHash>
#include <QPair>
#include <QList>
#include "EmulatorCore.h"
#include "EmulatorSettingsReader.h"
/******************************************************************************
* Author: Aaron Lindberg
* Class: EmulatorLauncher
* Created: 10/16/2013 Modified: 11/04/2013
*** OVERVIEW ***
* The buisness class to expose the c++ functionality of
* launching emulators with games, and managing emulator settings.
******************************************************************************/
class EmulatorLauncher: public QObject
{
Q_OBJECT
public:
/******************************************************************************
* Default Constructor
******************************************************************************/
EmulatorLauncher(QObject* parent = nullptr):QObject(parent){}
/******************************************************************************
* Destructor
*** OVERVIEW **
* Stops and deletes the emulator process if it exists, running or not.
******************************************************************************/
~EmulatorLauncher()
{}
/******************************************************************************
* start
*** OVERVIEW **
* Loads a specific emulator with a game.
*** INPUT **
* Takes a string of the emulator system type, the emulator python name, and
* the path to the game to load.
******************************************************************************/
Q_INVOKABLE void start(QString system,QString emuFile, QString game)
{mEmulatorCore.loadEmulator(mEmulatorDir + "/" + system,emuFile, mRomsDir + "/" +game);}
/******************************************************************************
* start
*** OVERVIEW **
* If no process is running start a new python file to load emulator launcher
* configuration, and command line arguments to send to the emulator.
*** INPUT **
* Takes a emulator systrm and path to the game.
******************************************************************************/
Q_INVOKABLE void start(const QString & system, const QString & game)
{mEmulatorCore.start(mEmulatorDir + "/" + system,mRomsDir + "/" +game);}
/******************************************************************************
* setRomsDir
*** OVERVIEW **
* Sets the path to all roms to launch.
*** INPUT **
* Take a QString by constant reference to set the executable path to.
******************************************************************************/
Q_INVOKABLE void setRomsDir(const QString& RomsDir)
{ mRomsDir = RomsDir;}
/******************************************************************************
* setEmulatorSystemDir
*** OVERVIEW **
* Sets the path to the emulator to launch.
*** INPUT **
* Take a QString by constant reference to set the executable path to.
******************************************************************************/
Q_INVOKABLE void setEmulatorSystemDir(const QString& EmuDir)
{mEmulatorDir = EmuDir;}
/******************************************************************************
* stop
*** OVERVIEW **
* Stops the emulator from running.
******************************************************************************/
Q_INVOKABLE void stop()
{
mEmulatorCore.stop();
}
Q_INVOKABLE void readSettings(QString system, QString emuPyFile)
{
mSettingsReader.ReadSettings(mEmulatorDir + "/" + system, emuPyFile);
}
signals:
void MultipleEmulatorsFound(QStringList emuList);
void NoEmulatorsFound(QString directory);
void BadPyDataProcessed(QString ErrMsg);
void SettingsLoaded(SettingsHash hash);
private:
QString mEmulatorDir;
QString mRomsDir;
EmulatorCore mEmulatorCore;
EmulatorSettingsReader mSettingsReader;
};
#endif
|
#ifndef simple_xAH_example_JetPlotsAlgo_H
#define simple_xAH_example_JetPlotsAlgo_H
#include <EventLoop/Algorithm.h>
// Infrastructure include(s):
#include "xAODRootAccess/Init.h"
#include "xAODRootAccess/TEvent.h"
#include "xAODRootAccess/TStore.h"
#include <xAODAnaHelpers/JetHists.h>
class JetPlotsAlgo : public EL::Algorithm
{
// put your configuration variables here as public variables.
// that way they can be set directly from CINT and python.
public:
// float cutValue;
// variables that don't get filled at submission time should be
// protected from being send from the submission node to the worker
// node (done by the //!)
public:
// Tree *myTree; //!
// TH1 *myHist; //!
bool m_debug;
std::string m_inContainerName;
std::string m_name;
std::string m_detailStr;
private:
xAOD::TEvent *m_event; //!
xAOD::TStore *m_store; //!
JetHists* m_plots; //!
public:
// this is a standard constructor
JetPlotsAlgo ();
// these are the functions inherited from Algorithm
virtual EL::StatusCode setupJob (EL::Job& job);
virtual EL::StatusCode fileExecute ();
virtual EL::StatusCode histInitialize ();
virtual EL::StatusCode changeInput (bool firstFile);
virtual EL::StatusCode initialize ();
virtual EL::StatusCode execute ();
virtual EL::StatusCode postExecute ();
virtual EL::StatusCode finalize ();
virtual EL::StatusCode histFinalize ();
// this is needed to distribute the algorithm to the workers
ClassDef(JetPlotsAlgo, 1);
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSYSTEMTRAYICON_H
#define QSYSTEMTRAYICON_H
#include <QtCore/qobject.h>
#ifndef QT_NO_SYSTEMTRAYICON
#include <QtGui/qicon.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
class QSystemTrayIconPrivate;
class QMenu;
class QEvent;
class QWheelEvent;
class QMouseEvent;
class QPoint;
class Q_GUI_EXPORT QSystemTrayIcon : public QObject
{
Q_OBJECT
Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip)
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible DESIGNABLE false)
public:
QSystemTrayIcon(QObject *parent = 0);
QSystemTrayIcon(const QIcon &icon, QObject *parent = 0);
~QSystemTrayIcon();
enum ActivationReason {
Unknown,
Context,
DoubleClick,
Trigger,
MiddleClick
};
#ifndef QT_NO_MENU
void setContextMenu(QMenu *menu);
QMenu *contextMenu() const;
#endif
QIcon icon() const;
void setIcon(const QIcon &icon);
QString toolTip() const;
void setToolTip(const QString &tip);
static bool isSystemTrayAvailable();
static bool supportsMessages();
enum MessageIcon { NoIcon, Information, Warning, Critical };
void showMessage(const QString &title, const QString &msg,
MessageIcon icon = Information, int msecs = 10000);
QRect geometry() const;
bool isVisible() const;
public Q_SLOTS:
void setVisible(bool visible);
inline void show() { setVisible(true); }
inline void hide() { setVisible(false); }
Q_SIGNALS:
void activated(QSystemTrayIcon::ActivationReason reason);
void messageClicked();
protected:
bool event(QEvent *event);
private:
Q_DISABLE_COPY(QSystemTrayIcon)
Q_DECLARE_PRIVATE(QSystemTrayIcon)
friend class QSystemTrayIconSys;
friend class QBalloonTip;
friend void qtsystray_sendActivated(QSystemTrayIcon *, int);
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QT_NO_SYSTEMTRAYICON
#endif // QSYSTEMTRAYICON_H
|
/* wlan-core-enumerate.h -- WLAN core enum commands
Copyright (C) 2000-2010, Nokia Corporation.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2.
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 ENUMERATE_H_
#define ENUMERATE_H_
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <getopt.h> /* getopt_long() */
#include <fcntl.h> /* low-level i/o */
#include <unistd.h>
#include <errno.h>
#include <malloc.h>
#include <sys/stat.h>
#include "wlan-core-definitions.h"
// --------------Test cases ------------
int enum_hardware(wlan_core_data* data);
int enum_features(wlan_core_data* data);
#endif /*ENUMERATE_H_*/
|
/**********************************************************************
*
* Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful but, except
* as otherwise stated in writing, without any warranty; without even the
* implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifndef MBXACCESS_MEMWRAPPER_TYPE_H
#define MBXACCESS_MEMWRAPPER_TYPE_H
typedef struct MBXUserDataForHostFlushCpuCacheAreaTag
{
void* vma;
IMG_UINT32 start;
IMG_UINT32 end;
IMG_UINT32 flags;
int err;
} MBXUserDataForHostFlushCpuCacheArea;
typedef struct MBXUserDataForPVRSRVFlushCpuCacheKMTag
{
IMG_UINT32 address;
IMG_UINT32 lengthBytes;
IMG_UINT32 flags;
int err;
} MBXUserDataForPVRSRVFlushCpuCacheKM;
#endif
|
/* irccmp.c: rfc1459-compliant string matching
*
* This code is heavily based on code from src/match.c in ircd-hybrid.
*
* Copyright (C) 1990 Jarkko Oikarinen
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef lint
static const char rcsid[] = "$Id: irccmp.c,v 1.4 2003/12/17 07:52:14 wcc Exp $";
#endif
#include "irccmp.h"
static const unsigned char ToLowerTab[] = {
0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f,
' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')',
'*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
':', ';', '<', '=', '>', '?',
'@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',
'_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',
0x7f,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
};
static const unsigned char ToUpperTab[] = {
0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f,
' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')',
'*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^',
0x5f,
'`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^',
0x7f,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
};
/* Case insensitive comparison of two terminated strings.
*
* 0 - s1 is equal to s2
* <0 - s1 is lexicographically less than s2
* >0 - s1 is lexicographically greater than s2
*/
int irccmp(const char *s1, const char *s2)
{
const unsigned char *str1 = (const unsigned char *) s1, *str2 = (const unsigned char *) s2;
int res;
while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0) {
if (*str1 == '\0') return(0);
str1++;
str2++;
}
return(res);
}
/* Case insensitive comparison of two terminated strings up to length 'n'.
*
* 0 - s1 is equal to s2
* <0 - s1 is lexicographically less than s2
* >0 - s1 is lexicographically greater than s2
*/
int ircncmp(const char* s1, const char *s2, int n)
{
const unsigned char *str1 = (const unsigned char *) s1, *str2 = (const unsigned char *) s2;
int res;
while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0) {
str1++;
str2++;
n--;
if (n == 0 || (*str1 == '\0' && *str2 == '\0')) return(0);
}
return(res);
}
|
/*
* $Id: glob.c,v 1.16 2008-07-27 03:18:38 haley Exp $
*/
/************************************************************************
* *
* Copyright (C) 2000 *
* University Corporation for Atmospheric Research *
* All Rights Reserved *
* *
* The use of this Software is governed by a License Agreement. *
* *
************************************************************************/
/*
* glob.c
*
* Author John Clyne
*
* Date Mon Apr 23 13:07:50 MDT 1990
*
* perform filname expansion on a string using the shell
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ncarg/c.h>
#include "glob.h"
static int to_child[2],
to_parent[2]; /* pipes for talking to spawned process */
static char ackString[80];
const char Magic[] = "NCARG_GRAPHICS_MAGIC_COOKIE";
const int magicLen = (sizeof(Magic) / sizeof(Magic[0]));
#define SMALL_MALLOC_BLOCK 10
/*
* talkto
* [internal]
*
* set up communictions between invoking process and the desired
* command; stderr of command is sent to /dev/null
* on entry
* **argv : name of command to talk to
* on exit
* to_child[1] : fd for writing to spawned process
* to_parent[0] : fd for reading from spawned process
*/
static void talkto(argv)
char **argv;
{
int pid;
FILE *fp;
if (pipe(to_child) < 0) {
perror((char *) NULL);
exit(1);
}
if (pipe(to_parent) < 0) {
perror((char *) NULL);
exit(1);
}
if ((pid = fork()) == 0) { /* the child process */
fp = fopen("/dev/null", "a");
(void) close(fileno(stdin)); /* close child's stdin */
(void) dup(to_child[0]); /* redirect stdin from pipe*/
(void) close(fileno(stdout)); /* close child's stdout */
(void) dup(to_parent[1]); /* redirect stdout to pipe*/
(void) close(fileno(stderr)); /* close child's stderr */
(void) dup(fileno(fp)); /* redirect stderr to bit-buck*/
(void) close(to_child[0]); /* close the pipes */
(void) close(to_child[1]);
(void) close(to_parent[0]);
(void) close(to_parent[1]);
(void) fclose(fp);
/*
* exec the command to talk to
*/
(void) execvp(argv[0], argv);
perror((char *) NULL); /* shouldn't get here */
exit(1);
}
else if (pid < 0) {
perror((char *) NULL);
(void) exit(1);
}
/* we're the parent */
return;
}
/*
* glob
* [exported]
*
* perform filename expansion on a string. glob allocates memory as
* necessary and returns a pointer to that memory. glob uses the command
* specified by the enviroment variable "SHELL" to do expansion. If
* SHELL is not set glob uses /bin/sh by default.
* on entry
* *string : the string
* on exit
* ***r_argv : a list of files expanded by the shell
* *r_argc : size of r_argv
*/
void glob(string, r_argv, r_argc)
const char *string;
char ***r_argv;
int *r_argc;
{
static short is_init = 0;
static char **argv;
static int argc;
static int args; /* memory alloced to argv */
static char inBuf[4*BUFSIZ];
char outbuf[1024];
char *cptr;
int nbytes;
char *shell_argv[3];
char *t, *s;
*r_argv = NULL;
*r_argc = argc = 0;
/*
* perform one time initialization
*/
if (!is_init) {
/*
* try and find out what shell the user like so we can spawn
* it to parse it to do globbing.
*/
if ((shell_argv[0] = getenv ("SHELL")) == NULL) {
shell_argv[0] = "/bin/sh"; /* default */
}
shell_argv[1] = NULL;
/*
* if using csh then use csh with the fast option, '-f'
*/
/*SUPPRESS 624*/
t = (t = strrchr(shell_argv[0], '/')) ? ++t : shell_argv[0];
if ((strcmp(t, "csh") == 0) || (strcmp(t, "tcsh") == 0)) {
shell_argv[1] = "-f";
shell_argv[2] = NULL;
}
else if (strcmp(t, "ksh") == 0) {
shell_argv[1] = "-p";
shell_argv[2] = NULL;
}
talkto(shell_argv); /* spawn shell to talk to */
is_init = 1;
argv = (char **) malloc(SMALL_MALLOC_BLOCK * sizeof(char **));
if (! argv) {
perror("malloc()");
return;
}
args = SMALL_MALLOC_BLOCK;
sprintf(ackString, "/bin/echo %s\n", Magic);
}
if ((strlen(outbuf) + strlen(string) + 1) >= sizeof(outbuf)) {
(void) fprintf(stderr, "Line too long: %s\n", string);
return;
}
/*
* build command to send to the shell.
*/
(void) strcpy(outbuf, "/bin/echo ");
(void) strcat(outbuf, string);
(void) strcat(outbuf, "\n");
/*
* send "echo whatever" to shell. Also send a \001 so we get an
* ack back. We need that ack in case the string send doen't
* generate a responce to stdout. i.e. a shell error
*/
(void) write(to_child[1], outbuf, strlen(outbuf));
(void) write(to_child[1], ackString, strlen(ackString));
/*
* read in output from shell
*/
nbytes = 0;
while (1) { /* read until receive ack or buffer is full */
cptr = inBuf + nbytes;
nbytes += read(to_parent[0], cptr, sizeof(inBuf) - nbytes);
if ((s = strstr(inBuf, Magic)) || nbytes == sizeof(inBuf)) {
*s = '\0';
break;
}
}
if (nbytes == sizeof(inBuf)) {
inBuf[nbytes-1] = '\0';
}
if (strlen(inBuf) == 0) {
return; /* no match */
}
/*
* replace terminating newline with a null terminator
*/
/*SUPPRESS 624*/
if (s = strchr(inBuf, '\n')) {
*s = '\0';
}
/*
* null terminate and assigne a poiner to each arg in inBuf
*/
cptr = inBuf;
argv[argc++] = cptr; /* point to first arg */
while(*cptr) {
if (isspace(*cptr)) {
*cptr = '\0';
if (argc >= args) { /* enough memory ? */
args += SMALL_MALLOC_BLOCK;
argv = (char **) realloc ((char *) argv,
(unsigned) (args * sizeof (char **)));
}
argv[argc++] = cptr+1;
}
cptr++;
}
*r_argv = argv;
*r_argc = argc;
}
|
/*
* Platform data for Android USB
*
* Copyright (C) 2008 Google, Inc.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __LINUX_USB_ANDROID_H
#define __LINUX_USB_ANDROID_H
#include <linux/usb/composite.h>
#include <linux/if_ether.h>
struct android_usb_function {
struct list_head list;
char *name;
int (*bind_config)(struct usb_configuration *c);
};
struct android_usb_product {
/* Default product ID. */
__u16 product_id;
/* List of function names associated with this product.
* This is used to compute the USB product ID dynamically
* based on which functions are enabled.
*/
int num_functions;
char **functions;
// TelephonyFeature.CHINA_CTC_DATA : For CTC_PC_MODEM [
__u8 bDeviceClass;
__u8 bDeviceSubClass;
__u8 bDeviceProtocol;
int mode; /* if product id is same, you have to refer this mode value. */
char *s;
//]
};
struct android_usb_platform_data {
/* USB device descriptor fields */
__u16 vendor_id;
/* Default product ID. */
__u16 product_id;
__u16 version;
char *product_name;
char *manufacturer_name;
char *serial_number;
/* List of available USB products.
* This is used to compute the USB product ID dynamically
* based on which functions are enabled.
* if num_products is zero or no match can be found,
* we use the default product ID
*/
int num_products;
struct android_usb_product *products;
/* List of all supported USB functions.
* This list is used to define the order in which
* the functions appear in the configuration's list of USB interfaces.
* This is necessary to avoid depending upon the order in which
* the individual function drivers are initialized.
*/
int num_functions;
char **functions;
};
// TelephonyFeature.CHINA_CTC_DATA : For CTC_PC_MODEM [
/* lun data for "usb_mass_storage" driver */
struct usb_mass_storage_lun_data {
const char *filename;
char ro;
char removable;
char cdrom;
};
//]
/* Platform data for "usb_mass_storage" driver. */
struct usb_mass_storage_platform_data {
/* Contains values for the SC_INQUIRY SCSI command. */
char *vendor;
char *product;
int release;
/* number of LUNS */
int nluns;
// TelephonyFeature.CHINA_CTC_DATA : For CTC_PC_MODEM [
struct usb_mass_storage_lun_data *luns;
//]
};
/* Platform data for USB ethernet driver. */
struct usb_ether_platform_data {
u8 ethaddr[ETH_ALEN];
u32 vendorID;
const char *vendorDescr;
};
extern void android_register_function(struct android_usb_function *f);
extern void android_enable_function(struct usb_function *f, int enable);
#endif /* __LINUX_USB_ANDROID_H */
|
/*
* Copyright (C) 2012-2013 Jiří Šimek
* Copyright (C) 2013 Zbyněk Křivka <krivka@fit.vutbr.cz>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef PBLAZECL_HEADER
#define PBLAZECL_HEADER
#include <list>
#include "uccl.h"
#include "regspblaze.h"
#include "interruptcl.h"
#include "portidcl.h"
#include "inputportcl.h"
#include "outputportcl.h"
using namespace std;
/*
* Base type of PicoBlaze microcontrollers
*/
class cl_pblaze: public cl_uc
{
public:
unsigned int ram_size;
unsigned int rom_size;
unsigned int stack_size;
unsigned int interrupt_vector;
TYPE_UBYTE hw_constant;
int active_regbank;
public:
class cl_address_space *ram;
class cl_address_space *rom;
class cl_address_space *stack;
class cl_address_space *sfr;
// Simulation of interrupt system
class cl_interrupt *interrupt;
list<long> stored_interrupts;
class cl_port_id *port_id;
class cl_output_port *output_port;
class cl_input_port *input_port;
public:
cl_pblaze(int cpu_type, class cl_sim *asim);
virtual ~cl_pblaze(void);
virtual int init(void);
virtual const char *id_string(void);
virtual cl_address_space * bit2mem(t_addr bitaddr, t_addr *memaddr, t_mem *bitmask);
virtual t_addr get_mem_size(enum mem_class type);
virtual void mk_hw_elements(void);
virtual void make_memories(void);
virtual void build_cmdset(class cl_cmdset *cmdset);
virtual long read_hex_file(const char *nam);
virtual struct dis_entry *dis_tbl(void);
virtual struct name_entry *sfr_tbl(void);
virtual struct name_entry *bit_tbl(void);
virtual int clock_per_cycle(void) { return(2); }
virtual int inst_length(t_addr addr);
virtual int inst_branch(t_addr addr);
virtual int longest_inst(void);
virtual const char *disass(t_addr addr, const char *sep);
virtual void print_regs(class cl_console_base *con);
virtual void print_state(class cl_console_base *con, char *file_name);
virtual void load_state(class cl_console_base *con, char *file_name);
virtual void read_interrupt_file(void);
virtual void read_input_file(void);
virtual int do_inst(int step);
virtual int exec_inst(void);
virtual int do_interrupt(void);
virtual const char *get_disasm_info(t_addr addr,
int *ret_len,
int *ret_branch,
int *immed_offset);
virtual void reset(void);
#include "instcl.h"
#include "stackcl.h"
private:
void init_uc_parameters(void);
virtual long std_read_hex_file(const char *nam);
virtual long pblaze_read_hex_file(const char *nam);
};
#endif
|
#undef CONFIG_SA1100_ADSBITSY
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef AUV_H
#define AUV_H
/**
* \defgroup auv Autonomous Underwater Vehicle
*
* This section documents the API of the ns-3 AUV module. For a generic functional description, please refer to the ns-3 manual.
*/
#endif /* AUV_H */
|
/* kaspopup.h
**
** Copyright (C) 2001-2004 Richard Moore <rich@kde.org>
** Contributor: Mosfet
** All rights reserved.
**
** KasBar is dual-licensed: you can choose the GPL or the BSD license.
** Short forms of both licenses are included below.
*/
/*
** 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 in a file called COPYING; if not, write to
** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
** MA 02110-1301, USA.
*/
/*
** 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 AUTHORS AND CONTRIBUTORS ``AS IS'' AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
*/
/*
** Bug reports and questions can be sent to kde-devel@kde.org
*/
// -*- c++ -*-
#ifndef KASPOPUP_H
#define KASPOPUP_H
#include <tqguardedptr.h>
#include <tqhbox.h>
#include <kpixmap.h>
#include "kasitem.h"
class KasBar;
/**
* Self positioning popup for KasItems.
*
* @author Richard Moore, rich@kde.org
*/
class KasPopup : public TQHBox
{
Q_OBJECT
public:
KasPopup( KasItem *item, const char *name=0 );
virtual ~KasPopup();
/** Returns the item that is the parent of this popup. */
KasItem *item() const { return item_; }
KasBar *kasbar() const { return kasbar_; }
static TQPoint calcPosition( KasItem *item, int w, int h );
public slots:
/**
* Move the popup to the right position. You should not need
* to call this directly.
*/
void positionSelf();
/** Reimplemented for internal reasons. */
void show();
signals:
void aboutToShow();
void shown();
private:
TQGuardedPtr<KasItem> item_;
KasBar *kasbar_;
};
#endif // KASPOPUP_H
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SIGNALSLOTEDITOR_TOOL_H
#define SIGNALSLOTEDITOR_TOOL_H
#include "signalsloteditor_global.h"
#include "signalsloteditor.h"
#include <QtCore/QPointer>
#include <QtDesigner/QDesignerFormWindowToolInterface>
QT_BEGIN_NAMESPACE
class QDesignerFormEditorInterface;
class QDesignerFormWindowInterface;
class QAction;
namespace qdesigner_internal {
class SignalSlotEditor;
class QT_SIGNALSLOTEDITOR_EXPORT SignalSlotEditorTool: public QDesignerFormWindowToolInterface
{
Q_OBJECT
public:
explicit SignalSlotEditorTool(QDesignerFormWindowInterface *formWindow, QObject *parent = 0);
virtual ~SignalSlotEditorTool();
virtual QDesignerFormEditorInterface *core() const;
virtual QDesignerFormWindowInterface *formWindow() const;
virtual QWidget *editor() const;
QAction *action() const;
virtual void activated();
virtual void deactivated();
virtual bool handleEvent(QWidget *widget, QWidget *managedWidget, QEvent *event);
virtual void saveToDom(DomUI *ui, QWidget *mainContainer);
virtual void loadFromDom(DomUI *ui, QWidget *mainContainer);
private:
QDesignerFormWindowInterface *m_formWindow;
mutable QPointer<qdesigner_internal::SignalSlotEditor> m_editor;
QAction *m_action;
};
} // namespace qdesigner_internal
QT_END_NAMESPACE
#endif // SIGNALSLOTEDITOR_TOOL_H
|
/*
* asic_reg_map.h
*
* A macro-enclosed list of the elements for the register_map structure for
* use in defining and manipulating the structure.
*
* Copyright (C) 2009 Cisco Systems, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
REGISTER_MAP_ELEMENT(eic_slow0_strt_add)
REGISTER_MAP_ELEMENT(eic_cfg_bits)
REGISTER_MAP_ELEMENT(eic_ready_status)
REGISTER_MAP_ELEMENT(chipver3)
REGISTER_MAP_ELEMENT(chipver2)
REGISTER_MAP_ELEMENT(chipver1)
REGISTER_MAP_ELEMENT(chipver0)
REGISTER_MAP_ELEMENT(uart1_intstat)
REGISTER_MAP_ELEMENT(uart1_inten)
REGISTER_MAP_ELEMENT(uart1_config1)
REGISTER_MAP_ELEMENT(uart1_config2)
REGISTER_MAP_ELEMENT(uart1_divisorhi)
REGISTER_MAP_ELEMENT(uart1_divisorlo)
REGISTER_MAP_ELEMENT(uart1_data)
REGISTER_MAP_ELEMENT(uart1_status)
REGISTER_MAP_ELEMENT(int_stat_3)
REGISTER_MAP_ELEMENT(int_stat_2)
REGISTER_MAP_ELEMENT(int_stat_1)
REGISTER_MAP_ELEMENT(int_stat_0)
REGISTER_MAP_ELEMENT(int_config)
REGISTER_MAP_ELEMENT(int_int_scan)
REGISTER_MAP_ELEMENT(ien_int_3)
REGISTER_MAP_ELEMENT(ien_int_2)
REGISTER_MAP_ELEMENT(ien_int_1)
REGISTER_MAP_ELEMENT(ien_int_0)
REGISTER_MAP_ELEMENT(int_level_3_3)
REGISTER_MAP_ELEMENT(int_level_3_2)
REGISTER_MAP_ELEMENT(int_level_3_1)
REGISTER_MAP_ELEMENT(int_level_3_0)
REGISTER_MAP_ELEMENT(int_level_2_3)
REGISTER_MAP_ELEMENT(int_level_2_2)
REGISTER_MAP_ELEMENT(int_level_2_1)
REGISTER_MAP_ELEMENT(int_level_2_0)
REGISTER_MAP_ELEMENT(int_level_1_3)
REGISTER_MAP_ELEMENT(int_level_1_2)
REGISTER_MAP_ELEMENT(int_level_1_1)
REGISTER_MAP_ELEMENT(int_level_1_0)
REGISTER_MAP_ELEMENT(int_level_0_3)
REGISTER_MAP_ELEMENT(int_level_0_2)
REGISTER_MAP_ELEMENT(int_level_0_1)
REGISTER_MAP_ELEMENT(int_level_0_0)
REGISTER_MAP_ELEMENT(int_docsis_en)
REGISTER_MAP_ELEMENT(mips_pll_setup)
<<<<<<< HEAD
REGISTER_MAP_ELEMENT(fs432x4b4_usb_ctl)
=======
REGISTER_MAP_ELEMENT(usb_fs)
>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a
REGISTER_MAP_ELEMENT(test_bus)
REGISTER_MAP_ELEMENT(crt_spare)
REGISTER_MAP_ELEMENT(usb2_ohci_int_mask)
REGISTER_MAP_ELEMENT(usb2_strap)
REGISTER_MAP_ELEMENT(ehci_hcapbase)
REGISTER_MAP_ELEMENT(ohci_hc_revision)
REGISTER_MAP_ELEMENT(bcm1_bs_lmi_steer)
REGISTER_MAP_ELEMENT(usb2_control)
REGISTER_MAP_ELEMENT(usb2_stbus_obc)
REGISTER_MAP_ELEMENT(usb2_stbus_mess_size)
REGISTER_MAP_ELEMENT(usb2_stbus_chunk_size)
REGISTER_MAP_ELEMENT(pcie_regs)
REGISTER_MAP_ELEMENT(tim_ch)
REGISTER_MAP_ELEMENT(tim_cl)
REGISTER_MAP_ELEMENT(gpio_dout)
REGISTER_MAP_ELEMENT(gpio_din)
REGISTER_MAP_ELEMENT(gpio_dir)
REGISTER_MAP_ELEMENT(watchdog)
REGISTER_MAP_ELEMENT(front_panel)
REGISTER_MAP_ELEMENT(misc_clk_ctl1)
REGISTER_MAP_ELEMENT(misc_clk_ctl2)
REGISTER_MAP_ELEMENT(crt_ext_ctl)
REGISTER_MAP_ELEMENT(register_maps)
|
/*
* The ManaPlus Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2014 The ManaPlus Developers
*
* This file is part of The ManaPlus Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GUI_WINDOWS_QUITDIALOG_H
#define GUI_WINDOWS_QUITDIALOG_H
#include "gui/widgets/window.h"
#include "listeners/actionlistener.h"
#include "listeners/keylistener.h"
#include <vector>
class Button;
class RadioButton;
/**
* The quit dialog.
*
* \ingroup Interface
*/
class QuitDialog final : public Window,
public ActionListener,
public KeyListener
{
public:
/**
* Constructor
*
* @pointerToMe will be set to NULL when the QuitDialog is destroyed
*/
explicit QuitDialog(QuitDialog **const pointerToMe);
A_DELETE_COPY(QuitDialog)
/**
* Destructor
*/
~QuitDialog();
void postInit() override final;
/**
* Called when receiving actions from the widgets.
*/
void action(const ActionEvent &event) override final;
void keyPressed(KeyEvent &event) override final;
private:
void placeOption(ContainerPlacer &placer,
RadioButton *const option);
std::vector<RadioButton*> mOptions;
RadioButton *mLogoutQuit;
RadioButton *mForceQuit;
RadioButton *mSwitchAccountServer;
RadioButton *mSwitchCharacter;
RadioButton *mRate;
Button *mOkButton;
Button *mCancelButton;
QuitDialog **mMyPointer;
bool mNeedForceQuit;
};
#endif // GUI_WINDOWS_QUITDIALOG_H
|
#ifndef __APP_MACROS_H__
#define __APP_MACROS_H__
#define DESIGN_RESOLUTION_480X320 0
#define DESIGN_RESOLUTION_960X640 1
#define DESIGN_RESOLUTION_1920X1080 2
//Modify this line for changing target device
#define TARGET_DESIGN_RESOLUTION_SIZE DESIGN_RESOLUTION_480X320
typedef struct tagResource
{
cocos2d::Size size;
char directory[50];
}Resource;
static Resource smallResource = { cocos2d::Size(320, 480), "ldpi" };
static Resource mediumResource = { cocos2d::Size(640, 960), "mdpi" };
static Resource largeResource = { cocos2d::Size(1080, 1920), "hdpi" };
#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320)
static cocos2d::Size designResolutionSize = cocos2d::Size(320, 480);
#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_960X640)
static cocos2d::Size designResolutionSize = cocos2d::Size(640, 960);
#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1920X1080)
static cocos2d::Size designResolutionSize = cocos2d::Size(1920, 1080);
#else
#error unknown target design resolution!
#endif
// 480*320µÄ×ÖÌå´óСÊÇ24ºÅ£¬¸ù¾Ýµ±Ç°µÄ·Ö±æÂÊÀ´ÐÞ¸Ä×ÖÌå´óС
#define TITLE_FONT_SIZE (cocos2d::Director::getInstance()->getOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24)
#endif
|
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2018
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/db/binlog/BinlogEvent.h"
#include "td/db/DbKey.h"
#include "td/utils/AesCtrByteFlow.h"
#include "td/utils/buffer.h"
#include "td/utils/BufferedFd.h"
#include "td/utils/ByteFlow.h"
#include "td/utils/common.h"
#include "td/utils/crypto.h"
#include "td/utils/port/FileFd.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
#include <functional>
namespace td {
struct BinlogInfo {
bool was_created;
uint64 last_id;
bool is_encrypted{false};
bool wrong_password{false};
bool is_opened{false};
};
namespace detail {
class BinlogReader;
class BinlogEventsProcessor;
class BinlogEventsBuffer;
}; // namespace detail
class Binlog {
public:
enum Error : int { WrongPassword = -1 };
static bool IGNORE_ERASE_HACK;
Binlog();
Binlog(const Binlog &other) = delete;
Binlog &operator=(const Binlog &other) = delete;
Binlog(Binlog &&other) = delete;
Binlog &operator=(Binlog &&other) = delete;
~Binlog();
using Callback = std::function<void(const BinlogEvent &)>;
Status init(string path, const Callback &callback, DbKey db_key = DbKey::empty(), DbKey old_db_key = DbKey::empty(),
int32 dummy = -1, const Callback &debug_callback = Callback()) TD_WARN_UNUSED_RESULT;
uint64 next_id() {
return ++last_id_;
}
uint64 next_id(int32 shift) {
auto res = last_id_ + 1;
last_id_ += shift;
return res;
}
uint64 peek_next_id() const {
return last_id_ + 1;
}
bool empty() const {
return fd_.empty();
}
void add_raw_event(BufferSlice &&raw_event) {
add_event(BinlogEvent(std::move(raw_event)));
}
void add_event(BinlogEvent &&event);
void sync();
void flush();
void lazy_flush();
double need_flush_since() const {
return need_flush_since_;
}
void change_key(DbKey new_db_key);
Status close(bool need_sync = true) TD_WARN_UNUSED_RESULT;
Status close_and_destroy() TD_WARN_UNUSED_RESULT;
static Status destroy(Slice path) TD_WARN_UNUSED_RESULT;
CSlice get_path() const {
return path_;
}
BinlogInfo get_info() const { // works even after binlog was closed
return info_;
}
private:
BufferedFdBase<FileFd> fd_;
ChainBufferWriter buffer_writer_;
ChainBufferReader buffer_reader_;
detail::BinlogReader *binlog_reader_ptr_;
BinlogInfo info_;
DbKey db_key_;
bool db_key_used_ = false;
DbKey old_db_key_;
enum class EncryptionType { None, AesCtr } encryption_type_ = EncryptionType::None;
// AesCtrEncryption
BufferSlice aes_ctr_key_salt_;
UInt256 aes_ctr_key_;
AesCtrState aes_ctr_state_;
bool byte_flow_flag_ = false;
ByteFlowSource byte_flow_source_;
ByteFlowSink byte_flow_sink_;
AesCtrByteFlow aes_xcode_byte_flow_;
int64 fd_size_{0};
uint64 fd_events_{0};
string path_;
std::vector<BinlogEvent> pending_events_;
std::unique_ptr<detail::BinlogEventsProcessor> processor_;
std::unique_ptr<detail::BinlogEventsBuffer> events_buffer_;
bool in_flush_events_buffer_{false};
uint64 last_id_{0};
double need_flush_since_ = 0;
bool need_sync_{false};
enum class State { Empty, Load, Reindex, Run } state_{State::Empty};
static constexpr uint32 MAX_EVENT_SIZE = 65536;
Result<FileFd> open_binlog(CSlice path, int32 flags);
size_t flush_events_buffer(bool force);
void do_add_event(BinlogEvent &&event);
void do_event(BinlogEvent &&event);
Status load_binlog(const Callback &callback, const Callback &debug_callback = Callback()) TD_WARN_UNUSED_RESULT;
void do_reindex();
void update_encryption(Slice key, Slice iv);
void reset_encryption();
void update_read_encryption();
void update_write_encryption();
};
} // namespace td
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.