text
stringlengths
4
6.14k
/******************************************************************************* * File: bsp_cal.c * Author: Mitchell S. Tilson * Created: 09/30/2019 * * Description: This file provides an interface for writing calibration to the * flash. ******************************************************************************/ /******************************************************************************* * Includes ******************************************************************************/ #include "bsp_cal.h" #include "driver_flash.h" #include "comms_xbee.h" #include <assert.h> #include <sys/kmem.h> #include <string.h> /******************************************************************************* * Local definitions ******************************************************************************/ #define CAL_HDR 0xA5A5A5A5 /******************************************************************************* * Local static function definitions ******************************************************************************/ static void bsp_cal_erase_cb( uint8_t* data, uint16_t len ); /******************************************************************************* * Local static data ******************************************************************************/ const uint32_t bsp_cal_space[256] __attribute__((section (".cal_space"),space(prog))) = {1}; uint32_t bsp_cal_words_used = 1; // The header for the calibration space uses 1 byte /******************************************************************************* * Public function section ******************************************************************************/ /******************************************************************************* * bsp_cal_init * * Description: Initializes the motor cal bsp * * Inputs: none * * Returns: none * * Revision: Initial Creation 09/29/2019 - Mitchell S. Tilson * ******************************************************************************/ void bsp_cal_init( void ) { comms_xbee_rx_cb_t bsp_cal_erase_rx_cb = { .cb = bsp_cal_erase_cb, .msg_id = COMMS_ERASE_CAL, }; ret_t ret = comms_xbee_register_rx_cb(bsp_cal_erase_rx_cb); assert(ret==rSUCCESS); } /******************************************************************************* * bsp_cal_request_space * * Description: Allocates flash space to a client * * Inputs: none * * Returns: none * * Revision: Initial Creation 09/29/2019 - Mitchell S. Tilson * ******************************************************************************/ const uint32_t* bsp_cal_request_space( uint32_t size ) { const uint32_t* mem_ptr = &bsp_cal_space[bsp_cal_words_used]; bsp_cal_words_used += size; return mem_ptr; } /******************************************************************************* * bsp_cal_erase_cb * * Description: Erases the calibration flash space when called from the comms * layer. * * Inputs: none * * Returns: none * * Revision: Initial Creation 09/29/2019 - Mitchell S. Tilson * * Notes: Calibration is read for all motors at once * ******************************************************************************/ static void bsp_cal_erase_cb( uint8_t* data, uint16_t len ) { (void)len; if( data[0] == COMMS_ERASE_CAL ) { driver_flash_erase_page(KVA_TO_PA(bsp_cal_space)); driver_flash_write_word(KVA_TO_PA(&bsp_cal_space[0]),CAL_HDR); } }
#import <QuartzCore/CALayer.h> #import <Foundation/NSObject.h> @import QuartzCore; @import JavaScriptCore; @protocol JSBCAAnimation; @protocol JSBCATransition <JSExport, JSBCAAnimation> #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @property (retain) CAMediaTimingFunction *timingFunction; @property (copy) NSArray *values; @property (copy) NSString *subtype; @property (retain) id delegate; @property (retain) id filter; @property (copy) NSArray *keyTimes; @property (retain) CAValueFunction *valueFunction; @property (getter = isCumulative) BOOL cumulative; @property (copy) NSArray *timingFunctions; @property CGPathRef path; @property (copy) NSString *calculationMode; @property (copy) NSString *rotationMode; @property (copy) NSString *type; @property float startProgress, endProgress; @property (copy) NSArray *animations; @property (copy) NSArray *tensionValues, *continuityValues, *biasValues; @property (copy) NSString *keyPath; @property (retain) id fromValue, toValue, byValue; @property (getter = isAdditive) BOOL additive; @property (getter = isRemovedOnCompletion) BOOL removedOnCompletion; #pragma clang diagnostic pop @end
include(__link__.m4) #ifndef _THREADS_H #define _THREADS_H #include <stdint.h> // DATA STRUCTURES typedef struct mtx_s { uint8_t thrd_owner; uint8_t mutex_type; uint8_t lock_count; uint8_t spinlock; void *q; // p_forward_list * } mtx_t; typedef uint16_t once_flag; #define ONCE_FLAG_INIT 0x00fe // mutex __DPROTO(void,,call_once,once_flag *flag,void *func) __DPROTO(void..mtx_destroy,mtx_t *m) __DPROTO(int,,mtx_init,mtx_t *m,int type) __DPROTO(int,,mtx_lock,mtx_t *m) __DPROTO(int,,mtx_timedlock,mtx_t *m,struct timespec *ts) __DPROTO(int,,mtx_trylock,mtx_t *m) __DPROTO(int,,mtx_unlock,mtx_t *m) __DPROTO(void,,spinlock_acquire,char *spinlock) __DPROTO(void,,spinlock_release,char *spinlock) __DPROTO(int,,spinlock_tryacquire,char *spinlock) #endif
#ifndef _CFG_CALIBRATION_D_H #define _CFG_CALIBRATION_D_H File_Calibration_Struct stCalibrationDefault = { 1 }; File_Acceleration_Struct stAccelerationDefault = { 1 }; File_Gyroscope_Struct stGyroscopeDefault = { 1 }; File_Shopdemo_Struct stShopdemoDefault = { 1 }; #endif
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include <sys/timex.h> #include "sd-bus.h" #include "sd-event.h" #include "sd-network.h" #include "sd-resolve.h" #include "list.h" #include "ratelimit.h" #include "time-util.h" #include "timesyncd-ntp-message.h" typedef struct Manager Manager; #include "timesyncd-server.h" /* * "A client MUST NOT under any conditions use a poll interval less * than 15 seconds." */ #define NTP_POLL_INTERVAL_MIN_USEC (32 * USEC_PER_SEC) #define NTP_POLL_INTERVAL_MAX_USEC (2048 * USEC_PER_SEC) #define NTP_RETRY_INTERVAL_MIN_USEC (15 * USEC_PER_SEC) #define NTP_RETRY_INTERVAL_MAX_USEC (6 * 60 * USEC_PER_SEC) /* 6 minutes */ #define DEFAULT_CONNECTION_RETRY_USEC (30*USEC_PER_SEC) struct Manager { sd_bus *bus; sd_event *event; sd_resolve *resolve; LIST_HEAD(ServerName, system_servers); LIST_HEAD(ServerName, link_servers); LIST_HEAD(ServerName, fallback_servers); bool have_fallbacks:1; RateLimit ratelimit; bool exhausted_servers; /* network */ sd_event_source *network_event_source; sd_network_monitor *network_monitor; /* peer */ sd_resolve_query *resolve_query; sd_event_source *event_receive; ServerName *current_server_name; ServerAddress *current_server_address; int server_socket; int missed_replies; uint64_t packet_count; sd_event_source *event_timeout; bool good; /* last sent packet */ struct timespec trans_time_mon; struct timespec trans_time; usec_t retry_interval; usec_t connection_retry_usec; bool pending; /* poll timer */ sd_event_source *event_timer; usec_t poll_interval_usec; usec_t poll_interval_min_usec; usec_t poll_interval_max_usec; bool poll_resync; /* history data */ struct { double offset; double delay; } samples[8]; unsigned samples_idx; double samples_jitter; usec_t max_root_distance_usec; /* last change */ bool jumped; bool sync; int64_t drift_freq; /* watch for time changes */ sd_event_source *event_clock_watch; int clock_watch_fd; /* Retry connections */ sd_event_source *event_retry; /* RTC runs in local time, leave it alone */ bool rtc_local_time; /* NTP response */ struct ntp_msg ntpmsg; struct timespec origin_time, dest_time; bool spike; }; int manager_new(Manager **ret); Manager* manager_free(Manager *m); DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free); void manager_set_server_name(Manager *m, ServerName *n); void manager_set_server_address(Manager *m, ServerAddress *a); void manager_flush_server_names(Manager *m, ServerType t); int manager_connect(Manager *m); void manager_disconnect(Manager *m);
#define LINES 25 #define COLUMNS_IN_LINE 80 #define BYTES_FOR_EACH_ELEMENT 2 #define SCREENSIZE BYTES_FOR_EACH_ELEMENT * COLUMNS_IN_LINE * LINES #define KEYBOARD_DATA_PORT 0x60 #define KEYBOARD_STATUS_PORT 0x64 #define IDT_SIZE 256 #define INTERRUPT_GATE 0x8e #define KERNEL_CODE_SEGMENT_OFFSET 0x08 #define ENTER_KEY_CODE 0x1C unsigned char keyboard_map[128] = { 0, 27, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */ '9', '0', '-', '=', '\b', /* Backspace */ '\t', /* Tab */ 'q', 'w', 'e', 'r', /* 19 */ 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', /* Enter key */ 0, /* 29 - Control */ 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', /* 39 */ '\'', '`', 0, /* Left shift */ '\\', 'z', 'x', 'c', 'v', 'b', 'n', /* 49 */ 'm', ',', '.', '/', 0, /* Right shift */ '*', 0, /* Alt */ ' ', /* Space bar */ 0, /* Caps lock */ 0, /* 59 - F1 key ... > */ 0, 0, 0, 0, 0, 0, 0, 0, 0, /* < ... F10 */ 0, /* 69 - Num lock*/ 0, /* Scroll Lock */ 0, /* Home key */ 0, /* Up Arrow */ 0, /* Page Up */ '-', 0, /* Left Arrow */ 0, 0, /* Right Arrow */ '+', 0, /* 79 - End key*/ 0, /* Down Arrow */ 0, /* Page Down */ 0, /* Insert Key */ 0, /* Delete Key */ 0, 0, 0, 0, /* F11 Key */ 0, /* F12 Key */ 0, /* All other keys are undefined */ }; unsigned char livecmd=''; extern void keyboard_handler(void); extern char read_port(unsigned short port); extern void write_port(unsigned short port, unsigned char data); extern void load_idt(unsigned long *idt_ptr); unsigned int current_loc = 0; char *vidptr = (char*)0xb8000; struct IDT_entry { unsigned short int offset_lowerbits; unsigned short int selector; unsigned char zero; unsigned char type_attr; unsigned short int offset_higherbits; }; struct IDT_entry IDT[IDT_SIZE]; void idt_init(void) { unsigned long keyboard_address; unsigned long idt_address; unsigned long idt_ptr[2]; keyboard_address = (unsigned long)keyboard_handler; IDT[0x21].offset_lowerbits = keyboard_address & 0xffff; IDT[0x21].selector = KERNEL_CODE_SEGMENT_OFFSET; IDT[0x21].zero = 0; IDT[0x21].type_attr = INTERRUPT_GATE; IDT[0x21].offset_higherbits = (keyboard_address & 0xffff0000) >> 16; write_port(0x20 , 0x11); write_port(0xA0 , 0x11); write_port(0x21 , 0x20); write_port(0xA1 , 0x28); write_port(0x21 , 0x00); write_port(0xA1 , 0x00); write_port(0x21 , 0x01); write_port(0xA1 , 0x01); write_port(0x21 , 0xff); write_port(0xA1 , 0xff); idt_address = (unsigned long)IDT ; idt_ptr[0] = (sizeof (struct IDT_entry) * IDT_SIZE) + ((idt_address & 0xffff) << 16); idt_ptr[1] = idt_address >> 16 ; load_idt(idt_ptr); } void kb_init(void) { write_port(0x21 , 0xFD); } void log(char *str) { unsigned int i = 0; while (str[i] != '\0') { vidptr[current_loc++] = str[i++]; vidptr[current_loc++] = 0x07; } } void newline(void) { unsigned int line_size = BYTES_FOR_EACH_ELEMENT * COLUMNS_IN_LINE; current_loc = current_loc + (line_size - current_loc % (line_size)); } void clear(void) { unsigned int i = 0; while (i < SCREENSIZE) { vidptr[i++] = ' '; vidptr[i++] = 0x07; } } void keyboard_handler_main(void) { unsigned char status; char keycode; write_port(0x20, 0x20); status = read_port(KEYBOARD_STATUS_PORT); if (status & 0x01) { keycode = read_port(KEYBOARD_DATA_PORT); if(keycode < 0) return; if(keycode == ENTER_KEY_CODE) { newline(); const char cmd=livecmd; an(cmd); livecmd=''; newline(); return; }else{ livecmd+=keyboard_map[(unsigned char) keycode]; vidptr[current_loc++] = keyboard_map[(unsigned char) keycode]; vidptr[current_loc++] = 0x07; } } } void an(const char *str){ const char sorry='Develop in progress...'; log(sorry); }
#ifndef M6502_DASM_H #define M6502_DASM_H #include "Debug.h" class Cdebug_m6502:public Cdebug{ Q_OBJECT public: quint32 DisAsm_1(quint32 adr); //disasm 1 line to Buffer Cdebug_m6502(CCPU *parent); virtual ~Cdebug_m6502(){} int DasmOpe(char *S,quint8 *A,unsigned long PC); }; #endif // M6502_DASM_H
/* vim: set ts=8 sw=8 sts=8 noet tw=78: * * tup - A file-based build system * * Copyright (C) 2010-2022 Mike Shal <marfey@gmail.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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "dirpath.h" #include "tup/tupid_tree.h" #include "tup/compat.h" #include "tup/config.h" #include "tup/container.h" #include <stdio.h> #include <stdlib.h> #include <pthread.h> static pthread_mutex_t dirpath_mutex = PTHREAD_MUTEX_INITIALIZER; static struct tupid_entries root = {NULL}; static int dp_fd = 10000; struct dirpath { struct tupid_tree tnode; char *path; }; const char *win32_get_dirpath(int dfd) { struct tupid_tree *tt; if(dfd == tup_top_fd()) { return get_tup_top(); } pthread_mutex_lock(&dirpath_mutex); tt = tupid_tree_search(&root, dfd); pthread_mutex_unlock(&dirpath_mutex); if(tt) { struct dirpath *dp = container_of(tt, struct dirpath, tnode); return dp->path; } return NULL; } int win32_add_dirpath(const char *path) { struct dirpath *dp; char buf[PATH_MAX]; int len1 = 0; int len2; dp = malloc(sizeof *dp); if(!dp) { perror("malloc"); return -1; } if(!is_full_path(path)) { /* Relative paths get prefixed with getcwd */ if(getcwd(buf, sizeof(buf)) == NULL) { perror("getcwd"); return -1; } len1 = strlen(buf); } len2 = strlen(path); dp->path = malloc(len1 + len2 + 2); if(!dp->path) { perror("malloc"); return -1; } if(!is_full_path(path)) { /* Relative paths */ memcpy(dp->path, buf, len1); dp->path[len1] = '\\'; memcpy(dp->path+len1+1, path, len2); dp->path[len1 + len2 + 1] = 0; } else { /* Full paths */ memcpy(dp->path, path, len2); dp->path[len2] = 0; } pthread_mutex_lock(&dirpath_mutex); dp->tnode.tupid = dp_fd; dp_fd++; if(tupid_tree_insert(&root, &dp->tnode) < 0) { fprintf(stderr, "tup error: Unable to add dirpath for '%s'\n", path); goto out_err; } pthread_mutex_unlock(&dirpath_mutex); return dp->tnode.tupid; out_err: pthread_mutex_unlock(&dirpath_mutex); return -1; } int win32_rm_dirpath(int dfd) { struct tupid_tree *tt; int rc = 0; pthread_mutex_lock(&dirpath_mutex); tt = tupid_tree_search(&root, dfd); if(tt) { struct dirpath *dp = container_of(tt, struct dirpath, tnode); tupid_tree_rm(&root, tt); free(dp->path); free(dp); rc = 1; } pthread_mutex_unlock(&dirpath_mutex); return rc; } int win32_dup(int oldfd) { struct tupid_tree *tt; int rc = -2; pthread_mutex_lock(&dirpath_mutex); tt = tupid_tree_search(&root, oldfd); if(tt) { struct dirpath *dp = container_of(tt, struct dirpath, tnode); struct dirpath *new; new = malloc(sizeof *new); if(!new) { perror("malloc"); goto out_err; } new->path = strdup(dp->path); if(!new->path) { perror("strdup"); goto out_err; } new->tnode.tupid = dp_fd; if(tupid_tree_insert(&root, &new->tnode) < 0) { fprintf(stderr, "tup error: Unable to dup fd %i\n", oldfd); goto out_err; } rc = dp_fd; dp_fd++; } pthread_mutex_unlock(&dirpath_mutex); return rc; out_err: pthread_mutex_unlock(&dirpath_mutex); return -1; }
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_HOST_H_ #define CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_HOST_H_ #pragma once #include "ui/gfx/native_widget_types.h" namespace views { class View; } class Profile; namespace chromeos { class StatusAreaHost { public: enum TextStyle { kWhitePlain, kWhiteHaloed, kGrayEmbossed }; enum ScreenMode { kLoginMode, kBrowserMode, kScreenLockerMode, }; virtual Profile* GetProfile() const = 0; virtual gfx::NativeWindow GetNativeWindow() const = 0; virtual bool ShouldOpenButtonOptions( const views::View* button_view) const = 0; virtual void OpenButtonOptions(const views::View* button_view) = 0; virtual void ExecuteBrowserCommand(int id) const = 0; virtual TextStyle GetTextStyle() const = 0; virtual ScreenMode GetScreenMode() const = 0; protected: virtual ~StatusAreaHost() {} }; } #endif
#include "../fd.h" #include "../sh.h" #include "../eval.h" #include "../fdstack.h" #include "../vartab.h" #include <assert.h> int eval_pop(struct eval* e) { int ret; assert(e == eval); ret = e->exitcode; while(fdstack != e->fdstack && &fdstack_root != fdstack) fdstack_pop(fdstack); while(varstack != e->varstack && &vartab_root != varstack) vartab_pop(varstack); // sh->exitcode = e->exitcode; //sh->eval = e->parent; eval = e->parent; return ret; }
#ifndef _TYPES_H #define _TYPES_H 1 typedef enum { FALSE = 0, TRUE = 1 } bool; #endif /* _TYPES_H */
/* This file is part of MADNESS. Copyright (C) 2007,2010 Oak Ridge National Laboratory 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 For more information please contact: Robert J. Harrison Oak Ridge National Laboratory One Bethel Valley Road P.O. Box 2008, MS-6367 email: harrisonrj@ornl.gov tel: 865-241-3937 fax: 865-572-0680 */ #ifndef MADNESS_WORLD_WORLDDEP_H__INCLUDED #define MADNESS_WORLD_WORLDDEP_H__INCLUDED /// \file worlddep.h /// \brief Defines DependencyInterface and CallbackInterface #include <madness/world/stack.h> #include <madness/world/worldmutex.h> #include <madness/world/atomicint.h> #include <madness/world/world.h> #include <typeinfo> namespace madness { /// This class used for callbacks (e.g., for dependency tracking) class CallbackInterface { public: virtual void notify() = 0; virtual ~CallbackInterface() {} }; /// Provides interface for tracking dependencies class DependencyInterface : public CallbackInterface, private Spinlock { private: // Replaced atomic counter with critical section so that all // data (callbacks and counter) were being consistently managed. volatile int ndepend; ///< Counts dependencies static const int MAXCALLBACKS = 8; typedef Stack<CallbackInterface*,MAXCALLBACKS> callbackT; mutable volatile callbackT callbacks; ///< Called ONCE by dec() when ndepend==0 // Main design point is that since a callback might destroy // this object, when callbacks are invoked we cannot be // holding the lock and all necessary data must be on the // stack (i.e., not from the object state). void do_callbacks(callbackT& cb) const { while (!cb.empty()) { cb.front()->notify(); cb.pop(); } } public: DependencyInterface(int ndep = 0) : ndepend(ndep) {} /// Returns the number of unsatisfied dependencies int ndep() const {return ndepend;} /// Returns true if ndepend == 0 bool probe() const {return ndep() == 0;} /// Invoked by callbacks to notify of dependencies being satisfied void notify() {dec();} /// Registers a callback for when \c ndepend==0 , immediately invoked if \c ndepend==0 void register_callback(CallbackInterface* callback) { callbackT cb; { ScopedMutex<Spinlock> obolus(this); const_cast<callbackT&>(this->callbacks).push(callback); if (probe()) { cb = const_cast<callbackT&>(callbacks); const_cast<callbackT&>(callbacks).clear(); } } do_callbacks(cb); } /// Increment the number of dependencies void inc() { ScopedMutex<Spinlock> obolus(this); ndepend++; } /// Decrement the number of dependencies and invoke callback if ndepend=0 void dec() { callbackT cb; { ScopedMutex<Spinlock> obolus(this); if (--ndepend == 0) { cb = const_cast<callbackT&>(callbacks); const_cast<callbackT&>(callbacks).clear(); } } do_callbacks(cb); } virtual ~DependencyInterface() { #ifdef MADNESS_ASSERTIONS_THROW if(ndepend != 0) error("DependencyInterface::~DependencyInterface(): ndepend =", ndepend); #else MADNESS_ASSERT(ndepend == 0); #endif } }; } #endif // MADNESS_WORLD_WORLDDEP_H__INCLUDED
/**************************************************************************** ** ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** This file may be used under the terms of the GNU General Public ** License versions 2.0 or 3.0 as published by the Free Software ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Alternatively you may (at ** your option) use any later version of the GNU General Public ** License if such license has been publicly approved by Trolltech ASA ** (or its successors, if any) and the KDE Free Qt Foundation. In ** addition, as a special exception, Trolltech gives you certain ** additional rights. These rights are described in the Trolltech GPL ** Exception version 1.2, which can be found at ** http://www.trolltech.com/products/qt/gplexception/ and in the file ** GPL_EXCEPTION.txt in this package. ** ** Please review the following information to ensure GNU General ** Public Licensing requirements will be met: ** http://trolltech.com/products/qt/licenses/licensing/opensource/. If ** you are unsure which license is appropriate for your use, please ** review the following information: ** http://trolltech.com/products/qt/licenses/licensing/licensingoverview ** or contact the sales department at sales@trolltech.com. ** ** In addition, as a special exception, Trolltech, as the sole ** copyright holder for Qt Designer, grants users of the Qt/Eclipse ** Integration plug-in the right for the Qt/Eclipse Integration to ** link to functionality provided by Qt Designer and its related ** libraries. ** ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly ** granted herein. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ****************************************************************************/ #ifndef QDESIGNER_WIDGETBOX_H #define QDESIGNER_WIDGETBOX_H #include "qdesigner_toolwindow.h" class QDesignerWorkbench; class QDesignerWidgetBox: public QDesignerToolWindow { Q_OBJECT public: QDesignerWidgetBox(QDesignerWorkbench *workbench); virtual ~QDesignerWidgetBox(); virtual Qt::DockWidgetArea dockWidgetAreaHint() const; virtual QRect geometryHint() const; }; #endif // QDESIGNER_WIDGETBOX_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 QtNetwork module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QNETWORKREPLY_H #define QNETWORKREPLY_H #include <QtCore/QIODevice> #include <QtCore/QString> #include <QtCore/QVariant> #include <QtNetwork/QNetworkRequest> #include <QtNetwork/QNetworkAccessManager> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Network) class QUrl; class QVariant; class QAuthenticator; class QSslConfiguration; class QSslError; class QNetworkReplyPrivate; class Q_NETWORK_EXPORT QNetworkReply: public QIODevice { Q_OBJECT Q_ENUMS(NetworkError) public: enum NetworkError { NoError = 0, // network layer errors [relating to the destination server] (1-99): ConnectionRefusedError = 1, RemoteHostClosedError, HostNotFoundError, TimeoutError, OperationCanceledError, SslHandshakeFailedError, UnknownNetworkError = 99, // proxy errors (101-199): ProxyConnectionRefusedError = 101, ProxyConnectionClosedError, ProxyNotFoundError, ProxyTimeoutError, ProxyAuthenticationRequiredError, UnknownProxyError = 199, // content errors (201-299): ContentAccessDenied = 201, ContentOperationNotPermittedError, ContentNotFoundError, AuthenticationRequiredError, UnknownContentError = 299, // protocol errors ProtocolUnknownError = 301, ProtocolInvalidOperationError, ProtocolFailure = 399 }; ~QNetworkReply(); virtual void abort() = 0; // reimplemented from QIODevice virtual void close(); virtual bool isSequential() const; // like QAbstractSocket: qint64 readBufferSize() const; virtual void setReadBufferSize(qint64 size); QNetworkAccessManager *manager() const; QNetworkAccessManager::Operation operation() const; QNetworkRequest request() const; NetworkError error() const; QUrl url() const; // "cooked" headers QVariant header(QNetworkRequest::KnownHeaders header) const; // raw headers: bool hasRawHeader(const QByteArray &headerName) const; QList<QByteArray> rawHeaderList() const; QByteArray rawHeader(const QByteArray &headerName) const; // attributes QVariant attribute(QNetworkRequest::Attribute code) const; #ifndef QT_NO_OPENSSL QSslConfiguration sslConfiguration() const; void setSslConfiguration(const QSslConfiguration &configuration); #endif public Q_SLOTS: virtual void ignoreSslErrors(); Q_SIGNALS: void metaDataChanged(); void finished(); void error(QNetworkReply::NetworkError); #ifndef QT_NO_OPENSSL void sslErrors(const QList<QSslError> &errors); #endif void uploadProgress(qint64 bytesSent, qint64 bytesTotal); void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); protected: QNetworkReply(QObject *parent = 0); QNetworkReply(QNetworkReplyPrivate &dd, QObject *parent); virtual qint64 writeData(const char *data, qint64 len); void setOperation(QNetworkAccessManager::Operation operation); void setRequest(const QNetworkRequest &request); void setError(NetworkError errorCode, const QString &errorString); void setUrl(const QUrl &url); void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value); void setRawHeader(const QByteArray &headerName, const QByteArray &value); void setAttribute(QNetworkRequest::Attribute code, const QVariant &value); private: Q_DECLARE_PRIVATE(QNetworkReply) }; QT_END_NAMESPACE QT_END_HEADER #endif
/**========================================================================= \file vos_Types.c \brief virtual Operating System Servies (vOS) Basic type definitions Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. Qualcomm Confidential and Proprietary. ========================================================================*/ /* $Header$ */ /*-------------------------------------------------------------------------- Include Files ------------------------------------------------------------------------*/ #include "vos_types.h" #include "vos_trace.h" //#include "wlan_libra_config.h" /*-------------------------------------------------------------------------- Preprocessor definitions and constants ------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------- Type declarations ------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- \brief vos_atomic_set_U32() - set a U32 variable atomically \param pTarget - pointer to the v_U32_t to set. \param value - the value to set in the v_U32_t variable. \return This function returns the value previously in the v_U32_t before the new value is set. \sa vos_atomic_increment_U32(), vos_atomic_decrement_U32() --------------------------------------------------------------------------*/ v_U32_t vos_atomic_set_U32( v_U32_t *pTarget, v_U32_t value ) { v_U32_t oldval; unsigned long flags; if (pTarget == NULL) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "NULL ptr passed into %s",__func__); return 0; } local_irq_save(flags); oldval = *pTarget; *pTarget = value; local_irq_restore(flags); // v_U32_t prev = atomic_read(pTarget); // atomic_set(pTarget, value); return oldval; } /*---------------------------------------------------------------------------- \brief vos_atomic_increment_U32() - Increment a U32 variable atomically \param pTarget - pointer to the v_U32_t to increment. \return This function returns the value of the variable after the increment occurs. \sa vos_atomic_decrement_U32(), vos_atomic_set_U32() --------------------------------------------------------------------------*/ v_U32_t vos_atomic_increment_U32( v_U32_t *pTarget ) { unsigned long flags; if (pTarget == NULL) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "NULL ptr passed into %s",__func__); return 0; } local_irq_save(flags); ++*pTarget; local_irq_restore(flags); return *pTarget; // return atomic_inc_return(pTarget); } /*---------------------------------------------------------------------------- \brief vos_atomic_decrement_U32() - Decrement a U32 variable atomically \param pTarget - pointer to the v_U32_t to decrement. \return This function returns the value of the variable after the decrement occurs. \sa vos_atomic_increment_U32(), vos_atomic_set_U32() --------------------------------------------------------------------------*/ v_U32_t vos_atomic_decrement_U32( v_U32_t *pTarget ) { unsigned long flags; if (pTarget == NULL) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "NULL ptr passed into %s",__func__); return 0; } // return atomic_dec_return(pTarget); local_irq_save(flags); --*pTarget; local_irq_restore(flags); return (*pTarget); } v_U32_t vos_atomic_increment_U32_by_value( v_U32_t *pTarget, v_U32_t value ) { unsigned long flags; if (pTarget == NULL) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "NULL ptr passed into %s",__func__); return 0; } local_irq_save(flags); *pTarget += value ; local_irq_restore(flags); return (*pTarget); } v_U32_t vos_atomic_decrement_U32_by_value( v_U32_t *pTarget, v_U32_t value ) { unsigned long flags; if (pTarget == NULL) { VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "NULL ptr passed into %s",__func__); return 0; } local_irq_save(flags); *pTarget -= value ; local_irq_restore(flags); return (*pTarget); } v_U32_t vos_get_skip_ssid_check(void) { /**This is needed by only AMSS for interoperatability **/ return 1; } v_U32_t vos_get_skip_11e_check(void) { /* this is needed only for AMSS for interopratability **/ return 1; }
/* * Access vector cache interface for object managers. * * Author : Stephen Smalley, <sds@epoch.ncsc.mil> */ #ifndef _SELINUX_AVC_H_ #define _SELINUX_AVC_H_ #include <linux/stddef.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/kdev_t.h> #include <linux/spinlock.h> #include <linux/init.h> #include <linux/audit.h> #include <linux/lsm_audit.h> #include <linux/in6.h> #include "flask.h" #include "av_permissions.h" #include "security.h" #ifdef CONFIG_SECURITY_SELINUX_DEVELOP extern int selinux_enforcing; #else #define selinux_enforcing 1 #endif /* * An entry in the AVC. */ struct avc_entry; struct task_struct; struct inode; struct sock; struct sk_buff; /* * AVC statistics */ struct avc_cache_stats { unsigned int lookups; unsigned int misses; unsigned int allocations; unsigned int reclaims; unsigned int frees; }; /* * We only need this data after we have decided to send an audit message. */ struct selinux_late_audit_data { u32 ssid; u32 tsid; u16 tclass; u32 requested; u32 audited; u32 denied; int result; }; /* * We collect this at the beginning or during an selinux security operation */ struct selinux_audit_data { /* * auditdeny is a bit tricky and unintuitive. See the * comments in avc.c for it's meaning and usage. */ u32 auditdeny; struct selinux_late_audit_data *slad; }; /* * AVC operations */ void __init avc_init(void); int avc_audit(u32 ssid, u32 tsid, u16 tclass, u32 requested, struct av_decision *avd, int result, struct common_audit_data *a, unsigned flags); #define AVC_STRICT 1 /* Ignore permissive mode. */ #define AVC_OPERATION_CMD 2 /* ignore command when updating operations */ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested, unsigned flags, struct av_decision *avd); int avc_has_operation(u32 ssid, u32 tsid, u16 tclass, u32 requested, u16 cmd, struct common_audit_data *ad); int avc_has_perm_flags(u32 ssid, u32 tsid, u16 tclass, u32 requested, struct common_audit_data *auditdata, unsigned); static inline int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested, struct common_audit_data *auditdata) { return avc_has_perm_flags(ssid, tsid, tclass, requested, auditdata, 0); } u32 avc_policy_seqno(void); #define AVC_CALLBACK_GRANT 1 #define AVC_CALLBACK_TRY_REVOKE 2 #define AVC_CALLBACK_REVOKE 4 #define AVC_CALLBACK_RESET 8 #define AVC_CALLBACK_AUDITALLOW_ENABLE 16 #define AVC_CALLBACK_AUDITALLOW_DISABLE 32 #define AVC_CALLBACK_AUDITDENY_ENABLE 64 #define AVC_CALLBACK_AUDITDENY_DISABLE 128 #define AVC_CALLBACK_ADD_OPERATION 256 int avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid, u16 tclass, u32 perms, u32 *out_retained), u32 events, u32 ssid, u32 tsid, u16 tclass, u32 perms); /* Exported to selinuxfs */ int avc_get_hash_stats(char *page); extern unsigned int avc_cache_threshold; /* Attempt to free avc node cache */ void avc_disable(void); #ifdef CONFIG_SECURITY_SELINUX_AVC_STATS DECLARE_PER_CPU(struct avc_cache_stats, avc_cache_stats); #endif #endif /* _SELINUX_AVC_H_ */
#ifndef INIT_COND_H #define INIT_COND_H #define INIT_COND_DEBUG 0 #include "param_types.h" #include "splaytree_types.h" void eval_init_cond(init_cond_t * init_cond); init_cond_t * new_init_cond(param_t * param, value_t init_val); void free_init_cond(init_cond_t * init_cond); char * create_init_cond_string_buffer(splaytree_t * init_cond_tree); #endif
/* $Id: //depot/sw/releases/9.5.3/linux/kernels/mips-linux-2.6.31/include/linux/isdn/capilli.h#1 $ * * Kernel CAPI 2.0 Driver Interface for Linux * * Copyright 1999 by Carsten Paeth <calle@calle.de> * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. * */ #ifndef __CAPILLI_H__ #define __CAPILLI_H__ #include <linux/kernel.h> #include <linux/list.h> #include <linux/capi.h> #include <linux/kernelcapi.h> typedef struct capiloaddatapart { int user; /* data in userspace ? */ int len; unsigned char *data; } capiloaddatapart; typedef struct capiloaddata { capiloaddatapart firmware; capiloaddatapart configuration; } capiloaddata; typedef struct capicardparams { unsigned int port; unsigned irq; int cardtype; int cardnr; unsigned int membase; } capicardparams; struct capi_ctr { /* filled in before calling attach_capi_ctr */ struct module *owner; void *driverdata; /* driver specific */ char name[32]; /* name of controller */ char *driver_name; /* name of driver */ int (*load_firmware)(struct capi_ctr *, capiloaddata *); void (*reset_ctr)(struct capi_ctr *); void (*register_appl)(struct capi_ctr *, u16 appl, capi_register_params *); void (*release_appl)(struct capi_ctr *, u16 appl); u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); char *(*procinfo)(struct capi_ctr *); int (*ctr_read_proc)(char *page, char **start, off_t off, int count, int *eof, struct capi_ctr *card); /* filled in before calling ready callback */ u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ capi_version version; /* CAPI_GET_VERSION */ capi_profile profile; /* CAPI_GET_PROFILE */ u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */ /* management information for kcapi */ unsigned long nrecvctlpkt; unsigned long nrecvdatapkt; unsigned long nsentctlpkt; unsigned long nsentdatapkt; int cnr; /* controller number */ volatile unsigned short cardstate; /* controller state */ volatile int blocked; /* output blocked */ int traceflag; /* capi trace */ struct proc_dir_entry *procent; char procfn[128]; }; int attach_capi_ctr(struct capi_ctr *); int detach_capi_ctr(struct capi_ctr *); void capi_ctr_ready(struct capi_ctr * card); void capi_ctr_down(struct capi_ctr * card); void capi_ctr_suspend_output(struct capi_ctr * card); void capi_ctr_resume_output(struct capi_ctr * card); void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb); // --------------------------------------------------------------------------- // needed for AVM capi drivers struct capi_driver { char name[32]; /* driver name */ char revision[32]; int (*add_card)(struct capi_driver *driver, capicardparams *data); /* management information for kcapi */ struct list_head list; }; void register_capi_driver(struct capi_driver *driver); void unregister_capi_driver(struct capi_driver *driver); // --------------------------------------------------------------------------- // library functions for use by hardware controller drivers void capilib_new_ncci(struct list_head *head, u16 applid, u32 ncci, u32 winsize); void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci); void capilib_release_appl(struct list_head *head, u16 applid); void capilib_release(struct list_head *head); void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgid); u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid); #endif /* __CAPILLI_H__ */
/* * font.h: Font handling for the DVB On Screen Display * * See the main source file 'vdr.c' for copyright information and * how to reach the author. * * $Id: font.h 2.7.1.1 2014/01/25 14:24:51 kls Exp $ */ #ifndef __FONT_H #define __FONT_H #include <stdint.h> #include <stdlib.h> #include "tools.h" #define MAXFONTNAME 64 #define MINFONTSIZE 10 #define MAXFONTSIZE 64 enum eDvbFont { fontOsd, fontFix, fontSml #define eDvbFontSize (fontSml + 1) }; class cBitmap; class cPixmap; typedef uint32_t tColor; // see also osd.h typedef uint8_t tIndex; extern const char *DefaultFontOsd; extern const char *DefaultFontSml; extern const char *DefaultFontFix; class cFont { private: static cFont *fonts[]; public: virtual ~cFont() {} virtual const char *FontName(void) const { return ""; } ///< Returns the font name. virtual int Size(void) const { return Height(); } ///< Returns the original size as requested when the font was created. ///< This may be different than the actual height. virtual int Width(uint c) const = 0; ///< Returns the width of the given character in pixel. virtual int Width(const char *s) const = 0; ///< Returns the width of the given string in pixel. virtual int Height(void) const = 0; ///< Returns the height of this font in pixel (all characters have the same height). int Height(const char *s) const { return Height(); } ///< Returns the height of this font in pixel (obsolete, just for backwards compatibility). virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const = 0; ///< Draws the given text into the Bitmap at position (x, y) with the given colors. ///< The text will not exceed the given Width (if > 0), and will end with a complete character. virtual void DrawText(cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const {}; // not "pure", so that existing implementations still compile ///< Draws the given text into the Pixmap at position (x, y) with the given colors. ///< The text will not exceed the given Width (if > 0), and will end with a complete character. static void SetFont(eDvbFont Font, const char *Name, int CharHeight); ///< Sets the given Font to use the font data according to Name (see CreateFont()) ///< and make its characters CharHeight pixels high. static const cFont *GetFont(eDvbFont Font); ///< Gets the given Font, which was previously set by a call to SetFont(). ///< If no SetFont() call has been made, the font as defined in the setup is returned. ///< GetFont() is not thread-safe, and shall only be called from the main ///< thread! A font returned by GetFont() must only be used locally inside the ///< function it was retrieved from, and no long term pointer to it shall be kept, ///< because the cFont object may become invalid at any time after the ///< function that called GetFont() has returned. static cFont *CreateFont(const char *Name, int CharHeight, int CharWidth = 0); ///< Creates a new font object with the given Name and makes its characters ///< CharHeight pixels high. If CharWidth is given, it overwrites the font's ///< default width. Name is of the form "Family:Style", for instance ///< "Verdana:Bold Italic" or "Times New Roman". See GetAvailableFontNames() ///< for how to get a list of all available font names. ///< If the requested font can't be created, a dummy font is returned. ///< The caller must delete the font when it is no longer needed. static bool GetAvailableFontNames(cStringList *FontNames, bool Monospaced = false); ///< Queries the font configuration for a list of available font names, ///< which is returned in FontNames. If Monospaced is true, only ///< monospaced fonts will be returned. The resulting font names are ///< in a format that can be used with GetFontFileName() to get the name ///< of the actual font file. ///< Returns true if any font names were found. static cString GetFontFileName(const char *FontName); ///< Returns the actual font file name for the given FontName. #ifdef BIDI static cString Bidi(const char *Ltr); ///< Converts any "right-to-left" parts in the "left-to-right" string Ltr ///< to the proper language specific representation and returns the resulting string. #endif }; class cTextWrapper { private: char *text; char *eol; int lines; int lastLine; public: cTextWrapper(void); cTextWrapper(const char *Text, const cFont *Font, int Width); ~cTextWrapper(); void Set(const char *Text, const cFont *Font, int Width); ///< Wraps the Text to make it fit into the area defined by the given Width ///< when displayed with the given Font. ///< Wrapping is done by inserting the necessary number of newline ///< characters into the string. const char *Text(void); ///< Returns the full wrapped text. int Lines(void) { return lines; } ///< Returns the actual number of lines needed to display the full wrapped text. const char *GetLine(int Line); ///< Returns the given Line. The first line is numbered 0. }; #endif //__FONT_H
/* (C) IT Sky Consulting GmbH 2014 * http://www.it-sky-consulting.com/ * Author: Karl Brodowsky * Date: 2014-02-27 * License: GPL v2 (See https://de.wikipedia.org/wiki/GNU_General_Public_License ) */ #ifndef _LIB_ITSKY_SORTIMPL #define _LIB_ITSKY_SORTIMPL #define POINTER(base, idx, size) ((base) + (size) * (idx)) #endif /* end of file sortcommon.h */
#import <UIKit/UIKit.h> @interface StatsSelectableTableViewCell : UITableViewCell @property (nonatomic, weak) IBOutlet UILabel *categoryIconLabel; @property (nonatomic, weak) IBOutlet UILabel *categoryLabel; @property (nonatomic, weak) IBOutlet UILabel *valueLabel; @end
// -*- c-basic-offset: 8; indent-tabs-mode: t -*- // vim:ts=8:sw=8:noet:ai: /* Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __ASS_BITMAP_H__ #define __ASS_BITMAP_H__ typedef struct ass_synth_priv_s ass_synth_priv_t; ass_synth_priv_t* ass_synth_init(); void ass_synth_done(ass_synth_priv_t* priv); typedef struct bitmap_s { int left, top; int w, h; // width, height unsigned char* buffer; // w x h buffer } bitmap_t; /** * \brief perform glyph rendering * \param glyph original glyph * \param outline_glyph "border" glyph, produced from original by FreeType's glyph stroker * \param bm_g out: pointer to the bitmap of original glyph is returned here * \param bm_o out: pointer to the bitmap of outline (border) glyph is returned here * \param bm_g out: pointer to the bitmap of glyph shadow is returned here * \param be 1 = produces blurred bitmaps, 0 = normal bitmaps */ int glyph_to_bitmap(ass_synth_priv_t* priv, FT_Glyph glyph, FT_Glyph outline_glyph, bitmap_t** bm_g, bitmap_t** bm_o, bitmap_t** bm_s, int be); void ass_free_bitmap(bitmap_t* bm); #endif
/* GNU/Linux/CRIS specific low level interface, for the remote server for GDB. Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "server.h" #include "linux-low.h" #include "nat/gdb_ptrace.h" #include "common/get-next-pcs.h" /* Defined in auto-generated file reg-cris.c. */ void init_registers_cris (void); extern const struct target_desc *tdesc_cris; /* CRISv10 */ #define cris_num_regs 32 /* Locations need to match <include/asm/arch/ptrace.h>. */ static int cris_regmap[] = { 15*4, 14*4, 13*4, 12*4, 11*4, 10*4, 9*4, 8*4, 7*4, 6*4, 5*4, 4*4, 3*4, 2*4, 23*4, 19*4, -1, -1, -1, -1, -1, 17*4, -1, 16*4, -1, -1, -1, 18*4, -1, 17*4, -1, -1 }; static int cris_cannot_store_register (int regno) { if (cris_regmap[regno] == -1) return 1; return (regno >= cris_num_regs); } static int cris_cannot_fetch_register (int regno) { if (cris_regmap[regno] == -1) return 1; return (regno >= cris_num_regs); } extern int debug_threads; static CORE_ADDR cris_get_pc (struct regcache *regcache) { unsigned long pc; collect_register_by_name (regcache, "pc", &pc); if (debug_threads) debug_printf ("stop pc is %08lx\n", pc); return pc; } static void cris_set_pc (struct regcache *regcache, CORE_ADDR pc) { unsigned long newpc = pc; supply_register_by_name (regcache, "pc", &newpc); } static const unsigned short cris_breakpoint = 0xe938; #define cris_breakpoint_len 2 static const unsigned char * cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *len) { *len = cris_breakpoint_len; return (unsigned char*) &cris_breakpoint; } static int cris_breakpoint_at (CORE_ADDR where) { unsigned short insn; (*the_target->read_memory) (where, (unsigned char *) &insn, cris_breakpoint_len); if (insn == cris_breakpoint) return 1; /* If necessary, recognize more trap instructions here. GDB only uses the one. */ return 0; } /* We only place breakpoints in empty marker functions, and thread locking is outside of the function. So rather than importing software single-step, we can just run until exit. */ static void cris_get_next_pcs (struct get_next_pcs *next_pcs) { struct regcache *regcache = get_thread_regcache (current_thread, 1); CORE_ADDR pc; collect_register_by_name (regcache, "srp", &pc); VEC_safe_push (CORE_ADDR, next_pcs->result, pc); } static void cris_arch_setup (void) { current_process ()->tdesc = tdesc_cris; } static struct usrregs_info cris_usrregs_info = { cris_num_regs, cris_regmap, }; static struct regs_info regs_info = { NULL, /* regset_bitmap */ &cris_usrregs_info, }; static const struct regs_info * cris_regs_info (void) { return &regs_info; } struct linux_target_ops the_low_target = { cris_arch_setup, cris_regs_info, cris_cannot_fetch_register, cris_cannot_store_register, NULL, /* fetch_register */ cris_get_pc, cris_set_pc, cris_breakpoint_from_pc, cris_get_next_pcs, 0, cris_breakpoint_at, 0, 0, 0, 0, }; void initialize_low_arch (void) { init_registers_cris (); }
/* YUView - YUV player with advanced analytics toolset * Copyright (C) 2015 Institut für Nachrichtentechnik * RWTH Aachen University, GERMANY * * YUView 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. * * YUView 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 YUView. If not, see <http://www.gnu.org/licenses/>. */ #ifndef VIDEOHANDLERDIFFERENCE_H #define VIDEOHANDLERDIFFERENCE_H #include "videoHandler.h" #include "ui_videoHandlerDifference.h" class videoHandlerDifference : public videoHandler { Q_OBJECT public: explicit videoHandlerDifference(); virtual void loadFrame(int frameIndex) Q_DECL_OVERRIDE; virtual void loadFrameForCaching(int frameIndex, QPixmap &frameToCache) Q_DECL_OVERRIDE { Q_UNUSED(frameIndex); Q_UNUSED(frameToCache); }; // Are both inputs valid and can be used? bool inputsValid(); // Create the yuv controls and return a pointer to the layout. virtual QLayout *createDifferenceHandlerControls(); // Set the two video inputs. This will also update the number frames, the controls and the frame size. // The signal signalHandlerChanged will be emitted if a redraw is required. void setInputVideos(frameHandler *childVideo0, frameHandler *childVideo1); QList<infoItem> differenceInfoList; // Draw the pixel values depending on the children type. E.g. if both children are YUV handlers, draw the YUV differences. virtual void drawPixelValues(QPainter *painter, int frameIdx, QRect videoRect, double zoomFactor, frameHandler *item2=NULL) Q_DECL_OVERRIDE; // The difference overloads this and returns the difference values (A-B) virtual ValuePairList getPixelValues(QPoint pixelPos, int frameIdx, frameHandler *item2=NULL) Q_DECL_OVERRIDE; // Calculate the position of the first difference and add the info to the list void reportFirstDifferencePosition(QList<infoItem> &infoList); private slots: void slotDifferenceControlChanged(); protected: bool markDifference; // Mark differences? int amplificationFactor; private: typedef enum { CodingOrder_HEVC } CodingOrder; CodingOrder codingOrder; // The two videos that the difference will be calculated from QPointer<frameHandler> inputVideo[2]; // Recursively scan the LCU bool hierarchicalPosition( int x, int y, int blockSize, int &firstX, int &firstY, int &partIndex, const QImage diffImg ); SafeUi<Ui::videoHandlerDifference> ui; }; #endif //VIDEOHANDLERDIFFERENCE_H
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifndef LMP_LAMMPS_H #define LMP_LAMMPS_H #include "stdio.h" namespace LAMMPS_NS { class LAMMPS { public: // ptrs to fundamental LAMMPS classes class Memory* memory; // memory allocation functions class Error* error; // error handling class Universe *universe; // universe of processors class Input *input; // input script processing // ptrs to top-level LAMMPS-specific classes class Atom *atom; // atom-based quantities class Update *update; // integrators/minimizers class Neighbor *neighbor; // neighbor lists class Comm *comm; // inter-processor communication class Domain *domain; // simulation box class Force *force; // inter-particle forces class Modify *modify; // fixes and computes class Group *group; // groups of atoms class Output *output; // thermo/dump/restart class Timer *timer; // CPU timing info MPI_Comm world; // MPI communicator FILE *infile; // infile FILE *screen; // screen output FILE *logfile; // logfile char *suffix; // suffix to add to input script style names int suffix_enable; // 1 if suffix enabled, 0 if disabled class Cuda *cuda; // CUDA accelerator class // constructor LAMMPS(int, char **, MPI_Comm); // destructor ~LAMMPS(); void create(); void init(); void destroy(); void print_styles(); }; } #endif
/** * @file * * @brief Watchdog Adjust to Chain * @ingroup ScoreWatchdog */ /* * COPYRIGHT (c) 1989-2009. * 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 <rtems/score/watchdogimpl.h> #include <rtems/score/isrlevel.h> void _Watchdog_Adjust_to_chain( Watchdog_Header *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; _ISR_Disable( level ); while ( 1 ) { if ( _Watchdog_Is_empty( header ) ) { break; } first = _Watchdog_First( header ); /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { first->delta_interval -= units; break; } /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; first->delta_interval = 0; while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); if ( _Watchdog_Is_empty( header ) ) break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); }
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* * Athena * * Copyright (C) 2003 Red Hat, Inc. * Copyright (C) 2010 Cosimo Cecchi <cosimoc@gnome.org> * * Athena 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. * * Athena is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef ATHENA_CONNECT_SERVER_DIALOG_H #define ATHENA_CONNECT_SERVER_DIALOG_H #include <gio/gio.h> #include <gtk/gtk.h> #include "athena-application.h" #include "athena-window.h" #define ATHENA_TYPE_CONNECT_SERVER_DIALOG\ (athena_connect_server_dialog_get_type ()) #define ATHENA_CONNECT_SERVER_DIALOG(obj)\ (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATHENA_TYPE_CONNECT_SERVER_DIALOG,\ AthenaConnectServerDialog)) #define ATHENA_CONNECT_SERVER_DIALOG_CLASS(klass)\ (G_TYPE_CHECK_CLASS_CAST ((klass), ATHENA_TYPE_CONNECT_SERVER_DIALOG,\ AthenaConnectServerDialogClass)) #define ATHENA_IS_CONNECT_SERVER_DIALOG(obj)\ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATHENA_TYPE_CONNECT_SERVER_DIALOG) typedef struct _AthenaConnectServerDialog AthenaConnectServerDialog; typedef struct _AthenaConnectServerDialogClass AthenaConnectServerDialogClass; typedef struct _AthenaConnectServerDialogDetails AthenaConnectServerDialogDetails; struct _AthenaConnectServerDialog { GtkDialog parent; AthenaConnectServerDialogDetails *details; }; struct _AthenaConnectServerDialogClass { GtkDialogClass parent_class; }; GType athena_connect_server_dialog_get_type (void); GtkWidget* athena_connect_server_dialog_new (AthenaWindow *window); void athena_connect_server_dialog_display_location_async (AthenaConnectServerDialog *self, GFile *location, GAsyncReadyCallback callback, gpointer user_data); gboolean athena_connect_server_dialog_display_location_finish (AthenaConnectServerDialog *self, GAsyncResult *result, GError **error); void athena_connect_server_dialog_fill_details_async (AthenaConnectServerDialog *self, GMountOperation *operation, const gchar *default_user, const gchar *default_domain, GAskPasswordFlags flags, GAsyncReadyCallback callback, gpointer user_data); gboolean athena_connect_server_dialog_fill_details_finish (AthenaConnectServerDialog *self, GAsyncResult *result); #endif /* ATHENA_CONNECT_SERVER_DIALOG_H */
// ZarplataView.h : èíòåðôåéñ êëàññà CZarplataView // #pragma once #include "EditPerson.h" #include "DialogFindId.h" #include "DiaSelection.h" #include "DialogPicture.h" class CZarplataView : public CScrollView { protected: // ñîçäàòü òîëüêî èç ñåðèàëèçàöèè CZarplataView(); DECLARE_DYNCREATE(CZarplataView) CPoint curPoint; int curCell; // Àòðèáóòû public: CZarplataDoc* GetDocument() const; void ResetScrollSizes(void); CBitmap* tRed; CBitmap* tBlue; CBitmap* tSort; // Îïåðàöèè public: // Ïåðåîïðåäåëåíèå public: virtual void OnDraw(CDC* pDC); // ïåðåîïðåäåëåíî äëÿ îòðèñîâêè ýòîãî ïðåäñòàâëåíèÿ virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: virtual void OnInitialUpdate(); // âûçûâàåòñÿ â ïåðâûé ðàç ïîñëå êîíñòðóêòîðà virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); // Ðåàëèçàöèÿ public: virtual ~CZarplataView(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Ñîçäàííûå ôóíêöèè ñõåìû ñîîáùåíèé protected: afx_msg void OnFilePrintPreview(); afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); DECLARE_MESSAGE_MAP() public: afx_msg void OnAddPerson(); virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void FindOnId(); afx_msg void OnSortfamily(); afx_msg void OnSortId(); afx_msg void OnSortPayment(); afx_msg void OnSortHours(); afx_msg void OnSelect(); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); afx_msg void OnUpdateSortfamily(CCmdUI *pCmdUI); afx_msg void OnUpdateSortId(CCmdUI *pCmdUI); afx_msg void OnUpdateSortPayment(CCmdUI *pCmdUI); afx_msg void OnUpdateSortHours(CCmdUI *pCmdUI); afx_msg void On32792(); afx_msg void OnGraphic(); }; #ifndef _DEBUG // îòëàäî÷íàÿ âåðñèÿ â ZarplataView.cpp inline CZarplataDoc* CZarplataView::GetDocument() const { return reinterpret_cast<CZarplataDoc*>(m_pDocument); } #endif
/* stat_tap_ui.h * Declarations of routines to register UI information for stats * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __STAT_TAP_UI_H__ #define __STAT_TAP_UI_H__ #include "ws_symbol_export.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * Parameters for taps. */ #include <epan/params.h> #include <epan/stat_groups.h> typedef enum { PARAM_UINT, /* Unused? */ PARAM_STRING, /* Unused? */ PARAM_ENUM, /* SCSI SRT */ PARAM_UUID, /* Unused? */ PARAM_FILTER } param_type; typedef struct _tap_param { param_type type; /* type of parameter */ const char *name; /* name to use in error messages */ const char *title; /* title to use in GUI widgets */ const enum_val_t *enum_vals; /* values for PARAM_ENUM */ gboolean optional; /* TRUE if the parameter is optional */ } tap_param; /* * UI information for a tap. */ typedef struct _stat_tap_ui { register_stat_group_t group; /* group to which statistic belongs */ const char *title; /* title of statistic */ const char *cli_string; /* initial part of the "-z" argument for statistic */ void (* tap_init_cb)(const char *, void*); /* callback to init function of the tap */ size_t nparams; /* number of parameters */ tap_param *params; /* pointer to table of parameter info */ } stat_tap_ui; /** Register UI information for a tap. * * @param ui UI information for the tap. * @param userdata Additional data for the init routine. */ WS_DLL_PUBLIC void register_stat_tap_ui(stat_tap_ui *ui, void *userdata); WS_DLL_PUBLIC gboolean process_stat_cmd_arg(char *optstr); WS_DLL_PUBLIC void list_stat_cmd_args(void); WS_DLL_PUBLIC void start_requested_stats(void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
/* This testcase is part of GDB, the GNU debugger. Copyright 2005, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> int x; void bar() { x--; } void foo() { x++; } int main() { foo(); bar(); return 0; }
/* * Copyright (C) 2006-2008 Nokia Corporation * * 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; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Check MTD device read. * * Author: Adrian Hunter <ext-adrian.hunter@nokia.com> */ #include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/err.h> #include <linux/mtd/mtd.h> #include <linux/slab.h> #include <linux/sched.h> #define PRINT_PREF KERN_INFO "mtd_readtest: " static int dev; module_param(dev, int, S_IRUGO); MODULE_PARM_DESC(dev, "MTD device number to use"); static struct mtd_info *mtd; static unsigned char *iobuf; static unsigned char *iobuf1; static unsigned char *bbt; static int pgsize; static int ebcnt; static int pgcnt; static int read_eraseblock_by_page(int ebnum) { size_t read = 0; int i, ret, err = 0; loff_t addr = ebnum * mtd->erasesize; void *buf = iobuf; void *oobbuf = iobuf1; for (i = 0; i < pgcnt; i++) { memset(buf, 0 , pgcnt); ret = mtd->read(mtd, addr, pgsize, &read, buf); if (ret == -EUCLEAN) ret = 0; if (ret || read != pgsize) { printk(PRINT_PREF "error: read failed at %#llx\n", (long long)addr); if (!err) err = ret; if (!err) err = -EINVAL; } if (mtd->oobsize) { struct mtd_oob_ops ops; ops.mode = MTD_OPS_PLACE_OOB; ops.len = 0; ops.retlen = 0; ops.ooblen = mtd->oobsize; ops.oobretlen = 0; ops.ooboffs = 0; ops.datbuf = NULL; ops.oobbuf = oobbuf; ret = mtd->read_oob(mtd, addr, &ops); if ((ret && !mtd_is_bitflip(ret)) || ops.oobretlen != mtd->oobsize) { printk(PRINT_PREF "error: read oob failed at " "%#llx\n", (long long)addr); if (!err) err = ret; if (!err) err = -EINVAL; } oobbuf += mtd->oobsize; } addr += pgsize; buf += pgsize; } return err; } static void dump_eraseblock(int ebnum) { int i, j, n; char line[128]; int pg, oob; printk(PRINT_PREF "dumping eraseblock %d\n", ebnum); n = mtd->erasesize; for (i = 0; i < n;) { char *p = line; p += sprintf(p, "%05x: ", i); for (j = 0; j < 32 && i < n; j++, i++) p += sprintf(p, "%02x", (unsigned int)iobuf[i]); printk(KERN_CRIT "%s\n", line); cond_resched(); } if (!mtd->oobsize) return; printk(PRINT_PREF "dumping oob from eraseblock %d\n", ebnum); n = mtd->oobsize; for (pg = 0, i = 0; pg < pgcnt; pg++) for (oob = 0; oob < n;) { char *p = line; p += sprintf(p, "%05x: ", i); for (j = 0; j < 32 && oob < n; j++, oob++, i++) p += sprintf(p, "%02x", (unsigned int)iobuf1[i]); printk(KERN_CRIT "%s\n", line); cond_resched(); } } static int is_block_bad(int ebnum) { loff_t addr = ebnum * mtd->erasesize; int ret; ret = mtd->block_isbad(mtd, addr); if (ret) printk(PRINT_PREF "block %d is bad\n", ebnum); return ret; } static int scan_for_bad_eraseblocks(void) { int i, bad = 0; bbt = kzalloc(ebcnt, GFP_KERNEL); if (!bbt) { printk(PRINT_PREF "error: cannot allocate memory\n"); return -ENOMEM; } /* NOR flash does not implement block_isbad */ if (mtd->block_isbad == NULL) return 0; printk(PRINT_PREF "scanning for bad eraseblocks\n"); for (i = 0; i < ebcnt; ++i) { bbt[i] = is_block_bad(i) ? 1 : 0; if (bbt[i]) bad += 1; cond_resched(); } printk(PRINT_PREF "scanned %d eraseblocks, %d are bad\n", i, bad); return 0; } static int __init mtd_readtest_init(void) { uint64_t tmp; int err, i; printk(KERN_INFO "\n"); printk(KERN_INFO "=================================================\n"); printk(PRINT_PREF "MTD device: %d\n", dev); mtd = get_mtd_device(NULL, dev); if (IS_ERR(mtd)) { err = PTR_ERR(mtd); printk(PRINT_PREF "error: Cannot get MTD device\n"); return err; } if (mtd->writesize == 1) { printk(PRINT_PREF "not NAND flash, assume page size is 512 " "bytes.\n"); pgsize = 512; } else pgsize = mtd->writesize; tmp = mtd->size; do_div(tmp, mtd->erasesize); ebcnt = tmp; pgcnt = mtd->erasesize / pgsize; printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, " "page size %u, count of eraseblocks %u, pages per " "eraseblock %u, OOB size %u\n", (unsigned long long)mtd->size, mtd->erasesize, pgsize, ebcnt, pgcnt, mtd->oobsize); err = -ENOMEM; iobuf = kmalloc(mtd->erasesize, GFP_KERNEL); if (!iobuf) { printk(PRINT_PREF "error: cannot allocate memory\n"); goto out; } iobuf1 = kmalloc(mtd->erasesize, GFP_KERNEL); if (!iobuf1) { printk(PRINT_PREF "error: cannot allocate memory\n"); goto out; } err = scan_for_bad_eraseblocks(); if (err) goto out; /* Read all eraseblocks 1 page at a time */ printk(PRINT_PREF "testing page read\n"); for (i = 0; i < ebcnt; ++i) { int ret; if (bbt[i]) continue; ret = read_eraseblock_by_page(i); if (ret) { dump_eraseblock(i); if (!err) err = ret; } cond_resched(); } if (err) printk(PRINT_PREF "finished with errors\n"); else printk(PRINT_PREF "finished\n"); out: kfree(iobuf); kfree(iobuf1); kfree(bbt); put_mtd_device(mtd); if (err) printk(PRINT_PREF "error %d occurred\n", err); printk(KERN_INFO "=================================================\n"); return err; } module_init(mtd_readtest_init); static void __exit mtd_readtest_exit(void) { return; } module_exit(mtd_readtest_exit); MODULE_DESCRIPTION("Read test module"); MODULE_AUTHOR("Adrian Hunter"); MODULE_LICENSE("GPL");
#ifndef __ASM_SMP_H #define __ASM_SMP_H /* * We need the APIC definitions automatically as part of 'smp.h' */ #ifndef __ASSEMBLY__ #include <linux/config.h> #include <linux/kernel.h> #include <linux/threads.h> #include <linux/cpumask.h> #endif #ifdef CONFIG_X86_LOCAL_APIC #ifndef __ASSEMBLY__ #include <asm/fixmap.h> #include <asm/bitops.h> #include <asm/mpspec.h> #ifdef CONFIG_X86_IO_APIC #include <asm/io_apic.h> #endif #include <asm/apic.h> #endif #endif #define BAD_APICID 0xFFu #ifdef CONFIG_SMP #ifndef __ASSEMBLY__ /* * Private routines/data */ extern void smp_alloc_memory(void); extern int pic_mode; extern int smp_num_siblings; extern int cpu_sibling_map[]; extern void smp_flush_tlb(void); extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs); extern void smp_send_reschedule(int cpu); extern void smp_invalidate_rcv(void); /* Process an NMI */ extern void (*mtrr_hook) (void); extern void zap_low_mappings (void); #define MAX_APICID 256 /* * This function is needed by all SMP systems. It must _always_ be valid * from the initial startup. We map APIC_BASE very early in page_setup(), * so this is correct in the x86 case. */ #define smp_processor_id() (current_thread_info()->cpu) extern cpumask_t cpu_callout_map; #define cpu_possible(cpu) cpu_isset(cpu, cpu_callout_map) /* We don't mark CPUs online until __cpu_up(), so we need another measure */ static inline int num_booting_cpus(void) { return cpus_weight(cpu_callout_map); } extern void map_cpu_to_logical_apicid(void); extern void unmap_cpu_to_logical_apicid(int cpu); #ifdef CONFIG_X86_LOCAL_APIC #ifdef APIC_DEFINITION extern int hard_smp_processor_id(void); #else #include <mach_apicdef.h> static inline int hard_smp_processor_id(void) { /* we don't want to mark this access volatile - bad code generation */ return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)); } #endif static __inline int logical_smp_processor_id(void) { /* we don't want to mark this access volatile - bad code generation */ return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)); } #endif #endif /* !__ASSEMBLY__ */ #define NO_PROC_ID 0xFF /* No processor magic marker */ #endif #endif
/* * board specific fonctions for the lisa_l board * */ #ifndef BOARDS_LISA_L_BARO_H #define BOARDS_LISA_L_BARO_H #include "std.h" #include "mcu_periph/i2c.h" enum LisaBaroStatus { LBS_UNINITIALIZED, LBS_RESETED, LBS_INITIALIZING_ABS, LBS_INITIALIZING_ABS_1, LBS_INITIALIZING_DIFF, LBS_INITIALIZING_DIFF_1, LBS_IDLE, LBS_READING_ABS, LBS_READ_ABS, LBS_READING_DIFF, LBS_READ_DIFF }; struct BaroBoard { enum LisaBaroStatus status; }; extern struct BaroBoard baro_board; extern struct i2c_transaction baro_trans; extern void baro_downlink_raw(void); extern void baro_board_send_reset(void); extern void baro_board_send_config_abs(void); extern void baro_board_send_config_diff(void); #define BaroEvent(_b_abs_handler, _b_diff_handler) { \ if (baro_board.status == LBS_READING_ABS && \ baro_trans.status != I2CTransPending) { \ baro_board.status = LBS_READ_ABS; \ if (baro_trans.status == I2CTransSuccess) { \ int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \ baro.absolute = tmp; \ _b_abs_handler(); \ } \ } \ else if (baro_board.status == LBS_READING_DIFF && \ baro_trans.status != I2CTransPending) { \ baro_board.status = LBS_READ_DIFF; \ if (baro_trans.status == I2CTransSuccess) { \ int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \ baro.differential = tmp; \ _b_diff_handler(); \ } \ } \ } #endif /* BOARDS_LISA_L_BARO_H */
/* md4.h MD4 - Message Digest Algorithm 4 Copyright: Copyright (c) 2002, 2003 SFNT Finland Oy. All rights reserved */ #ifndef MD4_H #define MD4_H /* Returns the size of an MD4 context. */ size_t ssh_md4_ctxsize(void); /* Resets the context to its initial state. */ void ssh_md4_reset_context(void *context); /* Add `len' bytes from the given buffer to the hash. */ void ssh_md4_update(void *context, const unsigned char *buf, size_t len); /* Finish hashing. 16-byte digest is copied to digest. */ SshCryptoStatus ssh_md4_final(void *context, unsigned char *digest); /* Compute a MD4 digest from the given buffer. */ void ssh_md4_of_buffer(unsigned char digest[16], const unsigned char *buf, size_t len); /* Make the defining structure visible everywhere. */ extern const SshHashDefStruct ssh_hash_md4_def; /* Compares the given oid with max size of max_len to the oid defined for the hash. If they match, then return the number of bytes actually used by the oid. If they do not match, return 0. */ size_t ssh_md4_asn1_compare(const unsigned char *oid, size_t max_len); /* Generate encoded asn1 oid. Returns the pointer to the staticly allocated buffer of the oid. Sets the len to be the length of the oid. */ const unsigned char *ssh_md4_asn1_generate(size_t *len); #endif /* MD4_H */
/* * Asterisk -- An open source telephony toolkit. * * Copyright (c) 2008, Digium, Inc. * * Tilghman Lesher <res_curl_v1@the-tilghman.com> * * See http://www.asterisk.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. */ /*! \file * * \brief curl resource engine * * \author Tilghman Lesher <res_curl_v1@the-tilghman.com> * * Depends on the CURL library - http://curl.haxx.se/ * */ /*! \li \ref res_curl.c uses the configuration file \ref res_curl.conf * \addtogroup configuration_file Configuration Files */ /*! * \page res_curl.conf res_curl.conf * \verbinclude res_curl.conf.sample */ /*** MODULEINFO <depend>curl</depend> <support_level>core</support_level> ***/ #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision: 375003 $") #include <curl/curl.h> #include "asterisk/module.h" static const char *dependents[] = { "func_curl.so", "res_config_curl.so", }; static int unload_module(void) { int res = 0; size_t i; /* If the dependent modules are still in memory, forbid unload */ for (i = 0; i < ARRAY_LEN(dependents); i++) { if (ast_module_check(dependents[i])) { ast_log(LOG_ERROR, "%s (dependent module) is still loaded. Cannot unload res_curl.so\n", dependents[i]); res = -1; } } if (res) return -1; curl_global_cleanup(); return res; } /*! * \brief Load the module * * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) { int res = 0; if (curl_global_init(CURL_GLOBAL_ALL)) { ast_log(LOG_ERROR, "Unable to initialize the cURL library. Cannot load res_curl.so\n"); return AST_MODULE_LOAD_DECLINE; } return res; } AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "cURL Resource Module", .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_REALTIME_DEPEND, );
/** * This header is generated by class-dump-z 0.2b. * * Source: /System/Library/PrivateFrameworks/OfficeImport.framework/OfficeImport */ #import <OfficeImport/XXUnknownSuperclass.h> __attribute__((visibility("hidden"))) @interface PXSlideLayout : XXUnknownSuperclass { } + (void)initialize; // 0x1b180d + (void)readFromPackagePart:(id)packagePart toSlideLayout:(id)slideLayout presentationState:(id)state; // 0x1b1865 + (id)stringForSlideLayoutType:(int)slideLayoutType; // 0x21bca1 @end
/* This file is part of the "Buggy Bawkses" Project. Copyright (C) 2012 Thomas Trapp; mailto: bawkses@thomastrapp.com "Buggy Bawkses" 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. See COPYING for details. */ #ifndef GAMEENTITIESBARTENDER_H #define GAMEENTITIESBARTENDER_H #include <vector> #include <ctime> #include <boost/shared_ptr.hpp> #include <boost/random.hpp> #include <boost/random/uniform_real.hpp> #include <SFML/System.hpp> #include "Game/Entity.h" #include "Game/Entities/RectangleDef.h" #include "Game/Entities/State.h" namespace Game { class World; namespace Entities { class Bar; /** * @brief Manages creation and deletion of Bars * * The Bartender is responsible for creating new bars and deleting old bars. * * As the view (=camera) moves upwards new bars need to be added. The Bartender * makes sure there's at least bar-pre-fill pixels full of bars on top of the * view. * * If a Bar becomes invisible (=it is not shown on the screen) it is deleted. */ class Bartender : public Game::Entity { /** * @brief A type of vector filled with pointers to Bars */ typedef std::vector< boost::shared_ptr<Game::Entities::Bar> > t_map_bars; public: /** * @brief Construct a Bartender * * @param conf A shared_ptr to Game::Config, a class that stores user * supplied configuration, as well as internal key/value pairs. * @param game_world A reference to the global World, which is a wrapper for * b2World */ Bartender(boost::shared_ptr<Game::Config> conf, Game::World& game_world); ~Bartender() {} /** * @brief Update the Bartender * * New Bars may be created. Old Bars may be deleted. * * @param view The current view (=camera position) */ State::t_entities_state update(const sf::View& view); /** * @brief Render all child Bars * * @param renderer The canvas to draw on */ void render(sf::RenderTarget& renderer); private: Bartender(const Bartender&); Bartender& operator=(const Bartender&); /** * @brief Adds new Bars if needed * * As the view (=camera) moves upwards new bars need to be added. The * Bartender makes sure there's at least bar-pre-fill pixels full of bars on * the top of view. * * @param view The current view (=camera position) */ void _maybe_add_new_bars(const sf::View& view); /** * @brief Remove old Bars if needed * * If a Bar becomes invisible (=it is not shown on the screen) it gets * deleted. * * @param view The current view (=camera position) */ void _maybe_remove_old_bars(const sf::View& view); /** * @brief Stores a new Bar * * @param rect_def An instance of RectangleDef defining the size and * position of a Bar */ void _insert_bar(const Game::Entities::RectangleDef& rect_def); /** * @brief A shared_ptr to Game::Config, a class that stores user * supplied configuration, as well as internal key/value pairs. */ boost::shared_ptr<Game::Config> config; /** * @brief A reference to the global World, which is a wrapper for b2World */ Game::World& world; /** * @brief A vector filled with pointers to Bars */ t_map_bars bars; /** * @brief The global y-offset for the next Bar to be placed on */ float next_bar_pos_y; /** * @brief A pseudo random generator * * The Bar's size and y-position is randomly generated */ boost::mt19937 rand_gen; }; } } #endif // GAMEENTITIESBARTENDER_H
/* Copyright (C) 2007-2008 The Android Open Source Project ** ** This software is licensed under the terms of the GNU General Public ** License version 2, as published by the Free Software Foundation, and ** may be copied, distributed, and modified under those terms. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. */ #include "migration/qemu-file.h" #include "hw/android/goldfish/device.h" #include "hw/android/goldfish/vmem.h" #include "hw/hw.h" enum { SW_NAME_LEN = 0x00, SW_NAME_PTR = 0x04, SW_FLAGS = 0x08, SW_STATE = 0x0c, SW_INT_STATUS = 0x10, SW_INT_ENABLE = 0x14, SW_FLAGS_OUTPUT = 1U << 0 }; struct switch_state { struct goldfish_device dev; char *name; uint32_t state; uint32_t state_changed : 1; uint32_t int_enable : 1; uint32_t (*writefn)(void *opaque, uint32_t state); void *writeopaque; }; #define GOLDFISH_SWITCH_SAVE_VERSION 1 static void goldfish_switch_save(QEMUFile* f, void* opaque) { struct switch_state* s = opaque; qemu_put_be32(f, s->state); qemu_put_byte(f, s->state_changed); qemu_put_byte(f, s->int_enable); } static int goldfish_switch_load(QEMUFile* f, void* opaque, int version_id) { struct switch_state* s = opaque; if (version_id != GOLDFISH_SWITCH_SAVE_VERSION) return -1; s->state = qemu_get_be32(f); s->state_changed = qemu_get_byte(f); s->int_enable = qemu_get_byte(f); return 0; } static uint32_t goldfish_switch_read(void *opaque, hwaddr offset) { struct switch_state *s = (struct switch_state *)opaque; //printf("goldfish_switch_read %x %x\n", offset, size); switch (offset) { case SW_NAME_LEN: return strlen(s->name); case SW_FLAGS: return s->writefn ? SW_FLAGS_OUTPUT : 0; case SW_STATE: return s->state; case SW_INT_STATUS: if(s->state_changed && s->int_enable) { s->state_changed = 0; goldfish_device_set_irq(&s->dev, 0, 0); return 1; } return 0; default: cpu_abort (cpu_single_env, "goldfish_switch_read: Bad offset %x\n", offset); return 0; } } static void goldfish_switch_write(void *opaque, hwaddr offset, uint32_t value) { struct switch_state *s = (struct switch_state *)opaque; //printf("goldfish_switch_read %x %x %x\n", offset, value, size); switch(offset) { case SW_NAME_PTR: safe_memory_rw_debug(cpu_single_env, value, (void*)s->name, strlen(s->name), 1); break; case SW_STATE: if(s->writefn) { uint32_t new_state; new_state = s->writefn(s->writeopaque, value); if(new_state != s->state) { goldfish_switch_set_state(s, new_state); } } else cpu_abort (cpu_single_env, "goldfish_switch_write: write to SW_STATE on input\n"); break; case SW_INT_ENABLE: value &= 1; if(s->state_changed && s->int_enable != value) goldfish_device_set_irq(&s->dev, 0, value); s->int_enable = value; break; default: cpu_abort (cpu_single_env, "goldfish_switch_write: Bad offset %x\n", offset); } } static CPUReadMemoryFunc *goldfish_switch_readfn[] = { goldfish_switch_read, goldfish_switch_read, goldfish_switch_read }; static CPUWriteMemoryFunc *goldfish_switch_writefn[] = { goldfish_switch_write, goldfish_switch_write, goldfish_switch_write }; void goldfish_switch_set_state(void *opaque, uint32_t state) { struct switch_state *s = opaque; s->state_changed = 1; s->state = state; if(s->int_enable) goldfish_device_set_irq(&s->dev, 0, 1); } void *goldfish_switch_add(char *name, uint32_t (*writefn)(void *opaque, uint32_t state), void *writeopaque, int id) { int ret; struct switch_state *s; s = g_malloc0(sizeof(*s)); s->dev.name = "goldfish-switch"; s->dev.id = id; s->dev.size = 0x1000; s->dev.irq_count = 1; s->name = name; s->writefn = writefn; s->writeopaque = writeopaque; ret = goldfish_device_add(&s->dev, goldfish_switch_readfn, goldfish_switch_writefn, s); if(ret) { g_free(s); return NULL; } register_savevm( "goldfish_switch", 0, GOLDFISH_SWITCH_SAVE_VERSION, goldfish_switch_save, goldfish_switch_load, s); return s; }
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein is * confidential and proprietary to MediaTek Inc. and/or its licensors. Without * the prior written permission of MediaTek inc. and/or its licensors, any * reproduction, modification, use or disclosure of MediaTek Software, and * information contained herein, in whole or in part, shall be strictly * prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek * Software") have been modified by MediaTek Inc. All revisions are subject to * any receiver's applicable license agreements with MediaTek Inc. */ #ifndef ANDROID_SRS_TECH_CSHP #define ANDROID_SRS_TECH_CSHP namespace android { struct SRS_Tech_CSHP { float IGain, OGain, BGain; bool DoTB, DoTBSplit, DoDef, DoDecode, DoDialog, DoLimit, Skip; float TBMin, TBWindow, TBSlide, TBCompress; float DefMin, DefWindow, DefSlide, Dialog, LimitMGain; int DecodeMode, TBFreq, TBAnalyze, TBMode; float TBSlideUDef, DefSlideUDef; }; struct SRS_Source_CSHP; // Instead of virtuals - or a 'public' class - we'll hide all of CSHP behind this... extern SRS_Source_CSHP* SRS_Create_CSHP(SRS_Source_Out* pOut); extern void SRS_Destroy_CSHP(SRS_Source_CSHP* pSrc, SRS_Source_Out* pOut); extern void SRS_Config_CSHP(SRS_Source_CSHP* pSrc, SRS_Source_Out* pOut, SRS_Tech_CSHP* pCFG, bool bBypass); extern void SRS_Process_CSHP_256(SRS_Source_CSHP* pSrc, SRSSamp* pData); extern char* SRS_GetVersion_CSHP(char* pWork, size_t maxBytes); extern SRS_Param* SRS_GetBank_CSHP(int& paramCount); extern void SRS_SetParam_CSHP(SRS_Tech_CSHP* pCFG, SRS_Param* pParam, const char* pValue); extern const char* SRS_GetParam_CSHP(SRS_Tech_CSHP* pCFG, SRS_Param* pParam); extern void SRS_Default_CSHP(SRS_Tech_CSHP* pCFG); extern void SRS_UserDefault_CSHP(SRS_Tech_CSHP* pCFG); }; #endif // ANDROID_SRS_TECH_CSHP
/* * This file is part of the coreboot project. * * Copyright (C) 2007-2009 coresystems GmbH * Copyright (C) 2011 Sven Schnelle <svens@stackframe.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; version 2 of * the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * 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 <console/console.h> #include <device/device.h> #include <arch/io.h> #include <delay.h> #include <string.h> #include <device/pci_def.h> #include <device/pci_ops.h> #include <device/pci_ids.h> #include <arch/io.h> #include <arch/interrupt.h> #include <ec/lenovo/pmh7/pmh7.h> #include <ec/acpi/ec.h> #include <ec/lenovo/h8/h8.h> #include <northbridge/intel/i945/i945.h> #include <pc80/mc146818rtc.h> #include "dock.h" #include <arch/x86/include/arch/acpigen.h> #include <smbios.h> #include <build.h> #include <drivers/intel/gma/int15.h> #define PANEL INT15_5F35_CL_DISPLAY_DEFAULT static acpi_cstate_t cst_entries[] = { { 1, 1, 1000, { 0x7f, 1, 2, { 0 }, 1, 0 } }, { 2, 1, 500, { 0x01, 8, 0, { 0 }, DEFAULT_PMBASE + LV2, 0 } }, { 2, 17, 250, { 0x01, 8, 0, { 0 }, DEFAULT_PMBASE + LV3, 0 } }, }; int get_cst_entries(acpi_cstate_t **entries) { *entries = cst_entries; return ARRAY_SIZE(cst_entries); } static void mainboard_init(device_t dev) { device_t dev0, idedev, sdhci_dev; ec_clr_bit(0x03, 2); if (inb(0x164c) & 0x08) { ec_set_bit(0x03, 2); ec_write(0x0c, 0x88); } install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, PANEL, 3); /* If we're resuming from suspend, blink suspend LED */ dev0 = dev_find_slot(0, PCI_DEVFN(0,0)); if (dev0 && pci_read_config32(dev0, SKPAD) == SKPAD_ACPI_S3_MAGIC) ec_write(0x0c, 0xc7); idedev = dev_find_slot(0, PCI_DEVFN(0x1f,1)); if (idedev && idedev->chip_info && dock_ultrabay_device_present()) { struct southbridge_intel_i82801gx_config *config = idedev->chip_info; config->ide_enable_primary = 1; /* enable Ultrabay power */ outb(inb(0x1628) | 0x01, 0x1628); ec_write(0x0c, 0x84); } else { /* disable Ultrabay power */ outb(inb(0x1628) & ~0x01, 0x1628); ec_write(0x0c, 0x04); } /* Set SDHCI write protect polarity "SDWPPol" */ sdhci_dev = dev_find_device(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C822, 0); if (sdhci_dev) { if (pci_read_config8(sdhci_dev, 0xfa) != 0x20) { /* unlock */ pci_write_config8(sdhci_dev, 0xf9, 0xfc); /* set SDWPPol, keep CLKRUNDis, SDPWRPol clear */ pci_write_config8(sdhci_dev, 0xfa, 0x20); /* restore lock */ pci_write_config8(sdhci_dev, 0xf9, 0x00); } } } const char *smbios_mainboard_bios_version(void) { /* Satisfy thinkpad_acpi. */ if (strlen(CONFIG_LOCALVERSION)) return "CBET4000 " CONFIG_LOCALVERSION; else return "CBET4000 " COREBOOT_VERSION; } static void mainboard_enable(device_t dev) { dev->ops->init = mainboard_init; } struct chip_operations mainboard_ops = { .enable_dev = mainboard_enable, };
#include "sample_converter.h" #include "3ds.h" #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswresample/swresample.h> #include <libavutil/opt.h> Result initSampleConverter(StreamState * ss){ ss->spl_swr_ctx = swr_alloc(); av_opt_set_int(ss->spl_swr_ctx, "in_channel_layout", ss->aCodecCtx->channel_layout, 0); av_opt_set_int(ss->spl_swr_ctx, "out_channel_layout", AV_CH_LAYOUT_MONO, 0); av_opt_set_int(ss->spl_swr_ctx, "in_sample_rate", ss->aCodecCtx->sample_rate, 0); av_opt_set_int(ss->spl_swr_ctx, "out_sample_rate", ss->aCodecCtx->sample_rate, 0); av_opt_set_sample_fmt(ss->spl_swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0); av_opt_set_sample_fmt(ss->spl_swr_ctx, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); swr_init(ss->spl_swr_ctx); printf("sample rate %i\n", ss->aCodecCtx->sample_rate); return 0; } Result sampleConvert(StreamState * ss){ int out_samples, output_data_size = 0, size = output_data_size = av_samples_get_buffer_size(&ss->linesize, ss->aCodecCtx->channels,ss->aFrame->nb_samples*10, AV_SAMPLE_FMT_S16, 1); if(ss->aFrame->nb_samples != ss->nb_samples){ //printf() //ss->aFrame->nb_samples * ss->aCodecCtx->channels * 4 * 4; ss->audioBuffer = (u32*) linearAlloc(size); memset(ss->audioBuffer, 0, size); ss->waveBuf[0].data_vaddr = &ss->audioBuffer[0]; ss->waveBuf[1].data_vaddr = &ss->audioBuffer[(size/40) * 1]; ss->waveBuf[2].data_vaddr = &ss->audioBuffer[(size/40) * 2]; ss->waveBuf[3].data_vaddr = &ss->audioBuffer[(size/40) * 3]; ss->waveBuf[4].data_vaddr = &ss->audioBuffer[(size/40) * 4]; ss->waveBuf[5].data_vaddr = &ss->audioBuffer[(size/40) * 5]; ss->waveBuf[6].data_vaddr = &ss->audioBuffer[(size/40) * 6]; ss->waveBuf[7].data_vaddr = &ss->audioBuffer[(size/40) * 7]; ss->waveBuf[8].data_vaddr = &ss->audioBuffer[(size/40) * 8]; ss->waveBuf[9].data_vaddr = &ss->audioBuffer[(size/40) * 9]; //av_samples_alloc(&ss->resampled_buffer, &ss->linesize, ss->aCodecCtx->channels, ss->aFrame->nb_samples, AV_SAMPLE_FMT_S16P, 0); ss->nb_samples = ss->aFrame->nb_samples; } u32* dir = &ss->audioBuffer[(size / 40) * ss->fillBlock]; out_samples = swr_convert(ss->spl_swr_ctx, (uint8_t **)&dir, ss->aFrame->nb_samples, (const uint8_t **) ss->aFrame->extended_data, ss->aFrame->nb_samples); // recompute output_data_size following swr_convert result (number of samples actually converted) output_data_size = av_samples_get_buffer_size(&ss->linesize, ss->aCodecCtx->channels, out_samples, AV_SAMPLE_FMT_S16, 1); //swr_convert(ss->spl_swr_ctx, &ss->resampled_buffer, ss->aFrame->nb_samples, (const uint8_t **) ss->aFrame->extended_data, ss->aFrame->nb_samples); return output_data_size; } Result closeSampleConverter(StreamState * ss){ /*printf("liberando resampled_buffer"); av_freep(ss->resampled_buffer);*/ swr_close(ss->spl_swr_ctx); swr_free(&ss->spl_swr_ctx); return 0; }
/* * Copyright (C) 2012 Tobias Brunner * Copyright (C) 2005-2006 Martin Willi * Copyright (C) 2005 Jan Hutter * Hochschule fuer Technik Rapperswil * * 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 <http://www.fsf.org/copyleft/gpl.txt>. * * 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. */ /** * @defgroup ike_sa_id ike_sa_id * @{ @ingroup sa */ #ifndef IKE_SA_ID_H_ #define IKE_SA_ID_H_ typedef struct ike_sa_id_t ike_sa_id_t; #include <library.h> /** * An object of type ike_sa_id_t is used to identify an IKE_SA. * * An IKE_SA is identified by its initiator and responder SPIs. * Additionally, it contains the major IKE version of the IKE_SA and, for IKEv2, * the role of the daemon (original initiator or responder). */ struct ike_sa_id_t { /** * Get the major IKE version of this IKE_SA. * * @return IKE version */ u_int8_t (*get_ike_version) (ike_sa_id_t *this); /** * Set the SPI of the responder. * * This function is called when a request or reply of a IKE_SA_INIT is received. * * @param responder_spi SPI of responder to set */ void (*set_responder_spi) (ike_sa_id_t *this, u_int64_t responder_spi); /** * Set the SPI of the initiator. * * @param initiator_spi SPI to set */ void (*set_initiator_spi) (ike_sa_id_t *this, u_int64_t initiator_spi); /** * Get the initiator SPI. * * @return SPI of the initiator */ u_int64_t (*get_initiator_spi) (ike_sa_id_t *this); /** * Get the responder SPI. * * @return SPI of the responder */ u_int64_t (*get_responder_spi) (ike_sa_id_t *this); /** * Check if two ike_sa_id_t objects are equal. * * Two ike_sa_id_t objects are equal if version and both SPI values match. * The role is not compared. * * @param other ike_sa_id_t object to check if equal * @return TRUE if given ike_sa_id_t are equal, * FALSE otherwise */ bool (*equals) (ike_sa_id_t *this, ike_sa_id_t *other); /** * Replace all values of a given ike_sa_id_t object with values. * from another ike_sa_id_t object. * * After calling this function, both objects are equal. * * @param other ike_sa_id_t object from which values will be taken */ void (*replace_values) (ike_sa_id_t *this, ike_sa_id_t *other); /** * Get the initiator flag. * * @return TRUE if we are the original initiator */ bool (*is_initiator) (ike_sa_id_t *this); /** * Switch the original initiator flag. * * @return new value if initiator flag. */ bool (*switch_initiator) (ike_sa_id_t *this); /** * Clones a given ike_sa_id_t object. * * @return cloned ike_sa_id_t object */ ike_sa_id_t *(*clone) (ike_sa_id_t *this); /** * Destroys an ike_sa_id_t object. */ void (*destroy) (ike_sa_id_t *this); }; /** * Creates an ike_sa_id_t object. * * @param ike_version major IKE version * @param initiator_spi initiators SPI * @param responder_spi responders SPI * @param is_initiaor TRUE if we are the original initiator * @return ike_sa_id_t object */ ike_sa_id_t * ike_sa_id_create(u_int8_t ike_version, u_int64_t initiator_spi, u_int64_t responder_spi, bool is_initiaor); #endif /** IKE_SA_ID_H_ @}*/
/* * Creation Date: <2004/08/28 17:29:43 greg> * Time-stamp: <2004/08/28 17:29:43 greg> * * <vfd.c> * * Simple text console * * Copyright (C) 2004 Greg Watson * * 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 * */ #include "openbios/config.h" #include "openbios/bindings.h" #include "briq/briq.h" static int vfd_is_open; static int vfd_init( void ) { vfd_is_open = 1; return 0; } void vfd_close( void ) { } int vfd_draw_str( const char *str ) { if (!vfd_is_open) vfd_init(); return 0; }
/* -------------------------------------------------------------------- * Filename: * src/mailbox/address.h * * Description: * Declaration of the Address class. * (originally from bincimapmime project) * -------------------------------------------------------------------- * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 Street #330, Boston, MA 02111-1307, USA. * -------------------------------------------------------------------- */ #ifndef address_h_included #define address_h_included #include <string> namespace Binc { //------------------------------------------------------------------------ class Address { public: std::string name; std::string local; std::string host; //-- std::string toParenList(void) const; //-- Address(const std::string &name, const std::string &addr); Address(const std::string &wholeaddr); }; } #endif
/* ***** BEGIN LICENSE BLOCK ***** * Source last modified: $Id: 3gpadapthdr.h,v 1.4 2006/07/27 19:32:54 cybette Exp $ * * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved. * * The contents of this file, and the files included with this file, * are subject to the current version of the RealNetworks Public * Source License (the "RPSL") available at * http://www.helixcommunity.org/content/rpsl unless you have licensed * the file under the current version of the RealNetworks Community * Source License (the "RCSL") available at * http://www.helixcommunity.org/content/rcsl, in which case the RCSL * will apply. You may also obtain the license terms directly from * RealNetworks. You may not use this file except in compliance with * the RPSL or, if you have a valid RCSL with RealNetworks applicable * to this file, the RCSL. Please see the applicable RPSL or RCSL for * the rights, obligations and limitations governing use of the * contents of the file. * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the * "GPL") in which case the provisions of the GPL are applicable * instead of those above. If you wish to allow use of your version of * this file only under the terms of the GPL, and not to allow others * to use your version of this file under the terms of either the RPSL * or RCSL, indicate your decision by deleting the provisions above * and replace them with the notice and other provisions required by * the GPL. If you do not delete the provisions above, a recipient may * use your version of this file under the terms of any one of the * RPSL, the RCSL or the GPL. * * This file is part of the Helix DNA Technology. RealNetworks is the * developer of the Original Code and owns the copyrights in the * portions it created. * * This file, and the files included with this file, is distributed * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET * ENJOYMENT OR NON-INFRINGEMENT. * * Technology Compatibility Kit Test Suite(s) Location: * http://www.helixcommunity.org/content/tck * * Contributor(s): * * ***** END LICENSE BLOCK ***** */ #ifndef _3GP_ADAPT_HDR_H #define _3GP_ADAPT_HDR_H #include "adapthdr.h" class C3gpAdaptationHeader : public CHXAdaptationHeader { public: C3gpAdaptationHeader(); ~C3gpAdaptationHeader(); protected: virtual const char* const* intParams() const; virtual const char* const* stringParams() const; virtual const char* const* paramOrder() const; private: // Hide copy constructor and assignment operator. C3gpAdaptationHeader(const C3gpAdaptationHeader& rhs); C3gpAdaptationHeader& operator=(const C3gpAdaptationHeader& rhs); static const char* const zm_pIntParams[]; static const char* const zm_pStringParams[]; static const char* const zm_pParamOrder[]; }; #endif /* _3GP_ADAPT_HDR_H */
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Test that the underlying kernel-scheduled entities for the process * contention scope threads that are created after this call completes inherit * their scheduling parameters from the process. */ #if __APPLE__ int main() { return 0; } #elif __ANDROID__ /* Temporarily disable it until https://tracker.crystax.net/issues/1114 is fixed */ int main() { return 0; } #else /* !__ANDROID__ */ #include <sched.h> #include <stdio.h> #include <pthread.h> #include <unistd.h> #include <errno.h> #include "posixtest.h" void * runner(void * arg) { while(1) sleep(1); return NULL; } int main() { int new_priority, max_priority, policy, result; struct sched_param param; pthread_t tid; pthread_attr_t attr; if(sched_getparam(getpid(), &param) != 0){ perror("An error occurs when calling sched_getparam()"); pthread_exit((void*)-1); } /* Make sure new_priority != old_priority */ max_priority = sched_get_priority_max(SCHED_FIFO); new_priority = (param.sched_priority == max_priority) ? sched_get_priority_min(SCHED_FIFO) : max_priority; param.sched_priority = new_priority; if(sched_setscheduler(getpid(), SCHED_FIFO, &param) != 0){ if(errno == EPERM) { printf("This process does not have the permission to set its own scheduling policy.\nTry to launch this test as root.\n"); return geteuid() == 0 ? PTS_UNRESOLVED : PTS_PASS; } perror("An error occurs when calling sched_setscheduler()"); return PTS_UNRESOLVED; } if(pthread_attr_init(&attr) != 0) { printf("An error occurs when calling pthread_attr_init()"); return PTS_UNRESOLVED; } result = pthread_attr_setscope(&attr, PTHREAD_SCOPE_PROCESS); if(result == ENOTSUP) { printf("Process contention scope threads are not supported.\n"); return PTS_UNSUPPORTED; } else if(result != 0) { printf("An error occurs when calling pthread_attr_setscope()"); return PTS_UNRESOLVED; } if(pthread_create(&tid, &attr, runner, NULL) != 0) { printf("An error occurs when calling pthread_create()"); return PTS_UNRESOLVED; } if(pthread_getschedparam(tid , &policy, &param) != 0) { printf("An error occurs when calling pthread_getschedparam()"); return PTS_UNRESOLVED; } pthread_cancel(tid); if(param.sched_priority == new_priority){ printf("Test PASSED\n"); return PTS_PASS; } printf("The thread does not inherit the right param.\n"); return PTS_FAIL; } #endif /* !__ANDROID__ */
/* * Copyright (C) 2011 Petr Benes. * Copyright (C) 2011 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.com/license/LICENSE. * * $Id$ */ #if HAVE_CONFIG_H #include "config.h" #endif #include <rtems/system.h> #include <rtems/config.h> #include <rtems/score/scheduler.h> #include <rtems/score/schedulerpriority.h> void _Scheduler_priority_Release_job( Thread_Control *the_thread, uint32_t deadline ) { return; }
/* * Copyright (C) 2011-2012 ArkCORE2 <http://www.arkania.net/> * Copyright (C) 2010-2012 Project SkyFire <http://www.projectskyfire.org/> * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __UPDATEMASK_H #define __UPDATEMASK_H #include "UpdateFields.h" #include "Errors.h" class UpdateMask { public: UpdateMask() : mCount(0), mBlocks(0), mUpdateMask(0) { } UpdateMask(const UpdateMask& mask) : mUpdateMask(0) { *this = mask; } ~UpdateMask() { delete [] mUpdateMask; } void SetBit (uint32 index) { ((uint8 *)mUpdateMask)[ index >> 3 ] |= 1 << (index & 0x7); } void UnsetBit (uint32 index) { ((uint8 *)mUpdateMask)[ index >> 3 ] &= (0xff ^ (1 << (index & 0x7))); } bool GetBit (uint32 index) const { return (((uint8 *)mUpdateMask)[ index >> 3 ] & (1 << (index & 0x7))) != 0; } uint32 GetBlockCount() const { return mBlocks; } uint32 GetLength() const { return mBlocks << 2; } uint32 GetCount() const { return mCount; } uint8* GetMask() { return (uint8*)mUpdateMask; } void SetCount (uint32 valuesCount) { delete [] mUpdateMask; mCount = valuesCount; mBlocks = (valuesCount + 31) / 32; mUpdateMask = new uint32[mBlocks]; memset(mUpdateMask, 0, mBlocks << 2); } void Clear() { if (mUpdateMask) memset(mUpdateMask, 0, mBlocks << 2); } UpdateMask& operator = (const UpdateMask& mask) { if (this == &mask) return *this; SetCount(mask.mCount); memcpy(mUpdateMask, mask.mUpdateMask, mBlocks << 2); return *this; } void operator &= (const UpdateMask& mask) { ASSERT(mask.mCount <= mCount); for (uint32 i = 0; i < mBlocks; ++i) mUpdateMask[i] &= mask.mUpdateMask[i]; } void operator |= (const UpdateMask& mask) { ASSERT(mask.mCount <= mCount); for (uint32 i = 0; i < mBlocks; ++i) mUpdateMask[i] |= mask.mUpdateMask[i]; } UpdateMask operator & (const UpdateMask& mask) const { ASSERT(mask.mCount <= mCount); UpdateMask newmask; newmask = *this; newmask &= mask; return newmask; } UpdateMask operator | (const UpdateMask& mask) const { ASSERT(mask.mCount <= mCount); UpdateMask newmask; newmask = *this; newmask |= mask; return newmask; } private: uint32 mCount; uint32 mBlocks; uint32 *mUpdateMask; }; #endif
/* * scriptenv.h * * Copyright (C) 2014 Andre Erdmann <dywi@mailerd.de> * * batwatch 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 _SCRIPTENV_H_ #define _SCRIPTENV_H_ #if SCRIPTENV_DEBUG #include <stdio.h> #endif #include "data_types.h" #include "globals.h" /* mini-howto for adding new env vars: * * (a) global env vars (not depending on runtime/battery information) * should be be set in main.c -- no need to do this more than once * * (b) if additional battery information is necessary, add a data field * to "struct battery_info" AND create_battery_info() in data_types.h, * and read/initialize the data in upower-listener.c->check_batteries() * * Run "make batlow" to verify your changes * (as far as the compiler can tell you about that) * * *Then*: * * (c) add a SCRIPT_ENV_INDEX_<sth> entry with a *short* description * to the enum below, *before* SCRIPT_ENV_VARCOUNT * * (d) Add an entry containing the env var's name to SCRIPT_ENV_VARNAMES * in scriptenv.c: * [SCRIPT_ENV_INDEX_<sth>] = "MY_ENV_VAR", * * (e) create the env var in set_battery_env_vars() (scriptenv.c): * * scriptenv_setenv ( SCRIPT_ENV_INDEX_<sth>, <str>|NULL, &ret ); * * (NULL sets the var to "") * Make sure to set the var in any case (or unconditionally), unless * your really want latch behavior. * * * backup_battery_env_vars_into(), restore_battery_env_vars(), * free_battery_env_backup() automatically inherit your changes. */ enum { /* the battery's name / sysfs path / percentage / remaining running time */ SCRIPT_ENV_INDEX_BATNAME, SCRIPT_ENV_INDEX_BATPATH, SCRIPT_ENV_INDEX_BATPERC, SCRIPT_ENV_INDEX_BATTIME, /* the fallback battery's name / path / perc / charging time / status */ SCRIPT_ENV_INDEX_FBATNAME, SCRIPT_ENV_INDEX_FBATPATH, SCRIPT_ENV_INDEX_FBATPERC, SCRIPT_ENV_INDEX_FBATTIME, SCRIPT_ENV_INDEX_FBATSTATE, /* misc */ SCRIPT_ENV_INDEX_ON_AC, /* number of elements -- last entry! */ SCRIPT_ENV_VARCOUNT }; extern const char* SCRIPT_ENV_VARNAMES[SCRIPT_ENV_VARCOUNT]; extern int unset_battery_env_vars(void); extern int set_battery_env_vars ( const struct battery_info* const battery, const struct battery_info* const fallback_battery, const struct batwatch_globals* const globals ); extern void backup_battery_env_vars_into ( char* dest [SCRIPT_ENV_VARCOUNT] ); extern int restore_battery_env_vars ( char* src [SCRIPT_ENV_VARCOUNT] ); extern void free_battery_env_backup ( char* bak [SCRIPT_ENV_VARCOUNT] ); #if SCRIPTENV_DEBUG static inline void scriptenv_test_backup_restore(void) { char* bak[SCRIPT_ENV_VARCOUNT]; backup_battery_env_vars_into ( bak ); if ( restore_battery_env_vars ( bak ) != 0 ) { fprintf(stderr, "env-restore: fail\n" ); } else { fprintf(stderr, "env-restore: success\n" ); } free_battery_env_backup ( bak ); } #endif #endif /* _SCRIPTENV_H_ */
#include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> #include "display.h" #include "charset.h" #define DATE_LENGTH 6 #define TIME_LENGTH 9 void drawStr(char* buf, char strlen, char x, char y) { char i; for(i=0; i<strlen - 1; i++) { drawChar(i*(CHAR_WIDTH + 2) + x, y, buf[i]); } } /* Draws the hours, minutes, and seconds in block letters. */ void drawTime(struct tm * timeinfo) { char buf[TIME_LENGTH]; gotoxy(2,15); printf("Local Time"); strftime(buf, TIME_LENGTH, "%H:%M:%S", timeinfo); drawStr(buf, TIME_LENGTH, 9, 18); } /* Draws a calendar. */ void drawCalendar(struct tm * timeinfo) { char i; char wk1; char wk_offset; char day_offset; char today; char month; char buf[15]; /* 15 = max number of characters in a month/year combo */ today = timeinfo->tm_mday; month = timeinfo->tm_mon; wk1 = 0; wk_offset = 0; day_offset = 0; /* Print a calendar header. */ gotoxy(3,2); strftime(buf, 15, "%B %Y",timeinfo); printf("%s Calendar", buf); gotoxy(3,4); printf("Su Mo Tu We Th Fr Sa Wk"); /* Blank out the calendar area. */ for(i=0; i < 8; i++) { gotoxy(3, 5+i); printf(" "); } for(i=1; i < 32; i++) { /* Iterate over all possible days in the month. */ timeinfo->tm_mday = i; if (mktime(timeinfo) != -1) { /* mktime returns -1 for Feb 30 and friends */ /* If it's the first day of the month, calculate the start position. */ if(i==1) { day_offset = timeinfo->tm_wday; strftime(buf, 3, "%U", timeinfo); wk1 = atoi(buf); gotoxy(25, 5); printf("%d",wk1); /* If it's any other Sunday, with iteration still in the same month. */ } else if(timeinfo->tm_wday == 0 && month == timeinfo->tm_mon) { /* Calculate what week it is. */ wk_offset++; day_offset = 0; gotoxy(25, 5 + wk_offset); printf("%d",wk1+wk_offset); } /* Print out a single day in the correct position */ if(month == timeinfo->tm_mon) { /* Invert console colors to mark the current day. */ if(i==today) { invertColors(); } gotoxy((day_offset * 3)+3,wk_offset + 5); printf("%d",timeinfo->tm_mday); day_offset++; /* Un-invert colors of the current day. */ if(i==today) { restoreColors(); } } } } } /* Draws the three-letter month and two-digit day in block letters. */ void drawDate(struct tm * timeinfo) { char buf[DATE_LENGTH]; gotoxy(36,2); printf("Today's date"); gotoxy(36,5); strftime(buf, DATE_LENGTH, "%a%d", timeinfo); drawStr(buf, DATE_LENGTH, 36, 5); } /* Entry point. */ int main() { char day; time_t rawtime; struct tm * timeinfo; day = 0; clrscr(); while(1) { /* Run until interrupted. */ time(&rawtime); timeinfo = localtime(&rawtime); /* Draw the time on every update. */ drawTime(timeinfo); /* If the date has changed, draw the date and year. This avoids console shearing on older hardware. */ if(day != timeinfo->tm_mday) { /* Update the day. */ day = timeinfo->tm_mday; drawDate(timeinfo); /* Update the calendar. */ drawCalendar(timeinfo); } fflush(stdout); sleep(1); } }
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- nautilus-vfs-directory.h: Subclass of NautilusDirectory to implement the the case of a VFS directory. Copyright (C) 1999, 2000 Eazel, 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, see <http://www.gnu.org/licenses/>. Author: Darin Adler <darin@bentspoon.com> */ #ifndef NAUTILUS_VFS_DIRECTORY_H #define NAUTILUS_VFS_DIRECTORY_H #include <libnautilus-private/nautilus-directory.h> #define NAUTILUS_TYPE_VFS_DIRECTORY nautilus_vfs_directory_get_type() #define NAUTILUS_VFS_DIRECTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_VFS_DIRECTORY, NautilusVFSDirectory)) #define NAUTILUS_VFS_DIRECTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VFS_DIRECTORY, NautilusVFSDirectoryClass)) #define NAUTILUS_IS_VFS_DIRECTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_VFS_DIRECTORY)) #define NAUTILUS_IS_VFS_DIRECTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_VFS_DIRECTORY)) #define NAUTILUS_VFS_DIRECTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_VFS_DIRECTORY, NautilusVFSDirectoryClass)) typedef struct NautilusVFSDirectoryDetails NautilusVFSDirectoryDetails; typedef struct { NautilusDirectory parent_slot; } NautilusVFSDirectory; typedef struct { NautilusDirectoryClass parent_slot; } NautilusVFSDirectoryClass; GType nautilus_vfs_directory_get_type (void); #endif /* NAUTILUS_VFS_DIRECTORY_H */
#include "semaphore.h" int sys_sem_count = 0; static int proc_in_queue (int pid, struct semaphore_t* sem) { /* if the thread is in sem's wait queue, return 1 * else, return 0 */ struct entry* np; /* loop variable */ SIMPLEQ_FOREACH(np, &(sem->head), next) { if(np->pid == pid) return 1; } return 0; } struct semaphore_t* find_semaphore (const char* semName) { struct node* np; printf("find: targ_proc pid is %d\n", targ_proc->pid); if(targ_proc == NULL) { printf("find: sem doesn't exist\n"); return NULL; } /* search targ_proc's list of semaphores */ LIST_FOREACH(np, &(targ_proc->list_head), next) if(strcmp(np->sem->name, semName)) { printf("Found sem: %s\n", np->sem->name); return np->sem; } /* search proc's parent */ printf("Find: Starting recursion\n"); find_semaphore(semName, targ_proc->parent); return NULL; } int allocate_semaphore( const char* name, int initCount , struct proc_sim_t* this_proc) { struct semaphore_t* newSem; /* the newly created semaphore */ struct node* np; /* will hold the new sem in its proc's sem list */ printf("alloc: starting\n"); printf("alloc: this proc's pid is %d\n", this_proc->pid); if( sys_sem_count >= SYS_SEM_MAX ) return ENOMEM; if( strlen(name) > SYS_SEM_NAME_MAX ) return ENAMETOOLONG; if( find_semaphore(name, this_proc) != NULL ) return EEXIST; /* create new semaphore */ newSem = (struct semaphore_t*) malloc(sizeof(struct semaphore_t)); /* set name and count*/ newSem->count = initCount; strcpy(newSem->name, name); /* init lock vars */ /* init queue head */ /* (expansion of the SIMPLEQ_HEAD_INITIALIZER macro in queue.h) */ newSem->head.sqh_first = NULL; newSem->head.sqh_last = &(newSem->head).sqh_first; /* set this sem's proc */ newSem->my_proc = this_proc; /* wrap sem in node and add to its proc's sem list */ np = (struct node*)malloc(sizeof(struct node)); np->sem = newSem; LIST_INSERT_HEAD( &(this_proc->list_head), np, next); /* lock */ ++sys_sem_count; /* unlock */ printf("finished creating sem\n"); return 0; } int free_semaphore (const char* name) { struct node* np; /*loop var*/ struct semaphore_t* sem = find_semaphore(name, this_proc); if (sem == NULL) { printf("Sem wasn't found!\n"); return ENOENT; } pthread_mutex_destroy(&sem->mutex); pthread_cond_destroy(&sem->cond); LIST_FOREACH(np, &(sem->my_proc->list_head), next) if (strcmp(sem->name, np->sem->name)) break; LIST_REMOVE(np,next); free(np); free(sem); /* lock */ sys_sem_count--; /* unlock */ return 0; } int down_semaphore(const char* name) { struct entry* np; /* will hold node for process wait queue if needed */ struct semaphore_t* sem = find_semaphore(name, this_proc); if (sem == NULL) return ENOENT; printf("Count: %d\n", sem->count); /* threads must wait if no resources are available, */ /* or if they are already waiting */ while (sem->count == 0 || proc_in_queue(pid, sem)) { printf("Thread is waiting\n"); if ( !proc_in_queue(pid, sem) ) { /* create new queue entry from current thread */ np = (struct entry*) malloc(sizeof(struct entry)); np->thread = pthread_self(); /* enqueue */ SIMPLEQ_INSERT_TAIL(&(sem->head), np, next); } if (find_semaphore(sem->name, sem->my_proc) == NULL) return ECONNABORTED; } sem->count--; return 0; } int up_semaphore(const char* name) { struct entry* queue_head; struct semaphore_t* sem = find_semaphore(name, this_proc); if (sem == NULL) return ENOENT; if (sem->count == 0) { sem->count++; /* dequeue and free head of queue */ queue_head = SIMPLEQ_FIRST(&(sem->head)); SIMPLEQ_REMOVE_HEAD(&(sem->head), queue_head, next); free(queue_head); } else sem->count++; return 0; }
#ifndef SOUND_DMA_H #define SOUND_DMA_H #include <asm/dma.h> /* Define the DMA unit size for IIS to use. This is different for 24xx & 2412... */ #ifndef CONFIG_CPU_S3C2412 #define DMA_UNIT_SIZE 2 #else #include <barcelona/gopins.h> #define DMA_UNIT_SIZE (((IO_GetCpuType() == GOCPU_S3C2412) || \ (IO_GetCpuType() == GOCPU_S3C2443) || \ (IO_GetCpuType() == GOCPU_S3C2450)) ? 4 : 2) #endif enum eDMAPurpose { DMAP_PLAY, DMAP_RECORD, }; typedef void (*sound_dma_callback_t)(enum eDMAPurpose purpose, int chunk); enum eDMABufferFlags { DBF_NONE = 0, DBF_ALLOCATED = (1<<0), DBF_ASSOCIATED = (1<<1), DBF_RUNNING = (1<<2), }; struct sDMABuffer { dmach_t channel; s3c_dma_client_t client; dma_addr_t phys; void * virt; size_t size; size_t real_size; size_t chunksize; int chunks; int fill; int pointer; int fpointer; int underrun; int overflow; enum eDMABufferFlags flags; struct device *pDev; sound_dma_callback_t callback; }; int sound_dma_init(struct device *pDev, sound_dma_callback_t callback); int sound_dma_suspend(void); int sound_dma_resume(void); int sound_dma_setup_buffers(int chunksize, int chunks); void sound_dma_usermode_debug(void); int sound_dma_output_start(void); void sound_dma_output_stop(void); int sound_dma_input_allocated(void); int sound_dma_input_ready(void); int sound_dma_input_running(void); size_t sound_dma_input_size(void); void * sound_dma_input_phys(void); int sound_dma_input_pos(void); int sound_dma_input_filled(void); void sound_dma_input_reset(void); void sound_dma_input_get(void *pData, int size, int offset, cs_primixer_t primixer, unsigned int flags); void sound_dma_input_advance(int size); int sound_dma_input_start(void); void sound_dma_input_stop(void); int sound_dma_output_allocated(void); int sound_dma_output_ready(void); int sound_dma_output_running(void); size_t sound_dma_output_size(void); void * sound_dma_output_phys(void); int sound_dma_output_pos(void); int sound_dma_output_free(void); void sound_dma_output_reset(void); void sound_dma_output_put(void *pData, int size, int offset, cs_primixer_t primixer, unsigned int flags); void sound_dma_output_advance(int size); void sound_dma_output_zeroes(int samples, int offset); /* Filter API */ void sound_dma_filter_init(void); void sound_dma_filter_shutdown(void); void sound_dma_filter_resync(void); void sound_dma_filter_magic(void); #endif /* SOUND_DMA_H */
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:40 2014 */ /* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/hw/random.h */
// license:BSD-3-Clause // copyright-holders:Miodrag Milanovic /*************************************************************************** luaengine.h Controls execution of the core MAME system. ***************************************************************************/ #pragma once #ifndef __EMU_H__ #error Dont include this file directly; include emu.h instead. #endif #ifndef __LUA_ENGINE_H__ #define __LUA_ENGINE_H__ #include <map> // None is typedef'd already in SDL/X11 libs #ifdef None #undef None #endif class cheat_manager; struct lua_State; namespace luabridge { class LuaRef; } class lua_engine { public: // construction/destruction lua_engine(); ~lua_engine(); void initialize(); void start_console(); void load_script(const char *filename); void load_string(const char *value); void serve_lua(); void periodic_check(); bool frame_hook(); void execute_function(const char *id); void resume(lua_State *L, int nparam = 0, lua_State *root = nullptr); void set_machine(running_machine *machine) { m_machine = machine; update_machine(); } void attach_notifiers(); private: struct hook { lua_State *L; int cb; hook(); void set(lua_State *L, int idx); lua_State *precall(); void call(lua_engine *engine, lua_State *T, int nparam); bool active() const { return L != nullptr; } }; static const char *const tname_ioport; // internal state lua_State *m_lua_state; running_machine * m_machine; hook hook_output_cb; bool output_notifier_set; hook hook_frame_cb; static lua_engine* luaThis; std::map<lua_State *, std::pair<lua_State *, int> > thread_registry; running_machine &machine() const { return *m_machine; } void update_machine(); void on_machine_start(); void on_machine_stop(); void on_machine_pause(); void on_machine_resume(); void on_machine_frame(); void output_notifier(const char *outname, INT32 value); static void s_output_notifier(const char *outname, INT32 value, void *param); void emu_after_done(void *_h, INT32 param); int emu_after(lua_State *L); int emu_wait(lua_State *L); void emu_hook_output(lua_State *L); void emu_set_hook(lua_State *L); static int l_ioport_write(lua_State *L); static int l_emu_after(lua_State *L); static int l_emu_app_name(lua_State *L); static int l_emu_app_version(lua_State *L); static int l_emu_wait(lua_State *L); static int l_emu_time(lua_State *L); static int l_emu_gamename(lua_State *L); static int l_emu_romname(lua_State *L); static int l_emu_keypost(lua_State *L); static int l_emu_hook_output(lua_State *L); static int l_emu_exit(lua_State *L); static int l_emu_start(lua_State *L); static int l_emu_pause(lua_State *L); static int l_emu_unpause(lua_State *L); static int l_emu_set_hook(lua_State *L); static int l_emu_register_start(lua_State *L); static int l_emu_register_stop(lua_State *L); static int l_emu_register_pause(lua_State *L); static int l_emu_register_resume(lua_State *L); static int l_emu_register_frame(lua_State *L); static int register_function(lua_State *L, const char *id); // "emu.machine" namespace static luabridge::LuaRef l_machine_get_devices(const running_machine *r); static luabridge::LuaRef l_ioport_get_ports(const ioport_manager *i); static luabridge::LuaRef l_render_get_targets(const render_manager *r); static luabridge::LuaRef l_ioports_port_get_fields(const ioport_port *i); static luabridge::LuaRef devtree_dfs(device_t *root, luabridge::LuaRef dev_table); static luabridge::LuaRef l_dev_get_states(const device_t *d); static UINT64 l_state_get_value(const device_state_entry *d); static void l_state_set_value(device_state_entry *d, UINT64 v); static luabridge::LuaRef l_dev_get_memspaces(const device_t *d); struct lua_machine { int l_popmessage(lua_State *L); int l_logerror(lua_State *L); }; struct lua_addr_space { template<typename T> int l_mem_read(lua_State *L); template<typename T> int l_mem_write(lua_State *L); }; static luabridge::LuaRef l_machine_get_screens(const running_machine *r); struct lua_screen { int l_height(lua_State *L); int l_width(lua_State *L); int l_orientation(lua_State *L); int l_refresh(lua_State *L); int l_type(lua_State *L); int l_snapshot(lua_State *L); int l_draw_box(lua_State *L); int l_draw_line(lua_State *L); int l_draw_text(lua_State *L); }; struct lua_video { int l_begin_recording(lua_State *L); int l_end_recording(lua_State *L); }; static luabridge::LuaRef l_cheat_get_entries(const cheat_manager *c); struct lua_cheat_entry { int l_get_state(lua_State *L); }; template<typename T> static luabridge::LuaRef l_options_get_entries(const T *o); struct lua_options_entry { int l_entry_value(lua_State *L); }; void resume(void *L, INT32 param); void start(); static int luaopen_ioport(lua_State *L); void close(); static void *checkparam(lua_State *L, int idx, const char *tname); static void *getparam(lua_State *L, int idx, const char *tname); static void push(lua_State *L, void *p, const char *tname); int report(int status); int docall(int narg, int nres); int incomplete(int status) ; }; #endif /* __LUA_ENGINE_H__ */
/* ** rq_fx_rate.h ** ** Written by Brett Hutley - brett@hutley.net ** ** Copyright (C) 2002-2008 Brett Hutley ** ** This file is part of the Risk Quantify Library ** ** Risk Quantify 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. ** ** Risk Quantify 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 Risk Quantify; if not, write to the Free ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef rq_fx_rate_h #define rq_fx_rate_h /* -- includes ----------------------------------------------------- */ #include "rq_config.h" #include "rq_side_rates.h" #include "rq_quoted_currency_pair.h" #include "rq_stream.h" /* -- structures --------------------------------------------------- */ struct rq_fx_rate { struct rq_quoted_currency_pair quoted_currency_pair; double rate; double spot_rate; /* optional */ double forward_points; /* optional */ struct rq_side_rates *side_rates; /* optional */ }; /* -- prototypes -------------------------------------------------- */ RQ_EXPORT int rq_fx_rate_write_xml(struct rq_fx_rate *p, rq_stream_t output_stream); RQ_EXPORT void rq_fx_rate_init(struct rq_fx_rate *p); RQ_EXPORT void rq_fx_rate_clear(struct rq_fx_rate *p); #endif
/* * TaskTreeIterator.h - TaskJuggler * * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org> * * 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. * * $Id$ */ #ifndef _TaskTreeIterator_h_ #define _TaskTreeIterator_h_ #include "CoreAttributesTreeIterator.h" class TaskTreeIterator : public virtual CoreAttributesTreeIterator { public: TaskTreeIterator(Task* r, IterationMode m = leavesOnly) : CoreAttributesTreeIterator(r, m) { } virtual ~TaskTreeIterator() { } Task* operator*() { return static_cast<Task*>(current); } Task* operator++() { return static_cast<Task*>(CoreAttributesTreeIterator::operator++()); } } ; #endif
/** * @file nmi_timer_int.c * * @remark Copyright 2003 OProfile authors * @remark Read the file COPYING * * @author Zwane Mwaikambo <zwane@linuxpower.ca> */ #include <linux/init.h> #include <linux/smp.h> #include <linux/irq.h> #include <linux/oprofile.h> #include <linux/rcupdate.h> #include <asm/nmi.h> #include <asm/apic.h> #include <asm/ptrace.h> static int nmi_timer_callback(struct pt_regs * regs, int cpu) { unsigned long eip = instruction_pointer(regs); oprofile_add_sample(eip, !user_mode(regs), 0, cpu); return 1; } static int timer_start(void) { disable_timer_nmi_watchdog(); set_nmi_callback(nmi_timer_callback); return 0; } static void timer_stop(void) { enable_timer_nmi_watchdog(); unset_nmi_callback(); synchronize_kernel(); } static struct oprofile_operations nmi_timer_ops = { .start = timer_start, .stop = timer_stop, .cpu_type = "timer" }; int __init op_nmi_timer_init(struct oprofile_operations **ops) { extern int nmi_active; if (nmi_active <= 0) return -ENODEV; *ops = &nmi_timer_ops; printk(KERN_INFO "oprofile: using NMI timer interrupt.\n"); return 0; }
#ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_REALMD "required_s2421_01_realmd_account_locale_agnostic" #define REVISION_DB_CHARACTERS "required_s2423_01_characters_item_instance_duration_default" #define REVISION_DB_MANGOS "required_s2425_01_mangos_creature_spawn_tideup" #endif // __REVISION_SQL_H__
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:40 2014 */ /* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/configfs/fs.h */
// shtLib.h // //**************************************************************************************************** // Author: // Nipun Gunawardena // // Credits: // Borrows from Texas Instruments' sht21 library. // // Requirements: // shtLib.c // // Description: // Library to interface with Sensirion SHT21 to measure humidity without driverlib // // Notes: // // Todo: // Make more durable, timeouts, testing, etc. //**************************************************************************************************** #ifndef SHTLIB_H_ #define SHTLIB_H_ // Includes ------------------------------------------------------------------------------------------ #include <stdint.h> // Defines ------------------------------------------------------------------------------------------- #define SHT21_I2C_ADDRESS 0x40 #define SHT21_TEMP_NOBLOCK 0xF3 #define SHT21_HUM_NOBLOCK 0xF5 #define SCODE_SHT21_VALS 0x01 // Variables ----------------------------------------------------------------------------------------- volatile unsigned char g_shtRxArr[2]; float g_temp; float g_hum; // Functions ----------------------------------------------------------------------------------------- extern void SHT21ReadTemperature(void); extern void SHT21ReadHumidity(void); #endif /* SHTLIB_H_ */
/* * Copyright (c) 1997-1999 Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef F77_FUNC_H #define F77_FUNC_H #include <rfftw/fftw-int.h> /* Define a macro to mangle function names so that they can be recognized by the Fortran linker. Specifically, F77_FUNC_ is designed to mangle identifiers containing an underscore. */ #ifdef FFTW_FORTRANIZE_LOWERCASE # ifdef FFTW_FORTRANIZE_EXTRA_UNDERSCORE # define F77_FUNC_(x,X) x ## _ # else # define F77_FUNC_(x,X) x # endif #endif #ifdef FFTW_FORTRANIZE_LOWERCASE_UNDERSCORE # ifdef FFTW_FORTRANIZE_EXTRA_UNDERSCORE # define F77_FUNC_(x,X) x ## __ # else # define F77_FUNC_(x,X) x ## _ # endif #endif #ifdef FFTW_FORTRANIZE_UPPERCASE # ifdef FFTW_FORTRANIZE_EXTRA_UNDERSCORE # define F77_FUNC_(x,X) X ## _ # else # define F77_FUNC_(x,X) X # endif #endif #ifdef FFTW_FORTRANIZE_UPPERCASE_UNDERSCORE # ifdef FFTW_FORTRANIZE_EXTRA_UNDERSCORE # define F77_FUNC_(x,X) X ## __ # else # define F77_FUNC_(x,X) X ## _ # endif #endif #endif /* F77_FUNC_H */
/* * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. */ #ifndef ResourceResponse_h #define ResourceResponse_h #include "ResourceResponseBase.h" namespace WebCore { class ResourceResponse : public ResourceResponseBase { public: ResourceResponse() { } ResourceResponse(const URL& url, const String& mimeType, long long expectedLength, const String& textEncodingName) //XXX:, const String& filename) : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName) //XXX: , filename) { } private: friend class ResourceResponseBase; void doUpdateResourceResponse() { } std::unique_ptr<CrossThreadResourceResponseData> doPlatformCopyData(std::unique_ptr<CrossThreadResourceResponseData> data) const { return data; } void doPlatformAdopt(std::unique_ptr<CrossThreadResourceResponseData>) { } String platformSuggestedFilename() const { return String(); } //XXX: check implementation }; struct CrossThreadResourceResponseData : public CrossThreadResourceResponseDataBase { }; } // namespace WebCore #endif // ResourceResponse_h
/* * The ManaPlus Client * Copyright (C) 2011-2019 The ManaPlus Developers * Copyright (C) 2019-2022 Andrei Karas * * This file is part of The ManaPlus Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef RESOURCES_DB_NETWORKDB_H #define RESOURCES_DB_NETWORKDB_H #include "enums/simpletypes/skiperror.h" #include "utils/vector.h" #include <map> #include <string> typedef std::map<int32_t, int32_t> NetworkInPacketInfos; typedef NetworkInPacketInfos::const_iterator NetworkInPacketInfosIter; typedef STD_VECTOR<int> NetworkRemovePacketInfos; typedef NetworkRemovePacketInfos::const_iterator NetworkRemovePacketInfosIter; namespace NetworkDb { /** * Loads the chars data. */ void load(); void loadXmlFile(const std::string &fileName, const SkipError skipError); /** * Clear the chars data */ void unload(); const NetworkInPacketInfos &getFakePackets(); const NetworkRemovePacketInfos &getRemovePackets(); } // namespace NetworkDb #endif // RESOURCES_DB_NETWORKDB_H
#ifndef __konq_main_h #define __konq_main_h #include <tdeapplication.h> // This is used to know if we are being closed by session management // or by the user. See KonqMainWindow::~KonqMainWindow. // Credits to Matthias Ettrich for the idea. class KonquerorApplication : public TDEApplication { public: KonquerorApplication() : TDEApplication(), closed_by_sm( false ) {} bool closedByUser() const { return !closed_by_sm; } void commitData(TQSessionManager& sm) { closed_by_sm = true; TDEApplication::commitData( sm ); closed_by_sm = false; } private: bool closed_by_sm; }; #endif
/* * rpiz - https://github.com/bp0/rpiz * Copyright (C) 2017 Burt P. <pburt0@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef _RPI_H_ #define _RPI_H_ #include "fields.h" int rpi_board_check(void); typedef struct rpi_board rpi_board; rpi_board *rpi_board_new(void); void rpi_board_free(rpi_board *); const char *rpi_board_desc(rpi_board *); const char *rpi_board_rcode(rpi_board *); const char *rpi_board_serial(rpi_board *); const char *rpi_board_model(rpi_board *); const char *rpi_board_rev(rpi_board *); const char *rpi_board_intro(rpi_board *); const char *rpi_board_mfgby(rpi_board *); const char *rpi_board_mem_spec(rpi_board *); const char *rpi_board_soc(rpi_board *); int rpi_board_overvolt(rpi_board *); float rpi_soc_temp(void); rpiz_fields *rpi_board_fields(rpi_board *); #endif
/*************************************************************************** * KBlocks, a falling blocks game for KDE * * Copyright (C) 2010 University Freiburg * * * * 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 KBLOCKSAIEVALUATION_H #define KBLOCKSAIEVALUATION_H #include "KBlocksAITypeDefine.h" #include "EvaluationInterface.h" #include "../KBlocksField.h" enum DecisionFeatureEnumeration { DF_HEIGHT_MAX, DF_PEEKS_COUNT, DF_BLOCK_SCAN, DF_LAYER_SCAN, DF_CREATING_TETRIS, DF_REMOVE_TETRIS, DF_DEEP_NARROW }; bool getDecisionFeature(const DecisionFeatureEnumeration, KBlocksField*); /****************************************************** **** Evaluation Function ************************* *******************************************************/ class BaseEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static BaseEvaluation *instance() { if ( _instance == 0 ) { _instance = new BaseEvaluation(); } return _instance; } CLASSNAME(BaseEvaluation) private: BaseEvaluation(){}; ~BaseEvaluation(){}; static BaseEvaluation *_instance; }; /*###################################################*/ class HalfBaseEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static HalfBaseEvaluation *instance() { if ( _instance == 0 ) { _instance = new HalfBaseEvaluation(); } return _instance; } CLASSNAME(HalfBaseEvaluation) private: HalfBaseEvaluation(){}; ~HalfBaseEvaluation(){}; static HalfBaseEvaluation *_instance; }; /*###################################################*/ class WellsFillerEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static WellsFillerEvaluation *instance() { if ( _instance == 0 ) { _instance = new WellsFillerEvaluation(); } return _instance; } CLASSNAME(WellsFillerEvaluation) private: WellsFillerEvaluation(){}; ~WellsFillerEvaluation(){}; static WellsFillerEvaluation *_instance; }; /*###################################################*/ class HeightKillerEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static HeightKillerEvaluation *instance() { if ( _instance == 0 ) { _instance = new HeightKillerEvaluation(); } return _instance; } CLASSNAME(HeightKillerEvaluation) private: HeightKillerEvaluation(){}; ~HeightKillerEvaluation(){}; static HeightKillerEvaluation *_instance; }; /*###################################################*/ class BlockRemoverEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static BlockRemoverEvaluation *instance() { if ( _instance == 0 ) { _instance = new BlockRemoverEvaluation(); } return _instance; } CLASSNAME(BlockRemoverEvaluation) private: BlockRemoverEvaluation(){}; ~BlockRemoverEvaluation(){}; static BlockRemoverEvaluation *_instance; }; /*###################################################*/ class DeepNarrowRemoverEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static DeepNarrowRemoverEvaluation *instance() { if ( _instance == 0 ) { _instance = new DeepNarrowRemoverEvaluation(); } return _instance; } CLASSNAME(DeepNarrowRemoverEvaluation) private: DeepNarrowRemoverEvaluation(){}; ~DeepNarrowRemoverEvaluation(){}; static DeepNarrowRemoverEvaluation *_instance; }; /*###################################################*/ class TetrisPreparingEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static TetrisPreparingEvaluation *instance() { if ( _instance == 0 ) { _instance = new TetrisPreparingEvaluation(); } return _instance; } CLASSNAME(TetrisPreparingEvaluation) private: TetrisPreparingEvaluation(){}; ~TetrisPreparingEvaluation(){}; static TetrisPreparingEvaluation *_instance; }; /*###################################################*/ class TetrisEliminationEvaluation : public EvaluationInterface { public: double evaluate(KBlocksField*); static TetrisEliminationEvaluation *instance() { if ( _instance == 0 ) { _instance = new TetrisEliminationEvaluation(); } return _instance; } CLASSNAME(TetrisEliminationEvaluation) private: TetrisEliminationEvaluation(){}; ~TetrisEliminationEvaluation(){}; static TetrisEliminationEvaluation *_instance; }; /*###################################################*/ class NBSEvaluation : public SpecialEvaluationInterface { public: double evaluate(KBlocksField*); static NBSEvaluation *instance() { if ( _instance == 0 ) { _instance = new NBSEvaluation(); } return _instance; } CLASSNAME(NBSEvaluation) private: NBSEvaluation(){}; ~NBSEvaluation(){}; static NBSEvaluation *_instance; }; /*###################################################*/ #endif //KBLOCKSAIEVALUATION_H
/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * as published by the Free Software Foundation. * * This 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 version 2 for more details (a copy is included * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. * * GPL HEADER END */ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. */ #define DEBUG_SUBSYSTEM S_LNET #include <lnet/lib-lnet.h> #include <lnet/lib-dlc.h> static int config_on_load = 0; module_param(config_on_load, int, 0444); MODULE_PARM_DESC(config_on_load, "configure network at module load"); static struct mutex lnet_config_mutex; static int lnet_configure(void *arg) { /* 'arg' only there so I can be passed to cfs_create_thread() */ int rc = 0; mutex_lock(&lnet_config_mutex); if (!the_lnet.ln_niinit_self) { rc = try_module_get(THIS_MODULE); if (rc != 1) goto out; rc = LNetNIInit(LNET_PID_LUSTRE); if (rc >= 0) { the_lnet.ln_niinit_self = 1; rc = 0; } else { module_put(THIS_MODULE); } } out: mutex_unlock(&lnet_config_mutex); return rc; } static int lnet_unconfigure (void) { int refcount; mutex_lock(&lnet_config_mutex); if (the_lnet.ln_niinit_self) { the_lnet.ln_niinit_self = 0; LNetNIFini(); module_put(THIS_MODULE); } mutex_lock(&the_lnet.ln_api_mutex); refcount = the_lnet.ln_refcount; mutex_unlock(&the_lnet.ln_api_mutex); mutex_unlock(&lnet_config_mutex); return (refcount == 0) ? 0 : -EBUSY; } static int lnet_dyn_configure(struct libcfs_ioctl_hdr *hdr) { struct lnet_ioctl_config_data *conf = (struct lnet_ioctl_config_data *)hdr; int rc; mutex_lock(&lnet_config_mutex); if (the_lnet.ln_niinit_self) rc = lnet_dyn_add_ni(LNET_PID_LUSTRE, conf); else rc = -EINVAL; mutex_unlock(&lnet_config_mutex); return rc; } static int lnet_dyn_unconfigure(struct libcfs_ioctl_hdr *hdr) { struct lnet_ioctl_config_data *conf = (struct lnet_ioctl_config_data *) hdr; int rc; mutex_lock(&lnet_config_mutex); if (the_lnet.ln_niinit_self) rc = lnet_dyn_del_ni(conf->cfg_net); else rc = -EINVAL; mutex_unlock(&lnet_config_mutex); return rc; } static int lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_hdr *hdr) { int rc; switch (cmd) { case IOC_LIBCFS_CONFIGURE: { struct libcfs_ioctl_data *data = (struct libcfs_ioctl_data *)hdr; the_lnet.ln_nis_from_mod_params = data->ioc_flags; return lnet_configure(NULL); } case IOC_LIBCFS_UNCONFIGURE: return lnet_unconfigure(); case IOC_LIBCFS_ADD_NET: return lnet_dyn_configure(hdr); case IOC_LIBCFS_DEL_NET: return lnet_dyn_unconfigure(hdr); default: /* Passing LNET_PID_ANY only gives me a ref if the net is up * already; I'll need it to ensure the net can't go down while * I'm called into it */ rc = LNetNIInit(LNET_PID_ANY); if (rc >= 0) { rc = LNetCtl(cmd, hdr); LNetNIFini(); } return rc; } } DECLARE_IOCTL_HANDLER(lnet_ioctl_handler, lnet_ioctl); static int __init lnet_init(void) { int rc; ENTRY; mutex_init(&lnet_config_mutex); rc = lnet_lib_init(); if (rc != 0) { CERROR("lnet_lib_init: error %d\n", rc); RETURN(rc); } rc = libcfs_register_ioctl(&lnet_ioctl_handler); LASSERT(rc == 0); if (config_on_load) { /* Have to schedule a separate thread to avoid deadlocking * in modload */ (void)kthread_run(lnet_configure, NULL, "lnet_initd"); } RETURN(0); } static void __exit lnet_exit(void) { int rc; rc = libcfs_deregister_ioctl(&lnet_ioctl_handler); LASSERT(rc == 0); lnet_lib_exit(); } MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>"); MODULE_DESCRIPTION("Lustre Networking layer"); MODULE_VERSION(LNET_VERSION); MODULE_LICENSE("GPL"); module_init(lnet_init); module_exit(lnet_exit);
/* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Error codes used by most functions returning (int) error codes within SUPPL */ #ifndef __ERRCODES_H #define __ERRCODES_H #define ESUPPL_NONE 0 /* no error */ #define ESUPPL_OK 0 /* no error */ #define ESUPPL_ZERO 0 /* no error */ #define ESUPPL_MEM 1 /* out of memory */ #define ESUPPL_NOMEM ESUPPL_MEM /* env: environment segment too small */ #define ESUPPL_MISSINFO 2 /* missing information */ #define ESUPPL_FPATH 30 /* ill-formed filename path */ #define ESUPPL_FACCESS 31 /* file access error */ #define ESUPPL_INIT 40 /* Not initialized */ #define ESUPPL_INVAL 50 /* Invalid argument, argument out of range */ #define ESUPPL_INVENV 51 /* Invalid environment */ #define ESUPPL_RANGE 52 /* Result too large */ /* env: returned string too large for buffer */ #define ESUPPL_NOENV 53 /* No environment at all */ #define ESUPPL_NOENT 55 /* No entry / no such file or directory */ /* env: no such variable / string */ #endif
#ifndef QUPROPERTYTABLE_H #define QUPROPERTYTABLE_H #include <QTableWidget> #include <QVariant> #include <QStringList> #include "QU.h" #include "QUFieldDelegate.h" class QTableWidgetItem; class QURemoteImageSource; class QUPropertyTable: public QTableWidget { Q_OBJECT public: QUPropertyTable(QURemoteImageSource *src, QWidget *parent = 0); protected: QURemoteImageSource* source() const { return _imageSource; } void initKeyColumn(); void initValueColumn(); void initSeparator(const QString &text, int row); QTableWidgetItem* keyItem(const QString &text); void setValueItem(int row, const QString &key, const QVariant &value, QUFieldDelegate::EditMode mode, const QStringList &allValues = QStringList(), const QString &helpText = QString()); private slots: void processPropertyEditing(QTableWidgetItem*); void skipReadOnlyCells(int, int, int, int); private: QURemoteImageSource *_imageSource; }; #endif // QUPROPERTYTABLE_H
/* Bare metal C program to initialize the onboard 512MB MIcron DDR3 RAM * on BBB and place the stack on RAM. * * @author: muteX023 */ #include "../common/bbb_hal.h" u32 hola; void init() { hal_init_led(); hal_usr_led_on(0); hal_init_ddr3_ram(); /* test the first 1MB DDR RAM onboard BBB * it will take long time to test all 512MB (around 20 min !) */ if(hal_ram_test(0xDEADCAFE, 1024 * 1024)) hal_usr_led_on(1); /* return to asm startup code. */ return; } void main() { static u32 jumba; hal_usr_led_on(3); /* test BSS - using the uninitalized static and global vars * the startup C should take care of initializing global and static * uninitialized variables to zero - which is actually done by * just zeroing out the bss segment in the asm code */ jumba += 3; hola += 3; if (jumba + hola == 6) hal_usr_led_off(0); while(1); }
#ifndef ORB_CORE_EXPORT_H #define ORB_CORE_EXPORT_H MateCORBASmallSkeleton get_small_skel_CORBA_Object (PortableServer_Servant servant, const char *opname, gpointer *m_data, gpointer *impl); #endif /* ORB_CORE_EXPORT_H */
#include <linux/module.h> #include <linux/vermagic.h> #include <linux/compiler.h> MODULE_INFO(vermagic, VERMAGIC_STRING); __visible struct module __this_module __attribute__((section(".gnu.linkonce.this_module"))) = { .name = KBUILD_MODNAME, .init = init_module, #ifdef CONFIG_MODULE_UNLOAD .exit = cleanup_module, #endif .arch = MODULE_ARCH_INIT, }; MODULE_INFO(intree, "Y"); static const struct modversion_info ____versions[] __used __attribute__((section("__versions"))) = { { 0xb95b937f, __VMLINUX_SYMBOL_STR(module_layout) }, { 0x19cbafdb, __VMLINUX_SYMBOL_STR(unregister_nls) }, { 0x474f6707, __VMLINUX_SYMBOL_STR(__register_nls) }, { 0x2e5810c6, __VMLINUX_SYMBOL_STR(__aeabi_unwind_cpp_pr1) }, { 0xb1ad28e0, __VMLINUX_SYMBOL_STR(__gnu_mcount_nc) }, }; static const char __module_depends[] __used __attribute__((section(".modinfo"))) = "depends="; MODULE_INFO(srcversion, "F9966840CF61711A1E55A09");
#include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> #include "definitions.h" #include "interpretor/interpretor.h" #include "launch/modifications.h" int main(int argc, char *argv[]){ processeur liste_processeur[16][16]; adresse j1,j2 ; int nbTours = 20; srand(time(NULL)); j1.x = 0; j1.y = 0; j2.x = 0; j2.y = 1; creer_liste(liste_processeur,argc,argv,j1,j2,C1,C2); printf("Combien de tours de jeu voulez-vous ??\n"); scanf("%d",&nbTours); jeu( liste_processeur, nbTours); controle_victoire(liste_processeur,*(short int *)&liste_processeur[j1.x][j1.y].ram[1],*(short int *)&liste_processeur[j2.x][j2.y].ram[1]); return 1; }
/* ***** BEGIN LICENSE BLOCK ***** * * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved. * * The contents of this file, and the files included with this file, * are subject to the current version of the RealNetworks Public * Source License (the "RPSL") available at * http://www.helixcommunity.org/content/rpsl unless you have licensed * the file under the current version of the RealNetworks Community * Source License (the "RCSL") available at * http://www.helixcommunity.org/content/rcsl, in which case the RCSL * will apply. You may also obtain the license terms directly from * RealNetworks. You may not use this file except in compliance with * the RPSL or, if you have a valid RCSL with RealNetworks applicable * to this file, the RCSL. Please see the applicable RPSL or RCSL for * the rights, obligations and limitations governing use of the * contents of the file. * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the * "GPL") in which case the provisions of the GPL are applicable * instead of those above. If you wish to allow use of your version of * this file only under the terms of the GPL, and not to allow others * to use your version of this file under the terms of either the RPSL * or RCSL, indicate your decision by deleting the provisions above * and replace them with the notice and other provisions required by * the GPL. If you do not delete the provisions above, a recipient may * use your version of this file under the terms of any one of the * RPSL, the RCSL or the GPL. * * This file is part of the Helix DNA Technology. RealNetworks is the * developer of the Original Code and owns the copyrights in the * portions it created. * * This file, and the files included with this file, is distributed * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET * ENJOYMENT OR NON-INFRINGEMENT. * * Technology Compatibility Kit Test Suite(s) Location: * http://www.helixcommunity.org/content/tck * * Contributor(s): * * ***** END LICENSE BLOCK ***** */ #ifndef FAKEAUDIODEVICE_H #define FAKEAUDIODEVICE_H // Includes #include "hxausvc.h" #include "hxengin.h" // Defines typedef enum _HXFakeAudioDeviceState { HXFakeAudioDeviceStateClosed, HXFakeAudioDeviceStateOpened, HXFakeAudioDeviceStatePaused, HXFakeAudioDeviceStateResumed } HXFakeAudioDeviceState; class CHXFakeAudioDevice : public IHXAudioDevice, public IHXCallback { public: CHXFakeAudioDevice(IUnknown* pContext, UINT32 ulGranularity); virtual ~CHXFakeAudioDevice(); // IUnknown methods STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj); STDMETHOD_(ULONG32,AddRef) (THIS); STDMETHOD_(ULONG32,Release) (THIS); // IHXAudioDevice methods STDMETHOD(Open) (THIS_ const HXAudioFormat* pAudioFormat, IHXAudioDeviceResponse* pStreamResponse); STDMETHOD(Close) (THIS_ const HXBOOL bFlush); STDMETHOD(Resume) (THIS); STDMETHOD(Pause) (THIS); STDMETHOD(Write) (THIS_ const HXAudioData* pAudioData); STDMETHOD_(HXBOOL,InitVolume) (THIS_ const UINT16 uMinVolume, const UINT16 uMaxVolume); STDMETHOD(SetVolume) (THIS_ const UINT16 uVolume); STDMETHOD_(UINT16,GetVolume) (THIS); STDMETHOD(Reset) (THIS); STDMETHOD(Drain) (THIS); STDMETHOD(CheckFormat) (THIS_ const HXAudioFormat* pAudioFormat); STDMETHOD(GetCurrentAudioTime) (THIS_ REF(ULONG32) ulCurrentTime); // IHXCallback methods STDMETHOD(Func) (THIS); // CHXFakeAudioDevice methods static HX_RESULT STDAPICALLTYPE HXCreateFakeAudioDevice(IUnknown* pContext, UINT32 ulGranularity, REF(IHXAudioDevice*) rpAudioDevice); HXFakeAudioDeviceState GetFakeAudioDeviceState() { return m_eState; } protected: IUnknown* m_pContext; IHXScheduler* m_pScheduler; INT32 m_lRefCount; HXAudioFormat m_AudioFormat; IHXAudioDeviceResponse* m_pResponse; UINT16 m_usVolume; UINT16 m_usMinVolume; UINT16 m_usMaxVolume; Timeval* m_pCallbackTime; UINT32 m_ulLastCallbackTime; UINT32 m_ulLastCallbackTick; UINT32 m_ulGranularity; CallbackHandle m_CallbackID; HXFakeAudioDeviceState m_eState; void ClearCallback(); }; #endif /* #ifndef FAKEAUDIODEVICE_H */
/* * cpuplugd - Linux for System z Hotplug Daemon * * CPU hotplug functions * * Copyright IBM Corp 2007, 2011 * Author(s): Gerald Schaefer <gerald.schaefer@de.ibm.com> * Hans-Joachim Picht <hans@linux.vnet.ibm.com> */ #include <limits.h> #include "cpuplugd.h" /* * Return overall number of available cpus. This does not necessarily * mean that those are currently online */ int get_numcpus() { int i; char path[PATH_MAX]; int number = 0; for (i = 0; i <= MAX_CPU; i++) { /* check whether file exists and is readable */ sprintf(path, "/sys/devices/system/cpu/cpu%d/online", i); if (access(path, R_OK) == 0) number++; } return number; } /* * Return number of online cpus */ int get_num_online_cpus() { FILE *filp; int i; char path[PATH_MAX]; int status = 0; int value_of_onlinefile, rc; for (i = 0; i <= get_numcpus(); i++) { /* check wether file exists and is readable */ sprintf(path, "/sys/devices/system/cpu/cpu%d/online", i); if (access(path, R_OK) != 0) continue; filp = fopen(path, "r"); if (!filp) cpuplugd_exit("Cannot open cpu online file: " "%s\n", strerror(errno)); else { rc = fscanf(filp, "%d", &value_of_onlinefile); if (rc != 1) cpuplugd_exit("Cannot read cpu online file: " "%s\n", strerror(errno)); if (value_of_onlinefile == 1) status++; } fclose(filp); } return status; } /* * Enable a certain cpu */ int hotplug(int cpuid) { FILE *filp; char path[PATH_MAX]; int status, rc; sprintf(path, "/sys/devices/system/cpu/cpu%d/online", cpuid); if (access(path, W_OK) == 0) { filp = fopen(path, "w"); if (!filp) cpuplugd_exit("Cannot open cpu online file: %s\n", strerror(errno)); fprintf(filp, "1"); fclose(filp); /* * check if the attempt to enable the cpus really worked */ filp = fopen(path, "r"); rc = fscanf(filp, "%d", &status); if (rc != 1) cpuplugd_exit("Cannot open cpu online file: %s\n", strerror(errno)); fclose(filp); if (status == 1) { cpuplugd_debug("cpu with id %d enabled\n", cpuid); return 1; } else { cpuplugd_debug("failed to enable cpu with id %d\n", cpuid); return -1; } } else { cpuplugd_error("hotplugging cpu with id %d failed\n", cpuid); return -1; } return -1; } /* * Disable a certain cpu */ int hotunplug(int cpuid) { FILE *filp; int state, rc; int retval = -1; char path[PATH_MAX]; state = -1; sprintf(path, "/sys/devices/system/cpu/cpu%d/online", cpuid); if (access(path, W_OK) == 0) { filp = fopen(path, "w"); fprintf(filp, "0"); fclose(filp); /* * Check if the attempt to enable the cpus really worked */ filp = fopen(path, "r"); rc = fscanf(filp, "%d", &state); if (rc != 1) cpuplugd_error("Failed to disable cpu with id %d\n", cpuid); fclose(filp); if (state == 0) return 1; } else { cpuplugd_error("unplugging cpu with id %d failed\n", cpuid); } return retval; } /* * Check if a certain cpu is currently online */ int is_online(int cpuid) { FILE *filp; int state; int retval, rc; char path[PATH_MAX]; retval = -1; sprintf(path, "/sys/devices/system/cpu/cpu%d/online", cpuid); if (access(path, R_OK) == 0) { filp = fopen(path, "r"); rc = fscanf(filp, "%d", &state); if (rc == 1) { if (state == 1) retval = 1; if (state == 0) retval = 0; fclose(filp); } } return retval; } /* * Cleanup method. If the daemon is stopped, we (re)activate all cpus */ void reactivate_cpus() { /* * Only enable the number of cpus which where * available at daemon startup time */ int cpuid, nc; cpuid = 0; /* suppress verbose messages on exit */ debug = 0; /* * We check for num_cpu_start != 0 because we might want to * clean up, before we queried for the number on cpus at * startup */ if (num_cpu_start == 0) return; while (get_num_online_cpus() != num_cpu_start && cpuid < MAX_CPU) { nc = get_num_online_cpus(); if (nc == num_cpu_start) return; if (nc > num_cpu_start && is_online(cpuid) == 1) hotunplug(cpuid); if (nc < num_cpu_start && is_online(cpuid) == 0) hotplug(cpuid); cpuid++; } } /* * In kernels > 2.6.24 cpus can be deconfigured. The following functions is used * to check if a certain cpus is in a deconfigured state. */ int cpu_is_configured(int cpuid) { FILE *filp; int retval, state, rc; char path[4096]; retval = -1; sprintf(path, "/sys/devices/system/cpu/cpu%d/configure", cpuid); if (access(path, R_OK) == 0) { filp = fopen(path, "r"); rc = fscanf(filp, "%d", &state); if (rc == 1) { if (state == 1) retval = 1; if (state == 0) retval = 0; fclose(filp); } } return retval; }
/* * Compressed RAM block device * * Copyright (C) 2008, 2009, 2010 Nitin Gupta * * This code is released using a dual license strategy: BSD/GPL * You can choose the licence that better fits your requirements. * * Released under the terms of 3-clause BSD License * Released under the terms of GNU General Public License Version 2.0 * * Project home: http://compcache.googlecode.com */ #ifndef _ZRAM_DRV_H_ #define _ZRAM_DRV_H_ #include <linux/spinlock.h> #include <linux/mutex.h> #include "../zsmalloc/zsmalloc.h" /* * Some arbitrary value. This is just to catch * invalid value for num_devices module parameter. */ static const unsigned max_num_devices = 32; /*-- Configurable parameters */ /* * Pages that compress to size greater than this are stored * uncompressed in memory. */ static const size_t max_zpage_size = PAGE_SIZE / 4 * 3; static const unsigned default_disksize_perc_ram = 25; /* * NOTE: max_zpage_size must be less than or equal to: * ZS_MAX_ALLOC_SIZE. Otherwise, zs_malloc() would * always return failure. */ /*-- End of configurable params */ #define SECTOR_SHIFT 9 #define SECTOR_SIZE (1 << SECTOR_SHIFT) #define SECTORS_PER_PAGE_SHIFT (PAGE_SHIFT - SECTOR_SHIFT) #define SECTORS_PER_PAGE (1 << SECTORS_PER_PAGE_SHIFT) #define ZRAM_LOGICAL_BLOCK_SHIFT 12 #define ZRAM_LOGICAL_BLOCK_SIZE (1 << ZRAM_LOGICAL_BLOCK_SHIFT) #define ZRAM_SECTOR_PER_LOGICAL_BLOCK \ (1 << (ZRAM_LOGICAL_BLOCK_SHIFT - SECTOR_SHIFT)) /* Flags for zram pages (table[page_no].flags) */ enum zram_pageflags { /* Page consists entirely of zeros */ ZRAM_ZERO, __NR_ZRAM_PAGEFLAGS, }; /*-- Data structures */ /* Allocated for each disk page */ struct table { unsigned long handle; u16 size; /* object size (excluding header) */ u8 count; /* object ref count (not yet used) */ u8 flags; } __aligned(4); struct zram_stats { u64 compr_size; /* compressed size of pages stored */ u64 num_reads; /* failed + successful */ u64 num_writes; /* --do-- */ u64 failed_reads; /* should NEVER! happen */ u64 failed_writes; /* can happen when memory is too low */ u64 invalid_io; /* non-page-aligned I/O requests */ u64 notify_free; /* no. of swap slot free notifications */ u32 pages_zero; /* no. of zero filled pages */ u32 pages_stored; /* no. of pages currently stored */ u32 good_compress; /* % of pages with compression ratio<=50% */ u32 bad_compress; /* % of pages with compression ratio>=75% */ }; struct zram_meta { void *compress_workmem; void *compress_buffer; struct table *table; struct zs_pool *mem_pool; }; struct zram { struct zram_meta *meta; spinlock_t stat64_lock; /* protect 64-bit stats */ struct rw_semaphore lock; /* protect compression buffers and table * against concurrent read and writes */ struct request_queue *queue; struct gendisk *disk; int init_done; /* Prevent concurrent execution of device init, reset and R/W request */ struct rw_semaphore init_lock; /* * This is the limit on amount of *uncompressed* worth of data * we can store in a disk. */ u64 disksize; /* bytes */ struct zram_stats stats; }; extern struct zram *zram_devices; unsigned int zram_get_num_devices(void); #ifdef CONFIG_SYSFS extern struct attribute_group zram_disk_attr_group; #endif extern void zram_reset_device(struct zram *zram); extern struct zram_meta *zram_meta_alloc(u64 disksize); extern void zram_meta_free(struct zram_meta *meta); extern void zram_init_device(struct zram *zram, struct zram_meta *meta); #endif
/* Copyright (c) 2012, Alexey Saenko Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef RENDER_H #define RENDER_H #include "math2d.h" #include "color.h" #include "VBO.h" #include "FBO.h" #include "Shader.h" #include "Texture.h" #include "Font.h" #include <vector> class World; class RenderResource; static const unsigned int ATTRIB_POSITION = 0; static const unsigned int ATTRIB_TEXCOORD = 1; static const unsigned int ATTRIB_LEVEL = 6; static const unsigned int ATTRIB_NORMAL = 7; struct V2TV2Vert { vec2 v, tv; V2TV2Vert() {} V2TV2Vert(const vec2& av, const vec2& atv): v(av), tv(atv) {} }; class Render { friend class RenderResource; int width, height; float aspect, scale; rect bounds; VBOVertex circleVBO; VBOIndex plantVBOIndex, linkVBOIndex; FBO fbo, blurFbo1, blurFbo2, fboNoise, fboBackground; VertexShader flatVertShader, stdVertShader, treeVertShader, linkVertShader, planetVertShader, noiseVertShader, blackHoleVertShader, fontVertShader; FragmentShader blurFragShader, finalFragShader, finalFragShader2, stdFragShader, treeFragShader, linkFragShader, backgroundFragShader, planetFragShader, noiseFragShader, blackHoleFragShader, fontFragShader, boobleFragShader; ShaderProgram blurShaderProgram, finalShaderProgram, finalShaderProgram2, stdShaderProgram, treeShaderProgram, linkShaderProgram, backgroundShaderProgram, planetShaderProgram, noiseShaderProgram, blackHoleShaderProgram, fontShaderProgram, boobleShaderProgram; mat4 transform; ShaderProgram *curShader; float animate, deform; Texture planetTexture; Font titleFont, simpleFont; int noiseStride; void generatePlanetTexture(int size); void generateCircleVerts(); void draw(World &world, FBO *renderTarget); Render(); virtual ~Render(); public: static Render &instance(); static void destroy(); void reshape(int w, int h); static void release(); void draw(World &world); void makeScreenshot(World &world); void drawChapteSShotBegin(const char *text, const color4 &tc); void drawChapteSShotEnd(const color4 &c); void drawBegin(const vec2 &pos = vec2(0.0f)); void drawEnd(FBO *renderTarget=0); void beginBooble(const mat4 &transform); void setStdShader(const mat4 &transform); void beginFont(const mat4 &transform); Font& getFont() { return titleFont; } Font& getSimpleFont() { return simpleFont; } float getAspect() { return aspect; } void setShader(ShaderProgram *sp); void setColor(const color4 &c); void setTreeShaderSeed(int seed); void setShaderSeed(float seed); void setDeform(bool t); void drawArrow(const vec2 &p1, const vec2 &p2, float arrowSize, const color4 &col); void drawUnlink(const vec2 &p1, const vec2 &p2, float size); void drawCurrentRace(const color4& col); void drawCircle(const mat4& transform, const vec2& p, float r); void drawCircle(const vec2& p, float r) { drawCircle(transform, p, r); } const rect &getBounds() { return bounds; } void drawRect(const rect &r, const color4& c); void fade(float v); void bindPlantVBOIndex() { plantVBOIndex.bind(); } void bindLinkVBOIndex() { linkVBOIndex.bind(); } }; #endif
// Ext2MgrDlg.h : header file // #if !defined(AFX_EXT2MGRDLG_H__EACC693E_C531_48BA_A0FD_4AFB090CCB29__INCLUDED_) #define AFX_EXT2MGRDLG_H__EACC693E_C531_48BA_A0FD_4AFB090CCB29__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "SysTray.h" #include "Toolbar.h" #include "splash.h" #include "donate.h" #include "TreeList.h" #include "HyperLink.h" #include "Mountpoints.h" #include "Properties.h" #include "ServiceManage.h" #include "Ext2Attribute.h" #include "PerfStatDlg.h" ///////////////////////////////////////////////////////////////////////////// // CExt2List window class CExt2List : public CListCtrl { // Construction public: CExt2List(); // Attributes public: CPoint m_Point; // Operations public: int QuerySubItemText(int item, CHAR *Data, int length); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CExt2List) //}}AFX_VIRTUAL // Implementation public: virtual ~CExt2List(); // Generated message map functions protected: //{{AFX_MSG(CExt2List) afx_msg void OnRButtonDown(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// // CExt2MgrDlg dialog class CDlgView; class CExt2MgrDlg : public CDialog { // Construction public: CExt2MgrDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CExt2MgrDlg) enum { IDD = IDD_EXT2MGR_DIALOG }; CTreeList m_DiskView; CExt2List m_VolumeList; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CExt2MgrDlg) public: virtual BOOL PreTranslateMessage(MSG* pMsg); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); //}}AFX_VIRTUAL public: /* routines */ PVOID QuerySelectedItem(PBOOL bIsExt2); VOID DriversChangeNotify(ULONG, BOOL); VOID DriverLetterChangeNotify(CHAR, BOOL); VOID DriverChangeNotify(PEXT2_LETTER, BOOL); VOID UpdateVolume(PEXT2_VOLUME volume); VOID UpdateCdrom(PEXT2_CDROM cdrom) ; VOID UpdatePartition(PEXT2_PARTITION part); VOID RegisterDeviceInterface(GUID, PHDEVNOTIFY); VOID OnFlush(); VOID OnPartType(); VOID OnRemoveDeadLetter(); VOID OnKeyupVolumeList(); VOID OnKeyupDiskList(); ULONG m_type; PVOID m_sdev; /* attributes */ CSplash * m_splash; CMenu m_Menu; CFont m_MSSanS; BOOL m_bHide; BOOL m_bQuiet; BOOL m_bService; BOOL m_bStat; CPerfStatDlg * m_PerfDlg; // Implementation protected: HICON m_hIcon; CSystemTray m_Tray; CStatusBar m_bar; CImageList m_ImageList; BOOL m_bFsStarted; BOOL m_bHandleChange; BOOL m_bFocusVolume; BOOL m_bFocusDisk; LONG m_IndexVolume; LONG m_IndexDisk; HACCEL m_hAccel; HDEVNOTIFY m_hUsbNotify; /* global parameters */ ULONG m_nStartmode; CString m_Codepage; BOOL m_bExt3Writable; BOOL m_bReadonly; CString m_srvStatus; CString m_sPrefix; CString m_sSuffix; BOOL m_bAutoMount; // Generated message map functions //{{AFX_MSG(CExt2MgrDlg) virtual BOOL OnInitDialog(); virtual void OnWindowPosChanging(WINDOWPOS* lpwndpos); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD dwData); afx_msg void OnDestroy(); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnChangeProperty(); afx_msg void OnRefresh(); afx_msg void OnFormat(); afx_msg void OnService(); virtual void OnCancel(); afx_msg void OnAbout(); afx_msg void OnExit(); virtual void OnOK(); afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct); afx_msg void OnDblclkDiskList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnKillfocusDiskList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnRclickDiskList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDblclkVolumeList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnKillfocusVolumeList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnRclickVolumeList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnClickDiskList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnClickVolumeList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnSetfocusDiskList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnSetfocusVolumeList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnProperty(); afx_msg void OnDonate(); afx_msg void OnCopy(); afx_msg void OnInstallService(); afx_msg void OnRemoveService(); afx_msg void OnEnableAutorun(); afx_msg void OnDisableAutorun(); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnDrvLetter(); afx_msg void OnDrvQuickMount(); afx_msg void OnShowMain(); afx_msg void OnHelp(); afx_msg void OnPerfStat(); afx_msg void OnPerfStop(); afx_msg void OnCopyAll(); //}}AFX_MSG afx_msg LRESULT OnTrayNotification(WPARAM wParam=0,LPARAM lParam=0); afx_msg LRESULT OnTerminate(WPARAM wParam=0,LPARAM lParam=0); afx_msg LRESULT OnMountPointNotify(WPARAM wParam=0,LPARAM lParam=0); DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_EXT2MGRDLG_H__EACC693E_C531_48BA_A0FD_4AFB090CCB29__INCLUDED_)
/* * Copyright (c) 1991,1992,1995 Linus Torvalds * Copyright (c) 1994 Alan Modra * Copyright (c) 1995 Markus Kuhn * Copyright (c) 1996 Ingo Molnar * Copyright (c) 1998 Andrea Arcangeli * Copyright (c) 2002,2006 Vojtech Pavlik * Copyright (c) 2003 Andi Kleen * */ #include <linux/clockchips.h> #include <linux/interrupt.h> #include <linux/i8253.h> #include <linux/time.h> #include <linux/mca.h> #include <asm/vsyscall.h> #include <asm/x86_init.h> #include <asm/i8259.h> #include <asm/timer.h> #include <asm/hpet.h> #include <asm/time.h> #ifdef CONFIG_X86_64 DEFINE_VVAR(volatile unsigned long, jiffies) = INITIAL_JIFFIES; #endif unsigned long profile_pc(struct pt_regs *regs) { unsigned long pc = instruction_pointer(regs); if (!user_mode_vm(regs) && in_lock_functions(pc)) { #ifdef CONFIG_FRAME_POINTER return *(unsigned long *)(regs->bp + sizeof(long)); #else unsigned long *sp = (unsigned long *)kernel_stack_pointer(regs); /* * Return address is either directly at stack pointer * or above a saved flags. Eflags has bits 22-31 zero, * kernel addresses don't. */ if (sp[0] >> 22) return sp[0]; if (sp[1] >> 22) return sp[1]; #endif } return pc; } EXPORT_SYMBOL(profile_pc); /* * Default timer interrupt handler for PIT/HPET */ static irqreturn_t timer_interrupt(int irq, void *dev_id) { /* Keep nmi watchdog up to date */ inc_irq_stat(irq0_irqs); global_clock_event->event_handler(global_clock_event); /* MCA bus quirk: Acknowledge irq0 by setting bit 7 in port 0x61 */ if (MCA_bus) outb_p(inb_p(0x61)| 0x80, 0x61); return IRQ_HANDLED; } static struct irqaction irq0 = { .handler = timer_interrupt, .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, .name = "timer" }; void __init setup_default_timer_irq(void) { setup_irq(0, &irq0); } /* Default timer init function */ void __init hpet_time_init(void) { if (!hpet_enable()) setup_pit_timer(); setup_default_timer_irq(); } static __init void x86_late_time_init(void) { x86_init.timers.timer_init(); tsc_init(); } /* * Initialize TSC and delay the periodic timer init to * late x86_late_time_init() so ioremap works. */ void __init time_init(void) { late_time_init = x86_late_time_init; }
/********************************************************* * Copyright (C) 1998-2014 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation version 2 and no later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *********************************************************/ /* * vm_asm.h * * asm macros */ #ifndef _VM_ASM_H_ #define _VM_ASM_H_ #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #ifdef VM_ARM_64 #include "vm_asm_arm64.h" #else #include "vm_basic_asm.h" #include "x86msr.h" #ifdef VM_X86_64 #include "vm_asm_x86_64.h" #else #include "vm_asm_x86.h" #endif static INLINE void SET_FS64(uint64 fs64) { __SET_MSR(MSR_FSBASE, fs64); } static INLINE void SET_GS64(uint64 gs64) { __SET_MSR(MSR_GSBASE, gs64); } static INLINE void SET_KernelGS64(uint64 kgs64) { __SET_MSR(MSR_KERNELGSBASE, kgs64); } static INLINE uint64 GET_FS64(void) { return __GET_MSR(MSR_FSBASE); } static INLINE uint64 GET_GS64(void) { return __GET_MSR(MSR_GSBASE); } static INLINE uint64 GET_KernelGS64(void) { return __GET_MSR(MSR_KERNELGSBASE); } #endif // VM_ARM_64 #endif
/* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: salwan.searty REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. Steps: 1. Set up a handler for signal SIGABRT, such that it is called if signal is ever raised. 2. Call sighold on that SIGABRT. 3. Raise a SIGABRT and verify that the signal handler was not called. Otherwise, the test exits with unresolved results. 4. Call sigrelse on SIGABRT. 5. Verify that the handler gets called this time. */ #define _XOPEN_SOURCE 600 #include <signal.h> #include <stdio.h> #include <unistd.h> #include "posixtest.h" int handler_called = 0; void handler(int signo) { handler_called = 1; } int main() { struct sigaction act; act.sa_handler = handler; act.sa_flags = 0; sigemptyset(&act.sa_mask); if (sigaction(SIGABRT, &act, 0) == -1) { perror("Unexpected error while attempting to setup test " "pre-conditions"); return PTS_UNRESOLVED; } sighold(SIGABRT); if (raise(SIGABRT) == -1) { perror("Unexpected error while attempting to setup test " "pre-conditions"); return PTS_UNRESOLVED; } if (handler_called) { printf("UNRESOLVED. possible problem in sigrelse\n"); return PTS_UNRESOLVED; } if (sigrelse(SIGABRT) == -1) { printf("UNRESOLVED. possible problem in sigrelse\n"); return PTS_UNRESOLVED; } sleep(1); if (handler_called) { printf("PASS: SIGABRT successfully removed from signal mask\n"); return PTS_PASS; } printf("FAIL\n"); return PTS_FAIL; }
/* * device.h * * Created on: 18 feb. 2015 * Author: enjschreuder */ #ifndef DEVICE_H_ #define DEVICE_H_ #include <stdbool.h> #include "bsl.h" typedef struct { bsl_object_t * bsl_object_p; unsigned int chip_id; unsigned int bsl_version; } device_object_t; typedef struct { bool main_memory; bool information_memory; bool segment_a; } device_memory_sections_t; device_object_t * device_construct(bsl_object_t * bsl_object_p); void device_destroy(device_object_t * device_object_p); int device_initialize(device_object_t * device_object_p, const unsigned char * password); void device_terminate(device_object_t * object_p); unsigned int device_get_chip_id(device_object_t * object_p); unsigned int device_get_bsl_version(device_object_t * object_p); int device_read_memory(device_object_t * object_p, unsigned short address, unsigned char * data, size_t length); int device_write_memory(device_object_t *object_p, unsigned short address, const unsigned char * data, size_t length); int device_erase_memory(device_object_t *object_p, device_memory_sections_t memory_sections); #endif /* DEVICE_H_ */
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code 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. Quake III Arena source code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Quake III Arena source code; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ // // This file must be identical in the quake and utils directories // contents flags are seperate bits // a given brush can contribute multiple content bits // these definitions also need to be in q_shared.h! #define CONTENTS_SOLID 1 // an eye is never valid in a solid #define CONTENTS_LAVA 8 #define CONTENTS_SLIME 16 #define CONTENTS_WATER 32 #define CONTENTS_FOG 64 #define CONTENTS_NOTTEAM1 0x0080 #define CONTENTS_NOTTEAM2 0x0100 #define CONTENTS_NOBOTCLIP 0x0200 #define CONTENTS_AREAPORTAL 0x8000 #define CONTENTS_PLAYERCLIP 0x10000 #define CONTENTS_MONSTERCLIP 0x20000 //bot specific contents types #define CONTENTS_TELEPORTER 0x40000 #define CONTENTS_JUMPPAD 0x80000 #define CONTENTS_CLUSTERPORTAL 0x100000 #define CONTENTS_DONOTENTER 0x200000 #define CONTENTS_BOTCLIP 0x400000 #define CONTENTS_MOVER 0x800000 #define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity #define CONTENTS_BODY 0x2000000 // should never be on a brush, only in game #define CONTENTS_CORPSE 0x4000000 #define CONTENTS_DETAIL 0x8000000 // brushes not used for the bsp #define CONTENTS_STRUCTURAL 0x10000000 // brushes used for the bsp #define CONTENTS_TRANSLUCENT 0x20000000 // don't consume surface fragments inside #define CONTENTS_TRIGGER 0x40000000 #define CONTENTS_NODROP 0x80000000 // don't leave bodies or items (death fog, lava) #define SURF_NODAMAGE 0x1 // never give falling damage #define SURF_SLICK 0x2 // effects game physics #define SURF_SKY 0x4 // lighting from environment map #define SURF_LADDER 0x8 #define SURF_NOIMPACT 0x10 // don't make missile explosions #define SURF_NOMARKS 0x20 // don't leave missile marks #define SURF_FLESH 0x40 // make flesh sounds and effects #define SURF_NODRAW 0x80 // don't generate a drawsurface at all #define SURF_HINT 0x100 // make a primary bsp splitter #define SURF_SKIP 0x200 // completely ignore, allowing non-closed brushes #define SURF_NOLIGHTMAP 0x400 // surface doesn't need a lightmap #define SURF_POINTLIGHT 0x800 // generate lighting info at vertexes #define SURF_METALSTEPS 0x1000 // clanking footsteps #define SURF_NOSTEPS 0x2000 // no footstep sounds #define SURF_NONSOLID 0x4000 // don't collide against curves with this set #define SURF_LIGHTFILTER 0x8000 // act as a light filter during q3map -light #define SURF_ALPHASHADOW 0x10000 // do per-pixel light shadow casting in q3map #define SURF_NODLIGHT 0x20000 // don't dlight even if solid (solid lava, skies) #define SURF_DUST 0x40000 // leave a dust trail when walking on this surface #define SURF_MENU 0x80000
/* vim: set cino= fo=croql sw=8 ts=8 sts=0 noet cin fdm=syntax : */ /* * Copyright (c) 2010, 2011 Ali Polatel <alip@exherbo.org> * * This file is part of Pandora's Box. pandora 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. * * pandora 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 SLIST_H #define SLIST_H 1 #include <stdlib.h> #include <sys/queue.h> /* Generic singly-linked list based on sys/queue.h */ struct snode { void *data; SLIST_ENTRY(snode) up; }; SLIST_HEAD(slist, snode); typedef struct slist slist_t; #define SLIST_FLUSH(var, head, field, freedata) \ do { \ while ((var = SLIST_FIRST(head))) { \ SLIST_REMOVE_HEAD(head, field); \ freedata(var->data); \ free(var); \ } \ SLIST_INIT(head); \ } while (0) #endif /* !SLIST_H */
/*************************************************************************** * Copyright (C) 2007-2014 by Glen Masgai * * mimosius@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 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 CSLTTS_H #define CSLTTS_H #define CSL_TTS_DEFAULT_VOLUME 50 class CSL_DLL_GUITOOLS CslTTSSettings : public wxObject { public: CslTTSSettings(bool enabled = true, wxInt32 volume = CSL_TTS_DEFAULT_VOLUME) { Create(enabled, volume); } bool operator==(const CslTTSSettings& settings) const { return Enabled == settings.Enabled && Volume == settings.Volume; } bool operator!=(const CslTTSSettings& settings) const { return !(*this == settings); } bool IsEmpty() const { return !Enabled || Volume<0; } void Create(bool enabled = true, wxInt32 volume = CSL_TTS_DEFAULT_VOLUME) { Enabled = enabled; Volume = volume; } bool Enabled; wxInt32 Volume; private: DECLARE_DYNAMIC_CLASS(CslTTSMessage) }; CSL_DLL_GUITOOLS extern const CslTTSSettings CslTTSEmptySettings; class CSL_DLL_GUITOOLS CslTTSMessage : public wxObject { public: CslTTSMessage(const wxString& text = wxEmptyString, const CslTTSSettings& settings = CslTTSEmptySettings) { Create(text, settings); } void Create(const wxString& text = wxEmptyString, const CslTTSSettings& settings = CslTTSEmptySettings) { Text = text; Settings = settings; } wxString Text; CslTTSSettings Settings; private: DECLARE_DYNAMIC_CLASS(CslTTSMessage) }; WX_DEFINE_USER_EXPORTED_ARRAY(CslTTSMessage*, CslArrayCslTTSMessage, class CSL_DLL_GUITOOLS); #if defined(__WXMAC__) || defined(__WXMSW__) class CSL_DLL_GUITOOLS CslTTS : public wxEvtHandler #else class CslTTS #endif { public: static bool Init(const CslTTSSettings& settings); static bool DeInit(); static bool IsOk() { return GetInstance().m_ok; } static bool IsEnabled() { return GetInstance().m_settings.Enabled; } static wxInt32 GetVolume() { return GetInstance().m_settings.Volume; } static CslTTSSettings GetSettings() { return GetInstance().m_settings; } static void SetSettings(const CslTTSSettings& settings) { GetInstance().m_settings = settings; } static bool Say(const wxString& text, const CslTTSSettings& settings = CslTTSEmptySettings); private: CslTTS(); CslTTS(const CslTTS& tts) { } static CslTTS& GetInstance(); static bool SetVolume(wxInt32 volume); bool ApplySettings(const CslTTSSettings& settings); #if defined(__WXMSW__) || defined(__WXMAC__) #ifdef __WXMSW__ static void wxCALLBACK OnProcessed(WPARAM wParam, LPARAM lParam); #endif #ifdef __WXMAC__ static void OnProcessed(SpeechChannel channel, void *data); #endif bool Process(CslTTSMessage *message = NULL); void OnIdle(wxIdleEvent& event); CslArrayCslTTSMessage m_messages; wxCriticalSection m_messagesCritSection; #endif bool m_ok; CslTTSSettings m_settings; }; #endif
//========================== Open Steamworks ================================ // // This file is part of the Open Steamworks project. All individuals associated // with this project do not claim ownership of the contents // // The code, comments, and all related files, projects, resources, // redistributables included with this project are Copyright Valve Corporation. // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition // Zero are trademarks and or registered trademarks of Valve Corporation. // All other trademarks are property of their respective owners. // //============================================================================= #ifndef GAMESERVERCOMMON_H #define GAMESERVERCOMMON_H #ifdef _WIN32 #pragma once #endif #define STEAMGAMESERVER_INTERFACE_VERSION_002 "SteamGameServer002" #define STEAMGAMESERVER_INTERFACE_VERSION_003 "SteamGameServer003" #define STEAMGAMESERVER_INTERFACE_VERSION_004 "SteamGameServer004" #define STEAMGAMESERVER_INTERFACE_VERSION_005 "SteamGameServer005" #define STEAMGAMESERVER_INTERFACE_VERSION_006 "SteamGameServer006" #define STEAMGAMESERVER_INTERFACE_VERSION_007 "SteamGameServer007" #define STEAMGAMESERVER_INTERFACE_VERSION_008 "SteamGameServer008" #define STEAMGAMESERVER_INTERFACE_VERSION_009 "SteamGameServer009" #define STEAMGAMESERVER_INTERFACE_VERSION_010 "SteamGameServer010" #define STEAMGAMESERVER_INTERFACE_VERSION_011 "SteamGameServer011" #define STEAMGAMESERVER_INTERFACE_VERSION_012 "SteamGameServer012" // Result codes to GSHandleClientDeny/Kick enum EDenyReason { k_EDenyInvalid = 0, k_EDenyInvalidVersion = 1, k_EDenyGeneric = 2, k_EDenyNotLoggedOn = 3, k_EDenyNoLicense = 4, k_EDenyCheater = 5, k_EDenyLoggedInElseWhere = 6, k_EDenyUnknownText = 7, k_EDenyIncompatibleAnticheat = 8, k_EDenyMemoryCorruption = 9, k_EDenyIncompatibleSoftware = 10, k_EDenySteamConnectionLost = 11, k_EDenySteamConnectionError = 12, k_EDenySteamResponseTimedOut = 13, k_EDenySteamValidationStalled = 14, k_EDenySteamOwnerLeftGuestUser = 15, }; #pragma pack( push, 8 ) // client has been approved to connect to this game server struct GSClientApprove_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 1 }; CSteamID m_SteamID; }; // client has been denied to connection to this game server struct GSClientDeny_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 2 }; CSteamID m_SteamID; EDenyReason m_eDenyReason; char m_pchOptionalText[ 128 ]; }; // request the game server should kick the user struct GSClientKick_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 3 }; CSteamID m_SteamID; EDenyReason m_eDenyReason; }; // client has been denied to connect to this game server because of a Steam2 auth failure struct GSClientSteam2Deny_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 4 }; uint32 m_UserID; ESteamError m_eSteamError; }; // client has been accepted by Steam2 to connect to this game server struct GSClientSteam2Accept_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 5 }; uint32 m_UserID; uint64 m_SteamID; }; // client achievement info struct GSClientAchievementStatus_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 6 }; CSteamID m_SteamID; char m_pchAchievement[ 128 ]; bool m_bUnlocked; }; // GS gameplay stats info struct GSGameplayStats_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 7 }; EResult m_eResult; // Result of the call int32 m_nRank; // Overall rank of the server (0-based) uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server }; // send as a reply to RequestUserGroupStatus() struct GSClientGroupStatus_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 8 }; CSteamID m_SteamIDUser; CSteamID m_SteamIDGroup; bool m_bMember; bool m_bOfficer; }; // Sent as a reply to GetServerReputation() struct GSReputation_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 9 }; EResult m_eResult; // Result of the call; uint32 m_unReputationScore; // The reputation score for the game server bool m_bBanned; // True if the server is banned from the Steam // master servers // The following members are only filled out if m_bBanned is true. They will all // be set to zero otherwise. Master server bans are by IP so it is possible to be // banned even when the score is good high if there is a bad server on another port. // This information can be used to determine which server is bad. uint32 m_unBannedIP; // The IP of the banned server uint16 m_usBannedPort; // The port of the banned server uint64 m_ulBannedGameID; // The game ID the banned server is serving uint32 m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) }; // Sent as a reply to AssociateWithClan() struct AssociateWithClanResult_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 10 }; EResult m_eResult; // Result of the call; }; // Sent as a reply to ComputeNewPlayerCompatibility() struct ComputeNewPlayerCompatibilityResult_t { enum { k_iCallback = k_iSteamGameServerCallbacks + 11 }; EResult m_eResult; // Result of the call; int m_cPlayersThatDontLikeCandidate; int m_cPlayersThatCandidateDoesntLike; int m_cClanPlayersThatDontLikeCandidate; CSteamID m_SteamIDCandidate; }; // received when the game server requests to be displayed as secure (VAC protected) // m_bSecure is true if the game server should display itself as secure to users, false otherwise struct GSPolicyResponse_t { enum { k_iCallback = k_iSteamUserCallbacks + 15 }; uint8 m_bSecure; }; #pragma pack( pop ) #endif // GAMESERVERCOMMON_H
/* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is the Netscape Portable Runtime (NSPR). * * The Initial Developer of the Original Code is Netscape * Communications Corporation. Portions created by Netscape are * Copyright (C) 1999-2000 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the * "GPL"), in which case the provisions of the GPL are applicable * instead of those above. If you wish to allow use of your * version of this file only under the terms of the GPL and not to * allow others to use your version of this file under the MPL, * indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by * the GPL. If you do not delete the provisions above, a recipient * may use your version of this file under either the MPL or the * GPL. */ #ifndef prshma_h___ #define prshma_h___ #include "prtypes.h" #include "prio.h" #include "prproces.h" PR_BEGIN_EXTERN_C NSPR_API( PRFileMap *) PR_OpenAnonFileMap( const char *dirName, PRSize size, PRFileMapProtect prot ); NSPR_API(PRStatus) PR_ProcessAttrSetInheritableFileMap( PRProcessAttr *attr, PRFileMap *fm, const char *shmname ); NSPR_API( PRFileMap *) PR_GetInheritedFileMap( const char *shmname ); NSPR_API( PRStatus ) PR_ExportFileMapAsString( PRFileMap *fm, PRSize bufsize, char *buf ); #define PR_FILEMAP_STRING_BUFSIZE 128 NSPR_API( PRFileMap * ) PR_ImportFileMapFromString( const char *fmstring ); PR_END_EXTERN_C #endif
/* base model for a client regions on an imageview */ /* Copyright (C) 1991-2003 The National Gallery 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 */ /* These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk */ #define TYPE_IREGIONGROUP (iregiongroup_get_type()) #define IREGIONGROUP( obj ) \ (G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_IREGIONGROUP, iRegiongroup )) #define IREGIONGROUP_CLASS( klass ) \ (G_TYPE_CHECK_CLASS_CAST( (klass), \ TYPE_IREGIONGROUP, iRegiongroupClass)) #define IS_IREGIONGROUP( obj ) \ (G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_IREGIONGROUP )) #define IS_IREGIONGROUP_CLASS( klass ) \ (G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_IREGIONGROUP )) #define IREGIONGROUP_GET_CLASS( obj ) \ (G_TYPE_INSTANCE_GET_CLASS( (obj), \ TYPE_IREGIONGROUP, iRegiongroupClass )) struct _iRegiongroup { Classmodel parent_class; }; typedef struct _iRegiongroupClass { ClassmodelClass parent_class; /* My methods. */ } iRegiongroupClass; GType iregiongroup_get_type( void ); iRegiongroup *iregiongroup_new( Classmodel *classmodel );
#include <linux/module.h> #include <linux/threads.h> #include <linux/smp.h> #include <linux/sched.h> #include <linux/elfcore.h> #include <linux/string.h> #include <linux/interrupt.h> #include <linux/screen_info.h> #include <linux/vt_kern.h> #include <linux/nvram.h> #include <linux/console.h> #include <linux/irq.h> #include <linux/pci.h> #include <linux/delay.h> #include <linux/ide.h> #include <linux/bitops.h> #include <asm/page.h> #include <asm/semaphore.h> #include <asm/processor.h> #include <asm/uaccess.h> #include <asm/io.h> #include <asm/ide.h> #include <asm/atomic.h> #include <asm/checksum.h> #include <asm/pgtable.h> #include <asm/tlbflush.h> #include <linux/adb.h> #include <linux/cuda.h> #include <linux/pmu.h> #include <asm/prom.h> #include <asm/system.h> #include <asm/pci-bridge.h> #include <asm/irq.h> #include <asm/pmac_feature.h> #include <asm/dma.h> #include <asm/machdep.h> #include <asm/hw_irq.h> #include <asm/nvram.h> #include <asm/mmu_context.h> #include <asm/backlight.h> #include <asm/time.h> #include <asm/cputable.h> #include <asm/btext.h> #include <asm/div64.h> #include <asm/signal.h> #ifdef CONFIG_8xx #include <asm/commproc.h> #endif #ifdef CONFIG_PPC32 extern void transfer_to_handler(void); extern void do_IRQ(struct pt_regs *regs); extern void machine_check_exception(struct pt_regs *regs); extern void alignment_exception(struct pt_regs *regs); extern void program_check_exception(struct pt_regs *regs); extern void single_step_exception(struct pt_regs *regs); extern int sys_sigreturn(struct pt_regs *regs); EXPORT_SYMBOL(clear_pages); EXPORT_SYMBOL(ISA_DMA_THRESHOLD); EXPORT_SYMBOL(DMA_MODE_READ); EXPORT_SYMBOL(DMA_MODE_WRITE); EXPORT_SYMBOL(__div64_32); EXPORT_SYMBOL(do_signal); EXPORT_SYMBOL(transfer_to_handler); EXPORT_SYMBOL(do_IRQ); EXPORT_SYMBOL(machine_check_exception); EXPORT_SYMBOL(alignment_exception); EXPORT_SYMBOL(program_check_exception); EXPORT_SYMBOL(single_step_exception); EXPORT_SYMBOL(sys_sigreturn); #endif EXPORT_SYMBOL(strcpy); EXPORT_SYMBOL(strncpy); EXPORT_SYMBOL(strcat); EXPORT_SYMBOL(strlen); EXPORT_SYMBOL(strcmp); EXPORT_SYMBOL(strcasecmp); EXPORT_SYMBOL(strncasecmp); EXPORT_SYMBOL(csum_partial); EXPORT_SYMBOL(csum_partial_copy_generic); EXPORT_SYMBOL(ip_fast_csum); EXPORT_SYMBOL(csum_tcpudp_magic); EXPORT_SYMBOL(__copy_tofrom_user); EXPORT_SYMBOL(__clear_user); EXPORT_SYMBOL(__strncpy_from_user); EXPORT_SYMBOL(__strnlen_user); #ifdef CONFIG_PPC64 EXPORT_SYMBOL(copy_4K_page); #endif #if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)) EXPORT_SYMBOL(ppc_ide_md); #endif #if defined(CONFIG_PCI) && defined(CONFIG_PPC32) EXPORT_SYMBOL(isa_io_base); EXPORT_SYMBOL(isa_mem_base); EXPORT_SYMBOL(pci_dram_offset); EXPORT_SYMBOL(pci_alloc_consistent); EXPORT_SYMBOL(pci_free_consistent); EXPORT_SYMBOL(pci_bus_io_base); EXPORT_SYMBOL(pci_bus_io_base_phys); EXPORT_SYMBOL(pci_bus_mem_base_phys); EXPORT_SYMBOL(pci_bus_to_hose); #endif /* CONFIG_PCI */ EXPORT_SYMBOL(start_thread); EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(giveup_fpu); #ifdef CONFIG_ALTIVEC EXPORT_SYMBOL(giveup_altivec); #endif /* CONFIG_ALTIVEC */ #ifdef CONFIG_SPE EXPORT_SYMBOL(giveup_spe); #endif /* CONFIG_SPE */ #ifndef CONFIG_PPC64 EXPORT_SYMBOL(flush_instruction_cache); EXPORT_SYMBOL(flush_tlb_kernel_range); EXPORT_SYMBOL(flush_tlb_page); EXPORT_SYMBOL(_tlbie); #endif EXPORT_SYMBOL(__flush_icache_range); EXPORT_SYMBOL(flush_dcache_range); #ifdef CONFIG_SMP #ifdef CONFIG_PPC32 EXPORT_SYMBOL(smp_hw_index); #endif #endif #ifdef CONFIG_ADB EXPORT_SYMBOL(adb_request); EXPORT_SYMBOL(adb_register); EXPORT_SYMBOL(adb_unregister); EXPORT_SYMBOL(adb_poll); EXPORT_SYMBOL(adb_try_handler_change); #endif /* CONFIG_ADB */ #ifdef CONFIG_ADB_CUDA EXPORT_SYMBOL(cuda_request); EXPORT_SYMBOL(cuda_poll); #endif /* CONFIG_ADB_CUDA */ #ifdef CONFIG_VT EXPORT_SYMBOL(kd_mksound); #endif EXPORT_SYMBOL(to_tm); #ifdef CONFIG_PPC32 long long __ashrdi3(long long, int); long long __ashldi3(long long, int); long long __lshrdi3(long long, int); EXPORT_SYMBOL(__ashrdi3); EXPORT_SYMBOL(__ashldi3); EXPORT_SYMBOL(__lshrdi3); #endif EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memmove); EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(memchr); #if defined(CONFIG_FB_VGA16_MODULE) EXPORT_SYMBOL(screen_info); #endif #ifdef CONFIG_PPC32 EXPORT_SYMBOL(timer_interrupt); EXPORT_SYMBOL(irq_desc); EXPORT_SYMBOL(tb_ticks_per_jiffy); EXPORT_SYMBOL(console_drivers); EXPORT_SYMBOL(cacheable_memcpy); #endif #ifdef CONFIG_8xx EXPORT_SYMBOL(cpm_install_handler); EXPORT_SYMBOL(cpm_free_handler); #endif /* CONFIG_8xx */ #if defined(CONFIG_8xx) || defined(CONFIG_40x) EXPORT_SYMBOL(__res); #endif #ifdef CONFIG_PPC32 EXPORT_SYMBOL(next_mmu_context); EXPORT_SYMBOL(set_context); #endif #ifdef CONFIG_PPC_STD_MMU_32 extern long mol_trampoline; EXPORT_SYMBOL(mol_trampoline); /* For MOL */ EXPORT_SYMBOL(flush_hash_pages); /* For MOL */ #ifdef CONFIG_SMP extern int mmu_hash_lock; EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */ #endif /* CONFIG_SMP */ extern long *intercept_table; EXPORT_SYMBOL(intercept_table); #endif /* CONFIG_PPC_STD_MMU_32 */ #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) EXPORT_SYMBOL(__mtdcr); EXPORT_SYMBOL(__mfdcr); #endif
#ifndef _TABLECREATOR_H_ #define _TABLECREATOR_H_ //#include "sheetCreater.h" int crTablmain() { int retCode = 0; char month[3] = ""; char yearAS[3] = ""; printf("SHEETCRT:: Please Enter Month For Which attendanceSheet is to be created:"); scanf ("%s",&month); printf("SHEETCRT:: Please Enter Year for which attendanceSheet is to be created:"); scanf ("%s", &yearAS); retCode=attendanceSheetCreater(month, yearAS); return 0; } #endif //TABLECREATOR_H_
#if !defined(AFX_REPLACEDLG_H__C4AA924C_7D56_45AB_BDE6_4E179A9AA961__INCLUDED_) #define AFX_REPLACEDLG_H__C4AA924C_7D56_45AB_BDE6_4E179A9AA961__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // ReplaceDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CReplaceDlg dialog class CReplaceDlg : public CDialog { // Construction public: BOOL OnInitDialog(); CReplaceDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CReplaceDlg) enum { IDD = IDD_REPLACE_BOX }; CListCtrl m_flist1; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CReplaceDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: CImageList m_images; // Generated message map functions //{{AFX_MSG(CReplaceDlg) virtual void OnOK(); afx_msg void OnChangeRpFind(); afx_msg void OnReplace(); afx_msg void OnReplaceAll(); virtual void OnCancel(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_REPLACEDLG_H__C4AA924C_7D56_45AB_BDE6_4E179A9AA961__INCLUDED_)
#ifndef __view_h__ #define __view_h__ #include <tdehtml_part.h> #include "glossary.h" #include "navigator.h" class TDEActionCollection; namespace DOM { class Node; } namespace KHC { class Formatter; class View : public TDEHTMLPart { Q_OBJECT public: View( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, TDEHTMLPart::GUIProfile prof, TDEActionCollection *col ); ~View(); virtual bool openURL( const KURL &url ); virtual void saveState( TQDataStream &stream ); virtual void restoreState( TQDataStream &stream ); enum State { Docu, About, Search }; int state() const { return mState; } TQString title() const { return mTitle; } static TQString langLookup( const TQString &fname ); void beginSearchResult(); void writeSearchResult( const TQString & ); void endSearchResult(); void beginInternal( const KURL & ); KURL internalUrl() const; int zoomStepping() const { return m_zoomStepping; } Formatter *formatter() const { return mFormatter; } void copySelectedText(); public slots: void lastSearch(); void slotIncFontSizes(); void slotDecFontSizes(); void slotReload( const KURL &url = KURL() ); void slotCopyLink(); bool nextPage(bool checkOnly = false); bool prevPage(bool checkOnly = false); signals: void searchResultCacheAvailable(); protected: bool eventFilter( TQObject *o, TQEvent *e ); private slots: void setTitle( const TQString &title ); void showMenu( const TQString& url, const TQPoint& pos); private: void showAboutPage(); KURL urlFromLinkNode( const DOM::Node &n ) const; int mState; TQString mTitle; TQString mSearchResult; KURL mInternalUrl; int m_zoomStepping; Formatter *mFormatter; TDEActionCollection *mActionCollection; TQString mCopyURL; }; } #endif // vim:ts=2:sw=2:et
/* ------------------------------------------------------------------------- */ /* i2c-mips-gpio.c i2c-hw access */ /* ------------------------------------------------------------------------- */ /* Improved version by Michael Schoeberl, 2008 - fixed the I2C bus handling - requires only 2 pins (SCL/SDA) - both pins needs a 10 kOhm pullup This is based on previous versions done by John Newbigin, Simon G. Vogl and Nekmech aka datenritter. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ------------------------------------------------------------------------- */ #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/module.h> #include <linux/init.h> #include <linux/stddef.h> #include <linux/i2c.h> #include <linux/i2c-algo-bit.h> #define DEFAULT_GPIO_SCL 4 #define DEFAULT_GPIO_SDA 3 // this is just the default, those are module paramers static int gpio_scl = DEFAULT_GPIO_SCL; static int gpio_sda = DEFAULT_GPIO_SDA; #define GPIO_SCL (1 << gpio_scl) #define GPIO_SDA (1 << gpio_sda) #ifndef __exit #define __exit __init #endif typedef unsigned int uint32; static volatile uint32 *gpioaddr_input = (uint32 *)0xb8000060; static volatile uint32 *gpioaddr_output = (uint32 *)0xb8000064; static volatile uint32 *gpioaddr_enable = (uint32 *)0xb8000068; static volatile uint32 *gpioaddr_control = (uint32 *)0xb800006c; // for the line to go high we need to release it (there is a pullup!) static void bit_gpio_set(unsigned int mask) { unsigned int port_state; // signal quality tweak: we drive it high for a short // time and then release it - this improves rise time port_state = *gpioaddr_output; port_state |= mask; *gpioaddr_output = port_state; port_state = *gpioaddr_enable; port_state &= ~mask; *gpioaddr_enable = port_state; } static void bit_gpio_clear(unsigned int mask) { unsigned int port_state; // set pin to output and drive it to low port_state = *gpioaddr_enable; port_state |= mask; *gpioaddr_enable = port_state; port_state = *gpioaddr_output; port_state &= ~mask; *gpioaddr_output = port_state; } static int bit_gpio_get(int mask) { unsigned char port_state; port_state = *gpioaddr_input; return port_state & mask; } static void bit_gpio_setscl(void *data, int state) { if (state) { bit_gpio_set(GPIO_SCL); } else { bit_gpio_clear(GPIO_SCL); } } static void bit_gpio_setsda(void *data, int state) { if (state) { bit_gpio_set(GPIO_SDA); } else { bit_gpio_clear(GPIO_SDA); } } static int bit_gpio_getscl(void *data) { return bit_gpio_get(GPIO_SCL); } static int bit_gpio_getsda(void *data) { return bit_gpio_get(GPIO_SDA); } static int bit_gpio_reg(struct i2c_client *client) { return 0; } static int bit_gpio_unreg(struct i2c_client *client) { return 0; } static void bit_gpio_inc_use(struct i2c_adapter *adap) { MOD_INC_USE_COUNT; } static void bit_gpio_dec_use(struct i2c_adapter *adap) { MOD_DEC_USE_COUNT; } // Encapsulate the above functions in the correct operations structure. // This is only done when more than one hardware adapter is supported. static struct i2c_algo_bit_data bit_gpio_data = { NULL, bit_gpio_setsda, bit_gpio_setscl, bit_gpio_getsda, bit_gpio_getscl, 80, // udelay, half-clock-cycle time in microsecs, i.e. clock is (500 / udelay) KHz 80, // mdelay, in millisecs, unused 100, // timeout, in jiffies }; static struct i2c_adapter bit_gpio_ops = { "I2C GPIO", I2C_HW_B_LP, // bit algorithm adapter "Phillips style" NULL, &bit_gpio_data, bit_gpio_inc_use, bit_gpio_dec_use, bit_gpio_reg, bit_gpio_unreg, }; int __init i2c_bitgpio_init(void) { unsigned char gpio_outen; printk(KERN_INFO "i2c-mpis-gpio.o: I2C GPIO module, SCL %d, SDA %d\n", gpio_scl, gpio_sda); // I'm still not sure why we do this, probably this needs cleanup on exit(?) gpio_outen = *gpioaddr_control; gpio_outen = gpio_outen & ~(GPIO_SCL | GPIO_SDA); *gpioaddr_control = gpio_outen; // set to high=input as default idle state bit_gpio_set(GPIO_SCL); bit_gpio_set(GPIO_SDA); // register bus if(i2c_bit_add_bus(&bit_gpio_ops) < 0) return -ENODEV; return 0; } void __exit i2c_bitgpio_exit(void) { // set to high=input as default idle state bit_gpio_set(GPIO_SCL); bit_gpio_set(GPIO_SDA); i2c_bit_del_bus(&bit_gpio_ops); } module_init(i2c_bitgpio_init); module_exit(i2c_bitgpio_exit); EXPORT_NO_SYMBOLS; MODULE_PARM(gpio_scl,"i"); MODULE_PARM_DESC(gpio_scl, "Number of GPIO wire used for SCL (default=5)."); MODULE_PARM(gpio_sda,"i"); MODULE_PARM_DESC(gpio_sda, "Number of GPIO wire used for SDA (default=6)."); MODULE_AUTHOR("Michael Schoeberl <openwrt@mailtonne.de>"); MODULE_DESCRIPTION("I2C-Bus adapter routines for GPIOs in openwrt"); MODULE_LICENSE("GPL"); #ifdef MODULE int init_module(void) { return i2c_bitgpio_init(); } void cleanup_module(void) { i2c_bitgpio_exit(); } #endif
/* * config_text.c * Copyright (C) 2018 Prashant A <prashant.barca@gmail.com> 2018-04-27 * */ #include<stdio.h> #include<string.h> #include<stdlib.h> #include<fcntl.h> #include<arpa/inet.h> #include<sys/types.h> #include<sys/socket.h> #include<sys/stat.h> #include<netinet/in.h> #include "C37_tools.h" int main() { int result = -1; uint8_t buf[128]; ssize_t read_bytes = read(stdin, buf, 128); result = data(buf, read_bytes); return 0; }
/* * awn-applet-gconf.h: awn applet preferences handling. * * Copyright (C) 2001-2003 Sun Microsystems, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Authors: * Mark McLoughlin <mark@skynet.ie> * Neil Jagdish Patel <njpatel@gmail.com> (Adapted for Awn) */ #ifndef __AWN_APPLET_GCONF_H__ #define __AWN_APPLET_GCONF_H__ #include <glib/gmacros.h> #include <glib/gerror.h> #include <gconf/gconf-value.h> #include <awn-applet.h> G_BEGIN_DECLS gchar *awn_applet_gconf_get_full_key (AwnApplet *applet, const gchar *key); void awn_applet_gconf_set_bool (AwnApplet *applet, const gchar *key, gboolean the_bool, GError **opt_error); void awn_applet_gconf_set_int (AwnApplet *applet, const gchar *key, gint the_int, GError **opt_error); void awn_applet_gconf_set_string (AwnApplet *applet, const gchar *key, const gchar *the_string, GError **opt_error); void awn_applet_gconf_set_float (AwnApplet *applet, const gchar *key, gdouble the_float, GError **opt_error); void awn_applet_gconf_set_list (AwnApplet *applet, const gchar *key, GConfValueType list_type, GSList *list, GError **opt_error); void awn_applet_gconf_set_value (AwnApplet *applet, const gchar *key, GConfValue *value, GError **opt_error); gboolean awn_applet_gconf_get_bool (AwnApplet *applet, const gchar *key, GError **opt_error); gint awn_applet_gconf_get_int (AwnApplet *applet, const gchar *key, GError **opt_error); gchar *awn_applet_gconf_get_string (AwnApplet *applet, const gchar *key, GError **opt_error); gdouble awn_applet_gconf_get_float (AwnApplet *applet, const gchar *key, GError **opt_error); GSList *awn_applet_gconf_get_list (AwnApplet *applet, const gchar *key, GConfValueType list_type, GError **opt_error); GConfValue *awn_applet_gconf_get_value (AwnApplet *applet, const gchar *key, GError **opt_error); G_END_DECLS #endif /* __AWN_APPLET_GCONF_H__ */
/* ASCEND modelling environment Copyright (C) 2007 Carnegie Mellon University 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, see <http://www.gnu.org/licenses/>. *//* @file Test registration function for the 'compiler' component. */ #include <test/common.h> #ifdef __cplusplus extern "C" { #endif PROTO_SUITE(integrator); #ifdef __cplusplus } #endif
/* sndcard.h - include the OSS' soundcard.h file This file is part of LibKMid 0.9.5 Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez LibKMid's homepage : http://www.arrakis.es/~rlarrosa/libkmid.html This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org> ***************************************************************************/ #ifndef _SNDCARD_H #define _SNDCARD_H #ifdef HAVE_CONFIG_H #include <config.h> #endif #ifdef HAVE_SYS_SOUNDCARD_H #include <sys/soundcard.h> #elif defined(HAVE_MACHINE_SOUNDCARD_H) #include <machine/soundcard.h> #endif /* Check for OSS MIDI API */ #if defined(SNDCTL_SEQ_NRSYNTHS) && defined(CTL_MAIN_VOLUME) #define HAVE_OSS_SUPPORT #else #undef HAVE_OSS_SUPPORT #endif #ifdef HAVE_OSS_SUPPORT #ifndef HZ #define HZ 100 #endif #ifndef MIDI_TYPE_MPU401 #define MIDI_TYPE_MPU401 0x401 #endif #else #define MIDI_NOTEON 0x80 #define MIDI_NOTEOFF 0x90 #define MIDI_KEY_PRESSURE 0xA0 #define MIDI_CTL_CHANGE 0xB0 #define MIDI_PGM_CHANGE 0xC0 #define MIDI_CHN_PRESSURE 0xD0 #define MIDI_PITCH_BEND 0xE0 #define MIDI_SYSTEM_PREFIX 0xF0 #define CTL_MAIN_VOLUME 7 #define SEQ_DEFINEBUF(a) #define SEQ_USE_EXTBUF() #define SEQ_MIDIOUT(a,b) {} #define SEQ_START_NOTE(a,b,c,d) {} #define SEQ_STOP_NOTE(a,b,c,d) {} #define SEQ_SET_PATCH(a,b,c) {} #define SEQ_CONTROL(a,b,c,d) {} #define SEQ_BENDER(a,b,c) {} #define SEQ_CHN_PRESSURE(a,b,c) {} #define SEQ_KEY_PRESSURE(a,b,c,d) {} #define SEQ_DUMPBUF() #define SEQ_WAIT_TIME(a) #define SEQ_START_TIMER() #define SEQ_STOP_TIMER() #define SEQ_CONTINUE_TIMER() #endif #endif
/* * objmgmt.h: Object caching system call stubs * * (C) 1998 Jens Albretsen, the Alliance Operating System Team * * HISTORY * Date Author Rev Notes * 11/12/98 jens 1.0 First full internal release * * 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 __SYS_STUBS_OBJMGMT_H #define __SYS_STUBS_OBJMGMT_H #include <typewrappers.h> #include "ckobjects.h" PUBLIC DATA CKcacheObjectKernelStub(DATA edi,DATA ebp,DATA e,DATA f,DATA ds,DATA a,DATA b,DATA c,DATA d,ADDR object,DATA signature,ADDR size,DATA flags) { return CKcacheObjectKernelCode(object, signature, size, flags); } PUBLIC DATA CKunCacheObjectKernelStub(DATA edi,DATA ebp,DATA e,DATA f,DATA ds,DATA a,DATA b,DATA c,DATA d,DESCRIPTOR object) { return CKunCacheObjectKernelCode(object); } #endif
// // OOSMOS TimeoutInUS Example // // Copyright (C) 2014-2016 OOSMOS, LLC // // 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 ("GPLv2"). // // This software may be used without the GPLv2 restrictions by entering // into a commercial license agreement with OOSMOS, LLC. // See <http://www.oosmos.com/licensing/>. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // #include <stdio.h> #include "oosmos.h" static const int WaitTimeUS = 1000 * 1000; // One second extern int main(void) { // // Allocate a Timeout object. // oosmos_sTimeout Timeout; // // Set timeout. // oosmos_TimeoutInUS(&Timeout, WaitTimeUS); printf("Waiting for %d microseconds...\n", WaitTimeUS); while (true) { // // Check if the time has expired. // if (oosmos_TimeoutHasExpired(&Timeout)) break; printf("Running...\n"); // // Be polite. Prevent 100% CPU usage on multi-tasked // machines (e.g. Windows or Linux). // oosmos_DelayMS(75); } printf("SUCCESS\n"); return 0; }