text
stringlengths
4
6.14k
// // ZJDHttpRequest.h // AppleRssDemo1 // // Created by qianfeng on 15/3/24. // Copyright (c) 2015年 ZJD. All rights reserved. // #import <Foundation/Foundation.h> @interface ZJDHttpRequest : NSObject @property (nonatomic, assign)id delegate; @property (nonatomic, assign)SEL action; @property (nonatomic, copy)NSString *url; @property (nonatomic, strong)NSMutableData *data; - (void)startRequest; - (void)stopRequest; @end
#ifndef COMPLETERPROJECT_H #define COMPLETERPROJECT_H #include <QCompleter> #include "projectproxymodel.h" class ProjectCompleter : public QCompleter { public: explicit ProjectCompleter(ProjectProxyModel*, QObject* parent); QString pathFromIndex ( const QModelIndex & index ) const; QStringList splitPath ( const QString & path ) const; }; #endif // COMPLETERPROJECT_H
/* * i2c.h * * Created on: Jul 8, 2013 * Original author: mike * * Customized on Jul 2, 2014 * Secondary author: JavierIH * */ #ifndef I2C_H_ #define I2C_H_ #include "../debug/debug.h" #include <linux/i2c-dev.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> // open(); #include <unistd.h> // close(); #include <sys/ioctl.h> // ioctl(); class I2C { private: int bus; int file; char filename[20]; bool openConnection(__u16 address); bool closeConnection(); public: I2C(int bus); ~I2C(); bool test(__u16 address); __s32 read8(__u16 address,__u8 reg); __s32 write8(__u16 address,__u8 reg, __u8 data); __s32 read16(__u16 address,__u8 reg); __s32 write16(__u16 address,__u8 reg, __u16 data); }; #endif /* I2C_H_ */
/* * linux/mm/page_io.c * * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds * * Swap reorganised 29.12.95, * Asynchronous swapping added 30.12.95. Stephen Tweedie * Removed race in async swapping. 14.4.1996. Bruno Haible * Add swap of shared pages through the page cache. 20.2.1998. Stephen Tweedie * Always use brw_page, life becomes simpler. 12 May 1998 Eric Biederman */ #include <linux/mm.h> #include <linux/kernel_stat.h> #include <linux/pagemap.h> #include <linux/swap.h> #include <linux/bio.h> #include <linux/swapops.h> #include <linux/writeback.h> #include <asm/pgtable.h> static struct bio *get_swap_bio(gfp_t gfp_flags, pgoff_t index, struct page *page, bio_end_io_t end_io) { struct bio *bio; bio = bio_alloc(gfp_flags, 1); if (bio) { struct swap_info_struct *sis; swp_entry_t entry = { .val = index, }; sis = get_swap_info_struct(swp_type(entry)); bio->bi_sector = map_swap_page(sis, swp_offset(entry)) * (PAGE_SIZE >> 9); bio->bi_bdev = sis->bdev; bio->bi_io_vec[0].bv_page = page; bio->bi_io_vec[0].bv_len = PAGE_SIZE; bio->bi_io_vec[0].bv_offset = 0; bio->bi_vcnt = 1; bio->bi_idx = 0; bio->bi_size = PAGE_SIZE; bio->bi_end_io = end_io; } return bio; } static void end_swap_bio_write(struct bio *bio, int err) { const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); struct page *page = bio->bi_io_vec[0].bv_page; if (!uptodate) { SetPageError(page); /* * We failed to write the page out to swap-space. * Re-dirty the page in order to avoid it being reclaimed. * Also print a dire warning that things will go BAD (tm) * very quickly. * * Also clear PG_reclaim to avoid rotate_reclaimable_page() */ set_page_dirty(page); printk(KERN_ALERT "Write-error on swap-device (%u:%u:%Lu)\n", imajor(bio->bi_bdev->bd_inode), iminor(bio->bi_bdev->bd_inode), (unsigned long long)bio->bi_sector); ClearPageReclaim(page); } end_page_writeback(page); bio_put(bio); } void end_swap_bio_read(struct bio *bio, int err) { const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); struct page *page = bio->bi_io_vec[0].bv_page; if (!uptodate) { SetPageError(page); ClearPageUptodate(page); printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n", imajor(bio->bi_bdev->bd_inode), iminor(bio->bi_bdev->bd_inode), (unsigned long long)bio->bi_sector); } else { SetPageUptodate(page); } unlock_page(page); bio_put(bio); } /* * We may have stale swap cache pages in memory: notice * them here and get rid of the unnecessary final write. */ int swap_writepage(struct page *page, struct writeback_control *wbc) { struct bio *bio; int ret = 0, rw = WRITE; if (remove_exclusive_swap_page(page)) { unlock_page(page); goto out; } bio = get_swap_bio(GFP_NOIO, page_private(page), page, end_swap_bio_write); if (bio == NULL) { set_page_dirty(page); unlock_page(page); ret = -ENOMEM; goto out; } if (wbc->sync_mode == WB_SYNC_ALL) rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG); count_vm_event(PSWPOUT); set_page_writeback(page); unlock_page(page); submit_bio(rw, bio); out: return ret; } int swap_readpage(struct file *file, struct page *page) { struct bio *bio; int ret = 0; BUG_ON(!PageLocked(page)); ClearPageUptodate(page); bio = get_swap_bio(GFP_KERNEL, page_private(page), page, end_swap_bio_read); if (bio == NULL) { unlock_page(page); ret = -ENOMEM; goto out; } count_vm_event(PSWPIN); submit_bio(READ, bio); out: return ret; }
void c_window(); void snake(int); void reset(){ int speed,l; char ch2; clrscr(); gotoxy(15,23); textcolor(BLUE); //cprintf("PRESS 's'AND 'w' TO NAVIGATE AND 'e' TO SELECT"); gotoxy(15,12); textcolor(WHITE); cprintf("SPEED LEVEL"); while(1){ gotoxy(27,12); textcolor(GREEN); cprintf("%d",l); ch2=getch(); if(ch2==13)break; else if(ch2==72){ l++; if(l>9)l=9; } else if(ch2==80){ l--; if(l<1)l=1; } } clrscr(); //textbackground(BLACK); c_window(); snake(l); }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_DELEGATE_H_ #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_DELEGATE_H_ class ExtensionInstallPrompt; class ExtensionEnableFlowDelegate { public: virtual void ExtensionEnableFlowFinished() = 0; virtual void ExtensionEnableFlowAborted(bool user_initiated) = 0; protected: virtual ~ExtensionEnableFlowDelegate() {} }; #endif
#ifndef _GAMELOOP_H #define _GAMELOOP_H #include "ios_fc.h" #include "drawcontext.h" #include "audiomanager.h" #include "GameControls.h" using namespace ios_fc; class GameLoop; class DrawableComponent { public: DrawableComponent(); virtual ~DrawableComponent(); virtual bool drawRequested() const; // Immediately draws the DrawableComponent void doDraw(DrawTarget *dt) ; // Reordering of drawable elements bool moveToFront(); bool moveToBack(DrawableComponent *gc); // Notifications virtual void onDrawableVisibleChanged(bool visible) {} protected: GameLoop *parentLoop; void requestDraw(); virtual void draw(DrawTarget *dt) {} friend class GameLoop; private: bool _drawRequested; }; class IdleComponent { public: IdleComponent(); virtual ~IdleComponent(); void callIdle(double currentTime) { if (!paused) idle(currentTime); } virtual void idle(double currentTime) {} /// return true if you want the GameLoop to skip some frames. virtual bool isLate(double currentTime) const { return false; } /// perform some computation if you're interested in events. virtual void onEvent(event_manager::GameControlEvent *event) {} virtual void setPause(bool paused); bool getPause() const; protected: GameLoop *parentLoop; bool paused; friend class GameLoop; }; class CycledComponent : public IdleComponent { public: CycledComponent(double cycleTime); virtual ~CycledComponent(); /// called 1 time every cycleTime seconds. virtual void cycle() {} void setCycleTime(double time); double getCycleTime() const; int getCycleNumber() const; void idle(double currentTime); bool isLate(double currentTime) const; virtual void setPause(bool paused); void reset(); private: double cycleTime; double cycleNumber; double firstCycleTime; bool *_deleteToken; }; class GarbageCollectableItem { public: virtual ~GarbageCollectableItem() {} }; /** * The GameLoop class manages the main loop of the game * and schedules the drawin, timing and events of the game */ class GameLoop { public: GameLoop(); void setDrawContext(DrawContext *dc) { m_dc = dc; } DrawContext *getDrawContext() const { return m_dc; } void setEventManager(event_manager::EventManager *em) { m_em = em; } event_manager::EventManager *getEventManager() const { return m_em; } void setAudioManager(audio_manager::AudioManager *am) { m_am = am; } audio_manager::AudioManager *getAudioManager() const { return m_am; } void addDrawable(DrawableComponent *gc); void addIdle(IdleComponent *gc); void removeDrawable(DrawableComponent *gc); void removeIdle(IdleComponent *gc); void garbageCollect(GarbageCollectableItem *item); void garbageCollectNow(); // run garbage collector. void run(); // Reordering of drawable elements bool moveToFront(DrawableComponent *gc); bool moveToBack(DrawableComponent *gc); void idle(double currentTime); void draw(bool flip = true); bool drawRequested() const; bool isLate(double currentTime) const; static inline double getCurrentTime() { return ios_fc::getUnixTime(); } private: DrawContext *m_dc; event_manager::EventManager *m_em; audio_manager::AudioManager *m_am; double timeDrift; double lastDrawTime, deltaDrawTimeMax; Vector<DrawableComponent> drawables; Vector<IdleComponent> idles; Vector<GarbageCollectableItem> garbageCollector; bool finished; }; #endif // _GAMELOOP_H
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_SYSTEM_IME_IME_OBSERVER_H_ #define ASH_SYSTEM_IME_IME_OBSERVER_H_ namespace ash { class IMEObserver { public: virtual ~IMEObserver() {} virtual void OnIMERefresh(bool show_message) = 0; }; } #endif
/* *** ColourScalePoint Variable and Array *** src/parser/colourscalepoint.h Copyright T. Youngs 2007-2016 This file is part of Aten. Aten 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. Aten 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 Aten. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ATEN_COLOURSCALEPOINTVARIABLE_H #define ATEN_COLOURSCALEPOINTVARIABLE_H #include "parser/pvariable.h" #include "parser/accessor.h" ATEN_BEGIN_NAMESPACE // Forward Declarations (Aten) class ColourScalePoint; // ColourScalePoint Variable class ColourScalePointVariable : public PointerVariable { public: // Constructor / Destructor ColourScalePointVariable(ColourScalePoint* i = NULL, bool constant = false); ~ColourScalePointVariable(); /* * Access Data */ public: // Accessor list enum Accessors { Colour, Value, nAccessors }; // Function list enum Functions { Copy, nFunctions }; // Search variable access list for provided accessor StepNode* findAccessor(QString name, TreeNode* arrayIndex, TreeNode* argList = NULL); // Static function to search accessors static StepNode* accessorSearch(QString name, TreeNode* arrayIndex, TreeNode* argList = NULL); // Retrieve desired value static bool retrieveAccessor(int i, ReturnValue& rv, bool hasArrayIndex, int arrayIndex = -1); // Set desired value static bool setAccessor(int i, ReturnValue& sourcerv, ReturnValue& newValue, bool hasArrayIndex, int arrayIndex = -1); // Perform desired function static bool performFunction(int i, ReturnValue& rv, TreeNode* node); // Accessor data static Accessor accessorData[nAccessors]; // Function Accessor data static FunctionAccessor functionData[nFunctions]; }; // ColourScalePoint Array Variable class ColourScalePointArrayVariable : public PointerArrayVariable { public: // Constructor / Destructor ColourScalePointArrayVariable(TreeNode* sizeexpr, bool constant = false); /* * Inherited Virtuals */ public: // Search variable access list for provided accessor StepNode* findAccessor(QString name, TreeNode* arrayIndex, TreeNode* argList = NULL); }; ATEN_END_NAMESPACE #endif
/* Test that the function: int sigaddset(sigset_t *, int); is declared. */ #include <signal.h> typedef int (*sigaddset_test)(sigset_t *, int); int dummyfcn (void) { sigaddset_test dummyvar; dummyvar = sigaddset; return 0; }
/* * %kadu copyright begin% * Copyright 2012 Bartosz Brachaczek (b.brachaczek@gmail.com) * Copyright 2011, 2012, 2013, 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com) * %kadu copyright end% * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SMS_SENDER_H #define SMS_SENDER_H #include <QtCore/QObject> class SmsSender : public QObject { Q_OBJECT QString Number; QString Signature; void fixNumber(); protected: QString Message; bool validateSignature(); public: explicit SmsSender(const QString &number, QObject *parent = nullptr); virtual ~SmsSender(); const QString &number() const { return Number; } const QString &signature() const { return Signature; } void setSignature(const QString &signature); virtual void sendMessage(const QString &message) = 0; public slots: virtual void cancel() = 0; signals: void gatewayAssigned(const QString &number, const QString &gatewayId); void smsSent(const QString &number, const QString &message); void progress(const QString &entryIcon, const QString &entryMessage); void finished(bool ok, const QString &entryIcon, const QString &entryMessage); void canceled(); }; #endif // SMS_SENDER_H
#include <stdio.h> #include <stdlib.h> #include <pthread.h> void *count(); pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; int counter = 0; int main() { int rc1, rc2; pthread_t thread1, thread2; if ((rc1 = pthread_create(&thread1, NULL, &count, NULL))) { printf("Thread creation failed: %d\n", rc1); } if ((rc2 = pthread_create(&thread2, NULL, &count, NULL))) { printf("Thread creation failed: %d\n", rc2); } pthread_join(thread1, NULL); pthread_join(thread2, NULL); return 0; } void *count() { pthread_mutex_lock(&mutex1); counter++; printf("Counter value: %d\n", counter); pthread_mutex_unlock(&mutex1); }
#include <stdio.h> #include <stdlib.h> #include <png.h> #include <zbar.h> #include "get_data.h" #if !defined(PNG_LIBPNG_VER) || \ PNG_LIBPNG_VER < 10018 || \ (PNG_LIBPNG_VER > 10200 && \ PNG_LIBPNG_VER < 10209) /* Changes to Libpng from version 1.2.42 to 1.4.0 (January 4, 2010) * ... * 2. m. The function png_set_gray_1_2_4_to_8() was removed. It has been * deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with * png_set_expand_gray_1_2_4_to_8() because the former function also * expanded palette images. */ # define png_set_expand_gray_1_2_4_to_8 png_set_gray_1_2_4_to_8 #endif /* to complete a runnable example, this abbreviated implementation of * get_data() will use libpng to read an image file. refer to libpng * documentation for details */ int get_data (const char *name, int *width, int *height, void **raw) { FILE *file = fopen(name, "rb"); if(!file) return 2; png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if(!png) return 3; if(setjmp(png_jmpbuf(png))) return 4; png_infop info = png_create_info_struct(png); if(!info) return 5; png_init_io(png, file); png_read_info(png, info); /* configure for 8bpp grayscale input */ int color = png_get_color_type(png, info); int bits = png_get_bit_depth(png, info); if(color & PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); if(color == PNG_COLOR_TYPE_GRAY && bits < 8) png_set_expand_gray_1_2_4_to_8(png); if(bits == 16) png_set_strip_16(png); if(color & PNG_COLOR_MASK_ALPHA) png_set_strip_alpha(png); if(color & PNG_COLOR_MASK_COLOR) png_set_rgb_to_gray_fixed(png, 1, -1, -1); /* allocate image */ *width = png_get_image_width(png, info); *height = png_get_image_height(png, info); *raw = malloc(*width * *height); png_bytep rows[*height]; int i; for(i = 0; i < *height; i++) rows[i] = *raw + (*width * i); png_read_image(png, rows); return 0; }
#ifndef STATUS_H #define STATUS_H #include <stdio.h> #include "string-list.h" #include "color.h" enum color_wt_status { WT_STATUS_HEADER = 0, WT_STATUS_UPDATED, WT_STATUS_CHANGED, WT_STATUS_UNTRACKED, WT_STATUS_NOBRANCH, WT_STATUS_UNMERGED, }; enum untracked_status_type { SHOW_NO_UNTRACKED_FILES, SHOW_NORMAL_UNTRACKED_FILES, SHOW_ALL_UNTRACKED_FILES }; struct wt_status_change_data { int worktree_status; int index_status; int stagemask; char *head_path; unsigned dirty_submodule : 2; unsigned new_submodule_commits : 1; }; struct wt_status { int is_initial; char *branch; const char *reference; const char **pathspec; int verbose; int amend; int in_merge; int nowarn; int use_color; int relative_paths; int submodule_summary; int show_ignored_files; enum untracked_status_type show_untracked_files; char color_palette[WT_STATUS_UNMERGED+1][COLOR_MAXLEN]; /* These are computed during processing of the individual sections */ int commitable; int workdir_dirty; const char *index_file; FILE *fp; const char *prefix; struct string_list change; struct string_list untracked; struct string_list ignored; }; void wt_status_prepare(struct wt_status *s); void wt_status_print(struct wt_status *s); void wt_status_collect(struct wt_status *s); void wt_shortstatus_print(struct wt_status *s, int null_termination); void wt_porcelain_print(struct wt_status *s, int null_termination); #endif /* STATUS_H */
// Animation names #define TURRET_ANIM_DEFAULT 0 // Color names // Patch names // Names of collision boxes #define TURRET_COLLISION_BOX_DEFAULT 0 // Attaching position names #define TURRET_ATTACHMENT_ROTATORHEADING 0 // Sound names
/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _SYS_UIO_H #define _SYS_UIO_H 1 #include <features.h> #include <sys/types.h> __BEGIN_DECLS /* This file defines `struct iovec'. */ #include <bits/uio.h> /* Read data from file descriptor FD, and put the result in the buffers described by IOVEC, which is a vector of COUNT `struct iovec's. The buffers are filled in the order specified. Operates just like `read' (see <unistd.h>) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count); /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT `struct iovec's, to file descriptor FD. The data is written in the order specified. Operates just like `write' (see <unistd.h>) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count); __END_DECLS #endif /* sys/uio.h */
/* main-grain-test.c */ /* This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.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 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/>. */ /* * grain test-suit * */ #include "main-test-common.h" #include "grain.h" #include "scal_grain.h" #include "scal-basic.h" #include "scal-nessie.h" #include "performance_test.h" char *algo_name = "Grain"; /***************************************************************************** * additional validation-functions * *****************************************************************************/ void grain_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){ uint8_t iv[8]={0}; grain_init(key, &iv, ctx); } uint8_t grain_getbyte_dummy(grain_ctx_t *ctx){ uint8_t i,ret=0; for(i=0; i<8; ++i){ ret<<=1; ret |= grain_enc(ctx); } return ret; } uint8_t grain_getbyte_dummy_rev(grain_ctx_t *ctx){ uint8_t i,ret=0; for(i=0; i<8; ++i){ ret >>= 1; ret |= grain_enc(ctx)?0x80:0x00; } return ret; } void testrun_nessie_grain(void){ scal_nessie_set_estream(1); scal_nessie_run(&grain_desc); } void testrun_std_grain(void){ grain_ctx_t ctx; uint8_t i, key[10], iv[8], out[10]; /* 1 */ memset(key, 0, 10); memset(iv, 0, 8); cli_putstr_P(PSTR("\r\n=== std test ===")); cli_putstr_P(PSTR("\r\n key: ")); cli_hexdump(key, 10); cli_putstr_P(PSTR("\r\n iv: ")); cli_hexdump(key, 8); grain_init(key, iv, &ctx); for(i=0; i<10; ++i){ out[i] = grain_getbyte_dummy(&ctx); } cli_putstr_P(PSTR("\r\n out: ")); cli_hexdump(out, 10); /* 2 */ for(i=0; i<8; ++i){ key[i] = i*0x22+1; } key[8]=0x12; key[9]=0x34; for(i=0; i<8; ++i){ iv[i] = i*0x22+1; } cli_putstr_P(PSTR("\r\n\r\n key: ")); cli_hexdump(key, 10); cli_putstr_P(PSTR("\r\n iv: ")); cli_hexdump(key, 8); grain_init(key, iv, &ctx); for(i=0; i<10; ++i){ out[i] = grain_getbyte_dummy(&ctx); } cli_putstr_P(PSTR("\r\n out: ")); cli_hexdump(out, 10); cli_putstr_P(PSTR("\r\n\r\n")); } void testrun_performance_grain(void){ uint64_t t; char str[16]; uint8_t key[10], iv[8]; grain_ctx_t ctx; calibrateTimer(); print_overhead(); memset(key, 0, 10); memset(iv, 0, 8); startTimer(1); grain_init(key, iv, &ctx); t = stopTimer(); cli_putstr_P(PSTR("\r\n\tctx-gen time: ")); ultoa((unsigned long)t, str, 10); cli_putstr(str); startTimer(1); grain_enc(&ctx); t = stopTimer(); cli_putstr_P(PSTR("\r\n\tencrypt time: ")); ultoa((unsigned long)t, str, 10); cli_putstr(str); cli_putstr_P(PSTR("\r\n")); } /***************************************************************************** * main * *****************************************************************************/ const char nessie_str[] PROGMEM = "nessie"; const char test_str[] PROGMEM = "test"; const char performance_str[] PROGMEM = "performance"; const char echo_str[] PROGMEM = "echo"; const cmdlist_entry_t cmdlist[] PROGMEM = { { nessie_str, NULL, testrun_nessie_grain }, { test_str, NULL, testrun_std_grain}, { performance_str, NULL, testrun_performance_grain}, { echo_str, (void*)1, (void_fpt)echo_ctrl}, { NULL, NULL, NULL} }; int main (void){ main_setup(); for(;;){ welcome_msg(algo_name); cmd_interface(cmdlist); } }
#ifndef __W1_H #define __W1_H struct w1_reg_num { #if defined(__LITTLE_ENDIAN_BITFIELD) __u64 family:8, id:48, crc:8; #elif defined(__BIG_ENDIAN_BITFIELD) __u64 crc:8, id:48, family:8; #else #error "Please fix <asm/byteorder.h>" #endif }; #ifdef __KERNEL__ #include <linux/completion.h> #include <linux/device.h> #include <linux/mutex.h> #include "w1_family.h" #define W1_MAXNAMELEN 32 #define W1_SEARCH 0xF0 #define W1_ALARM_SEARCH 0xEC #define W1_CONVERT_TEMP 0x44 #define W1_SKIP_ROM 0xCC #define W1_READ_SCRATCHPAD 0xBE #define W1_READ_ROM 0x33 #define W1_READ_PSUPPLY 0xB4 #define W1_MATCH_ROM 0x55 #define W1_SLAVE_ACTIVE 0 struct w1_slave { struct module *owner; unsigned char name[W1_MAXNAMELEN]; struct list_head w1_slave_entry; struct w1_reg_num reg_num; atomic_t refcnt; u8 rom[9]; u32 flags; int ttl; struct w1_master *master; struct w1_family *family; void *family_data; struct device dev; struct completion released; }; typedef void (*w1_slave_found_callback)(struct w1_master *, u64); struct w1_bus_master { void *data; u8 (*read_bit)(void *); void (*write_bit)(void *, u8); u8 (*touch_bit)(void *, u8); u8 (*read_byte)(void *); void (*write_byte)(void *, u8); u8 (*read_block)(void *, u8 *, int); void (*write_block)(void *, const u8 *, int); u8 (*triplet)(void *, u8); u8 (*reset_bus)(void *); u8 (*set_pullup)(void *, int); void (*search)(void *, struct w1_master *, u8, w1_slave_found_callback); }; struct w1_master { struct list_head w1_master_entry; struct module *owner; unsigned char name[W1_MAXNAMELEN]; struct list_head slist; int max_slave_count, slave_count; unsigned long attempts; int slave_ttl; int initialized; u32 id; int search_count; atomic_t refcnt; void *priv; int priv_size; int enable_pullup; int pullup_duration; struct task_struct *thread; struct mutex mutex; struct device_driver *driver; struct device dev; struct w1_bus_master *bus_master; u32 seq; }; int w1_create_master_attributes(struct w1_master *); void w1_destroy_master_attributes(struct w1_master *master); void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb); void w1_search_devices(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb); struct w1_slave *w1_search_slave(struct w1_reg_num *id); void w1_search_process(struct w1_master *dev, u8 search_type); struct w1_master *w1_search_master_id(u32 id); void w1_reconnect_slaves(struct w1_family *f, int attach); void w1_slave_detach(struct w1_slave *sl); u8 w1_triplet(struct w1_master *dev, int bdir); void w1_write_8(struct w1_master *, u8); u8 w1_read_8(struct w1_master *); int w1_reset_bus(struct w1_master *); u8 w1_calc_crc8(u8 *, int); void w1_write_block(struct w1_master *, const u8 *, int); void w1_touch_block(struct w1_master *, u8 *, int); u8 w1_read_block(struct w1_master *, u8 *, int); int w1_reset_select_slave(struct w1_slave *sl); void w1_next_pullup(struct w1_master *, int); static inline struct w1_slave* dev_to_w1_slave(struct device *dev) { return container_of(dev, struct w1_slave, dev); } static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj) { return dev_to_w1_slave(container_of(kobj, struct device, kobj)); } static inline struct w1_master* dev_to_w1_master(struct device *dev) { return container_of(dev, struct w1_master, dev); } extern struct device_driver w1_master_driver; extern struct device w1_master_device; extern int w1_max_slave_count; extern int w1_max_slave_ttl; extern struct list_head w1_masters; extern struct mutex w1_mlock; extern int w1_process(void *); #endif #endif
#ifndef LOTOSPP_NETWORK_SERVICEPORT_H #define LOTOSPP_NETWORK_SERVICEPORT_H #include <boost/enable_shared_from_this.hpp> #include <boost/core/noncopyable.hpp> #include <boost/asio/ip/tcp.hpp> #include <boost/asio/io_service.hpp> namespace LotosPP::Network { class Protocol; class NetworkMessage; class ServiceBase; typedef boost::shared_ptr<ServiceBase> Service_ptr; typedef boost::shared_ptr<boost::asio::ip::tcp::acceptor> Acceptor_ptr; /** * A Service Port represents a listener on a port * * It accepts connections, and asks each Service running on it if it can accept the connection, and if so passes * it on to the service */ class ServicePort : boost::noncopyable, public boost::enable_shared_from_this<ServicePort> { public: ServicePort(boost::asio::io_service& io_service); ~ServicePort(); static void openAcceptor(boost::weak_ptr<ServicePort> weak_service, uint16_t port); void open(uint16_t port); void close(); bool isSingleSocket() const; std::string getProtocolNames() const; bool addService(Service_ptr); Protocol* makeProtocol(NetworkMessage& msg) const; void onStopServer(); void onAccept(Acceptor_ptr acceptor, boost::asio::ip::tcp::socket* socket, const boost::system::error_code& error); protected: void accept(Acceptor_ptr acceptor); boost::asio::io_service& m_io_service; std::vector<Acceptor_ptr> m_tcp_acceptors{}; std::vector<Service_ptr> m_services{}; uint16_t m_serverPort{0}; bool m_pendingStart{false}; static inline bool m_logError{true}; }; typedef boost::shared_ptr<ServicePort> ServicePort_ptr; } #endif
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <cryptopals/core.h> #include <cryptopals/set1.h> #include <cryptopals/set3.h> void bigint_inc(unsigned char *x, size_t len, bool big_endian) { int direction = big_endian ? -1 : 1; unsigned char *p = big_endian ? x + len - 1 : x; unsigned int i; for (i = 0; i < len; i++) { p[i * direction]++; if (p[i * direction]) break; } } void aes_ctr_setup(AES_KEY *aes_key, unsigned int bits, const unsigned char *key, const unsigned char *nonce, unsigned char *ctr, unsigned char *keystream) { size_t halfblock = AES_BLOCK_SIZE / 2; memcpy(ctr, nonce, halfblock); memset(ctr + halfblock, 0, halfblock); AES_set_encrypt_key(key, bits, aes_key); } void aes_ctr_do_crypt(const unsigned char *in, unsigned char *out, size_t len, unsigned int bits, AES_KEY *aes_key, bool big_endian, unsigned char *ctr, unsigned char *keystream) { unsigned int i; size_t halfblock = AES_BLOCK_SIZE / 2; for (i = 0; i < len; i += AES_BLOCK_SIZE) { AES_encrypt(ctr, keystream, aes_key); fixed_xor(&in[i], keystream, min_t(size_t, len - i, AES_BLOCK_SIZE), &out[i]); bigint_inc(ctr + halfblock, halfblock, big_endian); } } void aes_ctr_crypt(const unsigned char *in, unsigned char *out, size_t len, unsigned int bits, const unsigned char *key, const unsigned char *nonce, bool big_endian) { unsigned char ctr[AES_BLOCK_SIZE]; unsigned char keystream[AES_BLOCK_SIZE]; AES_KEY aes_key; aes_ctr_setup(&aes_key, bits, key, nonce, ctr, keystream); aes_ctr_do_crypt(in, out, len, bits, &aes_key, big_endian, ctr, keystream); }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $URL$ * $Id$ * */ #ifndef SKY_STRUC_H #define SKY_STRUC_H namespace Sky { struct DisplayedText { byte *textData; uint32 textWidth; uint16 compactNum; }; #include "common/pack-start.h" // START STRUCT PACKING struct DataFileHeader { uint16 flag; // bit 0: set for colour data, clear for not // bit 1: set for compressed, clear for uncompressed // bit 2: set for 32 colours, clear for 16 colours uint16 s_x; uint16 s_y; uint16 s_width; uint16 s_height; uint16 s_sp_size; uint16 s_tot_size; uint16 s_n_sprites; int16 s_offset_x; int16 s_offset_y; uint16 s_compressed_size; } PACKED_STRUCT; struct TurnTable { uint16 turnTableUp[5]; uint16 turnTableDown[5]; uint16 turnTableLeft[5]; uint16 turnTableRight[5]; uint16 turnTableTalk[5]; } PACKED_STRUCT; struct MegaSet { uint16 gridWidth; // 0 uint16 colOffset; // 1 uint16 colWidth; // 2 uint16 lastChr; // 3 uint16 animUpId; // 4 uint16 animDownId; // 5 uint16 animLeftId; // 6 uint16 animRightId; // 7 uint16 standUpId; // 8 uint16 standDownId; // 9 uint16 standLeftId; // 10 uint16 standRightId; // 11 uint16 standTalkId; // 12 uint16 turnTableId; // 13 } PACKED_STRUCT; struct Compact { uint16 logic; // 0: Entry in logic table to run (byte as <256entries in logic table uint16 status; // 1 uint16 sync; // 2: flag sent to compacts by other things uint16 screen; // 3: current screen uint16 place; // 4: so's this one uint16 getToTableId; // 5: Address of how to get to things table uint16 xcood; // 6 uint16 ycood; // 7 uint16 frame; // 8 uint16 cursorText; // 9 uint16 mouseOn; // 10 uint16 mouseOff; // 11 uint16 mouseClick; // 12 int16 mouseRelX; // 13 int16 mouseRelY; // 14 uint16 mouseSizeX; // 15 uint16 mouseSizeY; // 16 uint16 actionScript; // 17 uint16 upFlag; // 18: usually holds the Action Mode uint16 downFlag; // 19: used for passing back uint16 getToFlag; // 20: used by action script for get to attempts, also frame store (hence word) uint16 flag; // 21: a use any time flag uint16 mood; // 22: high level - stood or not uint16 grafixProgId; // 23 uint16 grafixProgPos;// 24 uint16 offset; // 25 uint16 mode; // 26: which mcode block uint16 baseSub; // 27: 1st mcode block relative to start of compact uint16 baseSub_off; // 28 uint16 actionSub; // 29 uint16 actionSub_off;// 30 uint16 getToSub; // 31 uint16 getToSub_off; // 32 uint16 extraSub; // 33 uint16 extraSub_off; // 34 uint16 dir; // 35 uint16 stopScript; // 36 uint16 miniBump; // 37 uint16 leaving; // 38 uint16 atWatch; // 39: pointer to script variable uint16 atWas; // 40: pointer to script variable uint16 alt; // 41: alternate script uint16 request; // 42 uint16 spWidth_xx; // 43 uint16 spColour; // 44 uint16 spTextId; // 45 uint16 spTime; // 46 uint16 arAnimIndex; // 47 uint16 turnProgId; // 48 uint16 turnProgPos; // 49 uint16 waitingFor; // 50 uint16 arTargetX; // 51 uint16 arTargetY; // 52 uint16 animScratchId;// 53: data area for AR uint16 megaSet; // 54 MegaSet megaSet0; // 55 MegaSet megaSet1; // MegaSet megaSet2; // MegaSet megaSet3; // } PACKED_STRUCT; #include "common/pack-end.h" // END STRUCT PACKING } // End of namespace Sky #endif
/*********************************************************************************** * * * Voreen - The Volume Rendering Engine * * * * Copyright (C) 2005-2012 University of Muenster, Germany. * * Visualization and Computer Graphics Group <http://viscg.uni-muenster.de> * * For a list of authors please refer to the file "CREDITS.txt". * * * * This file is part of the Voreen software package. Voreen 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. * * * * Voreen 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 in the file * * "LICENSE.txt" along with this file. If not, see <http://www.gnu.org/licenses/>. * * * * For non-commercial academic use see the license exception specified in the file * * "LICENSE-academic.txt". To get information about commercial licensing please * * contact the authors. * * * ***********************************************************************************/ #ifndef VRN_PYTHONHIGHLIGHTER_H #define VRN_PYTHONHIGHLIGHTER_H #include "voreen/qt/widgets/syntaxhighlighter.h" namespace voreen { class VRN_QT_API PythonHighlighter : public SyntaxHighlighter { public: PythonHighlighter(QTextDocument* doc); protected: void setupKeywords(); void setupComments(); void setupNumberRules(); }; } // namespace #endif // VRN_PYTHONHIGHLIGHTER_H
/** * @file * * @brief Mutex Timed Lock * @ingroup POSIXAPI */ /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #if HAVE_CONFIG_H #include "config.h" #endif #include <errno.h> #include <pthread.h> #include <rtems/system.h> #include <rtems/score/coremuteximpl.h> #include <rtems/score/todimpl.h> #include <rtems/posix/muteximpl.h> #include <rtems/posix/priorityimpl.h> /** * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 * * NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { Watchdog_Interval ticks; bool do_wait = true; TOD_Absolute_timeout_conversion_results status; int lock_status; /* * POSIX requires that blocking calls with timeouts that take * an absolute timeout must ignore issues with the absolute * time provided if the operation would otherwise succeed. * So we check the abstime provided, and hold on to whether it * is valid or not. If it isn't correct and in the future, * then we do a polling operation and convert the UNSATISFIED * status into the appropriate error. * * If the status is TOD_ABSOLUTE_TIMEOUT_INVALID, * TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST, or TOD_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _TOD_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != TOD_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); /* * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == TOD_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == TOD_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == TOD_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; }
// -*- C++ -*- /*! \file geom/defs.h \brief Definitions for the computational geometry package. */ #if !defined(__geom_defs_h__) //! Include guard. #define __geom_defs_h__ // If we are debugging everything in STLib. #if defined(DEBUG_stlib) && !defined(DEBUG_geom) #define DEBUG_geom #endif //! Begin the geom namespace. #define BEGIN_NAMESPACE_GEOM namespace geom { //! End the geom namespace. #define END_NAMESPACE_GEOM } //! All classes and functions in the computational geometry package are defined in the geom namespace. namespace geom {} #endif
/* * Generated by MTK SP DrvGen Version 03.13.6 for MT6572_NP. Copyright MediaTek Inc. (C) 2013. * Sat May 10 18:56:22 2014 * Do Not Modify the File. */ #ifndef __CUST_AUXADC_TOOL_H #define __CUST_AUXADC_TOOL_H #define AUXADC_USB_ID_CHANNEL 0 #define AUXADC_PCB_REV_CHANNEL 1 #endif //_CUST_AUXADC_TOOL_H
/*************************************************************************** * * * (c) Art Tevs, MPI Informatik Saarbruecken * * mailto: <tevs@mpi-sb.mpg.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. * * * ***************************************************************************/ #ifndef __NR3D_GEOMETRY_H_ #define __NR3D_GEOMETRY_H_ //---------------------------------------------------------------------------------- // Includes //---------------------------------------------------------------------------------- #include <nrEngine/nrEngine.h> #include "nr3D.h" namespace nrEngine { namespace nr3D { //! Geometry class represents the geometry in our 3d world /** * A geometry object does contain mesh information. This are information * like vertices, normals, tangents, colours, texture coordinates and * other things which can be passed to graphics pipeline. * * Actually geometry should also be a resource object controlled by resource * management system. However we decided to use Meshes as resources. So that * each mesh containing the geometry is controlled by resource management. * This could prevent strange artifacts if a mesh is depending somehow on geometry * data (i.e. for animation or collision detection). So we do not get a part * of a mesh unloaded while another is still in the memory. * * \ingroup nr3d **/ class _NRPackageExport Geometry{ public: /** * Create an empty geometry object. **/ Geometry(); /** * Create geometry by copiing it from another one **/ Geometry(const Geometry& g); /** * Remove used memory, so geometry data is not used anymore **/ virtual ~Geometry(); /** * Check whenever the geometry object does contain any data. * @return false if no data available **/ //bool isEmpty() const; /** * Add new primitive array containing primitives to this geometry * object. The data will be copied, so you have then to release the old one. * * @param arr Smart array containing primitives **/ //void addPrimitives(); /** * Set vertex array containing all verticies for this geometry mesh * The array will be copied into internal data structures. So you * have to care about what will happen with original data. * * @param array Array containing the vertices data **/ void setVertexArray(const std::vector<vec3>& data); /** * Same as setVertexArray() but for color information on vertices **/ void setColorArray(const std::vector<vec4>& data); /** * Set normals for verticies **/ void setNormalArray(const std::vector<vec3>& data); /** * Set texture coordinates array. For each texture, we have 3 coordinates **/ void setTexCoordArray(uint32 unit, const std::vector<vec3>& data); /** * Vertex attributes **/ void setVertexAttribArray(uint32 unit, const std::vector<vec3>& data); protected: //! Store verticies of the geometry here std::vector<vec3> mVertexArray; //! Store normals here std::vector<vec3> mNormalArray; //! Store color information here std::vector<vec3> mColorArray; //! Store texture coordinates here std::map<uint32, std::vector<vec3> > mTexCoordArray; //! Store here vertex attributes std::map<uint32, std::vector<vec3> > mVertexAttribArray; /** * Cause the geometry data to empty all buffers. * After applying this method you have no more access * to any data. **/ //void emptyBuffers(); }; }; #endif
/* GStreamer * Copyright (C) <2002> David A. Schleef <ds@schleef.org> * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __GST_VIDEO_TEST_SRC_H__ #define __GST_VIDEO_TEST_SRC_H__ #include <gst/gst.h> #include <gst/base/gstpushsrc.h> #include <gst/video/gstvideometa.h> #include <gst/video/gstvideopool.h> G_BEGIN_DECLS #define GST_TYPE_VIDEO_TEST_SRC \ (gst_video_test_src_get_type()) #define GST_VIDEO_TEST_SRC(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrc)) #define GST_VIDEO_TEST_SRC_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrcClass)) #define GST_IS_VIDEO_TEST_SRC(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_TEST_SRC)) #define GST_IS_VIDEO_TEST_SRC_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_TEST_SRC)) /** * GstVideoTestSrcPattern: * @GST_VIDEO_TEST_SRC_SMPTE: A standard SMPTE test pattern * @GST_VIDEO_TEST_SRC_SNOW: Random noise * @GST_VIDEO_TEST_SRC_BLACK: A black image * @GST_VIDEO_TEST_SRC_WHITE: A white image * @GST_VIDEO_TEST_SRC_RED: A red image * @GST_VIDEO_TEST_SRC_GREEN: A green image * @GST_VIDEO_TEST_SRC_BLUE: A blue image * @GST_VIDEO_TEST_SRC_CHECKERS1: Checkers pattern (1px) * @GST_VIDEO_TEST_SRC_CHECKERS2: Checkers pattern (2px) * @GST_VIDEO_TEST_SRC_CHECKERS4: Checkers pattern (4px) * @GST_VIDEO_TEST_SRC_CHECKERS8: Checkers pattern (8px) * @GST_VIDEO_TEST_SRC_CIRCULAR: Circular pattern * @GST_VIDEO_TEST_SRC_BLINK: Alternate between black and white * @GST_VIDEO_TEST_SRC_SMPTE75: SMPTE test pattern (75% color bars) * @GST_VIDEO_TEST_SRC_ZONE_PLATE: Zone plate * @GST_VIDEO_TEST_SRC_GAMUT: Gamut checking pattern * @GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE: Chroma zone plate * @GST_VIDEO_TEST_SRC_BALL: Moving ball * @GST_VIDEO_TEST_SRC_SMPTE100: SMPTE test pattern (100% color bars) * @GST_VIDEO_TEST_SRC_BAR: Bar with foreground color * @GST_VIDEO_TEST_SRC_PINWHEEL: Pinwheel * @GST_VIDEO_TEST_SRC_SPOKES: Spokes * * The test pattern to produce. * * The Gamut pattern creates a checkerboard pattern of colors at the * edge of the YCbCr gamut and nearby colors that are out of gamut. * The pattern is divided into 4 regions: black, white, red, and blue. * After conversion to RGB, the out-of-gamut colors should be converted * to the same value as their in-gamut neighbors. If the checkerboard * pattern is still visible after conversion, this indicates a faulty * conversion. Image manipulation, such as adjusting contrast or * brightness, can also cause the pattern to be visible. * * The Zone Plate pattern is based on BBC R&D Report 1978/23, and can * be used to test spatial frequency response of a system. This * pattern generator is controlled by the xoffset and yoffset parameters * and also by all the parameters starting with 'k'. The default * parameters produce a grey pattern. Try 'videotestsrc * pattern=zone-plate kx2=20 ky2=20 kt=1' to produce something * interesting. */ typedef enum { GST_VIDEO_TEST_SRC_SMPTE, GST_VIDEO_TEST_SRC_SNOW, GST_VIDEO_TEST_SRC_BLACK, GST_VIDEO_TEST_SRC_WHITE, GST_VIDEO_TEST_SRC_RED, GST_VIDEO_TEST_SRC_GREEN, GST_VIDEO_TEST_SRC_BLUE, GST_VIDEO_TEST_SRC_CHECKERS1, GST_VIDEO_TEST_SRC_CHECKERS2, GST_VIDEO_TEST_SRC_CHECKERS4, GST_VIDEO_TEST_SRC_CHECKERS8, GST_VIDEO_TEST_SRC_CIRCULAR, GST_VIDEO_TEST_SRC_BLINK, GST_VIDEO_TEST_SRC_SMPTE75, GST_VIDEO_TEST_SRC_ZONE_PLATE, GST_VIDEO_TEST_SRC_GAMUT, GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE, GST_VIDEO_TEST_SRC_SOLID, GST_VIDEO_TEST_SRC_BALL, GST_VIDEO_TEST_SRC_SMPTE100, GST_VIDEO_TEST_SRC_BAR, GST_VIDEO_TEST_SRC_PINWHEEL, GST_VIDEO_TEST_SRC_SPOKES } GstVideoTestSrcPattern; typedef struct _GstVideoTestSrc GstVideoTestSrc; typedef struct _GstVideoTestSrcClass GstVideoTestSrcClass; /** * GstVideoTestSrc: * * Opaque data structure. */ struct _GstVideoTestSrc { GstPushSrc element; /*< private >*/ /* type of output */ GstVideoTestSrcPattern pattern_type; /* video state */ GstVideoInfo info; GstVideoChromaResample *subsample; gboolean bayer; gint x_invert; gint y_invert; /* private */ gint64 timestamp_offset; /* base offset */ /* running time and frames for current caps */ GstClockTime running_time; /* total running time */ gint64 n_frames; /* total frames sent */ /* previous caps running time and frames */ GstClockTime accum_rtime; /* accumulated running_time */ gint64 accum_frames; /* accumulated frames */ /* zoneplate */ gint k0; gint kx; gint ky; gint kt; gint kxt; gint kyt; gint kxy; gint kx2; gint ky2; gint kt2; gint xoffset; gint yoffset; /* solid color */ guint foreground_color; guint background_color; /* moving color bars */ gint horizontal_offset; gint horizontal_speed; void (*make_image) (GstVideoTestSrc *v, GstVideoFrame *frame); /* temporary AYUV/ARGB scanline */ guint8 *tmpline_u8; guint8 *tmpline; guint8 *tmpline2; guint16 *tmpline_u16; guint n_lines; gint offset; gpointer *lines; }; struct _GstVideoTestSrcClass { GstPushSrcClass parent_class; }; GType gst_video_test_src_get_type (void); G_END_DECLS #endif /* __GST_VIDEO_TEST_SRC_H__ */
// XGetopt.h Version 1.2 // // Author: Hans Dietrich // hdietrich2@hotmail.com // // This software is released into the public domain. // You are free to use it in any way you like. // // This software is provided "as is" with no expressed // or implied warranty. I accept no liability for any // damage or loss of business that this software may cause. // /////////////////////////////////////////////////////////////////////////////// #ifndef XGETOPT_H #define XGETOPT_H #ifdef __cplusplus extern "C" { #endif extern int optind, opterr; extern char *optarg; int getopt(int argc, char *argv[], char *optstring); #ifdef __cplusplus } #endif #endif //XGETOPT_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 QtOpenGL 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$ ** ****************************************************************************/ #ifdef QT_OPENGL_ES_1_CL // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of the QGLWidget class. This header file may change from // version to version without notice, or even be removed. // // We mean it. // QT_BEGIN_NAMESPACE inline void glTexParameterf (GLenum target, GLenum pname, GLfloat param) { glTexParameterx(target, pname, FLOAT2X(param)); } inline void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { glClearColorx(FLOAT2X(red) ,FLOAT2X(green), FLOAT2X(blue), FLOAT2X(alpha)); } inline void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { glColor4x(FLOAT2X(red) ,FLOAT2X(green), FLOAT2X(blue), FLOAT2X(alpha)); } inline void glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) { glOrthox(FLOAT2X(left), FLOAT2X(right), FLOAT2X(bottom), FLOAT2X(top), FLOAT2X(zNear), FLOAT2X(zFar)); } inline void glPointSize (GLfloat size) { glPointSizex(FLOAT2X(size)); } inline void glPolygonOffset (GLfloat factor, GLfloat units) { glPolygonOffsetx (FLOAT2X(factor), FLOAT2X(units)); } inline void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { glRotatex(FLOAT2X(angle), FLOAT2X(x), FLOAT2X(y), FLOAT2X(z)); } inline void glTranslatef (GLfloat x, GLfloat y, GLfloat z) { glTranslatex(FLOAT2X(x) ,FLOAT2X(y) ,FLOAT2X(z)); } inline void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz) { glNormal3x(FLOAT2X(nx), FLOAT2X(ny), FLOAT2X(nz)); } inline void glScalef(GLfloat x, GLfloat y, GLfloat z) { glScalex(FLOAT2X(x), FLOAT2X(y), FLOAT2X(z)); } inline void glClearDepthf (GLclampf depth) { glClearDepthx(FLOAT2X(depth)); } inline void glAlphaFunc (GLenum func, GLclampf ref) { glAlphaFuncx(func, FLOAT2X(ref)); } inline void glLoadMatrixf (const GLfloat *_m) { GLfixed m[16]; for (int i =0; i < 16; i++) m[i] = FLOAT2X(_m[i]); glLoadMatrixx(m); } inline void glMultMatrixf (const GLfloat *_m) { GLfixed m[16]; for (int i =0; i < 16; i++) m[i] = FLOAT2X(_m[i]); glMultMatrixx (m); } inline void glLineWidth (GLfloat width) { glLineWidthx(FLOAT2X(width)); } QT_END_NAMESPACE #endif //QT_OPENGL_ES_1_CL
/*************************************************************************** * Copyright (C) 2010, 2011 by EP Studios, Inc. * * mannd@epstudiossoftware.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 STUDYMANAGER_H #define STUDYMANAGER_H #include "catalog.h" namespace EpHardware { namespace EpOpticalDisk { class OpticalDisk; }} namespace EpStudy { class StudyWriter; // manages complex Study file handling class StudyManager { public: // StudyManager(); StudyManager(EpHardware::EpOpticalDisk::OpticalDisk*, StudyWriter*, const QString& networkPath = QString(), EpNavigator::Catalog::Source = EpNavigator::Catalog::System); Study* getPreregisterStudy(const QString& key); QString systemPath() const {return systemPath_;} QString opticalStudiesPath() const; // bool useNetwork() const {return useNetwork_;} EpNavigator::Catalog::Source activeCatalog() const {return activeCatalog_;} void setSystemPath(const QString& systemPath) { systemPath_ = systemPath; } void setOpticalDisk(EpHardware::EpOpticalDisk::OpticalDisk*); void setOpticalPath(const QString& opticalPath) { opticalPath_ = opticalPath; } void setNetworkPath(const QString& networkPath) { networkPath_ = networkPath; } void setOtherPath(const QString& otherPath) { otherPath_ = otherPath; } void setUseNetwork(bool value) {useNetwork_ = value;} void setActiveCatalog(EpNavigator::Catalog::Source activeCatalog) { activeCatalog_ = activeCatalog;} void setStudy(Study*); void addStudyToCatalog(Study*); void addStudy(Study*); // handles pre-register, network Study* study(); Study* study(const QString& key); private: void init(); QString studiesPath(const QString& path) const; QString activeCatalogStudiesPath() const; QString systemPath_; QString opticalPath_; QString networkPath_; QString otherPath_; EpHardware::EpOpticalDisk::OpticalDisk* opticalDisk_; StudyWriter* studyWriter_; EpNavigator::Catalog::Source activeCatalog_; bool useNetwork_; Study* study_; }; } // namespace EpStudy #endif
// Copyright 2010 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <memory> #include <string> #include "Common/MathUtil.h" #include "VideoBackends/D3D12/D3DBase.h" #include "VideoBackends/D3D12/D3DState.h" #include "VideoBackends/D3D12/D3DStreamBuffer.h" #include "VideoCommon/RenderBase.h" namespace DX12 { extern StateCache s_gx_state_cache; namespace D3D { void ResourceBarrier(ID3D12GraphicsCommandList* command_list, ID3D12Resource* resource, D3D12_RESOURCE_STATES state_before, D3D12_RESOURCE_STATES state_after, UINT subresource); // Font creation flags static const unsigned int s_d3dfont_bold = 0x0001; static const unsigned int s_d3dfont_italic = 0x0002; // Font rendering flags static const unsigned int s_d3dfont_centered = 0x0001; class CD3DFont { public: CD3DFont(); // 2D text drawing function // Initializing and destroying device-dependent objects int Init(); int Shutdown(); int DrawTextScaled(float x, float y, float size, float spacing, u32 dwColor, const std::string& text); private: ID3D12Resource* m_texture = nullptr; D3D12_CPU_DESCRIPTOR_HANDLE m_texture_cpu = {}; D3D12_GPU_DESCRIPTOR_HANDLE m_texture_gpu = {}; std::unique_ptr<D3DStreamBuffer> m_vertex_buffer; D3D12_INPUT_LAYOUT_DESC m_input_layout = {}; D3D12_SHADER_BYTECODE m_pshader = {}; D3D12_SHADER_BYTECODE m_vshader = {}; D3D12_BLEND_DESC m_blendstate = {}; D3D12_RASTERIZER_DESC m_raststate = {}; ID3D12PipelineState* m_pso = nullptr; unsigned int m_line_height = 0; float m_tex_coords[128 - 32][4] = {}; const int m_tex_width; const int m_tex_height; void InitalizeSRV(); }; // Ring buffer class, shared between the draw* functions class UtilVertexBuffer { public: UtilVertexBuffer(size_t size); ~UtilVertexBuffer(); // returns vertex offset to the new data size_t AppendData(void* data, size_t size, size_t vertex_size); size_t ReserveData(void** write_ptr, size_t size, size_t vertex_size); inline ID3D12Resource* GetBuffer() { return m_stream_buffer->GetBuffer(); } inline size_t GetSize() const { return m_stream_buffer->GetSize(); } private: std::unique_ptr<D3DStreamBuffer> m_stream_buffer; }; extern CD3DFont font; void InitUtils(); void ShutdownUtils(); void SetPointCopySampler(); void SetLinearCopySampler(); inline void SetViewportAndScissor(int top_left_x, int top_left_y, int width, int height, float min_depth = D3D12_MIN_DEPTH, float max_depth = D3D12_MAX_DEPTH) { D3D12_VIEWPORT viewport = { static_cast<float>(top_left_x), static_cast<float>(top_left_y), static_cast<float>(width), static_cast<float>(height), min_depth, max_depth }; D3D12_RECT scissor = { static_cast<LONG>(top_left_x), static_cast<LONG>(top_left_y), static_cast<LONG>(top_left_x + width), static_cast<LONG>(top_left_y + height) }; D3D::current_command_list->RSSetViewports(1, &viewport); D3D::current_command_list->RSSetScissorRects(1, &scissor); } void DrawShadedTexQuad(D3DTexture2D* texture, const D3D12_RECT* source, int source_width, int source_height, D3D12_SHADER_BYTECODE pshader12 = {}, D3D12_SHADER_BYTECODE vshader12 = {}, D3D12_INPUT_LAYOUT_DESC layout12 = {}, D3D12_SHADER_BYTECODE gshader12 = {}, u32 slice = 0, DXGI_FORMAT rt_format = DXGI_FORMAT_R8G8B8A8_UNORM, bool inherit_srv_binding = false, bool rt_multisampled = false, D3D12_DEPTH_STENCIL_DESC* depth_stencil_desc_override = nullptr ); void DrawClearQuad(u32 Color, float z, D3D12_BLEND_DESC* blend_desc, D3D12_DEPTH_STENCIL_DESC* depth_stencil_desc, bool rt_multisampled, DXGI_FORMAT rt_format); void DrawEFBPokeQuads(EFBAccessType type, const EfbPokeData* points, size_t num_points, D3D12_BLEND_DESC* blend_desc, D3D12_DEPTH_STENCIL_DESC* depth_stencil_desc, D3D12_CPU_DESCRIPTOR_HANDLE* render_target, D3D12_CPU_DESCRIPTOR_HANDLE* depth_buffer, bool rt_multisampled, DXGI_FORMAT rt_format); } }
#include <linux/bio.h> int main(void) { struct bio *bio = NULL; struct bio_set *bio_set = NULL; bio_free(bio, bio_set); return 0; }
/******************************************************************************* * Filename: target_core_hba.c * * This file copntains the iSCSI HBA Transport related functions. * * Copyright (c) 2003, 2004, 2005 PyX Technologies, Inc. * Copyright (c) 2005, 2006, 2007 SBE, Inc. * Copyright (c) 2007-2009 Rising Tide Software, Inc. * Copyright (c) 2008-2009 Linux-iSCSI.org * * Nicholas A. Bellinger <nab@kernel.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ******************************************************************************/ #define TARGET_CORE_HBA_C #include <linux/net.h> #include <linux/string.h> #include <linux/timer.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/smp_lock.h> #include <linux/in.h> #include <net/sock.h> #include <net/tcp.h> #include <../lio-core/iscsi_linux_defs.h> #include <target/target_core_base.h> #include <target/target_core_device.h> #include <target/target_core_device.h> #include <target/target_core_hba.h> #include <target/target_core_tpg.h> #include <target/target_core_transport.h> #include <target/target_core_plugin.h> #include <target/target_core_seobj.h> #undef TARGET_CORE_HBA_C int core_get_hba(se_hba_t *hba) { return ((down_interruptible(&hba->hba_access_sem) != 0) ? -1 : 0); } se_hba_t *core_alloc_hba(int hba_type) { se_hba_t *hba; hba = kmem_cache_zalloc(se_hba_cache, GFP_KERNEL); if (!(hba)) { printk(KERN_ERR "Unable to allocate se_hba_t\n"); return NULL; } hba->hba_status |= HBA_STATUS_FREE; hba->type = hba_type; INIT_LIST_HEAD(&hba->hba_dev_list); spin_lock_init(&hba->device_lock); spin_lock_init(&hba->hba_queue_lock); init_MUTEX(&hba->hba_access_sem); #ifdef SNMP_SUPPORT hba->hba_index = scsi_get_new_index(SCSI_INST_INDEX); #endif return hba; } EXPORT_SYMBOL(core_alloc_hba); void core_put_hba(se_hba_t *hba) { up(&hba->hba_access_sem); } EXPORT_SYMBOL(core_put_hba); /* se_core_add_hba(): * * */ int se_core_add_hba( se_hba_t *hba, u32 plugin_dep_id) { se_subsystem_api_t *t; int ret = 0; if (hba->hba_status & HBA_STATUS_ACTIVE) return -EEXIST; atomic_set(&hba->max_queue_depth, 0); atomic_set(&hba->left_queue_depth, 0); t = (se_subsystem_api_t *)plugin_get_obj(PLUGIN_TYPE_TRANSPORT, hba->type, &ret); if (!(t)) return -EINVAL; ret = t->attach_hba(hba, plugin_dep_id); if (ret < 0) return ret; hba->hba_status &= ~HBA_STATUS_FREE; hba->hba_status |= HBA_STATUS_ACTIVE; spin_lock(&se_global->hba_lock); hba->hba_id = se_global->g_hba_id_counter++; list_add_tail(&hba->hba_list, &se_global->g_hba_list); spin_unlock(&se_global->hba_lock); printk(KERN_INFO "CORE_HBA[%d] - Attached HBA to Generic Target" " Core\n", hba->hba_id); return 0; } EXPORT_SYMBOL(se_core_add_hba); static int se_core_shutdown_hba( se_hba_t *hba) { int ret = 0; se_subsystem_api_t *t; t = (se_subsystem_api_t *)plugin_get_obj(PLUGIN_TYPE_TRANSPORT, hba->type, &ret); if (!(t)) return ret; if (t->detach_hba(hba) < 0) return -1; return 0; } /* se_core_del_hba(): * * */ int se_core_del_hba( se_hba_t *hba) { if (!(hba->hba_status & HBA_STATUS_ACTIVE)) { printk(KERN_ERR "HBA ID: %d Status: INACTIVE, ignoring" " delhbafromtarget request\n", hba->hba_id); return -EINVAL; } if (!list_empty(&hba->hba_dev_list)) dump_stack(); se_core_shutdown_hba(hba); spin_lock(&se_global->hba_lock); list_del(&hba->hba_list); spin_unlock(&se_global->hba_lock); hba->type = 0; hba->transport = NULL; hba->hba_status &= ~HBA_STATUS_ACTIVE; hba->hba_status |= HBA_STATUS_FREE; printk(KERN_INFO "CORE_HBA[%d] - Detached HBA from Generic Target" " Core\n", hba->hba_id); kmem_cache_free(se_hba_cache, hba); return 0; } EXPORT_SYMBOL(se_core_del_hba);
/* * \brief Root component of an emulated IO_MEM service * \author Martin Stein * \date 2012-06-11 */ /* * Copyright (C) 2012 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. */ #ifndef _INCLUDE__IO_MEM_SESSION__ROOT_H_ #define _INCLUDE__IO_MEM_SESSION__ROOT_H_ /* Genode includes */ #include <emulation_session/emulation_session.h> #include <util/string.h> #include <root/component.h> /* local includes */ #include <io_mem_session/component.h> #include <util/assert.h> namespace Init { using namespace Genode; const char * emulation_key(); /** * Root component of an emulated IO_MEM service */ class Io_mem_root : public Root_component<Io_mem_session_component> { Rm_root * const _rm_root; /** * Create a new session for the requested MMIO * * \param args Session-creation arguments */ Io_mem_session_component * _create_session(const char * args) { /* get session attributes */ addr_t base = Arg_string::find_arg(args, "base").ulong_value(0); size_t size = Arg_string::find_arg(args, "size").ulong_value(0); Emulation::Session * const emu_session = (Emulation::Session *) Arg_string::find_arg(args, emulation_key()).ulong_value(0); assert(emu_session); /* create session */ return new (md_alloc()) Io_mem_session_component(_rm_root, base, size, emu_session); } public: /** * Constructor * * \param ep Entrypoint for the root component * \param md_alloc Meta-data allocator for the root component */ Io_mem_root(Rpc_entrypoint * const ep, Allocator * const md, Rm_root * const rm_root) : Root_component<Io_mem_session_component>(ep, md), _rm_root(rm_root) { } }; } #endif /* _INCLUDE__IO_MEM_SESSION__ROOT_H_ */
/** \file Parse.h - parse a string ** ** Written: 1999-Feb-10 grymse@alhem.net **/ /* Copyright (C) 1999-2008 Anders Hedstrom This library is made available under the terms of the GNU GPL. If you would like to use this library in a closed-source application, a separate license agreement is available. For information about the closed-source license agreement for the C++ sockets library, please visit http://www.alhem.net/Sockets/license.html and/or email license@alhem.net. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Parse_H #define _SOCKETS_Parse_H #include "sockets-config.h" #ifdef _MSC_VER #pragma warning(disable:4514) #endif #include <string> #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { #endif /***************************************************/ /* interface of class Parse */ /** Splits a string whatever way you want. \ingroup util */ class Parse { public: Parse(); Parse(const std::string&); Parse(const std::string&,const std::string&); Parse(const std::string&,const std::string&,short); ~Parse(); short issplit(const char); void getsplit(); void getsplit(std::string&); std::string getword(); void getword(std::string&); void getword(std::string&,std::string&,int); std::string getrest(); void getrest(std::string&); long getvalue(); void setbreak(const char); int getwordlen(); int getrestlen(); void enablebreak(const char c) { pa_enable = c; } void disablebreak(const char c) { pa_disable = c; } void getline(); void getline(std::string&); size_t getptr() { return pa_the_ptr; } void EnableQuote(bool b) { pa_quote = b; } private: std::string pa_the_str; std::string pa_splits; std::string pa_ord; size_t pa_the_ptr; char pa_breakchar; char pa_enable; char pa_disable; short pa_nospace; bool pa_quote; }; #ifdef SOCKETS_NAMESPACE } #endif #endif // _SOCKETS_Parse_H
/* Copyright (C) 2015 DiUS Computing Pty. Ltd. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef _PDI_H_ #define _PDI_H_ #include <stdint.h> #include <stdbool.h> #define PDI_REG_STATUS 0x00 #define PDI_REG_RESET 0x01 #define PDI_REG_CONTROL 0x02 // --- Initialisation (including pushing the device into PDI mode) --- bool pdi_init (uint8_t clk_pin, uint8_t data_pin, uint16_t delay_us); bool pdi_open (void); void pdi_close (void); // --- Low-level API ------------------------------------------------- // PDI commands enum { LDS = 0x00, // lower 4 bits: address-size; data-size (byte, word, 3, long) STS = 0x40, // "-" LD = 0x20, // lower 4 bits: ptr mode; size (byte, word, 3, long) ST = 0x60, // -"- LDCS = 0x80, // lower 2 bits: register no STCS = 0xC0, // -"- KEY = 0xE0, REPEAT = 0xA0 // lower 2 bits indicate length field following }; // pointer modes (*ptr, *ptr++, ptr, ptr++), for LD/ST commands enum { xPTR = (0 << 2), xPTRpp = (1 << 2), PTR = (2 << 2), PTRpp = (3 << 2) }; // sizes enum { SZ_1 = 0, SZ_2 = 1, SZ_3 = 2, SZ_4 = 3 }; typedef enum { PDI_OUT, PDI_IN } pdi_dir_t; typedef struct pdi_transfer { uint32_t len; char *buf; pdi_dir_t dir; } pdi_transfer_t; typedef struct pdi_sequence { pdi_transfer_t *xfer; struct pdi_sequence *next; } pdi_sequence_t; typedef void (*pdi_sequence_done_fn_t) (bool success, pdi_sequence_t *seq); // returns false if a job is already in progress // null ptrs or zero-length transfers NOT supported bool pdi_set_sequence (pdi_sequence_t *sequence, pdi_sequence_done_fn_t fn); // sends the double-break indication (unless a sequence is in progress) bool pdi_break (void); void pdi_run (void); void pdi_stop (void); // --- High-level API - be mindful of clock gaps - no printf'ing! ----- bool pdi_send (const char *buf, uint32_t len); bool pdi_recv (char *buf, uint32_t len); bool pdi_sendrecv (const char *cmd, uint32_t cmdlen, char *buf, uint32_t rxlen); #endif
/* * This file is part of the coreboot project. * * Copyright (C) 2013 Google, 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied wacbmem_entryanty 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 */ #include <arch/io.h> #include <baytrail/iosf.h> #if !defined(__PRE_RAM__) #define IOSF_PCI_BASE (CONFIG_MMCONF_BASE_ADDRESS + (IOSF_PCI_DEV << 12)) static inline void write_iosf_reg(int reg, uint32_t value) { write32(IOSF_PCI_BASE + reg, value); } static inline uint32_t read_iosf_reg(int reg) { return read32(IOSF_PCI_BASE + reg); } #else static inline void write_iosf_reg(int reg, uint32_t value) { pci_write_config32(IOSF_PCI_DEV, reg, value); } static inline uint32_t read_iosf_reg(int reg) { return pci_read_config32(IOSF_PCI_DEV, reg); } #endif uint32_t iosf_bunit_read(int reg) { uint32_t cr = IOSF_OPCODE(IOSF_OP_READ_BUNIT) | IOSF_PORT(IOSF_PORT_BUNIT) | IOSF_REG(reg) | IOSF_BYTE_EN; write_iosf_reg(MCR_REG, cr); return read_iosf_reg(MDR_REG); } void iosf_bunit_write(int reg, uint32_t val) { uint32_t cr = IOSF_OPCODE(IOSF_OP_WRITE_BUNIT) | IOSF_PORT(IOSF_PORT_BUNIT) | IOSF_REG(reg) | IOSF_BYTE_EN; write_iosf_reg(MCR_REG, cr); write_iosf_reg(MDR_REG, val); } uint32_t iosf_dunit_read(int reg) { uint32_t cr = IOSF_OPCODE(IOSF_OP_READ_SYSMEMC) | IOSF_PORT(IOSF_PORT_SYSMEMC) | IOSF_REG(reg) | IOSF_BYTE_EN; write_iosf_reg(MCR_REG, cr); return read_iosf_reg(MDR_REG); } void iosf_dunit_write(int reg, uint32_t val) { uint32_t cr = IOSF_OPCODE(IOSF_OP_WRITE_SYSMEMC) | IOSF_PORT(IOSF_PORT_SYSMEMC) | IOSF_REG(reg) | IOSF_BYTE_EN; write_iosf_reg(MCR_REG, cr); write_iosf_reg(MDR_REG, val); }
#ifndef CPC_PROT_H #define CPC_PROT_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef WIN32 #include <netinet/in.h> #endif #define CPC_TYPE_NS 1 #define CPC_TYPE_LINUX 2 #define CPC_TYPE_WIN 3 #include "cpc_defs.h" struct cpc_prot { int type; int len; void *data; }; #define NS_PROT_SIZE (sizeof(struct cpc_prot_ns)) void cpc_prot_send_packet(char *p, int n, struct in_addr dst); void cpc_prot_send_packet_with_data(char *p, int n, struct in_addr src, struct in_addr dst, struct in_addr next); #ifdef CPC_NS class CpcAgent; struct cpc_prot_ns { CpcAgent *agent; }; int cpc_init_ns(CpcAgent *agent); int cpc_des_ns(); #endif /* CPC_NS */ #ifdef CPC_LINUX #include <linux/netlink.h> struct prot_callback { process_route_prot prot_callback; process_route_table rt_callback; process_request_route route_req_callback; }; struct prot_callback callback_set; #define LINUX_PROT_SIZE (sizeof(struct cpc_prot_linux)) int cpc_init_linux(struct prot_callback *set); int cpc_des_linux(); #endif /* CPC_LINUX */ #ifdef WIN32 #define ROUTING_PORT 10000 struct ProtCallback { process_route_prot prot_callback; process_route_table rt_callback; process_request_route route_req_callback; }; struct ProtCallback callback_set; int cpc_init_win(struct ProtCallback *set); int cpc_des_win(void); #endif /* WIN32 */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CPC_PROT_H */
/** * @file cp_mission_terror.h * @brief Campaign mission headers */ /* Copyright (C) 2002-2011 UFO: Alien Invasion. 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 CP_MISSION_TERROR_H #define CP_MISSION_TERROR_H void CP_TerrorMissionOnSpawn(void); void CP_TerrorMissionStart(mission_t *mission); void CP_TerrorMissionIsFailure(mission_t *mission); void CP_TerrorMissionIsSuccess(mission_t *mission); void CP_TerrorMissionNextStage(mission_t *mission); #endif
/* * Copyright (c) 1991 Stanford University * Copyright (c) 1991 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Stanford and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Stanford and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef os_host_h #define os_host_h #include <OS/enter-scope.h> class Host { public: static const char* name(); private: static char name_[100]; }; #endif
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "stringmanager.h" namespace Ui { class MainWindow; } class KeyLineEdit; class StringManager; class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); protected: // overriden to handle windows global hotkey messages bool nativeEvent(const QByteArray &eventType, void *message, long *result); private: Ui::MainWindow *ui; StringManager stringManager; // setup the default connections of the application void makeConnections(); // register the global hotkeys void registerHotKeys(); // unregister global hotkeys void unregisterHotKeys(); private slots: // updates the stringHotKeys element of signal sender's name with str void on_keylineedit_edited(QString str); }; #endif // MAINWINDOW_H
// SWAG protocol device library // if you like this project, please add a start :) #include "include/Swag.h"
#ifndef DEBUG_H #define DEBUG_H // Enable/disable debug output globally #define DEBUG 1 #ifdef __cplusplus # include <QString> # include <iostream> /** * Operator that writes a QString to a std::ostream * @param out output stream to write into * @param s the QString to be written * @return the output stream with \a s written to it */ std::ostream& operator<<(std::ostream& out, const QString &s); namespace VersionInfo { extern const char* release; extern const char* svnRevision; extern const char* buildDate; extern const char* architecture; } namespace ProjectInfo { extern const char* projectName; extern const char* homePage; extern const char* bugTracker; extern const char* devMailingList; extern const char* userMailingList; } #endif /* __cplusplus */ #if (DEBUG == 1) && defined(__cplusplus) // Enable debug output for symbol parsing // (mostly in insightd/kernelsymbolparser.cpp) #undef DEBUG_SYM_PARSING //#define DEBUG_SYM_PARSING 1 // Activate for detailed node evaluation tracking #undef DEBUG_NODE_EVAL //#define DEBUG_NODE_EVAL 1 // Enable debug output for points-to analysis // (mostly in libcparser/asttypeevaluator.cpp) #undef DEBUG_POINTS_TO //#define DEBUG_POINTS_TO 1 // Enable debug output for used-as analysis // (mostly in libcparser/asttypeevaluator.cpp) #undef DEBUG_USED_AS //#define DEBUG_USED_AS 1 // Enable debug output for applying used-as relations to the types and symbols // (mostly in insightd/symfactory.cpp) #undef DEBUG_APPLY_USED_AS //#define DEBUG_APPLY_USED_AS 1 // Enable debug output for type merging after parsing the kernel source code // (mostly in insightd/symfactory.cpp) #undef DEBUG_MERGE_TYPES_AFTER_PARSING //#define DEBUG_MERGE_TYPES_AFTER_PARSING 1 #if !defined(_WIN32) && !defined(DEBUG_NO_COLORS) && !defined(NO_ANSI_COLORS) #define DEBUG_COLOR_DIM "\033[" "0" ";" "90" "m" #define DEBUG_COLOR_ERR "\033[" "0" ";" "91" "m" #define DEBUG_COLOR_RST "\033[" "0" "m" #else #define DEBUG_COLOR_DIM "" #define DEBUG_COLOR_ERR "" #define DEBUG_COLOR_RST "" #endif // # include <QTime> # include <iomanip> # include <sstream> # ifndef assert # define assert(x) if ( !(x) ) \ std::cerr << DEBUG_COLOR_DIM "(" __FILE__ ":" << __LINE__ << ")"\ DEBUG_COLOR_ERR " Assertion failed: " << #x << DEBUG_COLOR_RST << std::endl # endif # define debugerr(x) std::cerr << std::dec << DEBUG_COLOR_DIM "(" __FILE__ ":" << __LINE__ << ") " DEBUG_COLOR_ERR \ << x << std::endl << DEBUG_COLOR_RST << std::flush # define debugmsg(x) std::cout << std::dec << DEBUG_COLOR_DIM "(" __FILE__ ":" << __LINE__ << ") " DEBUG_COLOR_RST \ << x << std::endl << std::flush /*# define debugmsg(x) std::cout << std::dec << "(" << QTime::currentTime().toString("mm:ss.zzz").toStdString() << " " << __FILE__ << ":" << __LINE__ << ") " \ << x << std::endl << std::flush*/ # define debugenter() debugmsg("entering " << __PRETTY_FUNCTION__) # define debugleave() debugmsg("leaving " << __PRETTY_FUNCTION__) #else # ifndef assert # define assert(x) do { (x); } while (0) # endif # define debugmsg(x) # define debugerr(x) # define debugenter(x) # define debugleave(x) #endif /*DEBUG*/ #endif /* DEBUG_H */
/*************************************************************************** CUser.h (c) 2000-2013 Benoît Minisini <gambas@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, 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 __CUSER_H #define __CUSER_H #include "gambas.h" #include "gb.db.h" #include "CConnection.h" #ifndef __CUSER_C extern GB_DESC CConnectionUsersDesc[]; extern GB_DESC CUserDesc[]; #else #define THIS ((CUSER *)_object) #endif typedef struct { GB_BASE ob; DB_DRIVER *driver; CCONNECTION *conn; char *name; DB_USER info; } CUSER; void *CUSER_get(CCONNECTION *conn, const char *key); int CUSER_exist(CCONNECTION *conn, const char *key); void CUSER_list(CCONNECTION *conn, char ***list); void CUSER_release(CCONNECTION *conn, void *_object); #endif
/* This file is a part of ORCOM software distributed under GNU GPL 2 licence. Homepage: http://sun.aei.polsl.pl/orcom Github: http://github.com/lrog/orcom Authors: Sebastian Deorowicz, Szymon Grabowski and Lucas Roguski */ #ifndef H_DNARCHFILE #define H_DNARCHFILE #include "../orcom_bin/Globals.h" #include "Params.h" #include "CompressedBlockData.h" #include "../orcom_bin/FileStream.h" #include "../orcom_bin/Params.h" class DnarchFileBase { public: virtual ~DnarchFileBase() {} protected: struct DnarchFileHeader { static const uint32 ReservedBytes = 3; static const uint32 HeaderSize = 8 + 4 + ReservedBytes + 9; uint64 footerOffset; uint32 footerSize; uchar reserved[ReservedBytes]; MinimizerParameters minParams; DnarchFileHeader() { STATIC_ASSERT(sizeof(DnarchFileHeader) == HeaderSize); } }; struct DnarchFileFooter { std::vector<uint64> blockSizes; }; DnarchFileHeader fileHeader; DnarchFileFooter fileFooter; }; class DnarchFileWriter : public DnarchFileBase { public: DnarchFileWriter(); ~DnarchFileWriter(); void StartCompress(const std::string& fileName_, const MinimizerParameters& minParams_, const CompressorParams& compParams_); void WriteNextBin(const CompressedDnaBlock* bin_); void FinishCompress(); const std::vector<uint64> GetStreamSizes() const { return streamSizes; } protected: FileStreamWriter* metaStream; FileStreamWriter* dataStream; CompressorParams compParams; std::vector<uint64> streamSizes; // for DEBUG purposes void WriteFileHeader(); void WriteFileFooter(); }; class DnarchFileReader : public DnarchFileBase { public: DnarchFileReader(); ~DnarchFileReader(); void StartDecompress(const std::string& fileName_, MinimizerParameters& minParams_); bool ReadNextBin(CompressedDnaBlock *bin_); void FinishDecompress(); protected: FileStreamReader* metaStream; FileStreamReader* dataStream; uint64 blockIdx; void ReadFileHeader(); void ReadFileFooter(); }; #endif // H_DNARCHFILE
/* A Bison parser, made by GNU Bison 2.5. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOK = 258 }; #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE asdftest_yylval;
#ifndef md_pcap_adapter_h #define md_pcap_adapter_h #include <linux/if_ether.h> #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/tcp.h> #include <netinet/udp.h> #include <pcap/bpf.h> #include <pcap/pcap.h> #include <pcap/sll.h> #include <sys/types.h> #include <cstdbool> #include <cstdint> #include <iostream> #include <stdexcept> #include <string> template<typename TokenContainer, typename MD> class md_pcap_adapter: public md_adapter { public: const static int DEFAULT_SNAPLEN = 65535; /** * Create the pcap adapter to allow file or device packet sensing * * @param dev_name the device i.e eth0 or file name data/md-test-2.pcap * @param filter used for pcap capture filter i.e certain sub address or ports * @param snapLength length of the data segment, default allows the biggest * @param promisc allows us to listen to traffic * @param timeOut */ md_pcap_adapter(const std::string & dev_name, const std::string & filter="", int snapLength = DEFAULT_SNAPLEN, bool promisc = true, int timeOut = 500) { char error_buff[256]; // See if it is a file type pcap_hdl = pcap_open_offline(dev_name.c_str(), error_buff); // If not open and interface i.e eth0 if (!pcap_hdl) { pcap_hdl = pcap_open_live(dev_name.c_str(), snapLength, promisc,timeOut, error_buff); isdev=true; } if (!pcap_hdl) { throw std::runtime_error(std::string("Could not find pcap device or file:") + error_buff); } std::cerr << "[name:" + std::string(dev_name) + "]\n"; // what kind of link layer is it, just to waht out for the differnce in cooked versus // ethernet int link_layer_type = pcap_datalink(pcap_hdl); if (link_layer_type == DLT_LINUX_SLL) { link_layer_type = SLL_HDR_LEN; std::cerr << "Changed _linkLayerLength to cooked :" << link_layer_length << " " << pcap_datalink_val_to_name(link_layer_type) << "\n"; } // Apply the filter @see pcap manual for details, same as tcpdump bpf_program fcode; int optimize = 1; if (pcap_compile(pcap_hdl, &fcode, filter.c_str(), optimize, 0) < 0) { throw std::runtime_error(std::string("Falied to compile pcap:")+ pcap_geterr(pcap_hdl)); } if (pcap_setfilter(pcap_hdl, &fcode) < 0) { throw std::runtime_error(std::string("Falied to set filter for pcap:")+ pcap_geterr(pcap_hdl)); } pcap_freecode(&fcode); } /** * Destroy and cleanup * */ ~md_pcap_adapter() { if (pcap_hdl) { pcap_close(pcap_hdl); } } /** * Don't need to know how many messages. * When there is no more messages, packet is nullptr */ void wait() { } /** * Start the adapter processing. * * @param md The market data handler we will send the data to. */ void start(MD & md) { struct pcap_pkthdr header; // If this is used for a device listener we would have to override // the stopped and let the loop spin for timeout with isdev stopped=false; while (!stopped) { // Get the next packet from the device const unsigned char *packet = (u_char *) pcap_next(pcap_hdl,&header); if (packet) { //struct timeval ts = (header.ts); const struct ip *ip = (struct ip *) (packet + link_layer_length); int size_ip = (ip->ip_hl & 0x0f) * 4; int protocolHeader; unsigned char * value = nullptr; uint32_t length = 0; // Is it a TCP or UDP packet // Work out the length and extraction point for the byte stream if (ip->ip_p == IPPROTO_TCP) { const struct tcphdr *tcp = (struct tcphdr *) (packet + link_layer_length + size_ip); protocolHeader = (tcp->doff & 0x0f) * 4; value = (unsigned char *) (packet + link_layer_length + size_ip + protocolHeader); length = (ntohs(ip->ip_len) - (size_ip + protocolHeader)); } else if (ip->ip_p == IPPROTO_UDP) { udphdr *uh = (udphdr *) ((unsigned char *) ip + size_ip); protocolHeader = sizeof(*uh); value = (unsigned char *) (packet + link_layer_length + size_ip + protocolHeader); length = (ntohs(ip->ip_len) - (size_ip + protocolHeader)); } if (length>0) { // TODO this shouldn't be a string, but a byte stream (even nastier cast here!!) std::string line(reinterpret_cast<const char*>(value), length); try { md.process_message(get_tokens<TokenContainer>(line)); } catch (std::exception const& e) { std::cerr << "Caught exception: " << e.what() << " for event(" << line << ") line number:" << counter << "\n"; } counter++; } else { // If it is file we must be finished if (!isdev) stop(); } } else { // If it is file we must be finished if (!isdev) stop(); } } } private: // Handle to device pcap_t *pcap_hdl { }; // Default to ethernet int link_layer_length { ETH_HLEN }; // Allow to listen to device and file bool isdev{false}; }; #endif
#include <linux/unistd.h> #include <sys/syscall.h> #include <unistd.h> #include <linux/record.h> long start_rec(struct recording *rec){ return syscall(__NR_start_rec, 0, rec); } long start_rep(struct recording *rec){ return syscall(__NR_start_rec, 1, rec); } long stop_rec(void){ return syscall(__NR_stop_rec); } //its the same thing long stop_rep(void){ return syscall(__NR_stop_rec); } long rec_owner(void){ return syscall(__NR_rec_owner); }
/* ev-previewer-window.h: * this file is part of evince, a gnome document viewer * * Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org> * * Evince 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. * * Evince 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 EV_PREVIEWER_WINDOW_H #define EV_PREVIEWER_WINDOW_H #include <gtk/gtk.h> #include <evince-document.h> #include <evince-view.h> G_BEGIN_DECLS #define EV_TYPE_PREVIEWER_WINDOW (ev_previewer_window_get_type()) #define EV_PREVIEWER_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_PREVIEWER_WINDOW, EvPreviewerWindow)) #define EV_PREVIEWER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_PREVIEWER_WINDOW, EvPreviewerWindowClass)) #define EV_IS_PREVIEWER_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_PREVIEWER_WINDOW)) #define EV_IS_PREVIEWER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_PREVIEWER_WINDOW)) #define EV_PREVIEWER_WINDOW_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_PREVIEWER_WINDOW, EvPreviewerWindowClass)) typedef struct _EvPreviewerWindow EvPreviewerWindow; typedef struct _EvPreviewerWindowClass EvPreviewerWindowClass; GType ev_previewer_window_get_type (void) G_GNUC_CONST; EvPreviewerWindow *ev_previewer_window_new (EvDocumentModel *model); EvDocumentModel *ev_previewer_window_get_document_model (EvPreviewerWindow *window); void ev_previewer_window_set_print_settings (EvPreviewerWindow *window, const gchar *print_settings); void ev_previewer_window_set_source_file (EvPreviewerWindow *window, const gchar *source_file); G_END_DECLS #endif /* EV_PREVIEWER_WINDOW_H */
/* * GetProcNetDev.h * * Created on: Jul 3, 2011 * Author: cadm */ #ifndef GETPROCNETDEV_H_ #define GETPROCNETDEV_H_ #include "../Statistics/NetStatistics.h" #include "GetDataCommon.h" int InterpretNetLine(struct NetStatistics *pNetStatsStruct, char *szLine); int GetProcNetDev(struct NetInformationStructure * pNetInformationStruct); #endif /* GETPROCNETDEV_H_ */
#ifndef MENU_STATE_H #define MENU_STATE_H #include "gameestate.h" #include "gameobject.h" #include "mouseclick.h" #include "menubutton.h" #include <vector> class MenuState : public GameState, MouseClick::MouseClickListener{ public: virtual void update(); virtual void render(); virtual bool onEnter(); virtual bool onExit(); virtual std::string getStateId() const; virtual void onMouseClick(MouseClick *mouseClick); void createMenu(); private: static void menuToPlay(); static void menuToCredit(); static void exitFromMenu(); static const std::string menuId; std::vector<GameObject*> menuObjects; MenuButton *playButton; MenuButton *aboutButton; MenuButton *exitButton; MenuButton *audioButton; }; #endif
/* * host bridge related code */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/module.h> #include "pci.h" static struct pci_bus *find_pci_root_bus(struct pci_dev *dev) { struct pci_bus *bus; bus = dev->bus; while (bus->parent) bus = bus->parent; return bus; } static struct pci_host_bridge *find_pci_host_bridge(struct pci_dev *dev) { struct pci_bus *bus = find_pci_root_bus(dev); return to_pci_host_bridge(bus->bridge); } struct device *pci_get_host_bridge_device(struct pci_dev *dev) { struct pci_bus *root_bus = find_pci_root_bus(dev->bus); struct device *bridge = root_bus->bridge; kobject_get(&bridge->kobj); return bridge; } void pci_put_host_bridge_device(struct device *dev) { kobject_put(&dev->kobj); } void pci_set_host_bridge_release(struct pci_host_bridge *bridge, void (*release_fn)(struct pci_host_bridge *), void *release_data) { bridge->release_fn = release_fn; bridge->release_data = release_data; } static bool resource_contains(struct resource *res1, struct resource *res2) { return res1->start <= res2->start && res1->end >= res2->end; } void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res) { struct pci_host_bridge *bridge = find_pci_host_bridge(dev); struct pci_host_bridge_window *window; resource_size_t offset = 0; list_for_each_entry(window, &bridge->windows, list) { if (resource_type(res) != resource_type(window->res)) continue; if (resource_contains(window->res, res)) { offset = window->offset; break; } } region->start = res->start - offset; region->end = res->end - offset; } EXPORT_SYMBOL(pcibios_resource_to_bus); static bool region_contains(struct pci_bus_region *region1, struct pci_bus_region *region2) { return region1->start <= region2->start && region1->end >= region2->end; } void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region) { struct pci_host_bridge *bridge = find_pci_host_bridge(dev); struct pci_host_bridge_window *window; resource_size_t offset = 0; list_for_each_entry(window, &bridge->windows, list) { struct pci_bus_region bus_region; if (resource_type(res) != resource_type(window->res)) continue; bus_region.start = window->res->start - window->offset; bus_region.end = window->res->end - window->offset; if (region_contains(&bus_region, region)) { offset = window->offset; break; } } res->start = region->start + offset; res->end = region->end + offset; } EXPORT_SYMBOL(pcibios_bus_to_resource);
/* * DaVinci serial device definitions * * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> * * 2007 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. */ #ifndef __ASM_ARCH_SERIAL_H #define __ASM_ARCH_SERIAL_H #include <mach/hardware.h> #define DAVINCI_MAX_NR_UARTS 3 #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) //#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) #define DAVINCI_UART1_BASE (IO_PHYS + 0x106000) #define DAVINCI_UART2_BASE (IO_PHYS + 0x20800) #define DA8XX_UART0_BASE (IO_PHYS + 0x042000) #define DA8XX_UART1_BASE (IO_PHYS + 0x10c000) #define DA8XX_UART2_BASE (IO_PHYS + 0x10d000) /* DaVinci UART register offsets */ #define UART_DAVINCI_PWREMU 0x0c #define UART_DM646X_SCR 0x10 #define UART_DM646X_SCR_TX_WATERMARK 0x08 struct davinci_uart_config { /* Bit field of UARTs present; bit 0 --> UART1 */ unsigned int enabled_uarts; }; extern int davinci_serial_init(struct davinci_uart_config *); #endif /* __ASM_ARCH_SERIAL_H */
/*************************************************************************** text_box_help.h - description ------------------- begin : Tue Mar 2 2004 copyright : (C) 2004 by David Rokhvarg email : davidr@sangoma.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TEXT_BOX_HELP_H #define TEXT_BOX_HELP_H #include <text_box.h> #define DBG_TEXT_BOX_HELP 0 /**This class used for displaying Help, Warning and Iformation messages. *@author David Rokhvarg */ class text_box_help : public text_box { char lxdialog_path[MAX_PATH_LENGTH]; char path_to_text_file[MAX_PATH_LENGTH]; int help_text_type; char * get_path_to_help_text_file(IN int help_text_type) { char * result; return result; } public: text_box_help(IN char * lxdialog_path, IN int help_text_type) { Debug(DBG_TEXT_BOX_HELP, ("text_box_help::text_box_help()\n")); snprintf(this->lxdialog_path, MAX_PATH_LENGTH, lxdialog_path); this->help_text_type = help_text_type; } ~text_box_help() { Debug(DBG_TEXT_BOX_HELP, ("text_box_help::~text_box_help()\n")); } int run() { Debug(DBG_TEXT_BOX_HELP, ("text_box_help::run()\n")); snprintf(path_to_text_file, MAX_PATH_LENGTH, "%s%s", wancfg_cfg_dir, get_path_to_help_text_file(help_text_type)); Debug(DBG_TEXT_BOX_HELP, ("text_box_help: path_to_text_file: %s\n", path_to_text_file)); if(set_configuration(lxdialog_path, WANCFG_PROGRAM_NAME, path_to_text_file, TEXT_BOX_HEIGTH, TEXT_BOX_WIDTH) == NO){ return NO; } return show(); } }; #endif
/* * Based on arch/arm/include/asm/pgalloc.h * * Copyright (C) 2000-2001 Russell King * Copyright (C) 2012 ARM Ltd. * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef __ASM_PGALLOC_H #define __ASM_PGALLOC_H #include <asm/pgtable-hwdef.h> #include <asm/processor.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> #define check_pgt_cache() do { } while (0) #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) #define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t)) #if CONFIG_PGTABLE_LEVELS > 2 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) { return (pmd_t *)__get_free_page(PGALLOC_GFP); } static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) { BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); free_page((unsigned long)pmd); } static inline void __pud_populate(pud_t *pud, phys_addr_t pmd, pudval_t prot) { set_pud(pud, __pud(pmd | prot)); } static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) { __pud_populate(pud, __pa(pmd), PMD_TYPE_TABLE); } static inline void pud_populate_kernel(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) { pud_populate(mm, pud, pmd); } #else static inline void __pud_populate(pud_t *pud, phys_addr_t pmd, pudval_t prot) { BUILD_BUG(); } #endif /* CONFIG_PGTABLE_LEVELS > 2 */ #if CONFIG_PGTABLE_LEVELS > 3 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) { return (pud_t *)__get_free_page(PGALLOC_GFP); } static inline void pud_free(struct mm_struct *mm, pud_t *pud) { BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); free_page((unsigned long)pud); } static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t pud, pgdval_t prot) { set_pgd(pgdp, __pgd(pud | prot)); } static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) { __pgd_populate(pgd, __pa(pud), PUD_TYPE_TABLE); } static inline void pgd_populate_kernel(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) { pgd_populate(mm, pgd, pud); } #else static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t pud, pgdval_t prot) { BUILD_BUG(); } #endif /* CONFIG_PGTABLE_LEVELS > 3 */ extern pgd_t *pgd_alloc(struct mm_struct *mm); extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); static inline pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { return (pte_t *)__get_free_page(PGALLOC_GFP); } static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addr) { struct page *pte; pte = alloc_pages(PGALLOC_GFP, 0); if (!pte) return NULL; if (!pgtable_page_ctor(pte)) { __free_page(pte); return NULL; } return pte; } /* * Free a PTE table. */ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) { if (pte) free_page((unsigned long)pte); } static inline void pte_free(struct mm_struct *mm, pgtable_t pte) { pgtable_page_dtor(pte); __free_page(pte); } static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, pmdval_t prot) { set_pmd(pmdp, __pmd(pte | prot)); } /* * Populate the pmdp entry with a pointer to the pte. This pmd is part * of the mm address space. */ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) { /* * The pmd must be loaded with the physical address of the PTE table */ __pmd_populate(pmdp, __pa(ptep), PMD_TYPE_TABLE); } static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) { __pmd_populate(pmdp, page_to_phys(ptep), PMD_TYPE_TABLE); } #define pmd_pgtable(pmd) pmd_page(pmd) #endif
# ifndef F_ERC_H # define F_ERC_H # include <assert.h> # include "eref.h" /*@-exporttype@*/ /* These types should not be exported, but are used in macros. */ typedef struct s_elem { eref val; /*@null@*/ struct s_elem *next; } ercElem; typedef ercElem *ercList; typedef struct { /*@null@*/ ercList vals; int size; } ercInfo; /*@=exporttype@*/ typedef ercInfo *erc; # include "erc.lh" # define erc_size(c) ((c)->size) # define erc_initMod() \ do { bool_initMod(); employee_initMod();\ eref_initMod(); } while (FALSE) # define erc_elements(c, m_x) \ { erc m_c = (c); ercElem *m_ec = (m_c)->vals; int m_i = 0; \ while (m_i < (m_c)->size) { \ eref m_x; assert (m_ec != NULL); m_x = m_ec->val; m_ec = m_ec->next; m_i++; # define end_erc_elements }} # endif
// Copyright (C) 2017 Google 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. // //////////////////////////////////////////////////////////////////////////////// #ifndef DML_ENGINE_CODE_DEEPMIND_DMLAB_LOAD_MODEL_H_ #define DML_ENGINE_CODE_DEEPMIND_DMLAB_LOAD_MODEL_H_ #include <stdbool.h> #include "../../../deepmind/include/deepmind_model_setters.h" // Attempts to load a serialised model from the MD3 data in 'buffer', invoking // the relevant callbacks in 'model_setters' as the data is traversed. // Returns whether valid model data was found in the buffer. bool dmlab_deserialise_model( // const void* buffer, // const DeepmindModelSetters* model_setters, // void* model_data); // Attempts to load a model from a MD3 file at the given path, invoking the // relevant callbacks in 'model_setters' as the file is traversed. // Returns whether a valid model file was found at the given path. bool dmlab_load_model( // const char* model_path, // const DeepmindModelSetters* model_setters, // void* model_data); #endif // DML_ENGINE_CODE_DEEPMIND_DMLAB_LOAD_MODEL_H_
/* * Copyright (C) 2010, 2011 Robert Lougher <rob@jamvm.org.uk>. * * This file is part of JamVM. * * 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Thread */ extern char classlibInitJavaThread(Thread *thread, Object *jlthread, Object *name, Object *group, char is_daemon, int priority); extern Object *classlibThreadPreInit(Class *thread_class, Class *thrdGrp_class); extern char classlibCreateJavaThread(Thread *thread, Object *jThread); extern void classlibMarkThreadTerminated(Object *jThread); extern Thread *classlibJThread2Thread(Object *jThread); #define classlibThreadPostInit() \ /* NOTHING TO DO */ TRUE #define classlibThreadIdName() SYMBOL(threadId) #define classlibAddThreadName() SYMBOL(addThread) #define classlibRemoveThreadName() SYMBOL(removeThread) #define classlibThreadNameType() SYMBOL(sig_java_lang_String) #define classlibExceptionHandlerName() SYMBOL(exceptionHandler) #define classlibGetThreadState(thread) \ (thread)->state #define classlibSetThreadState(thread, new_state) \ (thread)->state = new_state extern void classlibThreadName2Buff(Object *jThread, char *buffer, int buff_len); #define classlibInitialiseSignals() \ /* NOTHING TO DO */ TRUE extern void classlibSignalThread(Thread *self); /* Class */ extern int classlibInitialiseClass(); extern void classlibCacheClassLoaderFields(Class *loader_class); extern HashTable *classlibLoaderTable(Object *class_loader); extern HashTable *classlibCreateLoaderTable(Object *class_loader); extern Object *classlibBootPackage(PackageEntry *entry); extern Object *classlibBootPackages(PackageEntry *entry); extern Class *classlibBootPackagesArrayClass(); extern char *classlibBootClassPathOpt(InitArgs *args); extern char *classlibDefaultBootClassPath(); extern char *classlibDefaultEndorsedDirs(); extern char *classlibDefaultExtDirs(); extern void classlibNewLibraryUnloader(Object *class_loader, void *entry); #define classlibSkipReflectionLoader(loader) \ loader /* Reflection */ extern int classlibInitReflection(); extern Object *classlibCreateConstructorObject(MethodBlock *mb); extern Object *classlibCreateMethodObject(MethodBlock *mb); extern Object *classlibCreateFieldObject(FieldBlock *fb); extern MethodBlock *classlibMbFromReflectObject(Object *reflect_ob); extern FieldBlock *classlibFbFromReflectObject(Object *reflect_ob); /* DLL */ #define classlibInitialiseDll() \ /* NOTHING TO DO */ TRUE extern char *classlibDefaultBootDllPath(); extern void *classlibLookupLoadedDlls(char *name, Object *loader); /* JNI */ extern int classlibInitialiseJNI(); extern Object *classlibNewDirectByteBuffer(void *addr, long long capacity); extern void *classlibGetDirectBufferAddress(Object *buff); extern long long classlibGetDirectBufferCapacity(Object *buff); extern Object *classlibCheckIfOnLoad(Frame *last); /* Properties */ extern char *classlibDefaultJavaHome(); extern void classlibAddDefaultProperties(Object *properties); /* Access */ #define classlibAccessCheck(class1, class2) FALSE /* Natives */ extern int classlibInitialiseNatives(); /* Excep */ extern int classlibInitialiseException(Class *throw_class); /* Frame */ #define classlibInitialiseFrame() \ /* NOTHING TO DO */ TRUE #define classlibIsSkippedReflectFrame(frame) FALSE extern Frame *classlibGetCallerFrame(Frame *last, int depth); /* Shutdown */ #define classlibVMShutdown() exitVM(0) /* Alloc */ extern void classlibMarkSpecial(Object *ob, int mark); extern void classlibHandleUnmarkedSpecial(Object *ob);
#ifndef QEMU_CHAR_H #define QEMU_CHAR_H #include "qemu-common.h" #include "qemu-queue.h" #include "qemu-option.h" #include "qemu-config.h" #include "qobject.h" /* character device */ #define CHR_EVENT_BREAK 0 /* serial break char */ #define CHR_EVENT_FOCUS 1 /* focus to this terminal (modal input needed) */ #define CHR_EVENT_OPENED 2 /* new connection established */ #define CHR_EVENT_MUX_IN 3 /* mux-focus was set to this terminal */ #define CHR_EVENT_MUX_OUT 4 /* mux-focus will move on */ #define CHR_EVENT_CLOSED 5 /* connection closed */ #define CHR_IOCTL_SERIAL_SET_PARAMS 1 typedef struct { int speed; int parity; int data_bits; int stop_bits; } QEMUSerialSetParams; #define CHR_IOCTL_SERIAL_SET_BREAK 2 #define CHR_IOCTL_PP_READ_DATA 3 #define CHR_IOCTL_PP_WRITE_DATA 4 #define CHR_IOCTL_PP_READ_CONTROL 5 #define CHR_IOCTL_PP_WRITE_CONTROL 6 #define CHR_IOCTL_PP_READ_STATUS 7 #define CHR_IOCTL_PP_EPP_READ_ADDR 8 #define CHR_IOCTL_PP_EPP_READ 9 #define CHR_IOCTL_PP_EPP_WRITE_ADDR 10 #define CHR_IOCTL_PP_EPP_WRITE 11 #define CHR_IOCTL_PP_DATA_DIR 12 #define CHR_IOCTL_SERIAL_SET_TIOCM 13 #define CHR_IOCTL_SERIAL_GET_TIOCM 14 #define CHR_TIOCM_CTS 0x020 #define CHR_TIOCM_CAR 0x040 #define CHR_TIOCM_DSR 0x100 #define CHR_TIOCM_RI 0x080 #define CHR_TIOCM_DTR 0x002 #define CHR_TIOCM_RTS 0x004 typedef void IOEventHandler(void *opaque, int event); struct CharDriverState { void (*init)(struct CharDriverState *s); int (*chr_write)(struct CharDriverState *s, const uint8_t *buf, int len); void (*chr_update_read_handler)(struct CharDriverState *s); int (*chr_ioctl)(struct CharDriverState *s, int cmd, void *arg); int (*get_msgfd)(struct CharDriverState *s); IOEventHandler *chr_event; IOCanReadHandler *chr_can_read; IOReadHandler *chr_read; void *handler_opaque; void (*chr_send_event)(struct CharDriverState *chr, int event); void (*chr_close)(struct CharDriverState *chr); void (*chr_accept_input)(struct CharDriverState *chr); void *opaque; QEMUBH *bh; char *label; char *filename; int opened; QTAILQ_ENTRY(CharDriverState) next; }; QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename); CharDriverState *qemu_chr_open_opts(QemuOpts *opts, void (*init)(struct CharDriverState *s)); CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s)); void qemu_chr_close(CharDriverState *chr); void qemu_chr_printf(CharDriverState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3); int qemu_chr_write(CharDriverState *s, const uint8_t *buf, int len); void qemu_chr_send_event(CharDriverState *s, int event); void qemu_chr_add_handlers(CharDriverState *s, IOCanReadHandler *fd_can_read, IOReadHandler *fd_read, IOEventHandler *fd_event, void *opaque); int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg); void qemu_chr_generic_open(CharDriverState *s); int qemu_chr_can_read(CharDriverState *s); void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len); int qemu_chr_get_msgfd(CharDriverState *s); void qemu_chr_accept_input(CharDriverState *s); void qemu_chr_info_print(Monitor *mon, const QObject *ret_data); void qemu_chr_info(Monitor *mon, QObject **ret_data); CharDriverState *qemu_chr_find(const char *name); /* add an eventfd to the qemu devices that are polled */ CharDriverState *qemu_chr_open_eventfd(int eventfd); extern int term_escape_char; /* async I/O support */ int qemu_set_fd_handler2(int fd, IOCanReadHandler *fd_read_poll, IOHandler *fd_read, IOHandler *fd_write, void *opaque); int qemu_set_fd_handler(int fd, IOHandler *fd_read, IOHandler *fd_write, void *opaque); #endif
#ifndef POLY_H #define POLY_H #include <QVector> #include <QPoint> #include <QColor> class QPainter; /** Althogh called 'poly', this class actually describes a triangle to be rendered into a scene */ class Poly { public: friend QDataStream &operator << ( QDataStream &ds, const Poly &s ); friend QDataStream &operator >> ( QDataStream &ds, Poly &s ); /// defines ways the triangle can be mutated, with probabilities enum MutationType { /// swaps the poly with another, in the z-order SwapZ = 20, /// randomises the position of one corner MoveCorner = 50, /// changes one of the RGBA values for the triangle TweakChannel = 80, /// randomises the position of all corners Relocate = 90, /// reinitialises all values with random data Randomize = 100 }; /// initialise a random triagle within a scene bounded by width and height Poly( int width, int height ); /// initialise a triangle from another Poly( const Poly &other ); virtual ~Poly(); /// mutates the triangle, based on the mutation type supplied void mutate( MutationType mutationType ); /// renders this triange to the specified painter, as part of a scene void renderTo( QPainter &painter ); /// assigns the data from another triangle to this one Poly &operator = ( const Poly &other ); /// merges the data from two triangles, to breed a new one /// randomly selects values from either d1 or d2 into s1, and copies /// the values from the opposite triangle into s2 static void uniformCrossover( Poly *d1, Poly *d2, Poly *s1, Poly *s2 ); private: QVector< QPoint > m_points; QColor m_color; int m_width; int m_height; }; #endif //POLY_H
// e32tools\petran\Szip\huffman.h // // Copyright (c) 1998-2004 Symbian Software Ltd. All rights reserved. // #ifndef __HUFFMAN_H__ #define __HUFFMAN_H__ #include <e32std.h> /** Bit output stream. Good for writing bit streams for packed, compressed or huffman data algorithms. This class must be derived from and OverflowL() reimplemented if the bitstream data cannot be generated into a single memory buffer. @since 8.0 @library euser.lib */ class TBitOutput { public: TBitOutput(); TBitOutput(TUint8* aBuf,TInt aSize); virtual ~TBitOutput() {} inline void Set(TUint8* aBuf,TInt aSize); inline const TUint8* Ptr() const; inline TInt BufferedBits() const; // void WriteL(TUint aValue, TInt aLength); void HuffmanL(TUint aHuffCode); void PadL(TUint aPadding); private: void DoWriteL(TUint aBits, TInt aSize); virtual void OverflowL(); private: TUint iCode; // code in production TInt iBits; TUint8* iPtr; TUint8* iEnd; }; /** Set the memory buffer to use for output Data will be written to this buffer until it is full, at which point OverflowL() will be called. This should handle the data and then can Set() again to reset the buffer for further output. @param "TUint8* aBuf" The buffer for output @param "TInt aSize" The size of the buffer in bytes */ inline void TBitOutput::Set(TUint8* aBuf,TInt aSize) {iPtr=aBuf;iEnd=aBuf+aSize;} /** Get the current write position in the output buffer In conjunction with the address of the buffer, which should be known to the caller, this describes the data in the bitstream. */ inline const TUint8* TBitOutput::Ptr() const {return iPtr;} /** Get the number of bits that are buffered This reports the number of bits that have not yet been written into the output buffer. It will always lie in the range 0..7. Use PadL() to pad the data out to the next byte and write it to the buffer. */ inline TInt TBitOutput::BufferedBits() const {return iBits+8;} /** Bit input stream. Good for reading bit streams for packed, compressed or huffman data algorithms. @since 8.0 @library euser.lib */ class TBitInput { public: TBitInput(); TBitInput(const TUint8* aPtr, TInt aLength, TInt aOffset=0); virtual ~TBitInput() {} void Set(const TUint8* aPtr, TInt aLength, TInt aOffset=0); // TUint ReadL(); TUint ReadL(TInt aSize); TUint HuffmanL(const TUint32* aTree); private: virtual void UnderflowL(); private: TInt iCount; TUint iBits; TInt iRemain; const TUint32* iPtr; }; /** Huffman code toolkit. This class builds a huffman encoding from a frequency table and builds a decoding tree from a code-lengths table The encoding generated is based on the rule that given two symbols s1 and s2, with code length l1 and l2, and huffman codes h1 and h2: if l1<l2 then h1<h2 when compared lexicographically if l1==l2 and s1<s2 then h1<h2 ditto This allows the encoding to be stored compactly as a table of code lengths @since 8.0 @library euser.lib */ class Huffman { public: enum {KMaxCodeLength=27}; enum {KMetaCodes=KMaxCodeLength+1}; enum {KMaxCodes=0x8000}; public: static void HuffmanL(const TUint32 aFrequency[],TInt aNumCodes,TUint32 aHuffman[]); static void Encoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aEncodeTable[]); static void Decoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aDecodeTree[],TInt aSymbolBase=0); static TBool IsValid(const TUint32 aHuffman[],TInt aNumCodes); // static void ExternalizeL(TBitOutput& aOutput,const TUint32 aHuffman[],TInt aNumCodes); static void InternalizeL(TBitInput& aInput,TUint32 aHuffman[],TInt aNumCodes); }; #endif
// ********************************************************************** // // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef ICE_TRACE_UTIL_H #define ICE_TRACE_UTIL_H #include <Ice/LoggerF.h> #include <Ice/TraceLevelsF.h> namespace Ice { class OutputStream; class InputStream; } namespace IceInternal { void traceSend(const ::Ice::OutputStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); void traceRecv(const ::Ice::InputStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); void trace(const char*, const ::Ice::OutputStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); void trace(const char*, const ::Ice::InputStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); void traceSlicing(const char*, const ::std::string&, const char *, const ::Ice::LoggerPtr&); } #endif
/* Knuth shuffle ak.a. Fisher-Yates shuffle. This implementation is due to Ben Pfaff: http://benpfaff.org/writings/clc/shuffle.html. Adapted for Linux/WMA11b by GJ06. */ #include <stdio.h> #include <stdlib.h> /* Arrange the N elements of ARRAY in random order. Only effective if N is much smaller than RAND_MAX; if this may not be the case, use a better random number generator. */ void shuffle(int *array, size_t n) { int i; #if 0 int *array_i = array; for (i = 0; i < n - 1; i++, array_i++) { /* Select element to swap from array[i..n-1] */ size_t j = i + rand() / (RAND_MAX / (n - i)); int t = array[j]; array[j] = *array_i; *array_i = t; } #else int *array_i = array + n; for (i = n-1; i >= 0; i--) { /* Select element to swap from array[0..i] */ size_t j = rand() / (RAND_MAX / (i + 1)); int t = array[j]; array_i--; array[j] = *array_i; *array_i = t; } #endif } int main(int argc, char *argv[]) { int A[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; int i, k, N; printf("RAND_MAX: %ld\n", RAND_MAX); for (k = 0; k < 100; k++) { shuffle(A, 16); for (i = 0; i < 16; i++) printf(" %d", A[i]); putchar('\n'); } #if 0 N = 10; for (i = 0; i < 100; i++) { size_t k = rand() / (RAND_MAX / (N + 1)); printf("%2d\n", k); } #endif return 0; }
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* Rosegarden A MIDI and audio sequencer and musical notation editor. Copyright 2000-2018 the Rosegarden development team. Other copyrights also apply to some parts of this work. Please see the AUTHORS file and individual file headers for details. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information. */ #ifndef RG_KEYSIGNATUREDIALOG_H #define RG_KEYSIGNATUREDIALOG_H #include "base/NotationTypes.h" #include <string> #include <QDialog> #include <QString> #include <QCheckBox> class QWidget; class QRadioButton; class QLabel; class QComboBox; class QCheckBox; namespace Rosegarden { class NotePixmapFactory; class KeySignatureDialog : public QDialog { Q_OBJECT public: enum ConversionType { NoConversion, Convert, Transpose }; KeySignatureDialog(QWidget *parent, NotePixmapFactory *npf, Clef clef, Rosegarden::Key defaultKey = Rosegarden::Key::DefaultKey, bool showApplyToAll = true, bool showConversionOptions = true, QString explanatoryText = ""); bool isValid() const; ::Rosegarden::Key getKey() const; bool shouldApplyToAll() const; bool shouldBeTransposed() const; ConversionType getConversionType() const; bool shouldIgnorePercussion() const; public slots: void slotKeyUp(); void slotKeyDown(); void slotKeyNameChanged(int); void slotMajorMinorChanged(const QString &); void slotHelpRequested(); protected: void redrawKeyPixmap(); void regenerateKeyCombo(); void setValid(bool valid); std::string getKeyName(const QString &s, bool minor); //--------------- Data members --------------------------------- NotePixmapFactory *m_notePixmapFactory; Rosegarden::Key m_key; Clef m_clef; bool m_valid; bool m_ignoreComboChanges; QLabel *m_keyPixmap; QComboBox *m_keyCombo; QComboBox *m_majorMinorCombo; QLabel *m_explanatoryLabel; QRadioButton *m_applyToAllButton; QRadioButton *m_yesTransposeButton; QRadioButton *m_noConversionButton; QRadioButton *m_convertButton; QRadioButton *m_transposeButton; QCheckBox *m_noPercussionCheckBox; }; } #endif
// // AddressBookModel.h // Meakelra // // Created by xiao_yu on 15/12/7. // Copyright © 2015年 Meakelra. All rights reserved. // #import <Foundation/Foundation.h> @interface AddressBookModel : NSObject @property (nonatomic, assign) NSInteger sectionNumber; @property (nonatomic, assign) NSInteger recordID; @property (nonatomic, strong) NSString *name; @property (nonatomic, strong) NSString *email; @property (nonatomic, strong) NSString *tel; @end
#ifndef _SPARC_BITEXT_H #define _SPARC_BITEXT_H #include <linux/spinlock.h> struct bit_map { spinlock_t lock; unsigned long *map; int size; int used; int last_off; int last_size; int first_free; int num_colors; }; extern int bit_map_string_get(struct bit_map *t, int len, int align); extern void bit_map_clear(struct bit_map *t, int offset, int len); extern void bit_map_init(struct bit_map *t, unsigned long *map, int size); #endif /* defined(_SPARC_BITEXT_H) */
#ifndef ARCH_I386_SCHEDULER_H # define ARCH_I386_SCHEDULER_H # include <kernel/proc/thread.h> # include <arch/cpu.h> void i386_switch(struct irq_regs *regs, struct thread *new, struct thread *old, spinlock_t *sched_lock); #endif /* !ARCH_I386_SCHEDULER_H */
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. * * This 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 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 software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ // -=- Socket.h - abstract base-class for any kind of network stream/socket #ifndef __NETWORK_SOCKET_H__ #define __NETWORK_SOCKET_H__ #include <list> #include <limits.h> #include <rdr/FdInStream.h> #include <rdr/FdOutStream.h> #include <rdr/Exception.h> namespace network { class Socket { public: Socket(int fd) : instream(new rdr::FdInStream(fd)), outstream(new rdr::FdOutStream(fd)), ownStreams(true), isShutdown_(false), queryConnection(false) {} virtual ~Socket() { if (ownStreams) { delete instream; delete outstream; } } rdr::FdInStream &inStream() {return *instream;} rdr::FdOutStream &outStream() {return *outstream;} int getFd() {return outstream->getFd();} // if shutdown() is overridden then the override MUST call on to here virtual void shutdown() {isShutdown_ = true;} bool isShutdown() const {return isShutdown_;} // information about this end of the socket virtual int getMyPort() = 0; // information about the remote end of the socket virtual char* getPeerAddress() = 0; // a string e.g. "192.168.0.1" virtual int getPeerPort() = 0; virtual char* getPeerEndpoint() = 0; // <address>::<port> // Is the remote end on the same machine? virtual bool sameMachine() = 0; // Was there a "?" in the ConnectionFilter used to accept this Socket? void setRequiresQuery() {queryConnection = true;} bool requiresQuery() const {return queryConnection;} protected: Socket() : instream(0), outstream(0), ownStreams(false), isShutdown_(false), queryConnection(false) {} Socket(rdr::FdInStream* i, rdr::FdOutStream* o, bool own) : instream(i), outstream(o), ownStreams(own), isShutdown_(false), queryConnection(false) {} rdr::FdInStream* instream; rdr::FdOutStream* outstream; bool ownStreams; bool isShutdown_; bool queryConnection; }; class ConnectionFilter { public: virtual bool verifyConnection(Socket* s) = 0; }; class SocketListener { public: SocketListener() : fd(0), filter(0) {} virtual ~SocketListener() {} // shutdown() stops the socket from accepting further connections virtual void shutdown() = 0; // accept() returns a new Socket object if there is a connection // attempt in progress AND if the connection passes the filter // if one is installed. Otherwise, returns 0. virtual Socket* accept() = 0; // setFilter() applies the specified filter to all new connections void setFilter(ConnectionFilter* f) {filter = f;} int getFd() {return fd;} protected: int fd; ConnectionFilter* filter; }; struct SocketException : public rdr::SystemException { SocketException(const char* text, int err_) : rdr::SystemException(text, err_) {} }; class SocketServer { public: virtual ~SocketServer() {} // addSocket() tells the server to serve the Socket. The caller // retains ownership of the Socket - the only way for the server // to discard a Socket is by calling shutdown() on it. // outgoing is set to true if the socket was created by connecting out // to another host, or false if the socket was created by accept()ing // an incoming connection. virtual void addSocket(network::Socket* sock, bool outgoing=false) = 0; // removeSocket() tells the server to stop serving the Socket. The // caller retains ownership of the Socket - the server must NOT // delete the Socket! This call is used mainly to cause per-Socket // resources to be freed. virtual void removeSocket(network::Socket* sock) = 0; // getSockets() gets a list of sockets. This can be used to generate an // fd_set for calling select(). virtual void getSockets(std::list<network::Socket*>* sockets) = 0; // processSocketReadEvent() tells the server there is a Socket read event. // The implementation can indicate that the Socket is no longer active // by calling shutdown() on it. The caller will then call removeSocket() // soon after processSocketEvent returns, to allow any pre-Socket // resources to be tidied up. virtual void processSocketReadEvent(network::Socket* sock) = 0; // processSocketReadEvent() tells the server there is a Socket write event. // This is only necessary if the Socket has been put in non-blocking // mode and needs this callback to flush the buffer. virtual void processSocketWriteEvent(network::Socket* sock) = 0; // checkTimeouts() allows the server to check socket timeouts, etc. The // return value is the number of milliseconds to wait before // checkTimeouts() should be called again. If this number is zero then // there is no timeout and checkTimeouts() should be called the next time // an event occurs. virtual int checkTimeouts() = 0; virtual bool getDisable() {return false;}; }; } #endif // __NETWORK_SOCKET_H__
/* * This file is part of the Popitam software * Copyright (C) 2009 Swiss Institute of Bioinformatics * * 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 _VERTEX_H_ #define _VERTEX_H_ #include "defines.h" /******************************************************************************/ struct SUCC1 { int iVertexSucc; int iAA; int iAAi; }; struct SUCC2 { int iVertexSucc; int iAA; int iAAi; int iAAj; }; /******************************************************************************/ class vertex { public : int or_indice; int mergedNb; double mean_bMass; double bMass[MAX_MERGED]; int iHypo[MAX_MERGED]; // indice de l'hypothèse ionique utilisée pour construire la bMass int iPeak[MAX_MERGED]; double peakMass[MAX_MERGED]; double peakInt[MAX_MERGED]; int peakBin[MAX_MERGED]; int succ1Nb; int succ2Nb; SUCC1 succ1List[MAX_SUCC1]; SUCC2 succ2List[MAX_SUCC2]; public : vertex(); ~vertex(); inline int getSucc(int i) {if (i < succ1Nb) return succ1List[i].iVertexSucc; else return succ2List[i-succ1Nb].iVertexSucc;} inline int getIAA(int i) {if (i < succ1Nb) return succ1List[i].iAA; else return succ2List[i-succ1Nb].iAA;} }; /******************************************************************************/ #endif
extern void s3c2410_map_io(struct map_desc *, int count); extern void s3c2410_init_irq(void);
#include <string.h> #include "oslib/strlcat.h" size_t strlcat(char *dst, const char *src, size_t size) { size_t dstlen; size_t srclen; dstlen = strlen(dst); size -= dstlen + 1; /* return if no room */ if (!size) return dstlen; srclen = strlen(src); if (srclen > size) srclen = size; memcpy(dst + dstlen, src, srclen); dst[dstlen + srclen] = '\0'; return dstlen + srclen; }
#ifndef newNTL_mat_poly_ZZ_p__H #define newNTL_mat_poly_ZZ_p__H #include <newNTL/mat_ZZ_p.h> #include <newNTL/ZZ_pX.h> newNTL_OPEN_NNS void CharPoly(ZZ_pX& f, const mat_ZZ_p& M); newNTL_CLOSE_NNS #endif
/** * Copyright (C) 2005-2012 Gekko Emulator * * @file atomic_win32.h * @author ShizZy <shizzy247@gmail.com> * @date 2012-06-28 * @brief Cross-platform atomic operations - Windows/Visual C++ * @remark Taken from Dolphin Emulator (http://code.google.com/p/dolphin-emu/) * * @section LICENSE * 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 at * http://www.gnu.org/copyleft/gpl.html * * Official project repository can be found at: * http://code.google.com/p/gekko-gc-emu/ */ #ifndef COMMON_ATOMIC_WIN32_H_ #define COMMON_ATOMIC_WIN32_H_ #include "types.h" #include <intrin.h> #include <Windows.h> namespace common { inline void AtomicAdd(volatile u32& target, u32 value) { InterlockedExchangeAdd((volatile LONG*)&target, (LONG)value); } inline void AtomicAnd(volatile u32& target, u32 value) { _InterlockedAnd((volatile LONG*)&target, (LONG)value); } inline void AtomicIncrement(volatile u32& target) { InterlockedIncrement((volatile LONG*)&target); } inline void AtomicDecrement(volatile u32& target) { InterlockedDecrement((volatile LONG*)&target); } inline u32 AtomicLoad(volatile u32& src) { return src; } inline u32 AtomicLoadAcquire(volatile u32& src) { u32 result = src; _ReadBarrier(); return result; } inline void AtomicOr(volatile u32& target, u32 value) { _InterlockedOr((volatile LONG*)&target, (LONG)value); } inline void AtomicStore(volatile u32& dest, u32 value) { dest = value; } inline void AtomicStoreRelease(volatile u32& dest, u32 value) { _WriteBarrier(); dest = value; } } // namespace #endif // COMMON_ATOMIC_WIN32_H_
/* * drivers/media/video/samsung/mfc40/s3c_mfc_fw.h * * Header file for Samsung MFC (Multi Function Codec - FIMV) driver * * PyoungJae Jung, Jiun Yu, Copyright (c) 2009 Samsung Electronics * http://www.samsungsemi.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _S3C_MFC_FW_H_ #define _S3C_MFC_FW_H_ extern unsigned char mp4_dec_mc_fw[26533]; extern unsigned char mp4_enc_mc_fw[11585]; extern unsigned char h264_dec_mc_fw[40397]; extern unsigned char h264_enc_mc_fw[23204]; extern unsigned char h263_dec_mc_fw[9833]; extern unsigned char mp2_dec_mc_fw[14637]; extern unsigned char vc1_dec_mc_fw[22653]; extern unsigned char cmd_ctrl_fw[7533] ; #endif /* _S3C_MFC_FW_H_ */
#include <string> using namespace std; #ifndef __MONGO_METHOD_DATABASE_ELEMENT_H__ #define __MONGO_METHOD_DATABASE_ELEMENT_H__ class MongoMethodDatabaseElement { private: string methodFullDesc; int optLevel; double counts; public: MongoMethodDatabaseElement (string _desc, int _optLevel, double _counts) { methodFullDesc = _desc; optLevel = _optLevel; counts = _counts; } string getMethodFullDesc () { return methodFullDesc; } int getOptLevel () { return optLevel; } double getCounts () { return counts; } string getClassName () { return methodFullDesc.substr (0, methodFullDesc.find (";")+1); } string getMethodName () { int pos = methodFullDesc.find (";") + 1; int size = methodFullDesc.find ("(") - pos; return methodFullDesc.substr (pos, size); } }; #endif
extern void ess_intr (sb_devc *devc); extern int ess_dsp_init (sb_devc *devc, struct address_info *hw_config); extern struct audio_driver *ess_audio_init (sb_devc *devc, int *audio_flags, int *format_mask); extern int ess_midi_init (sb_devc *devc, struct address_info *hw_config); extern void ess_mixer_init (sb_devc *devc); extern int ess_init (sb_devc *devc, struct address_info *hw_config); extern int ess_dsp_reset (sb_devc *devc); extern void ess_setmixer (sb_devc *devc, unsigned int port, unsigned int value); extern unsigned int ess_getmixer (sb_devc *devc, unsigned int port); extern int ess_mixer_set (sb_devc *devc, int dev, int left, int right); extern int ess_mixer_reset (sb_devc *devc); extern void ess_mixer_reload (sb_devc * devc, int dev); extern int ess_set_recmask (sb_devc *devc, int *mask);
/* process.h * - Processing chains * * $Id: process.h,v 1.3 2003/03/16 14:21:49 msmith Exp $ * * Copyright (c) 2001-2002 Michael Smith <msmith@xiph.org> * * This program is distributed under the terms of the GNU General * Public License, version 2. You may use, modify, and redistribute * it under the terms of this license. A copy should be included * with this source. */ #ifndef __PROCESS_H__ #define __PROCESS_H__ #include "event.h" typedef enum { MEDIA_VORBIS, MEDIA_PCM, MEDIA_DATA, MEDIA_NONE, } media_type; typedef enum { SUBTYPE_PCM_BE_16, SUBTYPE_PCM_LE_16, SUBTYPE_PCM_FLOAT, } media_subtype; typedef enum { FLAG_CRITICAL = 1<<0, FLAG_BOS = 1<<1, } buffer_flags; typedef struct { media_type type; /* Type of data held in buffer */ media_subtype subtype; short channels; int rate; void *buf; /* Actual data */ int len; /* Length of data (usually bytes, sometimes samples */ short count; /* Reference count */ buffer_flags flags; /* Flag: critical chunks must be processed fully */ int aux_data_len; long aux_data[1]; /* Auxilliary data used for various purposes */ } ref_buffer; /* Need some forward declarations */ struct _process_chain_element; struct _instance_t; struct _module_param_t; /* Note that instance will be NULL for input chains */ typedef int (*process_func)(struct _instance_t *instance, void *data, ref_buffer *in, ref_buffer **out); typedef int (*event_func)(struct _process_chain_element *self, event_type event, void *param); typedef int (*open_func)(struct _process_chain_element *self, struct _module_param_t *params); typedef struct _process_chain_element { char *name; open_func open; struct _module_param_t *params; process_func process; event_func event_handler; void *priv_data; media_type input_type; media_type output_type; struct _process_chain_element *next; } process_chain_element; typedef struct _instance_t { int buffer_failures; int died; int kill; int skip; int wait_for_critical; struct buffer_queue *queue; int max_queue_length; process_chain_element *output_chain; struct _instance_t *next; } instance_t; int process_chain(struct _instance_t *instance, process_chain_element *chain, ref_buffer *in, ref_buffer **out); ref_buffer *new_ref_buffer(media_type media, void *data, int len, int aux); void acquire_buffer(ref_buffer *buf); void release_buffer(ref_buffer *buf); void create_event(process_chain_element *chain, event_type event, void *param, int broadcast); #endif /* __PROCESS_H__ */
#pragma once #include <string> #include <vector> #include "baserender.h" #include "services/tvscraper.h" class cMetrixHDDisplayMenu : public cMetrixHDBaseRender, public cSkinDisplayMenu { private: cPixmap *menuPixmap; cPixmap *iconmenuPixmap; cPixmap *logomenuPixmap; cPixmap *scrollbarPixmap; cPixmap *siteBarPixmap; cPixmap *smallsiteBarPixmap; tColor ColorFg; tColor ColorBg; int contentTop; int scrollBarTop, scrollBarWidth, scrollBarHeight; int menuWidth; int menuWidthFg; bool clear; int itemHeight; int marginleft; int margintop; int imageheight; int sitebarwidth; void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown); int ItemsHeight(void); cString menuNumber; cString menuEntry; static std::string items[16]; cString IconName; void GetMainIconName(const char *Text, bool sel, bool icon); void CreateSmallSiteBar(void); void CreateSiteBar(void); void ClearSiteBar(void); virtual cString DrawPoster(const cRecording *Recording); TVScraperGetFullInformation mediainfo; public: cMetrixHDDisplayMenu(); virtual ~cMetrixHDDisplayMenu(); virtual void Scroll(bool Up, bool Page); virtual int MaxItems(void); virtual void Clear(void); virtual void SetTitle(const char *Title); virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); virtual void SetMessage(eMessageType Type, const char *Text); void SetItem(const char *Text, int Index, bool Current, bool Selectable); virtual void SetScrollbar(int Total, int Offset); virtual bool SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch); virtual void SetEvent(const cEvent *Event); virtual bool SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider); virtual void SetRecording(const cRecording *Recording); virtual bool SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New); virtual void SetText(const char *Text, bool FixedFont); virtual int GetTextAreaWidth(void) const; virtual const cFont *GetTextAreaFont(bool FixedFont) const; virtual void Flush(void); };
// Copyright 2013 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. // Modified for Ishiiruka by Tino #pragma once #include "VideoCommon/NativeVertexFormat.h" class VertexLoader_Position { public: // Init static void Init(void); // GetSize static unsigned int GetSize(u32 _type, u32 _format, u32 _elements); // GetFunction static TPipelineFunction GetFunction(u32 _type, u32 _format, u32 _elements); private: static bool Initialized; };
/* * Copyright (C) 2012 Google Inc. All rights reserved. * Copyright (C) 2017 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * 3. Neither the name of Google Inc. nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if ENABLE(WEB_RTC) #include "ExceptionOr.h" #include "RTCSdpType.h" #include "ScriptWrappable.h" namespace WebCore { class RTCSessionDescription : public RefCounted<RTCSessionDescription>, public ScriptWrappable { public: struct Init { RTCSdpType type; String sdp; }; static Ref<RTCSessionDescription> create(Init&&); static Ref<RTCSessionDescription> create(RTCSdpType, String&& sdp); RTCSdpType type() const { return m_type; } const String& sdp() const { return m_sdp; } void setSdp(String&& sdp) { m_sdp = WTFMove(sdp); } private: RTCSessionDescription(RTCSdpType, String&& sdp); RTCSdpType m_type; String m_sdp; }; } // namespace WebCore #endif // ENABLE(WEB_RTC)
// callers.h // // Caller dialog for the Mithlond Project. // // (C) Copyright 2002 Fred Gleason <fredg@paravelsystems.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., 675 Mass Ave, Cambridge, MA 02139, USA. // #ifndef CALLERS_H #define CALLERS_H #include <QtGui/QDialog> #include <QtGui/QLineEdit> #include <QtGui/QPixmap> #include <QtGui/QRadioButton> #include <QtGui/QPaintEvent> #include <bus_driver.h> #include <call_meta_data.h> #include "comment.h" class Callers : public QDialog { Q_OBJECT public: enum Action {Hold=0,Screened=1,Next=2}; Callers(bool extra,bool cid_active,int line,CallMetaData *data, BusDriver *driver,QWidget *parent=0); QSize sizeHint() const; QSizePolicy sizePolicy() const; protected: void paintEvent(QPaintEvent *); private slots: void cancelData(); void okData(); void screenData(); void holdData(); void awardData(); private: void WriteCallData(CallMetaData *data); QString DateTimeString(const QDateTime &datetime,const QDateTime &now); BusDriver *call_driver; int call_line; CallMetaData *call_data; QLineEdit *call_name; QLineEdit *call_age; QLineEdit *call_city; QLineEdit *call_state; QLineEdit *call_zip; QLineEdit *call_phone; QLineEdit *call_station; QRadioButton *call_gender_male; QRadioButton *call_gender_female; Comment *call_comment; QRadioButton *call_cell_yes; QRadioButton *call_quality_verypoor; QRadioButton *call_quality_poor; QRadioButton *call_quality_fair; QRadioButton *call_quality_good; QRadioButton *call_quality_excellent; }; #endif
/* arch/arm/plat-samsung/include/plat/pm.h * * Copyright (c) 2004 Simtec Electronics * http://armlinux.simtec.co.uk/ * Written by Ben Dooks, <ben@simtec.co.uk> * * 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. */ /* s3c_pm_init * * called from board at initialisation time to setup the power * management */ #include <linux/irq.h> struct device; #ifdef CONFIG_PM extern __init int s3c_pm_init(void); extern __init int s3c64xx_pm_init(void); #else static inline int s3c_pm_init(void) { return 0; } static inline int s3c64xx_pm_init(void) { return 0; } #endif /* configuration for the IRQ mask over sleep */ extern unsigned long s3c_irqwake_intmask; extern unsigned long s3c_irqwake_eintmask; /* IRQ masks for IRQs allowed to go to sleep (see irq.c) */ extern unsigned long s3c_irqwake_intallow; extern unsigned long s3c_irqwake_eintallow; /* per-cpu sleep functions */ extern void (*pm_cpu_prep)(void); extern int (*pm_cpu_sleep)(unsigned long); /* Flags for PM Control */ extern unsigned long s3c_pm_flags; /* from sleep.S */ extern void s3c_cpu_resume(void); extern int s3c2410_cpu_suspend(unsigned long); /* sleep save info */ /** * struct sleep_save - save information for shared peripherals. * @reg: Pointer to the register to save. * @val: Holder for the value saved from reg. * * This describes a list of registers which is used by the pm core and * other subsystem to save and restore register values over suspend. */ struct sleep_save { void __iomem *reg; unsigned long val; }; #define SAVE_ITEM(x) \ { .reg = (x) } /** * struct pm_uart_save - save block for core UART * @ulcon: Save value for S3C2410_ULCON * @ucon: Save value for S3C2410_UCON * @ufcon: Save value for S3C2410_UFCON * @umcon: Save value for S3C2410_UMCON * @ubrdiv: Save value for S3C2410_UBRDIV * * Save block for UART registers to be held over sleep and restored if they * are needed (say by debug). */ struct pm_uart_save { u32 ulcon; u32 ucon; u32 ufcon; u32 umcon; u32 ubrdiv; u32 udivslot; }; /* helper functions to save/restore lists of registers. */ extern void s3c_pm_do_save(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); #ifdef CONFIG_PM extern int s3c_irq_wake(struct irq_data *data, unsigned int state); extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); extern int s3c24xx_irq_suspend(void); extern void s3c24xx_irq_resume(void); #else #define s3c_irq_wake NULL #define s3c_irqext_wake NULL #define s3c24xx_irq_suspend NULL #define s3c24xx_irq_resume NULL #endif extern struct syscore_ops s3c24xx_irq_syscore_ops; /* PM debug functions */ #ifdef CONFIG_SAMSUNG_PM_DEBUG /** * s3c_pm_dbg() - low level debug function for use in suspend/resume. * @msg: The message to print. * * This function is used mainly to debug the resume process before the system * can rely on printk/console output. It uses the low-level debugging output * routine printascii() to do its work. */ extern void s3c_pm_dbg(const char *msg, ...); #define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) #else #define S3C_PMDBG(fmt...) pr_debug(fmt) #endif #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK /** * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs * @set: set bits for the state of the LEDs * @clear: clear bits for the state of the LEDs. */ extern void s3c_pm_debug_smdkled(u32 set, u32 clear); #else static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { } #endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */ /* suspend memory checking */ #ifdef CONFIG_SAMSUNG_PM_CHECK extern void s3c_pm_check_prepare(void); extern void s3c_pm_check_restore(void); extern void s3c_pm_check_cleanup(void); extern void s3c_pm_check_store(void); #else #define s3c_pm_check_prepare() do { } while(0) #define s3c_pm_check_restore() do { } while(0) #define s3c_pm_check_cleanup() do { } while(0) #define s3c_pm_check_store() do { } while(0) #endif /** * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ * * Setup all the necessary GPIO pins for waking the system on external * interrupt. */ extern void s3c_pm_configure_extint(void); /** * samsung_pm_restore_gpios() - restore the state of the gpios after sleep. * * Restore the state of the GPIO pins after sleep, which may involve ensuring * that we do not glitch the state of the pins from that the bootloader's * resume code has done. */ extern void samsung_pm_restore_gpios(void); /** * samsung_pm_save_gpios() - save the state of the GPIOs for restoring after sleep. * * Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios(). */ extern void samsung_pm_save_gpios(void); extern void s3c_pm_save_core(void); extern void s3c_pm_restore_core(void);
/* * Copyright 2007 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) * Copyright 2009 Daniel Schaeffer (daniel.schaeffer@timesys.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. */ #include <linux/platform_device.h> #include <linux/gpio.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> #include <asm/mach/map.h> #include <mach/hardware.h> #include <mach/common.h> #include <mach/iomux-mx27.h> #include "devices-imx27.h" static const int mx27lite_pins[] __initconst = { /* UART1 */ PE12_PF_UART1_TXD, PE13_PF_UART1_RXD, PE14_PF_UART1_CTS, PE15_PF_UART1_RTS, /* FEC */ PD0_AIN_FEC_TXD0, PD1_AIN_FEC_TXD1, PD2_AIN_FEC_TXD2, PD3_AIN_FEC_TXD3, PD4_AOUT_FEC_RX_ER, PD5_AOUT_FEC_RXD1, PD6_AOUT_FEC_RXD2, PD7_AOUT_FEC_RXD3, PD8_AF_FEC_MDIO, PD9_AIN_FEC_MDC, PD10_AOUT_FEC_CRS, PD11_AOUT_FEC_TX_CLK, PD12_AOUT_FEC_RXD0, PD13_AOUT_FEC_RX_DV, PD14_AOUT_FEC_RX_CLK, PD15_AOUT_FEC_COL, PD16_AIN_FEC_TX_ER, PF23_AIN_FEC_TX_EN, }; static const struct imxuart_platform_data uart_pdata __initconst = { .flags = IMXUART_HAVE_RTSCTS, }; static void __init mx27lite_init(void) { imx27_soc_init(); mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins), "imx27lite"); imx27_add_imx_uart0(&uart_pdata); imx27_add_fec(NULL); } static void __init mx27lite_timer_init(void) { mx27_clocks_init(26000000); } static struct sys_timer mx27lite_timer = { .init = mx27lite_timer_init, }; MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE") .atag_offset = 0x100, .map_io = mx27_map_io, .init_early = imx27_init_early, .init_irq = mx27_init_irq, .handle_irq = imx27_handle_irq, .timer = &mx27lite_timer, .init_machine = mx27lite_init, .restart = mxc_restart, MACHINE_END
/* Copyright (c) 2002-2012 Croteam Ltd. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef SE_INCL_VIEWPORT_H #define SE_INCL_VIEWPORT_H #ifdef PRAGMA_ONCE #pragma once #endif #include <Engine/Graphics/Raster.h> #ifdef SE1_D3D #include <d3d8.h> #endif // SE1_D3D /* * ViewPort */ /* rcg !!! FIXME: This will need to go away. */ #ifdef PLATFORM_WIN32 class CTempDC { public: HDC hdc; HWND hwnd; CTempDC(HWND hWnd); ~CTempDC(void); }; #endif // base abstract class for viewport class ENGINE_API CViewPort { public: // implementation HWND vp_hWnd; // canvas (child) window HWND vp_hWndParent; // window of the viewport CRaster vp_Raster; // the used Raster #ifdef SE1_D3D LPDIRECT3DSWAPCHAIN8 vp_pSwapChain; // swap chain for D3D LPDIRECT3DSURFACE8 vp_pSurfDepth; // z-buffer for D3D #endif // SE1_D3D INDEX vp_ctDisplayChanges; // number of display driver // open/close canvas window void OpenCanvas(void); void CloseCanvas(BOOL bRelease=FALSE); // interface /* Constructor for given window. */ CViewPort(PIX pixWidth, PIX pixHeight, HWND hWnd); /* Destructor. */ ~CViewPort(void); /* Display the back buffer on screen. */ void SwapBuffers(void); // change size of this viewport, it's raster and all it's drawports to fit it window void Resize(void); }; #endif /* include-once check. */
/* $Id: fcntl.h 573 2006-02-20 17:09:11Z stsp2 $ */ #ifndef _SPARC64_FCNTL_H #define _SPARC64_FCNTL_H /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ #define O_NDELAY 0x0004 #define O_APPEND 0x0008 #define FASYNC 0x0040 /* fcntl, for BSD compatibility */ #define O_CREAT 0x0200 /* not fcntl */ #define O_TRUNC 0x0400 /* not fcntl */ #define O_EXCL 0x0800 /* not fcntl */ #define O_SYNC 0x2000 #define O_NONBLOCK 0x4000 #define O_NOCTTY 0x8000 /* not fcntl */ #define O_LARGEFILE 0x40000 #define O_DIRECT 0x100000 /* direct disk access hint */ #define O_NOATIME 0x200000 #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ #define F_GETLK 7 #define F_SETLK 8 #define F_SETLKW 9 /* for posix fcntl() and lockf() */ #define F_RDLCK 1 #define F_WRLCK 2 #define F_UNLCK 3 #define __ARCH_FLOCK_PAD short __unused; #include <asm-generic/fcntl.h> #endif /* !(_SPARC64_FCNTL_H) */
// SPDX-License-Identifier: GPL-2.0 #ifndef PREF_H #define PREF_H #ifdef __cplusplus extern "C" { #endif #include "units.h" #include "taxonomy.h" /* can't use 'bool' for the boolean values - different size in C and C++ */ typedef struct { short po2; short pn2; short phe; double po2_threshold_min; double po2_threshold_max; double pn2_threshold; double phe_threshold; } partial_pressure_graphs_t; typedef struct { char *access_token; char *user_id; char *album_id; } facebook_prefs_t; typedef struct { bool enable_geocoding; bool parse_dive_without_gps; bool tag_existing_dives; enum taxonomy_category category[3]; } geocoding_prefs_t; typedef struct { const char *language; const char *lang_locale; bool use_system_language; } locale_prefs_t; enum deco_mode { BUEHLMANN, RECREATIONAL, VPMB }; typedef struct { bool dont_check_for_updates; bool dont_check_exists; char *last_version_used; char *next_check; } update_manager_prefs_t; typedef struct { char *vendor; char *product; char *device; int download_mode; } dive_computer_prefs_t; struct preferences { const char *divelist_font; const char *default_filename; const char *default_cylinder; const char *cloud_base_url; const char *cloud_git_url; const char *time_format; const char *date_format; const char *date_format_short; bool time_format_override; bool date_format_override; double font_size; partial_pressure_graphs_t pp_graphs; short mod; double modpO2; short ead; short dcceiling; short redceiling; short calcceiling; short calcceiling3m; short calcalltissues; short calcndltts; short gflow; short gfhigh; int animation_speed; bool gf_low_at_maxdepth; bool show_ccr_setpoint; bool show_ccr_sensors; short display_invalid_dives; short unit_system; struct units units; bool coordinates_traditional; short show_sac; short display_unused_tanks; short show_average_depth; short zoomed_plot; short hrgraph; short percentagegraph; short rulergraph; short tankbar; short save_userid_local; char *userid; int ascrate75; // All rates in mm / sec int ascrate50; int ascratestops; int ascratelast6m; int descrate; int sacfactor; int problemsolvingtime; int bottompo2; int decopo2; enum deco_mode display_deco_mode; depth_t bestmixend; int proxy_type; char *proxy_host; int proxy_port; short proxy_auth; char *proxy_user; char *proxy_pass; bool doo2breaks; bool drop_stone_mode; bool last_stop; // At 6m? bool verbatim_plan; bool display_runtime; bool display_duration; bool display_transitions; bool display_variations; bool safetystop; bool switch_at_req_stop; int reserve_gas; int min_switch_duration; // seconds int bottomsac; int decosac; int o2consumption; // ml per min int pscr_ratio; // dump ratio times 1000 int defaultsetpoint; // default setpoint in mbar bool show_pictures_in_profile; bool use_default_file; short default_file_behavior; facebook_prefs_t facebook; char *cloud_storage_password; char *cloud_storage_newpassword; char *cloud_storage_email; char *cloud_storage_email_encoded; bool save_password_local; short cloud_verification_status; bool cloud_background_sync; geocoding_prefs_t geocoding; enum deco_mode planner_deco_mode; short vpmb_conservatism; int time_threshold; int distance_threshold; bool git_local_only; short cloud_timeout; locale_prefs_t locale; //: TODO: move the rest of locale based info here. update_manager_prefs_t update_manager; dive_computer_prefs_t dive_computer; }; enum unit_system_values { METRIC, IMPERIAL, PERSONALIZE }; enum def_file_behavior { UNDEFINED_DEFAULT_FILE, LOCAL_DEFAULT_FILE, NO_DEFAULT_FILE, CLOUD_DEFAULT_FILE }; enum cloud_status { CS_UNKNOWN, CS_INCORRECT_USER_PASSWD, CS_NEED_TO_VERIFY, CS_VERIFIED, CS_NOCLOUD }; extern struct preferences prefs, default_prefs, git_prefs; #define PP_GRAPHS_ENABLED (prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe) extern const char *system_divelist_default_font; extern double system_divelist_default_font_size; extern const char *system_default_directory(void); extern const char *system_default_filename(); extern bool subsurface_ignore_font(const char *font); extern void subsurface_OS_pref_setup(); #ifdef __cplusplus } #endif #endif // PREF_H
/************************************************* * gMystar.h * * Copyright (C) 2009 csip(amoblin@gmail.com) * * ChangeLog: * * Description: * Warning: this file should be in UTF-8. * **************************************************/ #include "Mystar.h" #include <gtkmm.h> #include <libglademm.h> #include <libnotifymm.h> #include <boost/lexical_cast.hpp> using namespace Gtk; class gMystar:public Window { public: //gMystar(int argc, char* argv[]); gMystar(); ~gMystar(); static void help(); static Mystar *mystar; protected: bool on_key_press_event(GdkEventKey *); void on_quit_button_clicked(); void on_connect_button_clicked(); void on_disconnect_button_clicked(); void on_tray_clicked(); static void show_message(const char *message); void show_window(); static void hide_window(); //static void *authen(void *); static void *test(void *); static void *change_ui(void *); Glib::RefPtr<Gnome::Glade::Xml> refXml; //static Window *MainWindow; Entry *username_entry; Entry *password_entry; Entry *fakeAddress_entry; Entry *nickname_entry; static CheckButton *autologin_checkbutton; static Button *connect_button; Button *disconnect_button; Button *quit_button; static Label *status_label; static Glib::RefPtr<Gtk::StatusIcon> status_icon; pthread_t authen_thread; pthread_t change_ui_thread; static bool flag; static int window_x; static int window_y; static sigc::connection c; static Notify::Notification *n; };
/* * Copyright (C)2003,2004 USAGI/WIDE Project * * Header for use in defining a given L3 protocol for connection tracking. * * Author: * Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp> * * Derived from include/netfilter_ipv4/ip_conntrack_protocol.h */ #ifndef _NF_CONNTRACK_L3PROTO_H #define _NF_CONNTRACK_L3PROTO_H #include <linux/netlink.h> #include <net/netlink.h> #include <linux/seq_file.h> #include <net/netfilter/nf_conntrack.h> struct nf_conntrack_l3proto { /* L3 Protocol Family number. ex) PF_INET */ u_int16_t l3proto; /* Protocol name */ const char *name; /* * Try to fill in the third arg: nhoff is offset of l3 proto * hdr. Return true if possible. */ bool (*pkt_to_tuple)(const struct sk_buff *skb, unsigned int nhoff, struct nf_conntrack_tuple *tuple); /* * Invert the per-proto part of the tuple: ie. turn xmit into reply. * Some packets can't be inverted: return 0 in that case. */ bool (*invert_tuple)(struct nf_conntrack_tuple *inverse, const struct nf_conntrack_tuple *orig); /* Print out the per-protocol part of the tuple. */ int (*print_tuple)(struct seq_file *s, const struct nf_conntrack_tuple *); /* * Called before tracking. * *dataoff: offset of protocol header (TCP, UDP,...) in skb * *protonum: protocol number */ int (*get_l4proto)(const struct sk_buff *skb, unsigned int nhoff, unsigned int *dataoff, u_int8_t *protonum); int (*tuple_to_nlattr)(struct sk_buff *skb, const struct nf_conntrack_tuple *t); /* * Calculate size of tuple nlattr */ int (*nlattr_tuple_size)(void); int (*nlattr_to_tuple)(struct nlattr *tb[], struct nf_conntrack_tuple *t); const struct nla_policy *nla_policy; size_t nla_size; #ifdef CONFIG_SYSCTL struct ctl_table_header *ctl_table_header; struct ctl_path *ctl_table_path; struct ctl_table *ctl_table; #endif /* CONFIG_SYSCTL */ /* Module (if any) which this is connected to. */ struct module *me; }; <<<<<<< HEAD extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; ======= extern struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX]; >>>>>>> 296c66da8a02d52243f45b80521febece5ed498a /* Protocol registration. */ extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); /* Existing built-in protocols */ extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; static inline struct nf_conntrack_l3proto * __nf_ct_l3proto_find(u_int16_t l3proto) { if (unlikely(l3proto >= AF_MAX)) return &nf_conntrack_l3proto_generic; return rcu_dereference(nf_ct_l3protos[l3proto]); } #endif /*_NF_CONNTRACK_L3PROTO_H*/
// Copyright 2013 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. // Originally written by Sven Peter <sven@fail0verflow.com> for anergistic. #pragma once #include <atomic> namespace GDBStub { /// Breakpoint Method enum class BreakpointType { None, ///< None Execute, ///< Execution Breakpoint Read, ///< Read Breakpoint Write, ///< Write Breakpoint Access ///< Access (R/W) Breakpoint }; struct BreakpointAddress { PAddr address; BreakpointType type; }; /// If set to false, the server will never be started and no gdbstub-related functions will be executed. extern std::atomic<bool> g_server_enabled; /** * Set the port the gdbstub should use to listen for connections. * * @param port Port to listen for connection */ void SetServerPort(u16 port); /** * Set the g_server_enabled flag and start or stop the server if possible. * * @param status Set the server to enabled or disabled. */ void ToggleServer(bool status); /// Start the gdbstub server. void Init(); /// Stop gdbstub server. void Shutdown(); /// Returns true if there is an active socket connection. bool IsConnected(); /** * Signal to the gdbstub server that it should halt CPU execution. * * @param is_memory_break If true, the break resulted from a memory breakpoint. */ void Break(bool is_memory_break = false); /// Determine if there was a memory breakpoint. bool IsMemoryBreak(); /// Read and handle packet from gdb client. void HandlePacket(); /** * Get the nearest breakpoint of the specified type at the given address. * * @param addr Address to search from. * @param type Type of breakpoint. */ BreakpointAddress GetNextBreakpointFromAddress(u32 addr, GDBStub::BreakpointType type); /** * Check if a breakpoint of the specified type exists at the given address. * * @param addr Address of breakpoint. * @param type Type of breakpoint. */ bool CheckBreakpoint(u32 addr, GDBStub::BreakpointType type); // If set to true, the CPU will halt at the beginning of the next CPU loop. bool GetCpuHaltFlag(); // If set to true and the CPU is halted, the CPU will step one instruction. bool GetCpuStepFlag(); /** * When set to true, the CPU will step one instruction when the CPU is halted next. * * @param is_step */ void SetCpuStepFlag(bool is_step); }
/* $Id: namei.h,v 1.2 2000/08/25 20:26:28 hch Exp $ * linux/include/asm-i386/namei.h * * Included from linux/fs/namei.c */ #ifndef __I386_NAMEI_H #define __I386_NAMEI_H #include <linux/config.h> /* * The base directory for our emulations. * - sparc uses usr/gmemul here. */ #define I386_EMUL_BASE "emul/" /* * We emulate quite a lot operting systems... */ #define I386_SVR4_EMUL I386_EMUL_BASE "/svr4/" #define I386_SVR3_EMUL I386_EMUL_BASE "/svr3/" #define I386_SCOSVR3_EMUL I386_EMUL_BASE "/sco/" #define I386_OSR5_EMUL I386_EMUL_BASE "/osr5/" #define I386_WYSEV386_EMUL I386_EMUL_BASE "/wyse/" #define I386_ISCR4_EMUL I386_EMUL_BASE "/isc/" #define I386_BSD_EMUL I386_EMUL_BASE "/bsd/" #define I386_XENIX_EMUL I386_EMUL_BASE "/xenix/" #define I386_SOLARIS_EMUL I386_EMUL_BASE "/solaris/" #define I386_UW7_EMUL I386_EMUL_BASE "/uw7/" static inline char *__emul_prefix(void) { #if defined(CONFIG_ABI) || defined (CONFIG_ABI_MODULE) switch (current->personality) { case PER_SVR4: return I386_SVR4_EMUL; case PER_SVR3: return I386_SVR3_EMUL; case PER_SCOSVR3: return I386_SCOSVR3_EMUL; case PER_OSR5: return I386_OSR5_EMUL; case PER_WYSEV386: return I386_WYSEV386_EMUL; case PER_ISCR4: return I386_ISCR4_EMUL; case PER_BSD: return I386_BSD_EMUL; case PER_XENIX: return I386_XENIX_EMUL; case PER_SOLARIS: return I386_SOLARIS_EMUL; case PER_UW7: return I386_UW7_EMUL; } #endif /* CONFIG_ABI || CONFIG_ABI_MODULE */ return NULL; } #endif /* __I386_NAMEI_H */
/* Copyright (C) 1998-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <unistd.h> #include <setxid.h> int __setreuid (uid_t ruid, uid_t euid) { #ifdef __NR_setreuid32 return INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid); #else return INLINE_SETXID_SYSCALL (setreuid, 2, ruid, euid); #endif } #ifndef __setreuid weak_alias (__setreuid, setreuid) #endif
/*========================================================================= Program: Visualization Toolkit Module: $RCSfile: vtkImageSobel3D.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 vtkImageSobel3D - Computes a vector field using sobel functions. // .SECTION Description // vtkImageSobel3D computes a vector field from a scalar field by using // Sobel functions. The number of vector components is 3 because // the input is a volume. Output is always doubles. A little creative // liberty was used to extend the 2D sobel kernels into 3D. #ifndef __vtkImageSobel3D_h #define __vtkImageSobel3D_h #include "vtkImageSpatialAlgorithm.h" class VTK_IMAGING_EXPORT vtkImageSobel3D : public vtkImageSpatialAlgorithm { public: static vtkImageSobel3D *New(); vtkTypeRevisionMacro(vtkImageSobel3D,vtkImageSpatialAlgorithm); void PrintSelf(ostream& os, vtkIndent indent); protected: vtkImageSobel3D(); ~vtkImageSobel3D() {}; void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int outExt[6], int id); virtual int RequestInformation (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector); private: vtkImageSobel3D(const vtkImageSobel3D&); // Not implemented. void operator=(const vtkImageSobel3D&); // Not implemented. }; #endif
/* * csync2 - cluster synchronization tool, 2nd generation * LINBIT Information Technologies GmbH <http://www.linbit.com> * Copyright (C) 2004, 2005 Clifford Wolf <clifford@clifford.at> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "csync2.h" #include <sys/types.h> #include <sys/wait.h> #include <sys/stat.h> #include <fcntl.h> #include <fnmatch.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <assert.h> void csync_schedule_commands(const char *filename, int islocal) { const struct csync_group *g = NULL; const struct csync_group_action *a = NULL; const struct csync_group_action_pattern *p = NULL; const struct csync_group_action_command *c = NULL; while ( (g=csync_find_next(g, filename)) ) { for (a=g->action; a; a=a->next) { if ( !islocal && a->do_local_only ) continue; if ( islocal && !a->do_local ) continue; if (!a->pattern) goto found_matching_pattern; for (p=a->pattern; p; p=p->next) { int fnm_pathname = p->star_matches_slashes ? 0 : FNM_PATHNAME; if ( !fnmatch(p->pattern, filename, FNM_LEADING_DIR|fnm_pathname) ) goto found_matching_pattern; } continue; found_matching_pattern: for (c=a->command; c; c=c->next) SQL("Add action to database", "INSERT INTO action (filename, command, logfile) " "VALUES ('%s', '%s', '%s')", url_encode(filename), url_encode(c->command), url_encode(a->logfile)); } } } void csync_run_single_command(const char *command, const char *logfile) { char *command_clr = strdup(url_decode(command)); char *logfile_clr = strdup(url_decode(logfile)); char *real_command, *mark; struct textlist *tl = 0, *t; pid_t pid; SQL_BEGIN("Checking for removed files", "SELECT filename from action WHERE command = '%s' " "and logfile = '%s'", command, logfile) { textlist_add(&tl, SQL_V(0), 0); } SQL_END; mark = strstr(command_clr, "%%"); if ( !mark ) { real_command = strdup(command_clr); } else { int len = strlen(command_clr) + 10; char *pos; for (t = tl; t != 0; t = t->next) len += strlen(t->value) + 1; pos = real_command = malloc(len); memcpy(real_command, command_clr, mark-command_clr); real_command[mark-command_clr] = 0; for (t = tl; t != 0; t = t->next) { pos += strlen(pos); if ( t != tl ) *(pos++) = ' '; strcpy(pos, t->value); } pos += strlen(pos); strcpy(pos, mark+2); assert(strlen(real_command)+1 < len); } csync_debug(1, "Running '%s' ...\n", real_command); pid = fork(); if ( !pid ) { close(0); close(1); close(2); /* 0 */ open("/dev/null", O_RDONLY); /* 1 */ open(logfile_clr, O_WRONLY|O_CREAT|O_APPEND, 0666); /* 2 */ open(logfile_clr, O_WRONLY|O_CREAT|O_APPEND, 0666); execl("/bin/sh", "sh", "-c", real_command, NULL); _exit(127); } if ( waitpid(pid, 0, 0) < 0 ) csync_fatal("ERROR: Waitpid returned error %s.\n", strerror(errno)); for (t = tl; t != 0; t = t->next) SQL("Remove action entry", "DELETE FROM action WHERE command = '%s' " "and logfile = '%s' and filename = '%s'", command, logfile, t->value); textlist_free(tl); } void csync_run_commands() { struct textlist *tl = 0, *t; SQL_BEGIN("Checking for sceduled commands", "SELECT command, logfile FROM action GROUP BY command, logfile") { textlist_add2(&tl, SQL_V(0), SQL_V(1), 0); } SQL_END; for (t = tl; t != 0; t = t->next) csync_run_single_command(t->value, t->value2); textlist_free(tl); }
/* * Copyright (c) 2012 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Obere Lagerstr. 30 * 82178 Puchheim * Germany * <rtems@embedded-brains.de> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ #include <rtems/config.h> #include <bsp.h> #include <bsp/vectors.h> #include <bsp/bootcard.h> #include <bsp/irq-generic.h> #include <bsp/linker-symbols.h> LINKER_SYMBOL(bsp_exc_vector_base); /* * Configuration parameter for clock driver. The Trace32 PowerPC simulator has * an odd decrementer frequency. The time base frequency is one tick per * instruction. The decrementer frequency is one tick per ten instructions. * The clock driver assumes that the time base and decrementer frequencies are * equal. For now we simulate processor that issues 10000000 instructions per * second. */ uint32_t bsp_time_base_frequency = 10000000 / 10; void BSP_panic(char *s) { rtems_interrupt_level level; rtems_interrupt_disable(level); printk("%s PANIC %s\n", rtems_get_version_string(), s); while (1) { /* Do nothing */ } } void _BSP_Fatal_error(unsigned n) { rtems_interrupt_level level; rtems_interrupt_disable(level); printk("%s PANIC ERROR %u\n", rtems_get_version_string(), n); while (1) { /* Do nothing */ } } void bsp_start(void) { rtems_status_code sc; get_ppc_cpu_type(); get_ppc_cpu_revision(); /* Initialize exception handler */ ppc_exc_vector_base = (uint32_t) bsp_exc_vector_base; sc = ppc_exc_initialize( PPC_INTERRUPT_DISABLE_MASK_DEFAULT, (uintptr_t) bsp_section_work_begin, Configuration.interrupt_stack_size ); if (sc != RTEMS_SUCCESSFUL) { BSP_panic("cannot initialize exceptions"); } /* Initalize interrupt support */ sc = bsp_interrupt_initialize(); if (sc != RTEMS_SUCCESSFUL) { BSP_panic("cannot initialize interrupts\n"); } }
/* * Clutter. * * An OpenGL based 'interactive canvas' library. * * Copyright (C) 2011 Intel Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * * ClutterContainer: Generic actor container interface. * * Author: Emmanuele Bassi <ebassi@linux.intel.com> */ #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) #error "Only <clutter/clutter.h> can be included directly." #endif #ifndef __CLUTTER_CONTAINER_DEPRECATED_H__ #define __CLUTTER_CONTAINER_DEPRECATED_H__ #include <clutter/clutter-container.h> G_BEGIN_DECLS CLUTTER_DEPRECATED_FOR(clutter_actor_add_child) void clutter_container_add (ClutterContainer *container, ClutterActor *first_actor, ...) G_GNUC_NULL_TERMINATED; CLUTTER_DEPRECATED_FOR(clutter_actor_add_child) void clutter_container_add_actor (ClutterContainer *container, ClutterActor *actor); CLUTTER_DEPRECATED_FOR(clutter_actor_remove_child) void clutter_container_remove (ClutterContainer *container, ClutterActor *first_actor, ...) G_GNUC_NULL_TERMINATED; CLUTTER_DEPRECATED_FOR(clutter_actor_remove_child) void clutter_container_remove_actor (ClutterContainer *container, ClutterActor *actor); CLUTTER_DEPRECATED_FOR(clutter_actor_get_children) GList * clutter_container_get_children (ClutterContainer *container); CLUTTER_DEPRECATED_FOR(clutter_actor_set_child_above_sibling) void clutter_container_raise_child (ClutterContainer *container, ClutterActor *actor, ClutterActor *sibling); CLUTTER_DEPRECATED_FOR(clutter_actor_set_child_below_sibling) void clutter_container_lower_child (ClutterContainer *container, ClutterActor *actor, ClutterActor *sibling); CLUTTER_DEPRECATED void clutter_container_sort_depth_order (ClutterContainer *container); G_END_DECLS #endif /* __CLUTTER_CONTAINER_DEPRECATED_H__ */
#include "config.h" /* Generated from /home3/dni/haiyan.zhuang/r7800-test.git/build_dir/target-arm_v7-a_uClibc-0.9.33.2_eabi/samba-4.6.4/source4/heimdal/lib/wind/wind_err.et */ /* $Id$ */ #include <stddef.h> #include <com_err.h> #include "wind_err.h" #define N_(x) (x) static const char *wind_error_strings[] = { /* 000 */ N_("No error"), /* 001 */ N_("No such profile"), /* 002 */ N_("Buffer overrun"), /* 003 */ N_("Buffer underrun"), /* 004 */ N_("Length not mod2"), /* 005 */ N_("Length not mod4"), /* 006 */ N_("Invalid UTF-8 combination in string"), /* 007 */ N_("Invalid UTF-16 combination in string"), /* 008 */ N_("Invalid UTF-32 combination in string"), /* 009 */ N_("No byte order mark (BOM) in string"), /* 010 */ N_("Code can't be represented as UTF-16"), NULL }; #define num_errors 11 void initialize_wind_error_table_r(struct et_list **list) { initialize_error_table_r(list, wind_error_strings, num_errors, ERROR_TABLE_BASE_wind); } void initialize_wind_error_table(void) { init_error_table(wind_error_strings, ERROR_TABLE_BASE_wind, num_errors); }
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:38 2014 */ /* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/linux/user.h */ #if defined(__cplusplus) && !CLICK_CXX_PROTECTED # error "missing #include <click/cxxprotect.h>" #endif #include <asm/user.h>
/***** * * Copyright (C) 2003-2012 CS-SI. All Rights Reserved. * Author: Nicolas Delon <nicolas.delon@prelude-ids.com> * * This file is part of the Prelude library. * * 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; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * *****/ #ifndef _LIBPRELUDE_IDMEF_DATA_H #define _LIBPRELUDE_IDMEF_DATA_H #include "prelude-list.h" #ifdef __cplusplus extern "C" { #endif typedef enum { IDMEF_DATA_TYPE_UNKNOWN = 0, IDMEF_DATA_TYPE_CHAR = 1, IDMEF_DATA_TYPE_BYTE = 2, IDMEF_DATA_TYPE_UINT32 = 3, IDMEF_DATA_TYPE_UINT64 = 4, IDMEF_DATA_TYPE_FLOAT = 5, IDMEF_DATA_TYPE_CHAR_STRING = 6, IDMEF_DATA_TYPE_BYTE_STRING = 7 } idmef_data_type_t; typedef struct { int refcount; int flags; idmef_data_type_t type; size_t len; union { char char_data; uint8_t byte_data; uint32_t uint32_data; uint64_t uint64_data; float float_data; void *rw_data; const void *ro_data; } data; prelude_list_t list; } idmef_data_t; int idmef_data_new(idmef_data_t **data); idmef_data_t *idmef_data_ref(idmef_data_t *data); int idmef_data_new_char(idmef_data_t **data, char c); int idmef_data_new_byte(idmef_data_t **data, uint8_t i); int idmef_data_new_uint32(idmef_data_t **data, uint32_t i); int idmef_data_new_uint64(idmef_data_t **data, uint64_t i); int idmef_data_new_float(idmef_data_t **data, float f); void idmef_data_set_char(idmef_data_t *data, char c); void idmef_data_set_byte(idmef_data_t *data, uint8_t i); void idmef_data_set_uint32(idmef_data_t *data, uint32_t i); void idmef_data_set_uint64(idmef_data_t *data, uint64_t i); void idmef_data_set_float(idmef_data_t *data, float f); int idmef_data_set_ptr_dup_fast(idmef_data_t *data, idmef_data_type_t type, const void *ptr, size_t len); int idmef_data_set_ptr_ref_fast(idmef_data_t *data, idmef_data_type_t type, const void *ptr, size_t len); int idmef_data_set_ptr_nodup_fast(idmef_data_t *data, idmef_data_type_t type, void *ptr, size_t len); int idmef_data_new_ptr_dup_fast(idmef_data_t **data, idmef_data_type_t type, const void *ptr, size_t len); int idmef_data_new_ptr_ref_fast(idmef_data_t **data, idmef_data_type_t type, const void *ptr, size_t len); int idmef_data_new_ptr_nodup_fast(idmef_data_t **data, idmef_data_type_t type, void *ptr, size_t len); /* * String functions */ int idmef_data_set_char_string_dup_fast(idmef_data_t *data, const char *str, size_t len); int idmef_data_new_char_string_dup_fast(idmef_data_t **data, const char *str, size_t len); int idmef_data_new_char_string_ref_fast(idmef_data_t **data, const char *ptr, size_t len); int idmef_data_new_char_string_nodup_fast(idmef_data_t **data, char *ptr, size_t len); int idmef_data_set_char_string_ref_fast(idmef_data_t *data, const char *ptr, size_t len); int idmef_data_set_char_string_nodup_fast(idmef_data_t *data, char *ptr, size_t len); int idmef_data_new_char_string_ref(idmef_data_t **data, const char *ptr); int idmef_data_new_char_string_dup(idmef_data_t **data, const char *ptr); int idmef_data_new_char_string_nodup(idmef_data_t **data, char *ptr); int idmef_data_set_char_string_ref(idmef_data_t *data, const char *ptr); int idmef_data_set_char_string_dup(idmef_data_t *data, const char *ptr); int idmef_data_set_char_string_nodup(idmef_data_t *data, char *ptr); #define idmef_data_set_char_string_constant(string, str) \ idmef_data_set_char_string_ref_fast((string), (str), sizeof((str)) - 1) /* * Byte functions */ int idmef_data_new_byte_string_ref(idmef_data_t **data, const unsigned char *ptr, size_t len); int idmef_data_new_byte_string_dup(idmef_data_t **data, const unsigned char *ptr, size_t len); int idmef_data_new_byte_string_nodup(idmef_data_t **data, unsigned char *ptr, size_t len); int idmef_data_set_byte_string_ref(idmef_data_t *data, const unsigned char *ptr, size_t len); int idmef_data_set_byte_string_dup(idmef_data_t *data, const unsigned char *ptr, size_t len); int idmef_data_set_byte_string_nodup(idmef_data_t *data, unsigned char *ptr, size_t len); /* * */ void idmef_data_destroy(idmef_data_t *data); int idmef_data_copy_ref(const idmef_data_t *src, idmef_data_t *dst); int idmef_data_copy_dup(const idmef_data_t *src, idmef_data_t *dst); int idmef_data_clone(const idmef_data_t *src, idmef_data_t **dst); idmef_data_type_t idmef_data_get_type(const idmef_data_t *data); size_t idmef_data_get_len(const idmef_data_t *data); const void *idmef_data_get_data(const idmef_data_t *data); char idmef_data_get_char(const idmef_data_t *data); uint8_t idmef_data_get_byte(const idmef_data_t *data); uint32_t idmef_data_get_uint32(const idmef_data_t *data); uint64_t idmef_data_get_uint64(const idmef_data_t *data); float idmef_data_get_float(const idmef_data_t *data); const char *idmef_data_get_char_string(const idmef_data_t *data); const unsigned char *idmef_data_get_byte_string(const idmef_data_t *data); prelude_bool_t idmef_data_is_empty(const idmef_data_t *data); int idmef_data_to_string(const idmef_data_t *data, prelude_string_t *out); void idmef_data_destroy_internal(idmef_data_t *data); int idmef_data_compare(const idmef_data_t *data1, const idmef_data_t *data2); #ifdef __cplusplus } #endif #endif /* _LIBPRELUDE_IDMEF_DATA_H */
// // C++ Interface: selection navigation dialog // // Description: // // // Author: Vadim Lopatin <vadim.lopatin@coolreader.org>, (C) 2008 // // Copyright: See COPYING file that comes with this distribution // // bigfit.h #ifndef BIGFIT_H_INCLUDED #define BIGFIT_H_INCLUDED #include "mainwnd.h" /// window to show on top of DocView window, shifting/stretching DOCView content to fit class BackgroundFitWindow : public CRGUIWindowBase { protected: CRDocViewWindow * _mainwin; virtual void draw(); public: BackgroundFitWindow( CRGUIWindowManager * wm, CRDocViewWindow * mainwin ) : CRGUIWindowBase(wm), _mainwin(mainwin) { _fullscreen = true; } }; #endif
#define pr_fmt(fmt) "["KBUILD_MODNAME"] " fmt #include <linux/module.h> #include <linux/device.h> #include <linux/fs.h> #include <linux/cdev.h> #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/uaccess.h> #include <linux/mm.h> #include <linux/kfifo.h> #include <linux/firmware.h> #include <linux/syscalls.h> #include <linux/uaccess.h> #include <linux/platform_device.h> #include <linux/proc_fs.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/printk.h> #include <mach/mt_chip.h> #include <mach/mt_reg_base.h> #include <mach/mt_typedefs.h> #include <asm/setup.h> extern u32 get_devinfo_with_index(u32 index); void __iomem *APHW_CODE = NULL; void __iomem *APHW_SUBCODE = NULL; void __iomem *APHW_VER = NULL; void __iomem *APSW_VER = NULL; unsigned int __chip_hw_code(void) { return (APHW_CODE) ? readl(IOMEM(APHW_CODE)) : (0); } unsigned int __chip_hw_ver(void) { return (APHW_VER) ? readl(IOMEM(APHW_VER)) : (0); } unsigned int __chip_sw_ver(void) { return (APSW_VER) ? readl(IOMEM(APSW_VER)) : (0); } unsigned int __chip_hw_subcode(void) { return (APHW_SUBCODE) ? readl(IOMEM(APHW_SUBCODE)) : (0); } unsigned int __chip_func_code(void) { unsigned int val = get_devinfo_with_index(28) & 0xFF000000; return (val >> 24); } unsigned int __chip_date_code(void) { unsigned int val = get_devinfo_with_index(28) & 0x00FFC000; return (val >> 14); } unsigned int __chip_proj_code(void) { unsigned int val = get_devinfo_with_index(28) & 0x00003FFF; return (val); } unsigned int __chip_fab_code(void) { unsigned int val = get_devinfo_with_index(29) & 0x00000007; return (val); } unsigned int mt_get_chip_id(void) { unsigned int chip_id = __chip_hw_code(); return chip_id; } unsigned int mt_get_chip_hw_code(void) { return __chip_hw_code(); } unsigned int mt_get_chip_hw_ver(void) { return __chip_hw_ver(); } unsigned int mt_get_chip_hw_subcode(void) { return __chip_hw_subcode(); } chip_sw_ver_t mt_get_chip_sw_ver(void) { return (chip_sw_ver_t)__chip_sw_ver(); } static chip_info_cb g_cbs[CHIP_INFO_MAX] = { NULL, mt_get_chip_hw_code, mt_get_chip_hw_subcode, mt_get_chip_hw_ver, (chip_info_cb)mt_get_chip_sw_ver, __chip_hw_code, __chip_hw_subcode, __chip_hw_ver, __chip_sw_ver, __chip_func_code, __chip_date_code, __chip_proj_code, __chip_fab_code, NULL, }; unsigned int mt_get_chip_info(chip_info_t id) { if ((id <= CHIP_INFO_NONE) || (id >= CHIP_INFO_MAX)) return 0; else if (NULL == g_cbs[id]) return 0; return g_cbs[id](); } int __init chip_mod_init(void) { struct mt_chip_drv* p_drv = get_mt_chip_drv(); #ifdef CONFIG_OF struct device_node *node = of_find_compatible_node(NULL, NULL, "mediatek,CHIPID"); if (node) { APHW_CODE = of_iomap(node,0); WARN(!APHW_CODE, "unable to map APHW_CODE registers\n"); APHW_SUBCODE = of_iomap(node,1); WARN(!APHW_SUBCODE, "unable to map APHW_SUBCODE registers\n"); APHW_VER = of_iomap(node,2); WARN(!APHW_VER, "unable to map APHW_VER registers\n"); APSW_VER = of_iomap(node,3); WARN(!APSW_VER, "unable to map APSW_VER registers\n"); } #endif pr_alert("CODE = %04x %04x %04x %04x, %04x %04x %04x %04x, %04X %04X\n", __chip_hw_code(), __chip_hw_subcode(), __chip_hw_ver(), __chip_sw_ver(), __chip_func_code(), __chip_proj_code(), __chip_date_code(), __chip_fab_code(), mt_get_chip_hw_ver(), mt_get_chip_sw_ver()); p_drv->info_bit_mask |= CHIP_INFO_BIT(CHIP_INFO_HW_CODE) | CHIP_INFO_BIT(CHIP_INFO_HW_SUBCODE) | CHIP_INFO_BIT(CHIP_INFO_HW_VER) | CHIP_INFO_BIT(CHIP_INFO_SW_VER) | CHIP_INFO_BIT(CHIP_INFO_FUNCTION_CODE) | CHIP_INFO_BIT(CHIP_INFO_DATE_CODE) | CHIP_INFO_BIT(CHIP_INFO_PROJECT_CODE) | CHIP_INFO_BIT(CHIP_INFO_FAB_CODE); p_drv->get_chip_info = mt_get_chip_info; pr_alert("CODE = %08X %p", p_drv->info_bit_mask, p_drv->get_chip_info); return 0; } core_initcall(chip_mod_init); MODULE_DESCRIPTION("MTK Chip Information"); MODULE_LICENSE("GPL"); EXPORT_SYMBOL(mt_get_chip_id); EXPORT_SYMBOL(mt_get_chip_hw_code); EXPORT_SYMBOL(mt_get_chip_sw_ver); EXPORT_SYMBOL(mt_get_chip_info);