text
stringlengths
4
6.14k
// ********************************************************************** // // Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. // // ********************************************************************** #import <UIKit/UIKit.h> #import <DetailController.h> @protocol DemoLibraryPrx; @class WaitAlert; @interface AddController : DetailController { @private id<DemoLibraryPrx> library; } -(IBAction)cancel:(id)sender; -(IBAction)save:(id)sender; -(void)startEdit:(DemoBookDescription*)book library:(id<DemoLibraryPrx>)library; @end
/* * CINELERRA * Copyright (C) 2008 Adam Williams <broadcast at earthling dot 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 FILEAC3_H #define FILEAC3_H #include <stdio.h> #include <stdint.h> extern "C" { #include "libavcodec/avcodec.h" }; #include "filebase.h" #include "filempeg.inc" class FileAC3 : public FileBase { static int64_t get_channel_layout(int channels); public: FileAC3(Asset *asset, File *file); ~FileAC3(); int reset_parameters_derived(); static void get_parameters(BC_WindowBase *parent_window, Asset *asset, BC_WindowBase* &format_window, int audio_options, int video_options); static int check_sig(); int open_file(int rd, int wr); int close_file(); int read_samples(double *buffer, int64_t len); int write_samples(double **buffer, int64_t len); int get_index(char *index_path); private: // AVCodec *codec; // AVCodecContext *codec_context; void *codec; void *codec_context; FileMPEG *mpg_file; FILE *fd; int16_t *temp_raw; int temp_raw_allocated; int temp_raw_size; unsigned char *temp_compressed; int compressed_allocated; }; class AC3ConfigAudio : public BC_Window { public: AC3ConfigAudio(BC_WindowBase *parent_window, Asset *asset); void create_objects(); int close_event(); Asset *asset; BC_WindowBase *parent_window; char string[BCTEXTLEN]; }; class AC3ConfigAudioBitrate : public BC_PopupMenu { public: AC3ConfigAudioBitrate(AC3ConfigAudio *gui, int x, int y); void create_objects(); int handle_event(); static char* bitrate_to_string(char *string, int bitrate); AC3ConfigAudio *gui; }; #endif
/* filename: ISSP_Defs.h */ #include "issp_revision.h" #ifdef PROJECT_REV_1 /* Copyright 2006-2009, Cypress Semiconductor Corporation. // // This software is owned by Cypress Semiconductor Corporation (Cypress) // and is protected by and subject to worldwide patent protection (United // States and foreign), United States copyright laws and international // treaty provisions. Cypress hereby grants to licensee a personal, // non-exclusive, non-transferable license to copy, use, modify, create // derivative works of, and compile the Cypress Source Code and derivative // works for the sole purpose of creating custom software in support of // licensee product to be used only in conjunction with a Cypress integrated // circuit as specified in the applicable agreement. Any reproduction, // modification, translation, compilation, or representation of this // software except as specified above is prohibited without the express // written permission of Cypress. // // Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, // WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // Cypress reserves the right to make changes without further notice to the // materials described herein. Cypress does not assume any liability arising // out of the application or use of any product or circuit described herein. // Cypress does not authorize its products for use as critical components in // life-support systems where a malfunction or failure may reasonably be // expected to result in significant injury to the user. The inclusion of // Cypress� product in a life-support systems application implies that the // manufacturer assumes all risk of such use and in doing so indemnifies // Cypress against all charges. // // Use may be limited by and subject to the applicable Cypress software // license agreement. // //-------------------------------------------------------------------------- */ #ifndef INC_ISSP_DEFS #define INC_ISSP_DEFS #include "issp_directives.h" /* flash block is 128 bytes. Note Block-Verify Uses 64-Bytes of RAM */ #define TARGET_DATABUFF_LEN 128 #ifdef CONFIG_MACH_ACER_A4 #define SCLK_GPIO 32 #define SDATA_GPIO 151 #define XRES_GPIO 19 #else #define SCLK_GPIO 150 #define SDATA_GPIO 151 #define XRES_GPIO 181 #endif /* #define VDD_GPIO 31 */ /* The number of Flash blocks in each part is defined here. This is used in // main programming loop when programming and verifying the blocks. */ #ifdef CY8CTMA300 #define NUM_BANKS 1 #define BLOCKS_PER_BANK 256 #define SECURITY_BYTES_PER_BANK 64 #endif #ifdef CY8CTMA301D #define NUM_BANKS 1 #define BLOCKS_PER_BANK 128 #define SECURITY_BYTES_PER_BANK 64 #endif #ifdef CY8CTMA300E #define NUM_BANKS 1 #define BLOCKS_PER_BANK 256 #define SECURITY_BYTES_PER_BANK 64 #define ACTIVE_LOW_XRES #endif #ifdef CY8CTMA301E #define NUM_BANKS 1 #define BLOCKS_PER_BANK 128 #define SECURITY_BYTES_PER_BANK 64 #define ACTIVE_LOW_XRES #endif #endif /* (INC_ISSP_DEFS) */ #endif /* (PROJECT_REV_) */ /* end of file ISSP_Defs.h */
/* * FanControl * * Copyright (c) 2006-2012 Hendrik Holtmann * * MachineDefaults.m - MacBook(Pro) FanControl application * * 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 */ #import <Cocoa/Cocoa.h> #import "smcWrapper.h" @interface MachineDefaults : NSObject { NSString *machine; NSArray *supported_machines; Boolean supported; int machine_num; } + (NSString *)computerModel; - (instancetype)init:(NSString*)p_machine ; @property (NS_NONATOMIC_IOSONLY, getter=get_machine_defaults, readonly, copy) NSDictionary *_machine_defaults; @end
/* file: analyse.h Copyright (C) 1998-2004 Christophe GRENIER <grenier@cgsecurity.org> this software 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 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _ANALYSE_H #define _ANALYSE_H #ifdef __cplusplus extern "C" { #endif int search_type_0(const unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind); int search_type_1(const unsigned char *buffer, const disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind); int search_type_2(const unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind); int search_type_8(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind); int search_type_16(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind); int search_type_64(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind); int search_type_128(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind); int search_type_2048(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind); int search_exFAT_backup(unsigned char *buffer, disk_t *disk, partition_t *partition); int search_FAT_backup(unsigned char *buffer, disk_t *disk_car,partition_t *partition, const int verbose, const int dump_ind); int search_HFS_backup(unsigned char *buffer, disk_t *disk_car,partition_t *partition, const int verbose, const int dump_ind); int search_NTFS_backup(unsigned char *buffer, disk_t *disk_car,partition_t *partition, const int verbose, const int dump_ind); int check_linux(disk_t *disk, partition_t *partition, const int verbose); #ifdef __cplusplus } /* closing brace for extern "C" */ #endif #endif
#ifndef CHEAPOCT_H #define CHEAPOCT_H #define CHEAPOCT_URI "http://ssj71.github.io/infamousPlugins/plugs.html#cheapoct" enum cheapoct_ports { IN =0, OUT, TOL, WEIGHT, DBG }; #endif
/* packet-bthci_acl.h * * $Id: packet-bthci_acl.h 47632 2013-02-11 15:04:53Z etxrab $ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __PACKET_BTHCI_ACL_H__ #define __PACKET_BTHCI_ACL_H__ typedef struct _bthci_acl_data_t { guint32 interface_id; guint32 adapter_id; guint16 chandle; /* only low 12 bits used */ } bthci_acl_data_t; #endif /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
// // C++ Interface: k9newdvd // // Description: // // // Author: Jean-Michel PETIT <k9copy@free.fr>, (C) 2007 // // Copyright: See COPYING file that comes with this distribution // // #ifndef K9NEWDVD_H #define K9NEWDVD_H #include "k9common.h" #include <qobject.h> #include <qptrlist.h> #include <qdom.h> #include <qdatetime.h> #include "k9process.h" #include "k9progress.h" #include "k9avidecode.h" #include "k9config.h" /** @author Jean-Michel PETIT <k9copy@free.fr> */ class k9Title; class k9AviFile; class k9Menu; class k9ProcessList; class k9NewDVDItems : public QPtrList<k9Title> { protected: virtual int compareItems ( QPtrCollection::Item item1,QPtrCollection::Item item2 ); }; class k9NewDVD : public QObject { Q_OBJECT public: enum eFormat {NTSC=2,PAL=1}; k9NewDVD ( QObject *parent = 0, const char *name = 0 ); ~k9NewDVD(); k9NewDVDItems* getTitles() { return &m_titles; } eFormat m_format; void execute(); void createXML(); void addTitles ( QDomElement &_root ); void setFormat ( const eFormat& _value ); void setWorkDir ( const QString& _value ); void appendTitle ( k9Title *_title ); void setProcessList(k9ProcessList *_value); eFormat getFormat() const; int getTotalTime(); k9Menu* getRootMenu() const; QString getError() const; private: k9NewDVDItems m_titles; QStringList m_tmpFiles; QDomDocument *m_xml; QString m_workDir; k9ProcessList *m_processList; QTime m_timer; QTime m_timer2; QTime m_timer3; k9Menu *m_rootMenu; bool m_cancel; QString m_error; QString m_stdout; int m_videoBitrate; k9AviDecode m_aviDecode; int m_totalEncodedSize; int m_offset; int m_lastvalue; QMap <k9Process*,QTime> m_timers; void calcVideoBitrate(); void createMencoderCmd ( QString &_cmd,QString &_chapters, k9AviFile *_aviFile ); k9Config *m_config; protected slots: void getStdout ( KProcess *, char *, int ); void getStderr ( KProcess *, char *, int ); void drawImage ( QImage * _image ); signals: void sigAddTitle(); }; #endif
/*************************************************************************** clipboardinterface.h - description ------------------- begin : Sat Sep 13 2003 copyright : (C) 2003 by Friedrich W. H. Kossebau email : Friedrich.W.H@Kossebau.de ***************************************************************************/ /*************************************************************************** * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * * License version 2 as published by the Free Software Foundation. * * * ***************************************************************************/ #ifndef CLIPBOARDINTERFACE_H #define CLIPBOARDINTERFACE_H namespace KHE { /** * @short A simple interface for interaction with the clipboard * * This interface enables the interaction with the clipboard. It relies on the * possibilities of signal/slot so a class B that implements this interface * should be derived from QObject. When connecting to a signal or a slot * the class B has to be used, not the interface. * <p> * Example: * \code * KHE::ClipboardInterface *Clipboard = KHE::clipboardInterface( BytesEditWidget ); * if( Clipboard ) * { *   // Yes, use BytesEditWidget, not Clipboard, because that's the QObject, indeed hacky... *   connect( BytesEditWidget, SIGNAL(copyAvailable(bool)), this, SLOT(offerCopy(bool)) ); * } * \endcode * * @author Friedrich W. H. Kossebau <Friedrich.W.H@Kossebau.de> * @see createBytesEditWidget(), clipboardInterface() * @since 3.2 */ class ClipboardInterface { public: // slots /** tries to copy. If there is nothing to copy this call is a noop. */ virtual void copy() = 0; /** tries to cut. If there is nothing to cut this call is a noop. */ virtual void cut() = 0; /** tries to paste. * If there is nothing to paste or paste is not possible this call is a noop. * Use BytesEditInterface::isReadOnly() to find out if you can paste at all. */ virtual void paste() = 0; public: // signals /** signal: tells whether copy is possible or not. * Remember to use the created object, not the interface for connecting * Use BytesEditInterface::isReadOnly() to find out if you can also cut * As this function symbol serves as a signal, this is a noop. Don't use it * for anything else. */ virtual void copyAvailable(bool Really) = 0; }; /** tries to get the clipboard interface of t * @return a pointer to the interface, otherwise 0 * @author Friedrich W. H. Kossebau <Friedrich.W.H@Kossebau.de> * @since 3.2 */ template < class T > ClipboardInterface *clipboardInterface(T *t) { if(!t) return 0; return static_cast< ClipboardInterface * >(t->qt_cast("KHE::ClipboardInterface")); } } #endif
/* This file is part of the KDE libraries Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __ktexteditor_configinterfaceextension_h__ #define __ktexteditor_configinterfaceextension_h__ #include <qwidget.h> #include <qpixmap.h> #include <kicontheme.h> namespace KTextEditor { class KTEXTEDITOR_EXPORT ConfigPage : public QWidget { Q_OBJECT public: ConfigPage(QWidget *parent = 0, const char *name = 0); virtual ~ConfigPage(); // // slots !!! // public: /** Applies the changes to all documents */ virtual void apply() = 0; /** Reset the changes */ virtual void reset() = 0; /** Sets default options */ virtual void defaults() = 0; signals: /** Emitted when something changes */ void changed(); }; /** * This is an interface to extend the configuration of the * Document, Plugin and PluginViewInterface classes. */ class KTEXTEDITOR_EXPORT ConfigInterfaceExtension { friend class PrivateConfigInterfaceExtension; public: ConfigInterfaceExtension(); virtual ~ConfigInterfaceExtension(); unsigned int configInterfaceExtensionNumber() const; protected: void setConfigInterfaceExtensionDCOPSuffix(const QCString &suffix); // // slots !!! // public: /** Number of available config pages */ virtual uint configPages() const = 0; /** returns config page with the given number, config pages from 0 to configPages()-1 are available if configPages() > 0 */ virtual ConfigPage *configPage(uint number = 0, QWidget *parent = 0, const char *name = 0) = 0; virtual QString configPageName(uint number = 0) const = 0; virtual QString configPageFullName(uint number = 0) const = 0; virtual QPixmap configPagePixmap(uint number = 0, int size = KIcon::SizeSmall) const = 0; private: class PrivateConfigInterfaceExtension *d; static unsigned int globalConfigInterfaceExtensionNumber; unsigned int myConfigInterfaceExtensionNumber; }; class Document; class Plugin; class ViewPlugin; KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension(Document *doc); KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension(Plugin *plugin); } #endif
/* strsource.c - Describing an error source. Copyright (C) 2003 g10 Code GmbH This file is part of libgpg-error. libgpg-error 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.1 of the License, or (at your option) any later version. libgpg-error is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU General Public License along with libgpg-error; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "prelude-error.h" #include "gettext.h" #include "err-sources.h" /* Return a pointer to a string containing a description of the error source in the error value ERR. */ const char *prelude_strsource(prelude_error_t err) { prelude_error_source_t source = prelude_error_get_source(err); return dgettext(PACKAGE, msgstr + msgidx[msgidxof((int) source)]); }
#ifndef LABEL_H #define LABEL_H #include "Vertice.h" #include <iostream> using namespace std; class Label : public Vertice{ string s; public: Label(const string&); int getType() const; void setLabel(const string &); string getLabel(); bool operator<(const Vertice& other) const; ~Label(){} }; #endif
/* 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. */ /* * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, <wd@denx.de> * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Marius Groeger <mgroeger@sysgo.de> * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Alex Zuepke <azu@sysgo.de> * * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include <common.h> #include <SA-1100.h> DECLARE_GLOBAL_DATA_PTR; void serial_setbrg (void) { unsigned int reg = 0; if (gd->baudrate == 1200) reg = 191; else if (gd->baudrate == 9600) reg = 23; else if (gd->baudrate == 19200) reg = 11; else if (gd->baudrate == 38400) reg = 5; else if (gd->baudrate == 57600) reg = 3; else if (gd->baudrate == 115200) reg = 1; else hang (); #ifdef CONFIG_SERIAL1 /* SA1110 uart function */ Ser1SDCR0 |= SDCR0_SUS; /* Wait until port is ready ... */ while(Ser1UTSR1 & UTSR1_TBY) {} /* init serial serial 1 */ Ser1UTCR3 = 0x00; Ser1UTSR0 = 0xff; Ser1UTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData ); Ser1UTCR1 = 0; Ser1UTCR2 = (u32)reg; Ser1UTCR3 = ( UTCR3_RXE | UTCR3_TXE ); #elif defined(CONFIG_SERIAL3) /* Wait until port is ready ... */ while (Ser3UTSR1 & UTSR1_TBY) { } /* init serial serial 3 */ Ser3UTCR3 = 0x00; Ser3UTSR0 = 0xff; Ser3UTCR0 = (UTCR0_1StpBit | UTCR0_8BitData); Ser3UTCR1 = 0; Ser3UTCR2 = (u32) reg; Ser3UTCR3 = (UTCR3_RXE | UTCR3_TXE); #else #error "Bad: you didn't configured serial ..." #endif } /* * Initialise the serial port with the given baudrate. The settings * are always 8 data bits, no parity, 1 stop bit, no start bits. * */ int serial_init (void) { serial_setbrg (); return (0); } /* * Output a single byte to the serial port. */ void serial_putc (const char c) { #ifdef CONFIG_SERIAL1 /* wait for room in the tx FIFO on SERIAL1 */ while ((Ser1UTSR0 & UTSR0_TFS) == 0); Ser1UTDR = c; #elif defined(CONFIG_SERIAL3) /* wait for room in the tx FIFO on SERIAL3 */ while ((Ser3UTSR0 & UTSR0_TFS) == 0); Ser3UTDR = c; #endif /* If \n, also do \r */ if (c == '\n') serial_putc ('\r'); } /* * Read a single byte from the serial port. Returns 1 on success, 0 * otherwise. When the function is succesfull, the character read is * written into its argument c. */ int serial_tstc (void) { #ifdef CONFIG_SERIAL1 return Ser1UTSR1 & UTSR1_RNE; #elif defined(CONFIG_SERIAL3) return Ser3UTSR1 & UTSR1_RNE; #endif } /* * Read a single byte from the serial port. Returns 1 on success, 0 * otherwise. When the function is succesfull, the character read is * written into its argument c. */ int serial_getc (void) { #ifdef CONFIG_SERIAL1 while (!(Ser1UTSR1 & UTSR1_RNE)); return (char) Ser1UTDR & 0xff; #elif defined(CONFIG_SERIAL3) while (!(Ser3UTSR1 & UTSR1_RNE)); return (char) Ser3UTDR & 0xff; #endif } void serial_puts (const char *s) { while (*s) { serial_putc (*s++); } }
///////////////////////////////////////////////////////////////////////////// // Name: wx/wxshlba_cw_d.h // Purpose: wxWidgets definitions for CodeWarrior builds (Debug) // Author: Stefan Csomor // Modified by: // Created: 12/10/98 // RCS-ID: $Id: wxshlba_cw_d.h 67254 2011-03-20 00:14:35Z DS $ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CW__ #define _WX_CW__ #if __MWERKS__ >= 0x2400 #pragma old_argmatch on #endif #if __option(profile) #error "profiling is not supported in debug versions" #else #ifdef __cplusplus #if __POWERPC__ #include "wxshlba_PPC++_d.mch" #elif __INTEL__ #include "wxshlba_x86++_d.mch" #elif __CFM68K__ #include "wxshlba_cfm++_d.mch" #else #include "wxshlba_68k++_d.mch" #endif #else #if __POWERPC__ #include "wxshlba_PPC_d.mch" #elif __INTEL__ #include "wxshlba_x86_d.mch" #elif __CFM68K__ #include "wxshlba_cfm_d.mch" #else #include "wxshlba_68k_d.mch" #endif #endif #endif #endif // _WX_CW__
// -*- C++ -*- //============================================================================= /** * @file Monitor_Control_Action.h * * @author Jeff Parsons <j.parsons@vanderbilt.edu> */ //============================================================================= #ifndef MONITOR_CONTROL_ACTION_H #define MONITOR_CONTROL_ACTION_H #include /**/ "ace/pre.h" #include "ace/Refcountable_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1) ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE { namespace Monitor_Control { /** * @class ControlAction * * @brief Base class for control actions initiated by the * application or by constraint evaluation trigger. * * This class is extended by the application developer or * by the MC service itself to create a concrete class. */ class ACE_Export Control_Action : private ACE_Refcountable_T<ACE_SYNCH_MUTEX> { public: /// To be implemented by the concrete derived class. virtual void execute (const char* command = 0) = 0; /// Refcounting methods. void add_ref (void); void remove_ref (void); protected: Control_Action (); ~Control_Action () override = default; }; } } ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */ #include /**/ "ace/post.h" #endif // MONITOR_CONTROL_ACTION_H
/* * Copyright (C) 2010-2012 Motorola Mobility, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307, USA */ /* Local header for Atmel maXTouch touchscreens that uses touch_platform.h */ #ifndef _LINUX_ATMXT_H #define _LINUX_ATMXT_H #include <linux/types.h> #include <linux/input/touch_platform.h> #include <linux/i2c.h> #include <linux/input.h> #include <linux/mutex.h> #ifdef CONFIG_HAS_EARLYSUSPEND #include <linux/earlysuspend.h> #endif #define ATMXT_I2C_NAME "atmxt-i2c" #define ATMXT_DRIVER_VERSION "TF-11-00" #define ATMXT_DRIVER_DATE "2012-04-04" #ifdef CONFIG_TOUCHSCREEN_DEBUG #define atmxt_dbg(dd, level, format, args...) \ {\ if ((dd->dbg->dbg_lvl) >= level) \ printk(KERN_INFO format, ## args); \ } #else #define atmxt_dbg(dd, level, format, args...) {} #endif #define ATMXT_DBG0 0 #define ATMXT_DBG1 1 #define ATMXT_DBG2 2 #define ATMXT_DBG3 3 #define ATMXT_IRQ_ENABLED_FLAG 0 #define ATMXT_WAITING_FOR_FW_FLAG 1 #define ATMXT_CHECKSUM_FAILED 2 #define ATMXT_IGNORE_CHECKSUM 3 #define ATMXT_REPORT_TOUCHES 4 #define ATMXT_FIXING_CALIBRATION 5 #define ATMXT_RECEIVED_CALIBRATION 6 #define ATMXT_I2C_ATTEMPTS 10 #define ATMXT_I2C_WAIT_TIME 50 #define ATMXT_MAX_TOUCHES 10 #define ATMXT_ABS_RESERVED 0xFFFF #define ATMXT_MAX_I2C_TIMEOUT_COUNT 15 enum atmxt_driver_state { ATMXT_DRV_ACTIVE, ATMXT_DRV_IDLE, ATMXT_DRV_REFLASH, ATMXT_DRV_PROBE, ATMXT_DRV_ERROR, }; static const char * const atmxt_driver_state_string[] = { "ACTIVE", "IDLE", "REFLASH", "PROBE", "ERROR", }; enum atmxt_ic_state { ATMXT_IC_ACTIVE, ATMXT_IC_SLEEP, ATMXT_IC_UNKNOWN, ATMXT_IC_BOOTLOADER, ATMXT_IC_UNAVAILABLE, ATMXT_IC_PRESENT, ATMXT_IC_ERR_HWCONFIG, ATMXT_IC_ERR_BADAPP, ATMXT_IC_RECOVER, }; static const char * const atmxt_ic_state_string[] = { "ACTIVE", "SLEEP", "UNKNOWN", "BOOTLOADER", "UNAVAILABLE", "PRESENT", "ERR_HWCONFIG", "ERR_BADAPP", "RECOVER", }; struct atmxt_obj { uint8_t num; uint8_t addr[2]; uint8_t *data; uint8_t size; struct atmxt_obj *next_inst; struct atmxt_obj *next_obj; } __packed; struct atmxt_info_block { uint8_t header[7]; uint8_t *data; uint8_t size; uint8_t *msg_id; uint8_t id_size; uint16_t obj_size; uint8_t obj_chksum[3]; } __packed; struct atmxt_addr { uint8_t msg[2]; uint8_t pwr[2]; uint8_t rst[2]; uint8_t nvm[2]; uint8_t cal[2]; uint8_t dbg[2]; uint8_t dbg_cmd[2]; uint8_t acq[2]; uint8_t chg_cmd[2]; } __packed; struct atmxt_data { uint8_t pwr[2]; uint8_t max_msg_size; uint8_t touch_id_offset; bool res[2]; uint8_t xysize[2]; uint8_t acq[6]; unsigned long timer; uint8_t last_stat; uint8_t max_x; } __packed; struct atmxt_touch_data { bool active; uint16_t x; uint16_t y; uint8_t p; uint8_t w; uint8_t id; } __packed; struct atmxt_report_data { uint16_t axis[5]; uint8_t active_touches; struct atmxt_touch_data tchdat[ATMXT_MAX_TOUCHES]; } __packed; struct atmxt_debug { uint8_t dbg_lvl; uint8_t grp_num; uint8_t grp_off; #ifdef CONFIG_TOUCHSCREEN_DEBUG uint64_t evt_sec; uint64_t evt_ms; uint64_t evt_count; uint32_t evt_act; #endif } __packed; struct atmxt_driver_data { struct touch_platform_data *pdata; struct i2c_client *client; struct mutex *mutex; struct input_dev *in_dev; #ifdef CONFIG_HAS_EARLYSUSPEND struct early_suspend es; #endif enum atmxt_driver_state drv_stat; enum atmxt_ic_state ic_stat; struct atmxt_info_block *info_blk; struct atmxt_obj *objs; struct atmxt_addr *addr; struct atmxt_data *data; struct atmxt_report_data *rdat; struct atmxt_debug *dbg; uint16_t status; uint16_t settings; } __packed; #endif /* _LINUX_ATMXT_H */
// // distcauchy.h // physher // // Created by Mathieu Fourment on 8/6/19. // Copyright © 2019 Mathieu Fourment. All rights reserved. // #ifndef distcauchy_h #define distcauchy_h #include <stdio.h> #include "hashtable.h" #include "mjson.h" #include "distmodel.h" DistributionModel* new_CauchyDistributionModel_with_parameters(Parameters** parameters, Parameters* x); Model* new_CauchyDistributionModel_from_json(json_node* node, Hashtable* hash); #endif /* distcauchy_h */
/* HAM8 encoding, based on the jpegAGA HAM8 encoding * Originally by Günther Röhrich * Converted to C by Chris Lawrence <lawrencc@debian.org> * * © Copyright 1996-99 by Chris Lawrence * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of the Linux * distribution for more details. */ #ifndef VIDEO_HAM int encodeham8; /* Declare something so things don't act too weird */ #else #undef HISTOGRAM_WEIRDNESS #include <sys/types.h> #include <stdlib.h> #include <string.h> #include <ppm.h> extern void Die(const char *fmt,...) __attribute__((noreturn)); extern u_char ColorTable[64 * 3]; extern u_char *ColorCache; extern int depth; static u_int16_t compute_error(u_char orig[3], u_char chosen[3]); void EncodeHAM(pixel * pixrow, pixval maxval, u_char * yham, u_int16_t xsize, int do_histogram); static inline u_int16_t square(u_int16_t x) { return x*x; } static u_int16_t compute_error(u_char orig[3], u_char chosen[3]) { u_int16_t ret, x; x = orig[0] - chosen[0]; ret = square(x); x = orig[1] - chosen[1]; ret += square(x); x = orig[2] - chosen[2]; ret += square(x); return ret; } #define HAM_ENTRIES (1 << (depth-2)) /* 2^(depth-2) */ #define HAM_COLORS (HAM_ENTRIES - 1) /* 2^(depth-2) - 1 */ static inline char map_ham(char ham, char value) { if( depth == 8 ) { return (value << 2) | ham; } else { return (ham << (depth-2)) | value; } } void EncodeHAM(pixel *pixrow, pixval maxval, u_char *pos, u_int16_t xsize, int do_histogram) { u_char orig_cols[3], left[3], cache, *finham; u_char best_color = 0, colcount = 0, ham_offset, tmp, tmp2, change_val; u_int32_t CacheOffset, offset; u_int16_t err, min_error; int i; /* Force choosing a color for the first pixel */ left[0] = left[1] = left[2] = 255; finham = (pos + xsize); while( pos < finham ) { pixel p; PPM_DEPTH(p, (*pixrow), maxval, HAM_COLORS); pixrow++; orig_cols[0] = PPM_GETB(p); orig_cols[1] = PPM_GETR(p); orig_cols[2] = PPM_GETG(p); if( left[0] == orig_cols[0] && left[1] == orig_cols[1] && left[2] == orig_cols[2] ) { /* This pixel is identical to the previous one */ ham_offset = colcount; colcount = (colcount + 1) % 3; left[ham_offset] = orig_cols[ham_offset]; *(pos++) = map_ham(ham_offset+1, orig_cols[ham_offset]); } else { offset = (orig_cols[1] << 12) | (orig_cols[2] << 6) | orig_cols[0]; cache = ColorCache[offset]; if (!cache) { /* No cached color: find index of best color in palette */ CacheOffset = offset; best_color = offset = 0; min_error = 3*square(HAM_ENTRIES); do { err = compute_error(orig_cols, &ColorTable[offset]); if (err < min_error) { min_error = err; best_color = offset; } offset += 3; } while (err > 0 && offset < (3 * HAM_ENTRIES)); ColorCache[CacheOffset] = best_color; } else { /* There is a cached color */ #ifdef HISTOGRAM_WEIRDNESS if (!do_histogram) { *(pos++) = map_ham(0, cache/3); left[0] = ColorTable[cache]; left[1] = ColorTable[cache+1]; left[2] = ColorTable[cache+2]; continue; } #endif best_color = cache; min_error = compute_error(orig_cols, &ColorTable[best_color]); } tmp2 = abs(orig_cols[0] - left[0]); change_val = orig_cols[0]; ham_offset = 0; for(i=1; i<3; i++) { tmp = abs(orig_cols[i] - left[i]); if( tmp > tmp2 ) { change_val = orig_cols[i]; ham_offset = i; tmp2 = tmp; } } left[ham_offset] = change_val; err = compute_error(orig_cols, left); if (min_error >= err) { /* Hold-and-Modify pixel to the left */ *(pos++) = map_ham(ham_offset+1, change_val); } else { /* Use palette entry */ *(pos++) = map_ham(0, best_color/3); left[0] = ColorTable[best_color]; left[1] = ColorTable[best_color+1]; left[2] = ColorTable[best_color+2]; } } } return; } #endif
/*****************************************************************************/ /* */ /* inttypes.h */ /* */ /* Define integer types */ /* */ /* */ /* */ /* (C) 2004 Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ /* warranty. In no event will the authors be held liable for any damages */ /* arising from the use of this software. */ /* */ /* Permission is granted to anyone to use this software for any purpose, */ /* including commercial applications, and to alter it and redistribute it */ /* freely, subject to the following restrictions: */ /* */ /* 1. The origin of this software must not be misrepresented; you must not */ /* claim that you wrote the original software. If you use this software */ /* in a product, an acknowledgment in the product documentation would be */ /* appreciated but is not required. */ /* 2. Altered source versions must be plainly marked as such, and must not */ /* be misrepresented as being the original software. */ /* 3. This notice may not be removed or altered from any source */ /* distribution. */ /* */ /*****************************************************************************/ #ifndef INTTYPES_H #define INTTYPES_H /* If we have <stdint.h>, include it; otherwise, adapt types from <stddef.h>. ** gcc and msvc don't define __STDC_VERSION__ without special flags, so check ** for them explicitly. Undefined symbols are replaced by zero; so, checks for ** defined(__GNUC__) and defined(_MSC_VER) aren't necessary. */ #if (__STDC_VERSION__ >= 199901) || (__GNUC__ >= 3) || (_MSC_VER >= 1600) #include <stdint.h> #else /* Assume that ptrdiff_t and size_t are wide enough to hold pointers. ** Assume that they are the widest type. */ #include <stddef.h> typedef ptrdiff_t intptr_t; typedef size_t uintptr_t; typedef ptrdiff_t intmax_t; typedef size_t uintmax_t; #endif /* End of inttypes.h */ #endif
#pragma once enum LanguageID { MTitle, MDescription, MOK };
/* * arch/arm/mach-mv78xx0/common.h * * Core functions for Marvell MV78xx0 SoCs * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ #ifndef __ARCH_MV78XX0_COMMON_H #define __ARCH_MV78XX0_COMMON_H struct mv643xx_eth_platform_data; struct mv_sata_platform_data; /* * Basic MV78xx0 init functions used early by machine-setup. */ int mv78xx0_core_index(void); void mv78xx0_map_io(void); void mv78xx0_init(void); <<<<<<< HEAD void mv78xx0_init_early(void); ======= >>>>>>> 296c66da8a02d52243f45b80521febece5ed498a void mv78xx0_init_irq(void); extern struct mbus_dram_target_info mv78xx0_mbus_dram_info; void mv78xx0_setup_cpu_mbus(void); void mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, int maj, int min); void mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, int maj, int min); void mv78xx0_pcie_id(u32 *dev, u32 *rev); void mv78xx0_ehci0_init(void); void mv78xx0_ehci1_init(void); void mv78xx0_ehci2_init(void); void mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data); void mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data); void mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data); void mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data); void mv78xx0_pcie_init(int init_port0, int init_port1); void mv78xx0_sata_init(struct mv_sata_platform_data *sata_data); void mv78xx0_uart0_init(void); void mv78xx0_uart1_init(void); void mv78xx0_uart2_init(void); void mv78xx0_uart3_init(void); void mv78xx0_i2c_init(void); extern struct sys_timer mv78xx0_timer; #endif
#ifdef WIN32 // // Implementation of _mbrtowc() // // Copyright (c) 2004, Algin Technology LLC // Written by Alan Klietz // Distributed under GNU General Public License version 2. // // $Id: xmbrtowc.h,v 1.2 2007/10/05 00:48:19 cvsalan Exp $ // #ifdef __cplusplus extern "C" { #endif extern size_t __cdecl xmbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *pst); #define mbrtowc(pwc,s,n,pst) xmbrtowc(pwc,s,n,pst) #ifndef __cplusplus // // wchar.h forgot to define mbsinit() outside of __cplusplus. // It is wrong anyway. // extern int mbsinit(const mbstate_t *mbs); #endif // // Return the current effective codepage // extern int get_codepage(); #ifdef __cplusplus } #endif #endif // WIN32 /* vim:tabstop=4:shiftwidth=4:noexpandtab */
// ************************************************************************* // // Copyright 2004-2010 Bruno PAGES . // // This file is part of the BOUML Uml Toolkit. // // 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. // // e-mail : bouml@free.fr // home : http://bouml.free.fr // // ************************************************************************* #ifndef REVSETTINGSDIALOG_H #define REVSETTINGSDIALOG_H #include <qdialog.h> class QCheckBox; class QComboBox; class LineEdit; class RevSettingsDialog : public QDialog { Q_OBJECT protected: LineEdit * cpp_dir; LineEdit * cpp_file; QCheckBox * cpp_dir_case_sensitive; QCheckBox * cpp_file_case_sensitive; QComboBox * edcpp_h_extension; QComboBox * edcpp_src_extension; LineEdit * java_dir; LineEdit * java_file; QCheckBox * java_dir_case_sensitive; QCheckBox * java_file_case_sensitive; QComboBox * edjava_extension; LineEdit * php_dir; LineEdit * php_file; QCheckBox * php_dir_case_sensitive; QCheckBox * php_file_case_sensitive; QComboBox * edphp_extension; static QSize previous_size; public: RevSettingsDialog(); virtual ~RevSettingsDialog(); protected slots: virtual void polish(); void accept(); void show_regexp_help(); }; #endif
/* * pp_ftp.h * * Copyright (C) 2014-2016 Cisco and/or its affiliates. All rights reserved. * Copyright (C) 2004-2013 Sourcefire, Inc. * Steven A. Sturges <ssturges@sourcefire.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. You may not use, modify or * distribute this program under any other version of the GNU General * Public 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Description: * * Header file for FTPTelnet FTP Module * * This file defines the ftp checking functions * * NOTES: * - 20.09.04: Initial Development. SAS * */ #ifndef __PP_FTP_H__ #define __PP_FTP_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <sys/types.h> //#include "decode.h" #include "ftpp_ui_config.h" #include "ftpp_si.h" /* list of function prototypes for this preprocessor */ extern int check_ftp(FTP_SESSION *Session, SFSnortPacket *p, int iMode); extern int initialize_ftp(FTP_SESSION *Session, SFSnortPacket *p, int iMode); #endif
#ifndef LIBSWF_INSTANCEINFO_H #define LIBSWF_INSTANCEINFO_H class InstanceInfo { }; #endif //LIBSWF_INSTANCEINFO_H
/* * Copyright 2000-2015 Rochus Keller <mailto:rkeller@nmr.ch> * * This file is part of the CARA (Computer Aided Resonance Assignment, * see <http://cara.nmr.ch/>) NMR Application Framework (NAF) library. * * The following is the license that applies to this copy of the * library. For a license to use the library under conditions * other than those described here, please email to rkeller@nmr.ch. * * GNU General Public License Usage * This file may be used under the terms of the GNU General Public * License (GPL) versions 2.0 or 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 GNU General Public Licensing requirements will be met: * http://www.fsf.org/licensing/licenses/info/GPLv2.html and * http://www.gnu.org/copyleft/gpl.html. */ #if !defined(_QTL_DIALOG) #define _QTL_DIALOG typedef struct lua_State lua_State; namespace Qtl { class Dialog { public: static int init(lua_State * L); static int isSizeGripEnabled(lua_State * L); // const : bool static int result(lua_State * L); // const : int static int setModal(lua_State * L); // bool modal static int setResult(lua_State * L); // int i static int setSizeGripEnabled(lua_State * L); // bool static void install(lua_State * L); }; } #endif // !defined(_QTL_DIALOG)
/** ****************************************************************************** * @file usbh_ctlreq.h * @author MCD Application Team * @version V3.1.0 * @date 19-June-2014 * @brief Header file for usbh_ctlreq.c ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Define to prevent recursive ----------------------------------------------*/ #ifndef __USBH_CTLREQ_H #define __USBH_CTLREQ_H /* Includes ------------------------------------------------------------------*/ #include "usbh_core.h" /** @addtogroup USBH_LIB * @{ */ /** @addtogroup USBH_LIB_CORE * @{ */ /** @defgroup USBH_CTLREQ * @brief This file is the * @{ */ /** @defgroup USBH_CTLREQ_Exported_Defines * @{ */ /*Standard Feature Selector for clear feature command*/ #define FEATURE_SELECTOR_ENDPOINT 0X00 #define FEATURE_SELECTOR_DEVICE 0X01 #define INTERFACE_DESC_TYPE 0x04 #define ENDPOINT_DESC_TYPE 0x05 #define INTERFACE_DESC_SIZE 0x09 /** * @} */ /** @defgroup USBH_CTLREQ_Exported_Types * @{ */ /** * @} */ /** @defgroup USBH_CTLREQ_Exported_Macros * @{ */ /** * @} */ /** @defgroup USBH_CTLREQ_Exported_Variables * @{ */ extern uint8_t USBH_CfgDesc[512]; /** * @} */ /** @defgroup USBH_CTLREQ_Exported_FunctionsPrototype * @{ */ USBH_StatusTypeDef USBH_CtlReq (USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length); USBH_StatusTypeDef USBH_GetDescriptor(USBH_HandleTypeDef *phost, uint8_t req_type, uint16_t value_idx, uint8_t* buff, uint16_t length ); USBH_StatusTypeDef USBH_Get_DevDesc(USBH_HandleTypeDef *phost, uint8_t length); USBH_StatusTypeDef USBH_Get_StringDesc(USBH_HandleTypeDef *phost, uint8_t string_index, uint8_t *buff, uint16_t length); USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t configuration_value); USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, uint16_t length); USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, uint8_t DeviceAddress); USBH_StatusTypeDef USBH_SetInterface(USBH_HandleTypeDef *phost, uint8_t ep_num, uint8_t altSetting); USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, uint8_t ep_num); USBH_DescHeader_t *USBH_GetNextDesc (uint8_t *pbuf, uint16_t *ptr); /** * @} */ #endif /* __USBH_CTLREQ_H */ /** * @} */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * Copyright (C) 2007-2008 Sourcefire, Inc. * * Authors: Tomasz Kojm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __CVD_H #define __CVD_H #include <stdio.h> #include "clamav.h" int cli_cvdload(FILE *fs, struct cl_engine **engine, unsigned int *signo, short warn, unsigned int options, unsigned int cld); int cli_untgz(int fd, const char *destdir); #endif
int SUBST_putenv = 1; /* int putenv(char*); */ #include <stdio.h> #include <string.h> extern char **environ; static char **my_environ; void *malloc(int); void free(void*); int putenv(void *venv) { const char *env = (char*)venv; char name[256]; int ei,len; const char *ep; const char **newe; sscanf(env,"%256[^=]",name); len = strlen(name); for( ei = 0; ep = environ[ei]; ei++ ) if( strncmp(ep,name,len) == 0 ){ environ[ei] = (char*)env; return 0; } newe = (const char**)malloc(sizeof(char*)*(ei+2)); for( ei = 0; environ[ei]; ei++ ) newe[ei] = (const char*)environ[ei]; newe[ei] = env; newe[ei+1] = 0; if( environ == my_environ ) free(environ); environ = my_environ = (char**)newe; return 0; }
// guids.h: definitions of GUIDs/IIDs/CLSIDs used in this VsPackage /* Do not use #pragma once, as this file needs to be included twice. Once to declare the externs for the GUIDs, and again right after including initguid.h to actually define the GUIDs. */ // guidPersistanceSlot ID for the Tool Window // { 7a5a2942-c6a4-4d28-8c4d-7996c319206b } #define guidTangramPackagePersistenceSlot { 0x7A5A2942, 0xC6A4, 0x4D28, { 0x8C, 0x4D, 0x79, 0x96, 0xC3, 0x19, 0x20, 0x6B } } #ifdef DEFINE_GUID DEFINE_GUID(CLSID_guidPersistanceSlot, 0x7A5A2942, 0xC6A4, 0x4D28, 0x8C, 0x4D, 0x79, 0x96, 0xC3, 0x19, 0x20, 0x6B ); #endif // // package guid // { fea558f9-2737-4369-8e99-14f316ca9190 } #define guidTangramPackagePkg { 0xFEA558F9, 0x2737, 0x4369, { 0x8E, 0x99, 0x14, 0xF3, 0x16, 0xCA, 0x91, 0x90 } } //#ifdef DEFINE_GUID //DEFINE_GUID(CLSID_TangramPackage, //0xFEA558F9, 0x2737, 0x4369, 0x8E, 0x99, 0x14, 0xF3, 0x16, 0xCA, 0x91, 0x90 ); //#endif // Command set guid for our commands (used with IOleCommandTarget) // { fa4aeb54-81f6-4286-83cf-009c213224cb } #define guidTangramPackageCmdSet { 0xFA4AEB54, 0x81F6, 0x4286, { 0x83, 0xCF, 0x0, 0x9C, 0x21, 0x32, 0x24, 0xCB } } #ifdef DEFINE_GUID DEFINE_GUID(CLSID_TangramPackageCmdSet, 0xFA4AEB54, 0x81F6, 0x4286, 0x83, 0xCF, 0x0, 0x9C, 0x21, 0x32, 0x24, 0xCB ); #endif //Guid for the image list referenced in the VSCT file // { 440e1355-a553-4468-bd3a-750ce4199b77 } #define guidImages { 0x440E1355, 0xA553, 0x4468, { 0xBD, 0x3A, 0x75, 0xC, 0xE4, 0x19, 0x9B, 0x77 } } #ifdef DEFINE_GUID DEFINE_GUID(CLSID_Images, 0x440E1355, 0xA553, 0x4468, 0xBD, 0x3A, 0x75, 0xC, 0xE4, 0x19, 0x9B, 0x77 ); #endif // Guid for the Editor Factory // { 89c1346b-bb49-41ff-97d5-47470eed3c95 } #define guidTangramPackageEditorFactory { 0x89C1346B, 0xBB49, 0x41FF, { 0x97, 0xD5, 0x47, 0x47, 0xE, 0xED, 0x3C, 0x95 } } #ifdef DEFINE_GUID DEFINE_GUID(CLSID_TangramPackageEditorFactory, 0x89C1346B, 0xBB49, 0x41FF, 0x97, 0xD5, 0x47, 0x47, 0xE, 0xED, 0x3C, 0x95 ); #endif // Guid for the Editor Document (the document is the actual editor) // { 7f8286c6-672d-484a-8c4b-1f257d7353b1 } #define guidTangramPackageEditorDocument { 0x7F8286C6, 0x672D, 0x484A, { 0x8C, 0x4B, 0x1F, 0x25, 0x7D, 0x73, 0x53, 0xB1 } } #ifdef DEFINE_GUID DEFINE_GUID(CLSID_TangramPackageEditorDocument, 0x7F8286C6, 0x672D, 0x484A, 0x8C, 0x4B, 0x1F, 0x25, 0x7D, 0x73, 0x53, 0xB1 ); #endif
/* * This file is part of Experiental. * * Experiental 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. * * Experiental 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 Experiental. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _3DMATH_H_ #define _3DMATH_H_ #include <cfloat> //_isnan() for acos() #define PI 3.1415926535897932 struct CVector3 { public: float x, y, z; }; CVector3 Cross(CVector3 vVector1, CVector3 vVector2); CVector3 Vector(CVector3 vPoint1, CVector3 vPoint2); float Magnitude(CVector3 vNormal); CVector3 Normalize(CVector3 vNormal); CVector3 Normal(CVector3 vTriangle[]); float PlaneDistance(CVector3 Normal, CVector3 Point); bool IntersectedPlane(CVector3 vPoly[], CVector3 vLine[], CVector3 &vNormal, float &originDistance); //dot product between two vectors float Dot(CVector3 vVector1, CVector3 vVector2); //angle between two vectors double AngleBetweenVectors(CVector3 Vector1, CVector3 Vector2); //point of the polygon and line intersection (plane intersection) CVector3 IntersectionPoint(CVector3 vNormal, CVector3 vLine[], double distance); //true if intersection is inside the polygon bool InsidePolygon(CVector3 vIntersection, CVector3 Poly[], long verticeCount); //need to use this function for line and polygon intersection test bool IntersectedPolygon(CVector3 vPoly[], CVector3 vLine[], int verticeCount); #endif // _3DMATH_H_
/* * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation * * Author: Nikos Mavrogiannopoulos * * This file is part of GNUTLS. * * The GNUTLS library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * */ #include <gnutls_int.h> #ifdef ENABLE_SRP #include "gnutls_errors.h" #include "auth_srp_passwd.h" #include "gnutls_auth.h" #include "gnutls_auth_int.h" #include "gnutls_srp.h" #include "debug.h" #include "gnutls_num.h" #include "auth_srp.h" #include <gnutls_str.h> #include <auth_cert.h> #include <gnutls_datum.h> #include <gnutls_sig.h> #include <auth_srp.h> #include <gnutls_x509.h> static int gen_srp_cert_server_kx (gnutls_session_t, opaque **); static int proc_srp_cert_server_kx (gnutls_session_t, opaque *, size_t); const mod_auth_st srp_rsa_auth_struct = { "SRP", _gnutls_gen_cert_server_certificate, NULL, gen_srp_cert_server_kx, _gnutls_gen_srp_client_kx, NULL, NULL, _gnutls_proc_cert_server_certificate, NULL, /* certificate */ proc_srp_cert_server_kx, _gnutls_proc_srp_client_kx, NULL, NULL }; const mod_auth_st srp_dss_auth_struct = { "SRP", _gnutls_gen_cert_server_certificate, NULL, gen_srp_cert_server_kx, _gnutls_gen_srp_client_kx, NULL, NULL, _gnutls_proc_cert_server_certificate, NULL, /* certificate */ proc_srp_cert_server_kx, _gnutls_proc_srp_client_kx, NULL, NULL }; static int gen_srp_cert_server_kx (gnutls_session_t session, opaque ** data) { ssize_t ret, data_size; gnutls_datum_t signature, ddata; gnutls_certificate_credentials_t cred; gnutls_cert *apr_cert_list; gnutls_privkey *apr_pkey; int apr_cert_list_length; ret = _gnutls_gen_srp_server_kx (session, data); if (ret < 0) return ret; data_size = ret; ddata.data = *data; ddata.size = data_size; cred = (gnutls_certificate_credentials_t) _gnutls_get_cred (session->key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert (); return GNUTLS_E_INSUFFICIENT_CREDENTIALS; } /* find the appropriate certificate */ if ((ret = _gnutls_get_selected_cert (session, &apr_cert_list, &apr_cert_list_length, &apr_pkey)) < 0) { gnutls_assert (); return ret; } if ((ret = _gnutls_tls_sign_params (session, &apr_cert_list[0], apr_pkey, &ddata, &signature)) < 0) { gnutls_assert (); gnutls_free (*data); return ret; } *data = gnutls_realloc_fast (*data, data_size + signature.size + 2); if (*data == NULL) { _gnutls_free_datum (&signature); gnutls_assert (); return GNUTLS_E_MEMORY_ERROR; } _gnutls_write_datum16 (&(*data)[data_size], signature); data_size += signature.size + 2; _gnutls_free_datum (&signature); return data_size; } static int proc_srp_cert_server_kx (gnutls_session_t session, opaque * data, size_t _data_size) { ssize_t ret; int sigsize; gnutls_datum_t vparams, signature; ssize_t data_size; cert_auth_info_t info; gnutls_cert peer_cert; opaque *p; ret = _gnutls_proc_srp_server_kx (session, data, _data_size); if (ret < 0) return ret; data_size = _data_size - ret; info = _gnutls_get_auth_info (session); if (info == NULL || info->ncerts == 0) { gnutls_assert (); /* we need this in order to get peer's certificate */ return GNUTLS_E_INTERNAL_ERROR; } /* VERIFY SIGNATURE */ vparams.size = ret; /* all the data minus the signature */ vparams.data = data; p = &data[vparams.size]; DECR_LEN (data_size, 2); sigsize = _gnutls_read_uint16 (p); DECR_LEN (data_size, sigsize); signature.data = &p[2]; signature.size = sigsize; ret = _gnutls_raw_cert_to_gcert (&peer_cert, session->security_parameters.cert_type, &info->raw_certificate_list[0], CERT_NO_COPY); if (ret < 0) { gnutls_assert (); return ret; } ret = _gnutls_verify_sig_params (session, &peer_cert, &vparams, &signature); _gnutls_gcert_deinit (&peer_cert); if (ret < 0) { gnutls_assert (); return ret; } return 0; } #endif /* ENABLE_SRP */
/* * include/linux/random.h * * Include file for the random number generator. */ #ifndef _LINUX_RANDOM_H #define _LINUX_RANDOM_H #include <linux/types.h> #include <linux/ioctl.h> #include <linux/irqnr.h> /* ioctl()'s for the random number generator */ /* Get the entropy count. */ #define RNDGETENTCNT _IOR( 'R', 0x00, int ) /* Add to (or subtract from) the entropy count. (Superuser only.) */ #define RNDADDTOENTCNT _IOW( 'R', 0x01, int ) /* Get the contents of the entropy pool. (Superuser only.) */ #define RNDGETPOOL _IOR( 'R', 0x02, int [2] ) /* * Write bytes into the entropy pool and add to the entropy count. * (Superuser only.) */ #define RNDADDENTROPY _IOW( 'R', 0x03, int [2] ) /* Clear entropy count to 0. (Superuser only.) */ #define RNDZAPENTCNT _IO( 'R', 0x04 ) /* Clear the entropy pool and associated counters. (Superuser only.) */ #define RNDCLEARPOOL _IO( 'R', 0x06 ) struct rand_pool_info { int entropy_count; int buf_size; __u32 buf[0]; }; struct rnd_state { __u32 s1, s2, s3; }; /* Exported functions */ #ifdef __KERNEL__ extern void add_device_randomness(const void *, unsigned int); extern void add_input_randomness(unsigned int type, unsigned int code, unsigned int value); extern void add_interrupt_randomness(int irq, int irq_flags); extern void get_random_bytes(void *buf, int nbytes); extern void get_random_bytes_arch(void *buf, int nbytes); void generate_random_uuid(unsigned char uuid_out[16]); #ifndef MODULE extern const struct file_operations random_fops, urandom_fops; #endif unsigned int get_random_int(void); unsigned long get_random_long(void); unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); u32 random32(void); void srandom32(u32 seed); u32 prandom32(struct rnd_state *); /* * Handle minimum values for seeds */ static inline u32 __seed(u32 x, u32 m) { return (x < m) ? x + m : x; } /** * prandom32_seed - set seed for prandom32(). * @state: pointer to state structure to receive the seed. * @seed: arbitrary 64-bit value to use as a seed. */ static inline void prandom32_seed(struct rnd_state *state, u64 seed) { u32 i = (seed >> 32) ^ (seed << 10) ^ seed; state->s1 = __seed(i, 2); state->s2 = __seed(i, 8); state->s3 = __seed(i, 16); } #ifdef CONFIG_ARCH_RANDOM # include <asm/archrandom.h> #else static inline int arch_get_random_long(unsigned long *v) { return 0; } static inline int arch_get_random_int(unsigned int *v) { return 0; } #endif #endif /* __KERNEL___ */ #endif /* _LINUX_RANDOM_H */
/* FreeS/WAN config file parser (parser.h) * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security * * 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. * * RCSID $Id: parser.h,v 1.5 2004/01/19 17:55:45 mcr Exp $ */ #ifndef _IPSEC_PARSER_H_ #define _IPSEC_PARSER_H_ #include "constants.h" #include "openswan.h" struct config_parsed *parser_load_conf (const char *file, err_t *perr); void parser_free_conf (struct config_parsed *cfg); extern int warningsarefatal; extern char *parser_cur_filename(void); extern int parser_cur_lineno(void); extern void parser_y_error(char *b, int size, const char *s); extern void parser_y_init (const char *name, FILE *f); extern void parser_y_fini (void); extern int parser_y_include (const char *filename); extern char rootdir[PATH_MAX]; /* when evaluating paths, prefix this to them */ #define THIS_IPSEC_CONF_VERSION 2 #endif /* _IPSEC_PARSER_H_ */ /* * Local Variables: * c-basic-offset:4 * c-style: pluto * End: */
#ifndef CPU_H #define CPU_H #include <QScrollArea> #include "create_widgets/domain/_tab.h" #include "cpu_widgets/cpu_allocation.h" #include "cpu_widgets/logical_host_cpu.h" #include "cpu_widgets/cpu_model.h" #include "cpu_widgets/cpu_topology.h" class CPU : public _Tab { Q_OBJECT public: explicit CPU( QWidget *parent = NULL, QString _caps = "", QString _xmlDesc = QString()); CPU_Allocation *cpuAlloc; signals: private: const QString xmlDesc; QString capabilities; LogicalHostCPU *logicCPULabel; CPU_Model *cpuModel; CPU_Topology *cpuTopology; QScrollArea *commonWdg; QVBoxLayout *scrolledLayout; QWidget *scrolled; public slots: QDomDocument getDataDocument() const; void setMaxVCPU(QString&); void changeArch(QString&); private slots: void readXMLDesciption(); void readXMLDesciption(QString&); }; #endif // CPU_H
#ifdef __UINT32_TYPE__ typedef __UINT32_TYPE__ uint32_t; #else typedef unsigned uint32_t; #endif #ifdef __UINT8_TYPE__ typedef __UINT8_TYPE__ uint8_t; #else typedef unsigned char uint8_t; #endif #ifdef __INT32_TYPE__ typedef __INT32_TYPE__ int32_t; #else typedef int int32_t; #endif struct { uint32_t a; uint8_t b; } s = { 0x123456, 0x78 }; int32_t pr67781() { uint32_t c = (s.a << 8) | s.b; return c; } int main () { if (sizeof (uint32_t) * __CHAR_BIT__ != 32) return 0; if (pr67781 () != 0x12345678) __builtin_abort (); return 0; }
/* linux/drivers/input/keyboard/s3c-keypad.h * * Driver header for Samsung SoC keypad. * * Kim Kyoungil, Copyright (c) 2006-2009 Samsung Electronics * http://www.samsungsemi.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _S3C_KEYPAD_H_ #define _S3C_KEYPAD_H_ static void __iomem *key_base; #if defined (CONFIG_MACH_S5PC110_P1P2) #define KEYPAD_COLUMNS 14 #define KEYPAD_ROWS 8 #define MAX_KEYPAD_NR 112 #elif defined (CONFIG_MACH_S5PC110_ARIES) #if defined(CONFIG_S5PC110_KEPLER_BOARD) || defined(CONFIG_S5PC110_T959_BOARD) #define KEYPAD_COLUMNS 2 #define KEYPAD_ROWS 3 #elif defined(CONFIG_FLEMING_VER_B0) #define KEYPAD_COLUMNS 3 // 4 #define KEYPAD_ROWS 2 #else #define KEYPAD_COLUMNS 2 #define KEYPAD_ROWS 3 #endif #define MAX_KEYPAD_NR 6 #elif defined (CONFIG_MACH_SMDKC110 ) || defined (CONFIG_MACH_S5PC110_P1) #define KEYPAD_COLUMNS 8 #define KEYPAD_ROWS 8 #define MAX_KEYPAD_NR 64 /* 8*8 */ #endif #ifdef CONFIG_ANDROID int keypad_keycode[] = { #if defined (CONFIG_MACH_S5PC110_P1P2) 0, 15, 399, 2, 16, 30, 0, 0, //7 0, 0, 0, 0, 0, 0, 100, 56, //15 0, 0, 58, 4, 18, 32, 46, 57, //23 0, 0, 1, 3, 17, 31, 45, 44, //31 0, 0, 0, 0, 0, 0, 0, 0, //39 34, 20, 6, 5, 19, 33, 47, 48, //47 35, 21, 7, 8, 22, 36, 50, 49, //55 56, 0, 0, 10, 24, 38, 52, 108, //63 0, 0, 0, 0, 54, 42, 0, 0, //71 105, 0, 0, 9, 23, 37, 51, 0, //79 0, 97, 29, 0, 0, 0, 0, 0, //87 0, 0, 0, 150, 0, 0, 0, 0, //95 12, 106, 11, 25, 26, 39, 53, 103, //103 14, 106, 3, 14, 27, 43, 40, 28, //111 #elif defined (CONFIG_MACH_S5PC110_ARIES) #if defined (CONFIG_T959_VER_B5) 50,0,0,0,42,58, #else #if defined (CONFIG_FLEMING_VER_B0) 158,107,42,58,28,139,34,8, #else 50,0,0,0,58,42, #endif #endif #elif defined (CONFIG_MACH_SMDKC110) 1,2,3,4,5,6,7,8, 9,10,11,12,13,14,15,16, 17,18,19,20,21,22,23,24, 25,26,27,28,29,30,31,32, 33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48, 49,50,51,52,53,54,55,56, 57,58,59,60,61,62,63,64 #endif }; #else int keypad_keycode[] = { 1, 2, KEY_1, KEY_Q, KEY_A, 6, 7, KEY_LEFT, 9, 10, KEY_2, KEY_W, KEY_S, KEY_Z, KEY_RIGHT, 16, 17, 18, KEY_3, KEY_E, KEY_D, KEY_X, 23, KEY_UP, 25, 26, KEY_4, KEY_R, KEY_F, KEY_C, 31, 32, 33, KEY_O, KEY_5, KEY_T, KEY_G, KEY_V, KEY_DOWN, KEY_BACKSPACE, KEY_P, KEY_0, KEY_6, KEY_Y, KEY_H, KEY_SPACE, 47, 48, KEY_M, KEY_L, KEY_7, KEY_U, KEY_J, KEY_N, 55, KEY_ENTER, KEY_LEFTSHIFT, KEY_9, KEY_8, KEY_I, KEY_K, KEY_B, 63, KEY_COMMA }; #endif #if CONFIG_ANDROID #ifdef CONFIG_CPU_S3C6410 #define KEYPAD_ROW_GPIOCON S3C64XX_GPKCON #define KEYPAD_ROW_GPIOPUD S3C64XX_GPKPUD #define KEYPAD_COL_GPIOCON S3C64XX_GPLCON #define KEYPAD_COL_GPIOPUD S3C64XX_GPLPUD #elif defined( CONFIG_CPU_S5PC100 ) #define KEYPAD_ROW_GPIOCON S5PC1XX_GPH3CON #define KEYPAD_ROW_GPIOPUD S5PC1XX_GPH3PUD #define KEYPAD_COL_GPIOCON S5PC1XX_GPH2CON #define KEYPAD_COL_GPIOPUD S5PC1XX_GPH2PUD #elif defined( CONFIG_CPU_S5PC110 ) || defined (CONFIG_CPU_S5PV210 ) #define KEYPAD_ROW_GPIOCON S5PV210_GPH3CON #define KEYPAD_ROW_GPIOPUD S5PV210_GPH3PUD #define KEYPAD_COL_GPIOCON S5PV210_GPH2CON #define KEYPAD_COL_GPIOPUD S5PV210_GPH2PUD #endif #endif /* CONFIG_ANDROID */ #if defined(CONFIG_CPU_S3C6410) #define KEYPAD_DELAY (50) #elif defined(CONFIG_CPU_S5PC100) || defined(CONFIG_CPU_S5PC110) || defined(CONFIG_CPU_S5PV210) #define KEYPAD_DELAY (300) //600 #endif #define KEYIFCOL_CLEAR (readl(key_base+S3C_KEYIFCOL) & ~0xffff) #define KEYIFCON_CLEAR (readl(key_base+S3C_KEYIFCON) & ~0x1f) #define KEYIFFC_DIV (readl(key_base+S3C_KEYIFFC) | 0x1) #define KEYCODE_UNKNOWN 10 struct s3c_keypad { struct input_dev *dev; int nr_rows; int no_cols; int total_keys; int keycodes[MAX_KEYPAD_NR]; }; extern void s3c_setup_keypad_cfg_gpio(int rows, int columns); #endif /* _S3C_KEYIF_H_ */
/* * arch/arm/kernel/return_address.c * * Copyright (C) 2009 Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> * for Pengutronix * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. */ #include <linux/export.h> #include <linux/ftrace.h> #if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) #include <linux/sched.h> #include <asm/stacktrace.h> struct return_address_data { unsigned int level; void *addr; }; static int save_return_addr(struct stackframe *frame, void *d) { struct return_address_data *data = d; if (!data->level) { data->addr = (void *)frame->lr; return 1; } else { --data->level; return 0; } } void *return_address(unsigned int level) { struct return_address_data data; struct stackframe frame; register unsigned long current_sp asm ("sp"); data.level = level + 1; frame.fp = (unsigned long)__builtin_frame_address(0); frame.sp = current_sp; frame.lr = (unsigned long)__builtin_return_address(0); frame.pc = (unsigned long)return_address; walk_stackframe(&frame, save_return_addr, &data); if (!data.level) return data.addr; else return NULL; } #else /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */ #if defined(CONFIG_ARM_UNWIND) #warning "TODO: return_address should use unwind tables" #endif /* void *return_address(unsigned int level) { return NULL; } */ #endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */ EXPORT_SYMBOL_GPL(return_address);
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2002 CodeFactory AB * Copyright (C) 2002 Richard Hult <richard@imendio.com> * Copyright (C) 2002 Mikael Hallendal <micke@imendio.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include <config.h> #include <glib.h> #include "planner-window.h" #include "planner-plugin.h" #include "valgrind.h" static void mv_init (PlannerPlugin *plugin); static void mv_class_init (PlannerPluginClass *class); static void mv_finalize (GObject *object); static GObjectClass *parent_class; GType planner_plugin_get_type (void) { static GType type = 0; if (!type) { static const GTypeInfo info = { sizeof (PlannerPluginClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) mv_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (PlannerPlugin), 0, (GInstanceInitFunc) mv_init }; type = g_type_register_static (G_TYPE_OBJECT, "PlannerPlugin", &info, 0); } return type; } static void mv_class_init (PlannerPluginClass *klass) { GObjectClass *o_class; parent_class = g_type_class_peek_parent (klass); o_class = (GObjectClass *) klass; o_class->finalize = mv_finalize; } static void mv_init (PlannerPlugin *plugin) { plugin->init = NULL; plugin->exit = NULL; } static void mv_finalize (GObject *object) { PlannerPlugin *plugin = PLANNER_PLUGIN (object); if (plugin->exit) { plugin->exit (plugin); } /* Don't unload modules when running in valgrind to make sure * stack traces won't have missing symbols. */ if (!RUNNING_ON_VALGRIND) { g_module_close (plugin->handle); } } void planner_plugin_setup (PlannerPlugin *plugin, PlannerWindow *main_window) { g_return_if_fail (PLANNER_IS_PLUGIN (plugin)); plugin->main_window = main_window; if (plugin->init) { plugin->init (plugin); } }
#ifndef __VIBRATOR_H__ #define __VIBRATOR_H__ struct vibe_state; int _duty_cycle_store(struct vibe_state *state, int value); int _direction_store(struct vibe_state *state, int value); #endif
#pragma once /* * Copyright (C) 2005-2010 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #ifndef HAS_DS_PLAYER #error DSPlayer's header file included without HAS_DS_PLAYER defined #endif #include "FilterSelectionRule.h" #include <tinyxml.h> #include "globalfilterselectionrule.h" #include "dialogs/GUIDialogOK.h" #include "guilib/GUIWindowManager.h" #include "utils/StringUtils.h" typedef CFGFilter* (*InternalFilterConstructorPtr) (std::string name); template< class T > CFGFilter* InternalFilterConstructor(std::string name = "") { return new CFGFilterInternal<T>(name); }; struct InternalFilters { std::string name; std::string osdname; InternalFilterConstructorPtr cst; }; class CFilterCoreFactory { public: static std::vector<CFGFilterFile *> m_Filters; static HRESULT LoadFiltersConfiguration(TiXmlElement* pConfig); static HRESULT LoadMediasConfiguration(TiXmlElement* pConfig, int iPriority); static HRESULT GetSourceFilter(const CFileItem& pFileItem, std::string& filter); static HRESULT GetSplitterFilter(const CFileItem& pFileItem, std::string& filter); static HRESULT GetAudioRendererFilter(const CFileItem& pFileItem, std::string& filter); static HRESULT GetVideoFilter(const CFileItem& pFileItem, std::string& filter, bool dxva = false); static HRESULT GetAudioFilter(const CFileItem& pFileItem, std::string& filter, bool dxva = false); static HRESULT GetSubsFilter(const CFileItem& pFileItem, std::string& filter, bool dxva = false); static HRESULT GetExtraFilters(const CFileItem& pFileItem, std::vector<std::string>& filters, bool dxva = false); static HRESULT GetShaders(const CFileItem& pFileItem, std::vector<uint32_t>& shaders, std::vector<uint32_t>& shadersStage, bool dxva = false); static CFGFilter* GetFilterFromName(const std::string& filter, bool showError = true); static bool SomethingMatch(const CFileItem& pFileItem) { return (GetGlobalFilterSelectionRule(pFileItem) != NULL); } static void Destroy() { while (!m_Filters.empty()) { if (m_Filters.back()) delete m_Filters.back(); m_Filters.pop_back(); } while (!m_selecRules.empty()) { if (m_selecRules.back()) delete m_selecRules.back(); m_selecRules.pop_back(); } // CLog::Log(LOGDEBUG, "%s Ressources released", __FUNCTION__); } private: static bool CompareCFGFilterFileToString(CFGFilterFile * f, std::string s) { return StringUtils::EqualsNoCase(f->GetInternalName(),s); } static CGlobalFilterSelectionRule* GetGlobalFilterSelectionRule(const CFileItem& pFileItem, bool checkUrl = false); static std::vector<CGlobalFilterSelectionRule *> m_selecRules; static bool compare_by_word(CGlobalFilterSelectionRule* lhs, CGlobalFilterSelectionRule* rhs) { std::string strLine1 = lhs->GetPriority(); std::string strLine2 = rhs->GetPriority(); StringUtils::ToLower(strLine1); StringUtils::ToLower(strLine2); return strcmp(strLine1.c_str(), strLine2.c_str()) < 0; } };
/* * Written by Mark Spencer <markster@digium.com> * Based on previous works, designs, and architectures conceived and * written by Jim Dixon <jim@lambdatel.com>. * * Copyright (C) 2001 Jim Dixon / Zapata Telephony. * Copyright (C) 2001-2008 Digium, Inc. * * All rights reserved. * * Primary Author: Mark Spencer <markster@digium.com> * Radio Support by Jim Dixon <jim@lambdatel.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 as published by the * Free Software Foundation. See the LICENSE file included with * this program for more details. */ #include <stdio.h> #include <fcntl.h> #include <string.h> #include <errno.h> #include <stdio.h> #include <linux/types.h> #include <linux/ppp_defs.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <unistd.h> #include <stdlib.h> #include "bittest.h" #include <dahdi/user.h> #include "dahdi_tools_version.h" #define BLOCK_SIZE 2039 #define DEVICE "/dev/dahdi/channel" static const char rcsid[] = "$Id: pattest.c 9975 2011-06-07 19:44:34Z kmoore $"; char *prog_name; static void usage(void) { fprintf(stderr, "Usage: %s <dahdi_chan>\n", prog_name); fprintf(stderr, " e.g.: %s /dev/dahdi/55\n", prog_name); fprintf(stderr, " %s 455\n", prog_name); fprintf(stderr, "%s version %s\n", prog_name, rcsid); exit(1); } void print_packet(unsigned char *buf, int len) { int x; printf("{ "); for (x=0;x<len;x++) printf("%02x ",buf[x]); printf("}\n"); } int channel_open(const char *name, int *bs) { int channo, fd; struct dahdi_params tp; struct stat filestat; /* stat file, if character device, open it */ channo = strtoul(name, NULL, 10); fd = stat(name, &filestat); if (!fd && S_ISCHR(filestat.st_mode)) { fd = open(name, O_RDWR, 0600); if (fd < 0) { perror(name); return -1; } /* try out the dahdi_specify interface */ } else if (channo > 0) { fd = open(DEVICE, O_RDWR, 0600); if (fd < 0) { perror(DEVICE); return -1; } if (ioctl(fd, DAHDI_SPECIFY, &channo) < 0) { perror("DAHDI_SPECIFY ioctl failed"); return -1; } /* die */ } else { fprintf(stderr, "Specified channel is not a valid character " "device or channel number"); return -1; } if (ioctl(fd, DAHDI_SET_BLOCKSIZE, bs) < 0) { perror("SET_BLOCKSIZE"); return -1; } if (ioctl(fd, DAHDI_GET_PARAMS, &tp)) { fprintf(stderr, "Unable to get channel parameters\n"); return -1; } return fd; } int main(int argc, char *argv[]) { int fd; int res, x; int bs = BLOCK_SIZE; unsigned char c=0; unsigned char outbuf[BLOCK_SIZE]; int setup=0; int errors=0; int bytes=0; prog_name = argv[0]; if (argc < 2) { usage(); } fd = channel_open(argv[1], &bs); if (fd < 0) exit(1); ioctl(fd, DAHDI_GETEVENT); for(;;) { res = bs; res = read(fd, outbuf, res); if (res < bs) { int e; struct dahdi_spaninfo zi; res = ioctl(fd,DAHDI_GETEVENT,&e); if (res == -1) { perror("DAHDI_GETEVENT"); exit(1); } if (e == DAHDI_EVENT_NOALARM) printf("ALARMS CLEARED\n"); if (e == DAHDI_EVENT_ALARM) { zi.spanno = 0; res = ioctl(fd,DAHDI_SPANSTAT,&zi); if (res == -1) { perror("DAHDI_SPANSTAT"); exit(1); } printf("Alarm mask %x hex\n",zi.alarms); } continue; } if (!setup) { c = outbuf[0]; setup++; } for (x=0;x<bs;x++) { if (outbuf[x] != c) { printf("(Error %d): Unexpected result, %d != %d, %d bytes since last error.\n", ++errors, outbuf[x], c, bytes); c = outbuf[x]; bytes=0; } c = bit_next(c); bytes++; } #if 0 printf("(%d) Wrote %d bytes\n", packets++, res); #endif } }
#pragma once #include <algorithm> #include <cmath> #include <cstdint> #include <cstdio> #include <limits> #ifdef __MBED__ #define FORCE_INLINE __attribute__((always_inline)) #define RESTRICT __restrict__ #define MEM_BARRIER() asm volatile("" : : : "memory") #elif defined(_MSC_VER) #define FORCE_INLINE __forceinline #define RESTRICT __restrict #define MEM_BARRIER() inline void wait_us(int){}; #else #error "Compiler isn't supported!" #endif #ifdef NDEBUG #define scAssert(_Expression) ((void)0) #define scExecute(_Expression) ((void)0) #elif __MBED__ #define scAssert(_Expression) MBED_ASSERT(_Expression) #else #include <string> #include <stdexcept> #define scAssert(_Expression) \ do { \ if (!(_Expression)) \ throw std::logic_error((__FILE__ "(") + std::to_string(__LINE__) + \ ("): " #_Expression " ")); \ } while (false) #endif /* NDEBUG */ namespace StepperControl { inline auto lTruncTowardZero(float v) -> int32_t { return static_cast<int32_t>(v); } inline auto lTruncTowardInf(float v) -> int32_t { return static_cast<int32_t>(v < 0.0f ? floor(v) : ceil(v)); } constexpr auto inf() -> float { return std::numeric_limits<float>::infinity(); } constexpr const auto *eol = "\r\n"; inline const char *sep(int i, int size) { return i == size - 1 ? "" : ", "; } struct Printer { virtual ~Printer() {} virtual void print(const int32_t *n, int size) = 0; virtual void print(const float *n, int size) = 0; virtual void print(const char *str) = 0; static Printer *instance() { struct Default : Printer { void print(const float *n, int size) override { for (int i = 0; i < size; i++) { printf("%f%s", n[i], sep(i, size)); } } void print(const int32_t *n, int size) override { for (int i = 0; i < size; i++) { printf("%ld%s", n[i], sep(i, size)); } } void print(const char *str) override { printf("%s", str); } }; static Default p; return &p; } }; template <typename T> auto operator<<(Printer &p, T n) -> typename std::enable_if<std::is_integral<T>::value, Printer &>::type { auto val = static_cast<int32_t>(n); p.print(&val, 1); return p; } inline auto operator<<(Printer &p, float n) -> Printer & { p.print(&n, 1); return p; } inline auto operator<<(Printer &p, const char *str) -> Printer & { p.print(str); return p; } enum class DistanceMode { Absolute, Relative }; }
#define QOP_Precision 'D' #define QOP_Colors 'N' //#define QOP_Nc #define QDP_Precision 'D' #define QDP_Colors 'N' //#define QDP_Nc #define QLA_Precision 'D' #define QLA_Colors 'N' //#define QLA_Nc #include "mg/wilson_mg_p.c"
/****************************************************************************** * File : errorHandler.c * * Author : Carlos Rosales Fernandez (carlos@ihpc.a-star.edu.sg) * * Date : 01-09-2006 * * Revision : 1.0 * ******************************************************************************* * Prints an error message and exits to the system stopping the parent program.* ******************************************************************************/ /****************************************************************************** * COPYRIGHT & LICENSE INFORMATION * * * * Copyright 2006 Carlos Rosales Fernandez and The Institute of High * * Performance Computing (A*STAR) * * * * This file is part of thPost. * * * * thPost 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. * * * * thPost 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 thPost; if not, write to the Free Software * * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * ******************************************************************************/ void errorHandler(char errorText[]) { fprintf(stderr,"\n%s\n",errorText); fprintf(stderr,"*** PROGRAM TERMINATED ***\n\n"); exit(1); }
#include <linux/module.h> #include <linux/init.h> /* This is the function executed during the module loading */ static int dummy_module_init(void) { printk("dummy_module loaded!\n"); return 0; } /* This is the function executed during the module unloading */ static void dummy_module_exit(void) { printk("dummy_module unloaded!\n"); return; } module_init(dummy_module_init); module_exit(dummy_module_exit); MODULE_LICENSE("GPL");
/* * The ManaPlus Client * Copyright (C) 2011-2018 The ManaPlus Developers * * This file is part of The ManaPlus Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* _______ __ __ __ ______ __ __ _______ __ __ * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson * * * Per Larsson a.k.a finalman * Olof Naessén a.k.a jansem/yakslem * * Visit: http://guichan.sourceforge.net * * License: (BSD) * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name of Guichan nor the names of its contributors may * be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef LISTENERS_ACTIONLISTENER_H #define LISTENERS_ACTIONLISTENER_H #include "events/actionevent.h" /** * Interface for listening for action events from widgets. * * @see Widget::addActionListener, Widget::removeActionListener, * ActionEvent * @author Olof Naessén * @author Per Larsson */ class ActionListener notfinal { public: A_DELETE_COPY(ActionListener) /** * Destructor. */ virtual ~ActionListener() { } /** * Called when an action is recieved from a widget. It is used * to be able to recieve a notification that an action has * occured. * * @param actionEvent The event of the action. */ virtual void action(const ActionEvent &actionEvent) = 0; protected: /** * Constructor. * * You should not be able to make an instance of ActionListener, * therefore its constructor is protected. */ ActionListener() { } }; #endif // LISTENERS_ACTIONLISTENER_H
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <errno.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <netdb.h> #include <poll.h> #include <getopt.h> #include "libespif.h" static void usage(const espif_setup *setup) { fprintf(stderr, "usage: espif [options] host string...\n"); fprintf(stderr, "-C|--conntr set connect attempts [%d]\n", setup->conntr); fprintf(stderr, "-c|--connto set connect / send timeout in milliseconds [%d]\n", setup->connto); fprintf(stderr, "-d|--retrydelay set delay in milliseconds before earch retry [%d]\n", setup->retrydelay); fprintf(stderr, "-m|--multicast use multicast [%d]\n", setup->use_multicast); fprintf(stderr, "-p|--port set port [%d]\n", setup->port); fprintf(stderr, "-r|--recvto1 set initial receive timeout in milliseconds [%d]\n", setup->recvto1); fprintf(stderr, "-R|--recvto2 set subsequent receive timeout in milliseconds [%d]\n", setup->recvto2); fprintf(stderr, "-s|--sendtr set send/receive retries [%d]\n", setup->sendtr); fprintf(stderr, "-t|--tcp force use of tcp [%d]\n", setup->force_tcp); fprintf(stderr, "-u|--udp force use of udp [%d]\n", setup->force_udp); fprintf(stderr, "-v|--verbose enable verbose output on stderr [%d]\n", setup->use_multicast); } int main(int argc, char ** argv) { static const char *shortopts = "C:c:mR:r:p:s:tuv"; static const struct option longopts[] = { { "conntr", required_argument, 0, 'C' }, { "connto", required_argument, 0, 'c' }, { "port", required_argument, 0, 'p' }, { "multicast", no_argument, 0, 'm' }, { "recvto2", required_argument, 0, 'R' }, { "recvto1", required_argument, 0, 'r' }, { "retrydelay", required_argument, 0, 'd' }, { "sendtr", required_argument, 0, 's' }, { "tcp", no_argument, 0, 't' }, { "udp", no_argument, 0, 'u' }, { "verbose", no_argument, 0, 'v' }, { 0, 0, 0, 0 } }; char buffer[128 * 1024]; int arg; espif_setup setup = { .verbose = 0, .connto = 1000, .conntr = 2, .use_multicast = false, .port = 24, .recvto1 = 2000, .recvto2 = 100, .retrydelay = 200, .force_tcp = false, .force_udp = false, .sendtr = 4, }; while((arg = getopt_long(argc, argv, shortopts, longopts, 0)) != -1) { switch(arg) { case('C'): { setup.conntr = atoi(optarg); break; } case('c'): { setup.connto = atoi(optarg); break; } case('d'): { setup.retrydelay = atoi(optarg); break; } case('m'): { setup.use_multicast = true; setup.force_udp = true; setup.force_tcp = false; break; } case('p'): { setup.port = atoi(optarg); break; } case('R'): { setup.recvto2 = atoi(optarg); break; } case('r'): { setup.recvto1 = atoi(optarg); break; } case('s'): { setup.sendtr = atoi(optarg); break; } case('t'): { setup.force_tcp = 1; break; } case('u'): { setup.force_udp = 1; break; } case('v'): { setup.verbose = 1; break; } default: { usage(&setup); exit(1); } } } if((argc - optind) <= 1) { usage(&setup); exit(1); } buffer[0] = '\0'; for(arg = optind + 1; argv[arg]; arg++) { if(strlen(buffer) > 0) { strncat(buffer, " ", sizeof(buffer) - 1); buffer[sizeof(buffer) - 1] = '\0'; } strncat(buffer, argv[arg], sizeof(buffer) - 1); buffer[sizeof(buffer) - 1] = '\0'; } strncat(buffer, "\r\n", sizeof(buffer) - 1); buffer[sizeof(buffer) - 1] = '\0'; if(espif(&setup, argv[optind], buffer, sizeof(buffer), buffer)) printf("ERROR: %s\n", buffer); else printf("%s\n", buffer); return(0); }
/******************************************************************************** ** Form generated from reading UI file 'libraryfoldersdock.ui' ** ** Created by: Qt User Interface Compiler version 5.7.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_LIBRARYFOLDERSDOCK_H #define UI_LIBRARYFOLDERSDOCK_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QHeaderView> #include <QtWidgets/QTreeWidget> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_LibraryFoldersDock { public: QHBoxLayout *horizontalLayout; QTreeWidget *foldersTreeWidget; void setupUi(QWidget *LibraryFoldersDock) { if (LibraryFoldersDock->objectName().isEmpty()) LibraryFoldersDock->setObjectName(QStringLiteral("LibraryFoldersDock")); LibraryFoldersDock->resize(216, 440); horizontalLayout = new QHBoxLayout(LibraryFoldersDock); horizontalLayout->setSpacing(0); horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); horizontalLayout->setContentsMargins(0, 0, 0, 0); foldersTreeWidget = new QTreeWidget(LibraryFoldersDock); QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem(); __qtreewidgetitem->setText(0, QStringLiteral("1")); foldersTreeWidget->setHeaderItem(__qtreewidgetitem); foldersTreeWidget->setObjectName(QStringLiteral("foldersTreeWidget")); foldersTreeWidget->setUniformRowHeights(true); foldersTreeWidget->setColumnCount(1); foldersTreeWidget->header()->setVisible(false); horizontalLayout->addWidget(foldersTreeWidget); retranslateUi(LibraryFoldersDock); QMetaObject::connectSlotsByName(LibraryFoldersDock); } // setupUi void retranslateUi(QWidget *LibraryFoldersDock) { LibraryFoldersDock->setWindowTitle(QApplication::translate("LibraryFoldersDock", "Form", 0)); } // retranslateUi }; namespace Ui { class LibraryFoldersDock: public Ui_LibraryFoldersDock {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_LIBRARYFOLDERSDOCK_H
#include <stdio.h> /* If we are compiling on Windows compile these functions and/or add these headers */ #if defined(_WIN16) #include <conio.h> /* Clear the screen using this function when conio.h is not present */ void clrscr() { printf("\x1B[2J\x1B[0;0f"); } /* Otherwise define getch() and getche() */ #elif defined(__linux__) #include <termios.h> static struct termios old, new; /* Initialize new terminal i/o settings */ void initTermios(int echo) { tcgetattr(0, &old); /* grab old terminal i/o settings */ new = old; /* make new settings same as old settings */ new.c_lflag &= ~ICANON; /* disable buffered i/o */ new.c_lflag &= echo ? ECHO : ~ECHO; /* set echo mode */ tcsetattr(0, TCSANOW, &new); /* use these new terminal i/o settings now */ } /* Restore old terminal i/o settings */ void resetTermios(void) { tcsetattr(0, TCSANOW, &old); } /* Read 1 character - echo defines echo mode */ char getch_(int echo) { char ch; initTermios(echo); ch = getchar(); resetTermios(); return ch; } /* Read 1 character without echo */ char getch(void) { return getch_(0); } /* Read 1 character with echo */ char getche(void) { return getch_(1); } /* Clear the screen */ void clrscr() { printf("\x1B[2J\x1B[0;0f"); } #endif int main() { int order, output = 0, i, j, mat[3][3]; clrscr(); printf("Enter the order of the matrix(2/3): "); scanf("%d", &order); if (order < 2 || order > 3) { printf("\nWrong input!!"); getch(); return 0; } printf("Enter your matrix input:\n"); for (i = 0; i < order; i++) for (j = 0; j < order; j++) { printf("Element #[%d][%d] : ", i,j); scanf("%d",&mat[i][j]); } if (order == 2) { output = (mat[0][0] * mat[1][1]) - (mat[0][1] * mat[1][0]); } else if (order == 3) { output = (mat[0][0] * mat[1][1] * mat[2][2]) - (mat[0][0] * mat[2][1] * mat[1][2]) - (mat[0][1] * mat[1][0] * mat[2][2]) + (mat[0][1] * mat[2][0] * mat[1][2]) + (mat[0][2] * mat[1][0] * mat[2][1]) - (mat[0][2] * mat[1][1] * mat[2][0]); } printf("Determinant for the given matrix: %d\n", output); getch(); return 0; }
/* * limits.h Machine and OS limits * * Open Watcom Project * * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== * * This file contains Original Code and/or Modifications of Original * Code as defined in and that are subject to the Sybase Open Watcom * Public License version 1.0 (the 'License'). You may not use this file * except in compliance with the License. BY USING THIS FILE YOU AGREE TO * ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is * provided with the Original Code and Modifications, and is also * available at www.sybase.com/developer/opensource. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR * NON-INFRINGEMENT. Please see the License for the specific language * governing rights and limitations under the License. * * ======================================================================== */ #ifndef _LIMITS_H_INCLUDED #define _LIMITS_H_INCLUDED #ifndef MB_CUR_MAX #define MB_CUR_MAX 2 #endif #ifndef MB_LEN_MAX #define MB_LEN_MAX 2 #endif /* * ANSI required limits */ #define CHAR_BIT 8 /* number of bits in a byte */ #ifdef __CHAR_SIGNED__ #define CHAR_MIN (-128) /* minimum value of a char */ #define CHAR_MAX 127 /* maximum value of a char */ #else #define CHAR_MIN 0 /* minimum value of a char */ #define CHAR_MAX 255 /* maximum value of a char */ #endif #define SCHAR_MIN (-128) /* minimum value of a signed char */ #define SCHAR_MAX 127 /* maximum value of a signed char */ #define UCHAR_MAX 255U /* maximum value of an unsigned char */ #define SHRT_MIN (-32767-1) /* minimum value of a short int */ #define SHRT_MAX 32767 /* maximum value of a short int */ #define USHRT_MAX 65535U /* maximum value of an unsigned short */ #define LONG_MAX 2147483647L /* maximum value of a long int */ #define LONG_MIN (-2147483647L-1) /* minimum value of a long int */ #define ULONG_MAX 4294967295UL /* maximum value of an unsigned long*/ #if defined(__386__) || defined(__AXP__) || defined(__PPC__) || defined(__x86_64__) || defined(__MIPS__) #define INT_MIN (-2147483647-1) /* minimum value of an int */ #define INT_MAX 2147483647 /* maximum value of an int */ #define UINT_MAX 4294967295U /* maximum value of an unsigned int*/ #elif defined(__16BIT__) #define INT_MIN (-32767-1) /* minimum value of an int */ #define INT_MAX 32767 /* maximum value of an int */ #define UINT_MAX 65535U /* maximum value of an unsigned int*/ #else #error Unsupported platform! #endif #ifdef __WATCOM_INT64__ #define LONGLONG_MIN (-9223372036854775807I64-1) /* minimum value of an __int64 */ #define LONGLONG_MAX 9223372036854775807I64 /* maximum value of an __int64 */ #define ULONGLONG_MAX 18446744073709551615UI64 /* maximum value of an unsigned __int64*/ #define LLONG_MIN (-9223372036854775807LL-1) /* for C99 */ #define LLONG_MAX 9223372036854775807LL /* for C99 */ #define ULLONG_MAX 18446744073709551615ULL /* for C99 */ #endif #define _I8_MIN SCHAR_MIN /* minimum value of a signed 8 bit type */ #define _I8_MAX SCHAR_MAX /* maximum value of a signed 8 bit type */ #define _UI8_MAX UCHAR_MAX /* maximum value of an unsigned 8 bit type*/ #define _I16_MIN SHRT_MIN /* minimum value of a signed 16 bit type */ #define _I16_MAX SHRT_MAX /* maximum value of a signed 16 bit type */ #define _UI16_MAX USHRT_MAX /* maximum value of an unsigned 16 bit type*/ #define _I32_MIN LONG_MIN /* minimum value of a signed 32 bit type */ #define _I32_MAX LONG_MAX /* maximum value of a signed 32 bit type */ #define _UI32_MAX ULONG_MAX /* maximum value of an unsigned 32 bit type*/ #ifdef __WATCOM_INT64__ #define _I64_MIN LONGLONG_MIN /* minimum value of a signed 64 bit type */ #define _I64_MAX LONGLONG_MAX /* maximum value of a signed 64 bit type */ #define _UI64_MAX ULONGLONG_MAX /* maximum value of an unsigned 64 bit type*/ #endif #define TZNAME_MAX 128 /* The maximum number of bytes */ /* supported for the name of a time */ /* zone (not of the TZ variable). */ #endif
/* Copyright (c) 2015 Andrzej <ndrwrdck@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 __PULSEAUDIO_MENU_H__ #define __PULSEAUDIO_MENU_H__ #include <glib.h> #include <gtk/gtk.h> #include "pulseaudio-volume.h" #include "pulseaudio-config.h" G_BEGIN_DECLS GType pulseaudio_menu_get_type (void); #define TYPE_PULSEAUDIO_MENU (pulseaudio_menu_get_type()) #define PULSEAUDIO_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_PULSEAUDIO_MENU, PulseaudioMenu)) #define PULSEAUDIO_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_PULSEAUDIO_MENU, PulseaudioMenuClass)) #define IS_PULSEAUDIO_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_PULSEAUDIO_MENU)) #define IS_PULSEAUDIO_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_PULSEAUDIO_MENU)) #define PULSEAUDIO_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_PULSEAUDIO_MENU, PulseaudioMenuClass)) typedef struct _PulseaudioMenu PulseaudioMenu; typedef struct _PulseaudioMenuClass PulseaudioMenuClass; GtkWidget *pulseaudio_menu_new (PulseaudioVolume *volume, PulseaudioConfig *config, GtkWidget *widget); G_END_DECLS #endif /* !__PULSEAUDIO_MENU_H__ */
// // AIListBookmark.h // Adium // // Created by Chloe Haney on 19/07/07. // #import <AIListContact.h> #import <AIAccount.h> #import <AIListGroup.h> @interface AIListBookmark : AIListContact <NSCoding> { NSDictionary *chatCreationDictionary; NSString *password; NSString *name; } - (id)initWithChat:(AIChat *)inChat; - (NSString*)name; - (NSDictionary*)chatCreationDictionary; - (void)openChat; @end
/* * cafebabe - the class loader library in C * Copyright (C) 2009 Tomasz Grabiec <tgrabiec@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. */ #include <stdio.h> #include <stdlib.h> #include "cafebabe/attribute_info.h" #include "cafebabe/source_file_attribute.h" #include "cafebabe/stream.h" int cafebabe_source_file_attribute_init(struct cafebabe_source_file_attribute *a, struct cafebabe_stream *s) { if (cafebabe_stream_read_uint16(s, &a->sourcefile_index)) goto out; if (!cafebabe_stream_eof(s)) { s->cafebabe_errno = CAFEBABE_ERROR_EXPECTED_EOF; goto out; } /* Success */ return 0; out: return 1; } void cafebabe_source_file_attribute_deinit(struct cafebabe_source_file_attribute *a) { }
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.h * @brief : Header for main.c file. * This file contains the common defines of the application. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license * SLA0044, the "License"; You may not use this file except in compliance with * the License. You may obtain a copy of the License at: * www.st.com/SLA0044 * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ /* USER CODE END EM */ /* Exported functions prototypes ---------------------------------------------*/ #define Error_Handler() Error_Handler_Ex(__BASE_FILE__, __LINE__, __FUNCTION__) /* USER CODE BEGIN EFP */ void Error_Handler_Ex(const char* file, int line, const char* func); /* USER CODE END EFP */ /* Private defines -----------------------------------------------------------*/ #define LD1_R_Pin GPIO_PIN_13 #define LD1_R_GPIO_Port GPIOC #define LD1_G_Pin GPIO_PIN_14 #define LD1_G_GPIO_Port GPIOC #define LD1_B_Pin GPIO_PIN_15 #define LD1_B_GPIO_Port GPIOC #define SPI_SYNC_MOSI_Pin GPIO_PIN_4 #define SPI_SYNC_MOSI_GPIO_Port GPIOA #define SD_GND_DETECT_Pin GPIO_PIN_5 #define SD_GND_DETECT_GPIO_Port GPIOC #define B1_Pin GPIO_PIN_14 #define B1_GPIO_Port GPIOB #define LD3_Pin GPIO_PIN_15 #define LD3_GPIO_Port GPIOB #define SD_DETECT_Pin GPIO_PIN_6 #define SD_DETECT_GPIO_Port GPIOC #define TMS_Pin GPIO_PIN_13 #define TMS_GPIO_Port GPIOA #define TCK_Pin GPIO_PIN_14 #define TCK_GPIO_Port GPIOA #define LD2_Pin GPIO_PIN_12 #define LD2_GPIO_Port GPIOC #define SWO_Pin GPIO_PIN_3 #define SWO_GPIO_Port GPIOB #define SPI_SYNC_MISO_Pin GPIO_PIN_6 #define SPI_SYNC_MISO_GPIO_Port GPIOB #define BUFFER_ENABLE_Pin GPIO_PIN_2 #define BUFFER_ENABLE_GPIO_Port GPIOA #define SATURN_POWER_Pin GPIO_PIN_3 #define SATURN_POWER_GPIO_Port GPIOA /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#undef CONFIG_USB_SERIAL_AIRPRIME
/* This file is part of krita Copyright (c) 2008 Boudewijn Rempt <boud@valdyas.org> Copyright (c) 2008 Thomas Zander <zander@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KRITA_EXPORT_H #define KRITA_EXPORT_H #include <kdemacros.h> /* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */ #if defined(_WIN32) || defined(_WIN64) #ifndef KRITAUI_EXPORT # ifdef MAKE_KRITAUI_LIB # define KRITAUI_EXPORT KDE_EXPORT # else # define KRITAUI_EXPORT KDE_IMPORT # endif #endif #ifndef KRITAIMAGE_EXPORT # ifdef MAKE_KRITAIMAGE_LIB # define KRITAIMAGE_EXPORT KDE_EXPORT # else # define KRITAIMAGE_EXPORT KDE_IMPORT # endif #endif #ifndef PAINTOP_EXPORT # ifdef MAKE_KRITALIBPAINTOP_LIB # define PAINTOP_EXPORT KDE_EXPORT # else # define PAINTOP_EXPORT KDE_IMPORT # endif #endif #ifndef BRUSH_EXPORT # ifdef MAKE_KRITALIBBRUSH_LIB # define BRUSH_EXPORT KDE_EXPORT # else # define BRUSH_EXPORT KDE_IMPORT # endif #endif #else // not windows #define KRITAUI_EXPORT KDE_EXPORT #define KRITAIMAGE_EXPORT KDE_EXPORT #define PAINTOP_EXPORT KDE_EXPORT #define BRUSH_EXPORT KDE_EXPORT #endif /* not windows */ /* Now the same for Krita*_TEST_EXPORT, if compiling with unit tests enabled */ #ifdef COMPILING_TESTS #if defined _WIN32 || defined _WIN64 # if defined(MAKE_KRITAUI_LIB) # define KRITAIMAGE_TEST_EXPORT KDE_EXPORT # define KRITAUI_TEST_EXPORT KDE_EXPORT # else # define KRITAIMAGE_TEST_EXPORT KDE_IMPORT # define KRITAUI_TEST_EXPORT KDE_IMPORT # endif # else /* not windows */ # define KRITAIMAGE_TEST_EXPORT KDE_EXPORT # define KRITAUI_TEST_EXPORT KDE_EXPORT # endif #else /* not compiling tests */ # define KRITAIMAGE_TEST_EXPORT # define KRITAUI_TEST_EXPORT #endif #endif /* KRITA_EXPORT_H */
/** file.h - file system browser subsystem **/ #ifndef FILE_H #define FILE_H #include <windows.h> #include <list> #include <string> using namespace std; typedef unsigned char uchar; class disk_file { private: public: disk_file() { } disk_file(const disk_file& src) { this->path=src.path.c_str(); } friend bool operator==(const disk_file& lh, const disk_file& rh); virtual bool kill(); virtual bool create(); virtual bool move(string& dest); virtual bool move(char* dest); virtual bool copy(string& dest); virtual bool copy(char* dest); virtual bool exists(); virtual bool setpath(string& path); virtual bool setpath(char* path); virtual string& getpath(); protected: string path; }; class file : public disk_file { private: public: file() { data=NULL; size=0; } file(const file& src) { this->path=src.path; size=src.size; } ~file(){ GlobalFree(data); } int getsize(); uchar* load(); bool write(uchar* data, int size); bool write(char* data); protected: uchar* data; int size; }; class directory : public disk_file { private: bool listdir(string dir); public: directory(){}; directory(const directory& src) { this->path=src.path; } ~directory(){}; bool listcontents(); list<file> contents; protected: }; #endif
/* $FreeBSD: release/8.2.0/lib/libc/include/port_before.h 156956 2006-03-21 15:37:16Z ume $ */ #ifndef _PORT_BEFORE_H_ #define _PORT_BEFORE_H_ #define _LIBC 1 //#define DO_PTHREADS 1 //#define USE_KQUEUE 1 #define ISC_SOCKLEN_T socklen_t #define ISC_FORMAT_PRINTF(fmt, args) \ __attribute__((__format__(__printf__, fmt, args))) #define DE_CONST(konst, var) \ do { \ union { const void *k; void *v; } _u; \ _u.k = konst; \ var = _u.v; \ } while (0) #define UNUSED(x) (x) = (x) #endif /* _PORT_BEFORE_H_ */
#ifndef ASM_X86_INTERNAL_H #warning Do not include this file directly #else static inline void asm_orl(struct assembler_state_t *state, const uint32_t src, uint32_t *dst) { *dst = *dst | src; write_cf(state->eflags, 0); write_of(state->eflags, 0); write_sf(state->eflags, *dst & 0x80000000); write_zf(state->eflags, !*dst); #ifdef X86_PF asm_update_pf(state->eflags, *dst); #endif } static inline void asm_orw(struct assembler_state_t *state, const uint16_t src, uint16_t *dst) { *dst = *dst | src; write_cf(state->eflags, 0); write_of(state->eflags, 0); write_sf(state->eflags, *dst & 0x8000); write_zf(state->eflags, !*dst); #ifdef X86_PF asm_update_pf(state->eflags, *dst); #endif } static inline void asm_orb(struct assembler_state_t *state, const uint8_t src, uint8_t *dst) { *dst = *dst | src; write_cf(state->eflags, 0); write_of(state->eflags, 0); write_sf(state->eflags, *dst & 0x80); write_zf(state->eflags, !*dst); #ifdef X86_PF asm_update_pf(state->eflags, *dst); #endif } #endif
// This file is part of Chaotic Rage (c) 2010 Josh Heidenreich // // kate: tab-width 4; indent-width 4; space-indent off; word-wrap off; #pragma once #include <string> #include <SDL2/SDL.h> class GameState; class Cmd { public: Cmd() { lock = SDL_CreateMutex(); complete = SDL_CreateCond(); }; virtual ~Cmd() { SDL_DestroyMutex(lock); SDL_DestroyCond(complete); } void exec(GameState* st) { SDL_LockMutex(lock); this->resp = this->doWork(st); SDL_CondBroadcast(complete); SDL_UnlockMutex(lock); }; void cancel() { SDL_LockMutex(lock); this->resp = ""; SDL_CondBroadcast(complete); SDL_UnlockMutex(lock); } virtual std::string doWork(GameState* st) = 0; std::string waitDone() { SDL_LockMutex(lock); SDL_CondWait(complete, lock); SDL_UnlockMutex(lock); return this->resp; }; private: SDL_mutex* lock; SDL_cond* complete; std::string resp; };
/* * Copyright (C) 2014 Red Hat * * Author: Nikos Mavrogiannopoulos * * This file is part of ocserv. * * ocserv 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. * * ocserv is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <occtl.h> #if defined(HAVE_LIBNL) && defined(__linux__) #include <netlink/netlink.h> #include <netlink/socket.h> #include <netlink/route/link.h> #include <inttypes.h> static struct nl_sock *sock = NULL; static int nl_failed = 0; static int open_netlink(void) { int err; if (sock != NULL) return 0; if (nl_failed != 0) /* don't bother re-opening */ return -1; sock = nl_socket_alloc(); if (sock == NULL) { fprintf(stderr, "nl: cannot open netlink\n"); goto error; } if ((err = nl_connect(sock, NETLINK_ROUTE)) < 0) { fprintf(stderr, "nl: error in nl_connect"); goto error; } return 0; error: if (sock != NULL) { nl_socket_free(sock); sock = NULL; } nl_failed = 1; return -1; } static void value2speed(unsigned long bytes, time_t time, char* output, unsigned output_size) { unsigned long speed; speed = bytes / time; bytes2human(speed, output, output_size, "/sec"); } void print_iface_stats(const char *iface, time_t since, FILE * out, cmd_params_st *params, unsigned have_more) { uint64_t tx, rx; char buf1[32], buf2[32]; time_t diff = time(0) - since; int ret; struct rtnl_link *rlink = NULL; if (iface == NULL || iface[0] == 0) return; if (open_netlink() < 0) return; ret = rtnl_link_get_kernel(sock, 0, iface, &rlink); if (ret < 0) { fprintf(stderr, "nl: cannot find %s\n", iface); return; } rx = rtnl_link_get_stat(rlink, RTNL_LINK_RX_BYTES); tx = rtnl_link_get_stat(rlink, RTNL_LINK_TX_BYTES); bytes2human(rx, buf1, sizeof(buf1), NULL); bytes2human(tx, buf2, sizeof(buf2), NULL); if (HAVE_JSON(params)) { fprintf(out, " \"RX\": \"%"PRIu64"\",\n \"TX\": \"%"PRIu64"\",\n", rx, tx); fprintf(out, " \"_RX\": \"%s\",\n \"_TX\": \"%s\",\n", buf1, buf2); } else fprintf(out, "\tRX: %"PRIu64" (%s) TX: %"PRIu64" (%s)\n", rx, buf1, tx, buf2); value2speed(rx, diff, buf1, sizeof(buf1)); value2speed(tx, diff, buf2, sizeof(buf2)); if (HAVE_JSON(params)) fprintf(out, " \"Average RX\": \"%s\",\n \"Average TX\": \"%s\"%s\n", buf1, buf2, have_more?",":""); else fprintf(out, "\tAverage bandwidth RX: %s TX: %s\n", buf1, buf2); return; } #else void print_iface_stats(const char *iface, time_t since, FILE * out, cmd_params_st *params, unsigned have_more) { return; } #endif
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * This file was automatically generated by headergen, DO NOT EDIT it. * headergen version: 2.1.8 * XML versions: stmp3600:2.3.0 * * Copyright (C) 2013 by Amaury Pouly * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef __SELECT__MEMCPY__H__ #define __SELECT__MEMCPY__H__ #include "regs-macro.h" #define STMP3600_INCLUDE "stmp3600/regs-memcpy.h" #include "regs-select.h" #undef STMP3600_INCLUDE #endif /* __SELECT__MEMCPY__H__ */
/* * Print Dialog for Canon LIPS/PS/LIPSLX/UFR2/CAPT Printer. * Copyright (C) 2010-2011 Canon 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; 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 _WIDGETS #define _WIDGETS #include <gtk/gtk.h> #include <glade/glade.h> #include "cngplpmodIF.h" #include "controller.h" #include "localize.h" #ifdef __cplusplus extern "C" { #endif extern GtkWidget* g_main_dlg; void SigInit(void); gboolean SigEnable(void); gboolean SigDisable(void); char* GetCurrOpt(cngplpData* data, const int id, const char *in); char* GetOptionList(cngplpData* data, const int id); void UpdateDataCheck(const int id, const int active); void SetGladeXML(GladeXML* my_xml); void SetData(cngplpData* my_data); void UpdateData(int id, const char *value); void UpdateDataCombo(const int id, const char *combo_entry_name); void UpdateCpcaComboWidget(const int id, const char *combo_name); const gchar* GetTextEntry(const char *entry_name); void SetTextEntry(const gchar *entry_name, const gchar *text); gchar* GetTextofTextView(const char *text_view_name); void SetTextofTextView(const char *text_view_name, const gchar *text, const int length); void SetTextview(const WidgetInfo* widget_info); void SavePrinterData(); FuncInfo *FindKeyInfoBasedID(ConfigFile* config, int id); void ShowDialog(const char *dialog, int print); PropInfo *FindProperty(PropInfo *prop_list, const char *name); char* GetCNUIValue(char *key); void SetMainDlgInfo(GtkWidget* main_dlg, const char* main_dlg_name); double GetCurrOptDouble(int id, double def); void SetActiveCheckButton(const gchar *widget_name, gboolean on); void UpdateDataDouble(int id, double value); gfloat GetSpinButtonValue(const gchar *spin_button_name); void SetCursolPosition(const gchar *entry_name, const gint position); int GetCharSet(void); void SetTextMaxLength(const gchar *entry_name, const gint max_num); void SetEntryVisibility(const gchar *entry_name); void UpdateAllPPDWidgets(char *id_list); void UpdatePropGeneralWidgets(const int id); void SetWidgetSensitive(const gchar *widget_name, gboolean value); void memFree(void *pointer); int GetCurrOptInt(int id, int def); void UpdateDataInt(int id, int value); void HideDialog(const char *dlg_name, const gboolean flag); void RestoreDefault(); void SetTextToLabel(const gchar *label_name, const gchar *text); void SetButtonLabel(const gchar *button_name, const gchar *text); void SetActiveRadioButton(const gchar *button_name[], int set_index); gboolean FindKey(const KeyInfo *key, cngplpData *data); #define EUC 1 #define UTF8 2 #if 0 GList *GetGList(cngplpData* data, int id); gchar* GetCurrComboText(gchar *combo_entry_name); void ShowFunctionWidget(const FuncInfo *funclist); #endif #ifdef __cplusplus } #endif #endif
/* * This source code is public domain. * * Authors: Rani Assaf <rani@magic.metawire.com>, * Olivier Lapicque <olivierl@jps.net>, * Adam Goode <adam@evdebs.org> (endian and char fixes for PPC) */ #ifndef _STDAFX_H_ #define _STDAFX_H_ /* Autoconf detection of stdint/inttypes */ #if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED) # include "config.h" # define CONFIG_H_INCLUDED 1 #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif /* disable AGC and FILESAVE for all targets for uniformity. */ #define NO_AGC #define MODPLUG_NO_FILESAVE #ifdef _WIN32 #ifdef MSC_VER #pragma warning (disable:4201) #pragma warning (disable:4514) #endif #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> #include <mmsystem.h> #include <stdio.h> #include <malloc.h> #include <stdint.h> #define srandom(_seed) srand(_seed) #define random() rand() #define sleep(_ms) Sleep(_ms) inline void ProcessPlugins(int n) {} #undef strcasecmp #undef strncasecmp #define strcasecmp(a,b) _stricmp(a,b) #define strncasecmp(a,b,c) _strnicmp(a,b,c) #define HAVE_SINF 1 #ifndef isblank #define isblank(c) ((c) == ' ' || (c) == '\t') #endif #else #include <stdlib.h> #include <stdio.h> #include <string.h> #ifdef HAVE_MALLOC_H #include <malloc.h> #endif typedef int8_t CHAR; typedef uint8_t UCHAR; typedef uint8_t* PUCHAR; typedef uint16_t USHORT; typedef uint32_t ULONG; typedef uint32_t UINT; typedef uint32_t DWORD; typedef int32_t LONG; typedef int64_t LONGLONG; typedef int32_t* LPLONG; typedef uint32_t* LPDWORD; typedef uint16_t WORD; typedef uint8_t BYTE; typedef uint8_t* LPBYTE; typedef bool BOOL; typedef char* LPSTR; typedef void* LPVOID; typedef uint16_t* LPWORD; typedef const char* LPCSTR; typedef void* PVOID; typedef void VOID; static inline LONG MulDiv (long a, long b, long c) { /*if (!c) return 0;*/ return ((uint64_t) a * (uint64_t) b ) / c; } #define LPCTSTR LPCSTR #define lstrcpyn strncpy #define lstrcpy strcpy #define lstrcmp strcmp #define wsprintf sprintf #define WAVE_FORMAT_PCM 1 #define GHND 0 #define GlobalFreePtr(p) free((void *)(p)) static inline int8_t * GlobalAllocPtr(unsigned int, size_t size) { int8_t * p = (int8_t *) malloc(size); if (p != NULL) memset(p, 0, size); return p; } static inline void ProcessPlugins(int n) {} #ifndef FALSE #define FALSE false #endif #ifndef TRUE #define TRUE true #endif #endif /* _WIN32 */ #define MODPLUG_EXPORT #endif
/* tls_kt_WCertificateRequest.c Copyright: Copyright 2002-2007, SafeNet Inc. All rights reserved. All rights reserved. */ #include "sshtlskextrans.h" SshTlsTransStatus ssh_tls_trans_write_server_certreq(SshTlsProtocolState s) { #ifdef SSHDIST_VALIDATOR int i, l; SshDNStruct dn; unsigned char *der; size_t der_len; if (s->kex.flags & SSH_TLS_KEX_ANONYMOUS_SERVER) { SSH_DEBUG(5, ("Anonymous server so cannot request client certificate.")); s->kex.state = SSH_TLS_KEX_SEND_S_HELLODONE; return SSH_TLS_TRANS_OK; } if (!(s->conf.flags & SSH_TLS_CLIENTAUTH)) { SSH_DEBUG(6, ("Client authentication not requested so do not request " "client certificate.")); s->kex.state = SSH_TLS_KEX_SEND_S_HELLODONE; return SSH_TLS_TRANS_OK; } s->kex.flags |= SSH_TLS_KEX_CLIENT_CERT_REQUESTED; if (s->conf.suggested_ca_distinguished_names == NULL || s->conf.suggested_ca_distinguished_names[0] == NULL) { FAIL(SSH_TLS_ALERT_INTERNAL_ERROR, ("no suggested distinguished names for CAs")); } /* Currently, we support only the rsa_sign(1) certificate type. */ SSH_DEBUG(6, ("Requesting client certificate.")); /* Calculate the length of the name list and write header. */ l = 0; for (i = 0; s->conf.suggested_ca_distinguished_names[i] != NULL; i++) { ssh_dn_init(&dn); ssh_dn_decode_ldap(s->conf.suggested_ca_distinguished_names[i], &dn); ssh_dn_encode_der(&dn, &der, &der_len, NULL); l += der_len + 2; ssh_free(der); ssh_dn_clear(&dn); } l += 2; ssh_tls_make_hs_header(s, SSH_TLS_HS_CERT_REQ, l + 2); { unsigned char tempbuf[2]; /* Write certificate types */ tempbuf[0] = 1; tempbuf[1] = SSH_TLS_CERTTYPE_RSA_SIGN; ssh_tls_add_to_kex_packet(s, tempbuf, 2); /* Write distinguished names */ SSH_DEBUG(7, ("Enumerating the list of suggested CAs:")); SSH_PUT_16BIT(tempbuf, l - 2); ssh_tls_add_to_kex_packet(s, tempbuf, 2); for (i = 0; s->conf.suggested_ca_distinguished_names[i] != NULL; i++) { ssh_dn_init(&dn); ssh_dn_decode_ldap(s->conf.suggested_ca_distinguished_names[i], &dn); der_len = 0; ssh_dn_encode_der(&dn, &der, &der_len, NULL); l = der_len; SSH_DEBUG(7, ("(%d) CA `%s' (%d bytes der).", i, s->conf.suggested_ca_distinguished_names[i], l)); SSH_PUT_16BIT(tempbuf, l); ssh_tls_add_to_kex_packet(s, tempbuf, 2); ssh_tls_add_to_kex_packet(s, (unsigned char *)der, l); ssh_free(der); ssh_dn_clear(&dn); } } s->kex.state = SSH_TLS_KEX_SEND_S_HELLODONE; #endif /* SSHDIST_VALIDATOR */ /* At present the non SSHDIST_VALIDATOR distribution does not request certificates from the peer. */ s->kex.state = SSH_TLS_KEX_SEND_S_HELLODONE; return SSH_TLS_TRANS_OK; }
/* { dg-do compile { target *-octeon-* } } */ /* { dg-options "-O2" } */ /* SI-truncation of a 32 or more bit zero-extraction is really a sign-extraction. */ /* { dg-final { scan-assembler "exts\t.*,31" } } */ typedef unsigned short int uint16_t; typedef unsigned long long uint64_t; struct prts { uint64_t pad:8; uint64_t prts:33; }; typedef struct flow_record { struct prts key2; uint16_t dstsd; } FlowRecord, *Flow; fw_flow_dump (Flow flow) { f ((int) flow->key2.prts, decode_sd (flow->dstsd)); }
/* * \brief Some size definitions and macros needed by LwIP. * \author Stefan Kalkowski * \date 2009-11-10 */ /* * Copyright (C) 2009-2012 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. */ #ifndef __LWIP__ARCH__CC_H__ #define __LWIP__ARCH__CC_H__ #include <stddef.h> #include <base/fixed_stdint.h> typedef genode_uint8_t u8_t; typedef genode_int8_t s8_t; typedef genode_uint16_t u16_t; typedef genode_int16_t s16_t; typedef genode_uint32_t u32_t; typedef genode_int32_t s32_t; typedef unsigned long mem_ptr_t; /* Define (sn)printf formatters */ #define U16_F "u" // we don't have hu #define S16_F "d" // we don't have hd #define X16_F "x" // we don't have hx #define U32_F "u" #define S32_F "d" #define X32_F "x" void lwip_printf(const char *format, ...); #define LWIP_PLATFORM_DIAG(x) do { lwip_printf x; } while(0) #ifdef GENODE_RELEASE #define LWIP_PLATFORM_ASSERT(x) #else /* GENODE_RELEASE */ #define LWIP_PLATFORM_ASSERT(x) do { \ lwip_printf("Assertion \"%s\" failed at line %d in %s\n", \ x, __LINE__, __FILE__); } while(0) #endif /* GENODE_RELEASE */ #define PACK_STRUCT_FIELD(x) x #define PACK_STRUCT_STRUCT #define PACK_STRUCT_BEGIN #define PACK_STRUCT_END #ifndef BYTE_ORDER #define BYTE_ORDER LITTLE_ENDIAN #endif /* BYTE_ORDER */ #define mem_realloc realloc #endif /* __LWIP__ARCH__CC_H__ */
// // YGAppDelegate+StatusBar.h // iSpoiler // // Created by HEINRICH Yannick on 02/10/13. // Copyright (c) 2013 YaGeek. All rights reserved. // #import "YGAppDelegate.h" @interface YGAppDelegate (StatusBar) - (void) initStatusBar; - (void) setStatusBarHidden:(BOOL) hidden; - (void) setProgress:(CGFloat) value; - (void) setStatusTextValue:(NSString*) value; @end
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. Copyright 2010 Lennart Poettering systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include <stdlib.h> #include <stdbool.h> #include <errno.h> #include <string.h> #include <stdio.h> #include <limits.h> #include <stdarg.h> #include "log.h" #include "hashmap.h" #include "strv.h" #include "util.h" static int delete_rule(const char *rule) { char *x, *fn, *e; int r; assert(rule[0]); if (!(x = strdup(rule))) return -ENOMEM; e = strchrnul(x+1, x[0]); *e = 0; asprintf(&fn, "/proc/sys/fs/binfmt_misc/%s", x+1); free(x); if (!fn) return -ENOMEM; r = write_one_line_file(fn, "-1"); free(fn); return r; } static int apply_rule(const char *rule) { int r; delete_rule(rule); if ((r = write_one_line_file("/proc/sys/fs/binfmt_misc/register", rule)) < 0) { log_error("Failed to add binary format: %s", strerror(-r)); return r; } return 0; } static int apply_file(const char *path, bool ignore_enoent) { FILE *f; int r = 0; assert(path); if (!(f = fopen(path, "re"))) { if (ignore_enoent && errno == ENOENT) return 0; log_error("Failed to open file '%s', ignoring: %m", path); return -errno; } log_debug("apply: %s\n", path); while (!feof(f)) { char l[LINE_MAX], *p; int k; if (!fgets(l, sizeof(l), f)) { if (feof(f)) break; log_error("Failed to read file '%s', ignoring: %m", path); r = -errno; goto finish; } p = strstrip(l); if (!*p) continue; if (strchr(COMMENTS, *p)) continue; if ((k = apply_rule(p)) < 0 && r == 0) r = k; } finish: fclose(f); return r; } int main(int argc, char *argv[]) { int r = 0; if (argc > 2) { log_error("This program expects one or no arguments."); return EXIT_FAILURE; } log_set_target(LOG_TARGET_AUTO); log_parse_environment(); log_open(); if (argc > 1) { r = apply_file(argv[1], false); } else { char **files, **f; /* Flush out all rules */ write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1"); r = conf_files_list(&files, ".conf", "/run/binfmt.d", "/etc/binfmt.d", "/usr/local/lib/binfmt.d", "/usr/lib/binfmt.d", NULL); if (r < 0) { log_error("Failed to enumerate binfmt.d files: %s", strerror(-r)); goto finish; } STRV_FOREACH(f, files) { int k; k = apply_file(*f, true); if (k < 0 && r == 0) r = k; } strv_free(files); } finish: return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; }
/*************************************************************************** * Copyright (C) 2007 by Christoph Thelen * * doc_bacardi@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. * ***************************************************************************/ #include "../romloader.h" #ifndef __ROMLOADER_USB_MAIN_H__ #define __ROMLOADER_USB_MAIN_H__ /*-----------------------------------*/ /* The LIBUSB header is only used in the private section of the class. * It should not be exported. */ #ifndef SWIG # include "romloader_usb_device_libusb.h" #endif /*-----------------------------------*/ class romloader_usb_provider; /*-----------------------------------*/ class romloader_usb : public romloader { public: romloader_usb(const char *pcName, const char *pcTyp, romloader_usb_provider *ptProvider, unsigned int uiBusNr, unsigned int uiDeviceAdr); romloader_usb(const char *pcName, const char *pcTyp, const char *pcLocation, romloader_usb_provider *ptProvider, unsigned int uiBusNr, unsigned int uiDeviceAdr); ~romloader_usb(void); // *** lua interface start *** // open the connection to the device virtual void Connect(lua_State *ptClientData); // close the connection to the device virtual void Disconnect(lua_State *ptClientData); // *** lua interface end *** protected: virtual TRANSPORTSTATUS_T send_raw_packet(const void *pvPacket, size_t sizPacket); virtual TRANSPORTSTATUS_T receive_packet(void); private: #ifndef SWIG // static const size_t m_sizMaxPacketSizeHost = 8192+64; // size_t m_sizMaxPacketSizeClient; // uint8_t m_aucPacketOutputBuffer[m_sizMaxPacketSizeHost]; // uint8_t m_aucPacketInputBuffer[m_sizMaxPacketSizeHost]; // unsigned int m_uiMonitorSequence; romloader_usb_provider *m_ptUsbProvider; unsigned int m_uiBusNr; unsigned int m_uiDeviceAdr; /* Pointer to the USB device and the USB device handle. */ romloader_usb_device_libusb *m_ptUsbDevice; #endif }; /*-----------------------------------*/ class romloader_usb_provider : public muhkuh_plugin_provider { public: romloader_usb_provider(swig_type_info *p_romloader_usb, swig_type_info *p_romloader_usb_reference); ~romloader_usb_provider(void); int DetectInterfaces(lua_State *ptLuaStateForTableAccess, lua_State *ptLuaStateForTableAccessOptional); virtual romloader_usb *ClaimInterface(const muhkuh_plugin_reference *ptReference); virtual bool ReleaseInterface(muhkuh_plugin *ptPlugin); private: static const char *m_pcPluginNamePattern; romloader_usb_device_libusb *m_ptUsbDevice; }; /*-----------------------------------*/ class romloader_usb_reference : public muhkuh_plugin_reference { public: romloader_usb_reference(void); romloader_usb_reference(const char *pcName, const char *pcTyp, bool fIsUsed, romloader_usb_provider *ptProvider); romloader_usb_reference(const char *pcName, const char *pcTyp, const char *pcLocation, bool fIsUsed, romloader_usb_provider *ptProvider); romloader_usb_reference(const romloader_usb_reference *ptCloneMe); }; /*-----------------------------------*/ #endif /* __ROMLOADER_USB_MAIN_H__ */
// Copyright 2014 Citra Emulator Project // Licensed under GPLv2 // Refer to the license.txt file included. #pragma once #include "common/common_types.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace Syscall namespace Syscall { typedef u32 Handle; typedef s32 Result; void Register(); } // namespace
#ifndef __READ_H__ #define __READ_H__ #define DONOTHING 0 /* Read menu command return states */ #define FULLUPDATE 1 /* Entire screen was destroyed in this oper */ #define PARTUPDATE 2 /* Only the top three lines were destroyed */ #define DOQUIT 3 /* Exit read menu was executed */ #define NEWDIRECT 4 /* Directory has changed, re-read files */ #define READ_NEXT 5 /* Direct read next file */ #define READ_PREV 6 /* Direct read prev file */ #define GOTO_NEXT 7 /* Move cursor to next */ #define DIRCHANGED 8 /* Index file was changed */ #define NEWSCREEN 9 /* split the screen */ #define CHANGEMODE 10 /* »»°æÃæÁË»òÕßÊÇ»»Ä£Ê½ÁË*/ #define SELCHANGE 11 /*Ñ¡Ôñ±äÁË,¶ÔÓ¦SHOW_SELCHANGE*/ /* ÔĶÁµÄ¼ü¶¨Ò廨µ÷º¯Êý£¬²ÎÊýÒÀ´ÎΪ struct _select_def* conf ÁбíÊý¾Ý½á¹¹ void* data µ±Ç°Ñ¡ÔñµÄÊý¾Ý void* extraarg ¶îÍâ´«µÝµÄ²ÎÊý */ typedef int (*READ_KEY_FUNC)(struct _select_def*,void*,void*); /* ÏÔʾÿһÏîµÄ»Øµ÷º¯Êý ²ÎÊýÒÀ´ÎΪ: char* outputbuf,Êä³öµÄ»º³åÇø int ent λÖà void* data Êý¾Ý void* readdata ÓÃÓÚÏÔʾÏà¹ØÊý¾ÝµÄ¶îÍâ²ÎÊý£¬±ÈÈçͬÖ÷ÌâµÄÖ÷ÌâÎÄÕ¡£ struct _select_def* conf ÁбíÊý¾Ý½á¹¹ ·µ»Ø: ÏÔʾµÄ×Ö·û´®¡£Ó¦¸ÃÊÇÒ»¸öÖ¸ÏòoutputbufµÄÖ¸Õë */ typedef char *(*READ_ENT_FUNC) (char *, int, void *,void*,struct _select_def*); int fileheader_thread_read(struct _select_def* conf, struct fileheader* fh,int ent, void* extraarg); int find_nextnew(struct _select_def* conf,int begin); struct key_command { /* Used to pass commands to the readmenu */ int key; READ_KEY_FUNC fptr; void* arg; }; enum { READ_NORMAL, READ_THREAD, READ_NEW, READ_AUTHOR }; struct read_arg { int returnvalue; /* ÓÃÓÚÉèÖÃi_readµÄ·µ»ØÖµ*/ /* save argument */ enum BBS_DIR_MODE mode; enum BBS_DIR_MODE newmode; /*µ±·µ»ØNEWDIRECTµÄʱºò£¬ÉèÖÃÕâ¸ö*/ char* direct; char* dingdirect; void (*dotitle) (); READ_ENT_FUNC doentry; struct key_command *rcmdlist; int ssize; int oldpos; /*ÔÚͬÖ÷ÌâÔĶÁµÄʱºò£¬±£´æÔ­Ê¼Î»ÖÃ*/ time_t lastupdatetime; /*ÉϴθüÐÂʱ¼ä*/ struct write_dir_arg* writearg; int bid; struct boardheader* board; struct BoardStatus* boardstatus; /*ÓÃÓÚÈ·¶¨µ±Ç°µÄÔĶÁģʽ£¬Èç¹ûÊÇ READ_NORMAL Õý³£µÄ˳ÐòÔĶÁ READ_THREAD ÕýÔÚÖ÷ÌâÔĶÁ */ int readmode; char* data; //readed data int fd; //filehandle,open always void* readdata; int filecount; //the item count of file }; /* »ñµÃµ±Ç°µÄposËùÊôµÄÎļþÃû,Ö÷ÒªÊÇΪÁËÇø·ÖÖö¥ºÍÆÕͨµÄ.DIR*/ char* read_getcurrdirect(struct _select_def* conf); enum { APPLY_CONTINUE, APPLY_QUIT, APPLY_REAPPLY }; /* Ó¦ÓÃÓÚapply_threadµÄº¯Êý confÊÇselect½á¹¹ fhÊǵ±Ç°µÄfileheader entÊÇÐòºÅ argÊÇ´«¸øapply_threadµÄ¶îÍâ²ÎÊý */ typedef int (*APPLY_THREAD_FUNC)(struct _select_def* conf,struct fileheader* fh,int ent,void* arg); /*¶ÔͬÖ÷ÌâÓ¦ÓÃͬһ¸öfuncº¯Êý @param conf µ±Ç°µÄselect½á¹¹ @param fh µ±Ç°µÄfileheaderÖ¸Õë @param func Ó¦ÓÃÓÚÖ÷Ìâ½á¹¹µÄº¯Êý¡£ ·µ»ØAPPLY_CONTINUE¼ÌÐøÓ¦ÓÃÏÂÒ»¸öÖ÷Ìâ½á¹¹ ·µ»ØAPPLY_QUITÔòÍ£Ö¹Ö´ÐС£ ·µ»ØAPPLY_REAPPLYÔòÖØ¸´Ó¦ÓÃÕâÒ»¸öλÖõÄfileheader @param applycurrent ÊÇ·ñ¶Ôµ±Ç°Î»ÖõÄfileheaderÓ¦ÓÃfunc @param down ²éÕÒÖ÷Ìâ·½Ïò£¬Èç¹ûÊÇ1,ÏòϲéÕÒ£¬·ñÔòÏòÉÏ @param arg ´«µÝ¸øfuncµÄ²ÎÊý @return Ó¦ÓõÄÖ÷Ìâ¸öÊý */ int apply_thread(struct _select_def* conf, struct fileheader* fh,APPLY_THREAD_FUNC func,bool applycurrent, bool down,void* arg); /*@param buf ÏÔʾµÄ×Ö·û´® @param num ÐòºÅ @param data Êý¾Ý @param readdata ÉÏ´ÎÔĶÁµÄÊý¾Ý,ÓÃÓÚÅжÏͬÖ÷ÌâÖ®Àà @param conf _select_conf½á¹¹Ö¸Õë */ int new_i_read(enum BBS_DIR_MODE cmdmode, char *direct, void (*dotitle) (struct _select_def*), READ_ENT_FUNC doentry, struct key_command *rcmdlist, int ssize); /* some function for fileheader */ int auth_search(struct _select_def* conf, struct fileheader *fileinfo,void* extraarg); int title_search(struct _select_def* conf, struct fileheader* fh, void* extraarg); int thread_search(struct _select_def* conf, struct fileheader* fh, void* extraarg); int post_search(struct _select_def* conf, struct fileheader* fh, void* extraarg); #define SR_FIRSTNEW 0 #define SR_FIRST 1 #define SR_LAST 2 #define SR_NEXT 3 #define SR_PREV 4 #define SR_READ 5 /*ͬÖ÷ÌâÔĶÁ*/ #define SR_READX 6 /*ͬÖ÷ÌâÔĶÁ£¬±£´æÔ­Ê¼Î»ÖÃ*/ #define SR_FIRSTNEWDOWNSEARCH 100 int thread_read(struct _select_def* conf, struct fileheader* fh, void* extraarg); int author_read(struct _select_def* conf, struct fileheader* fh, void* extraarg); int read_sendmsgtoauthor(struct _select_def* conf, struct fileheader* fh, void* extraarg); int read_showauthor(struct _select_def* conf, struct fileheader* fh, void* extraarg); int read_authorinfo(struct _select_def *conf,struct fileheader *fh,void *arg); int read_cross(struct _select_def* conf, struct fileheader* fh, void* extraarg); int read_zsend(struct _select_def* conf, struct fileheader* fh, void* extraarg); int read_addauthorfriend(struct _select_def* conf, struct fileheader* fh, void* extraarg); int read_splitscreen(struct _select_def* conf, struct fileheader* fh, void* extraarg); /* ÉèÖõ±Ç°ÔĶÁµÄfileheaderÓÃÓÚͬÖ÷ÌâÅÐ¶Ï */ void setreadpost(struct _select_def* conf,struct fileheader* fh); int read_showauthorBM(struct _select_def* conf, struct fileheader* fh, void* extraarg); int getPos(int mode,char* direct,struct boardheader* bh); void savePos(int mode,char* direct,int pos,struct boardheader* bh); /*µ÷ÓÃÎÞ²ÎÊýµÄº¯Êý*/ int read_callfunc0(struct _select_def* conf, void* data, void* extraarg); /*ÅжÏÁ½¸ö±êÌâÊÇ·ñÊÇͬÖ÷Ìâ*/ bool isThreadTitle(char* a,char* b); #ifdef PERSONAL_CORP int read_importpc(struct _select_def* conf, struct fileheader* fh, void* extraarg); #endif int prepare_write_dir(struct write_dir_arg *filearg, struct fileheader *fileinfo, int mode); #endif //__READ_H__
#ifndef GUI2_TOGGLEBUTTON_H #define GUI2_TOGGLEBUTTON_H #include "gui2_button.h" class GuiToggleButton : public GuiButton { public: typedef std::function<void(bool active)> func_t; protected: bool value; func_t toggle_func; const GuiThemeStyle* back_on_style; const GuiThemeStyle* front_on_style; public: GuiToggleButton(GuiContainer* owner, string id, string text, func_t func); virtual void onDraw(sp::RenderTarget& target) override; bool getValue() const; GuiToggleButton* setValue(bool value); private: void onClick(); }; #endif//GUI2_TOGGLEBUTTON_H
/* * check.h * * Copyright (c) 2012-2021 Pacman Development Team <pacman-dev@archlinux.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PM_CHECK_H #define PM_CHECK_H #include <alpm.h> int check_pkg_fast(alpm_pkg_t *pkg); int check_pkg_full(alpm_pkg_t *pkg); #endif /* PM_CHECK_H */
/* * eHome.h * * Created: 2015-04-06 23:25:13 * Author: Pawel */ #ifndef EHOME_H_ #define EHOME_H_ #endif /* EHOME_H_ */
#pragma once /* * Copyright (C) 2005-2013 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "utils/StdString.h" #include <map> class TiXmlElement; class CLangCodeExpander { public: CLangCodeExpander(void); ~CLangCodeExpander(void); bool Lookup(CStdString& desc, const CStdString& code); bool Lookup(CStdString& desc, const int code); #ifdef TARGET_WINDOWS bool ConvertTwoToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strTwoCharCode, bool localeHack = false); bool ConvertToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strCharCode, bool localeHack = false); #else bool ConvertTwoToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strTwoCharCode); bool ConvertToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strCharCode); #endif #ifdef TARGET_WINDOWS bool ConvertLinuxToWindowsRegionCodes(const CStdString& strTwoCharCode, CStdString& strThreeCharCode); bool ConvertWindowsToGeneralCharCode(const CStdString& strWindowsCharCode, CStdString& strThreeCharCode); #endif void LoadUserCodes(const TiXmlElement* pRootElement); void Clear(); protected: typedef std::map<CStdString, CStdString> STRINGLOOKUPTABLE; STRINGLOOKUPTABLE m_mapUser; bool LookupInDb(CStdString& desc, const CStdString& code); bool LookupInMap(CStdString& desc, const CStdString& code); }; extern CLangCodeExpander g_LangCodeExpander;
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include <inttypes.h> #include <stdbool.h> #include <stdio.h> #include "sd-ipv4acd.h" #include "conf-parser.h" #include "in-addr-util.h" #include "networkd-link.h" #include "networkd-util.h" #include "time-util.h" typedef struct Address Address; typedef struct Manager Manager; typedef struct Network Network; typedef struct Request Request; typedef int (*address_ready_callback_t)(Address *address); struct Address { Link *link; Network *network; NetworkConfigSection *section; NetworkConfigSource source; NetworkConfigState state; union in_addr_union provider; /* DHCP server or router address */ int family; unsigned char prefixlen; unsigned char scope; uint32_t flags; uint32_t route_metric; /* route metric for prefix route */ char *label; int set_broadcast; struct in_addr broadcast; union in_addr_union in_addr; union in_addr_union in_addr_peer; /* These are absolute points in time, and NOT timespans/durations. * Must be specified with clock_boottime_or_monotonic(). */ usec_t lifetime_valid_usec; usec_t lifetime_preferred_usec; bool scope_set:1; bool ip_masquerade_done:1; AddressFamily duplicate_address_detection; sd_ipv4acd *acd; /* Called when address become ready */ address_ready_callback_t callback; }; const char* format_lifetime(char *buf, size_t l, usec_t lifetime_usec) _warn_unused_result_; /* Note: the lifetime of the compound literal is the immediately surrounding block, * see C11 §6.5.2.5, and * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks */ #define FORMAT_LIFETIME(lifetime) \ format_lifetime((char[FORMAT_TIMESPAN_MAX+STRLEN("for ")]){}, FORMAT_TIMESPAN_MAX+STRLEN("for "), lifetime) int address_new(Address **ret); Address* address_free(Address *address); int address_get(Link *link, const Address *in, Address **ret); int address_configure_handler_internal(sd_netlink *rtnl, sd_netlink_message *m, Link *link, const char *error_msg); int address_remove(Address *address); int address_dup(const Address *src, Address **ret); bool address_is_ready(const Address *a); void address_set_broadcast(Address *a); DEFINE_NETWORK_SECTION_FUNCTIONS(Address, address_free); int link_drop_addresses(Link *link); int link_drop_foreign_addresses(Link *link); int link_drop_ipv6ll_addresses(Link *link); void link_foreignize_addresses(Link *link); bool link_address_is_dynamic(const Link *link, const Address *address); int link_get_ipv6_address(Link *link, const struct in6_addr *address, Address **ret); int link_get_ipv4_address(Link *link, const struct in_addr *address, unsigned char prefixlen, Address **ret); int manager_has_address(Manager *manager, int family, const union in_addr_union *address, bool check_ready); void address_cancel_request(Address *address); int link_request_address( Link *link, Address *address, bool consume_object, unsigned *message_counter, link_netlink_message_handler_t netlink_handler, Request **ret); int link_request_static_address(Link *link, Address *address, bool consume); int link_request_static_addresses(Link *link); int request_process_address(Request *req); int manager_rtnl_process_address(sd_netlink *nl, sd_netlink_message *message, Manager *m); int network_drop_invalid_addresses(Network *network); void address_hash_func(const Address *a, struct siphash *state); int address_compare_func(const Address *a1, const Address *a2); DEFINE_NETWORK_CONFIG_STATE_FUNCTIONS(Address, address); static inline void address_enter_probing(Address *address) { address_update_state(address, NETWORK_CONFIG_STATE_PROBING, NETWORK_CONFIG_STATE_PROBING); } static inline void address_cancel_probing(Address *address) { address_update_state(address, NETWORK_CONFIG_STATE_PROBING, 0); } void link_mark_addresses(Link *link, NetworkConfigSource source, const struct in6_addr *router); CONFIG_PARSER_PROTOTYPE(config_parse_address); CONFIG_PARSER_PROTOTYPE(config_parse_broadcast); CONFIG_PARSER_PROTOTYPE(config_parse_label); CONFIG_PARSER_PROTOTYPE(config_parse_lifetime); CONFIG_PARSER_PROTOTYPE(config_parse_address_flags); CONFIG_PARSER_PROTOTYPE(config_parse_address_scope); CONFIG_PARSER_PROTOTYPE(config_parse_address_route_metric); CONFIG_PARSER_PROTOTYPE(config_parse_duplicate_address_detection);
#ifndef ABSTRACTDATAPROVIDER_H #define ABSTRACTDATAPROVIDER_H #include <QtSql> #include <statevent.h> #include <msisdn.h> #include <coreutils.h> class AbstractDataProvider { public: virtual QList<StatEvent> getEventsForMsisdn(MSISDN msisdn) = 0; virtual QList<StatEvent> selectByDateAndMsisdn(MSISDN msisdn, QDateTime dateTime) = 0; virtual void insertList(QList<StatEvent> list) = 0; virtual void insertVal(StatEvent e) = 0; virtual void init(QString dbName="db_name.sqlite") = 0; virtual QString close(QString dbName="db_name.sqlite") = 0; virtual QSqlDatabase _getDatabase() = 0; }; #endif // ABSTRACTDATAPROVIDER_H
#ifndef APERIODICLINK_H #define APERIODICLINK_H #include "TLink.h" namespace rraLink { class AperiodicLinkPrivate; class AperiodicLink : public TLink { public: AperiodicLink(); double out(double in); void reset(); protected: AperiodicLink(AperiodicLinkPrivate* d_ptr); DECLARE_PRIVATE(AperiodicLink) }; } #endif // APERIODICLINK_H
/********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ***********************************************************************/ #ifndef FC__IOZ_H #define FC__IOZ_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /********************************************************************** An IO layer to support transparent compression/uncompression. (Currently only "required" functionality is supported.) ***********************************************************************/ #include <stdio.h> /* FILE */ #include <freeciv_config.h> #include "shared.h" /* fc__attribute */ struct fz_FILE_s; /* opaque */ typedef struct fz_FILE_s fz_FILE; /* (Possibly) supported methods (depending on fc_config.h). */ enum fz_method { FZ_PLAIN = 0, #ifdef FREECIV_HAVE_LIBZ FZ_ZLIB, #endif #ifdef FREECIV_HAVE_LIBBZ2 FZ_BZIP2, #endif #ifdef FREECIV_HAVE_LIBLZMA FZ_XZ, #endif }; fz_FILE *fz_from_file(const char *filename, const char *in_mode, enum fz_method method, int compress_level); fz_FILE *fz_from_stream(FILE *stream); fz_FILE *fz_from_memory(char *buffer, int size, bool control); int fz_fclose(fz_FILE *fp); char *fz_fgets(char *buffer, int size, fz_FILE *fp); int fz_fprintf(fz_FILE *fp, const char *format, ...) fc__attribute((__format__ (__printf__, 2, 3))); int fz_ferror(fz_FILE *fp); const char *fz_strerror(fz_FILE *fp); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* FC__IOZ_H */
#include <linux/mmc/sdio_func.h> int wilc_sdio_init(void); int wilc_sdio_cmd52(struct wilc *wilc, sdio_cmd52_t *cmd); int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd); int wilc_sdio_enable_interrupt(struct wilc *); void wilc_sdio_disable_interrupt(struct wilc *);
/*************************************************************************** * Copyright (C) 2008-2021 by Andrzej Rybczak * * andrzej@rybczak.net * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef NCMPCPP_ENUMS_H #define NCMPCPP_ENUMS_H #include "config.h" #include <iostream> enum class SearchDirection { Backward, Forward }; std::ostream &operator<<(std::ostream &os, SearchDirection sd); std::istream &operator>>(std::istream &is, SearchDirection &sd); enum class SpaceAddMode { AddRemove, AlwaysAdd }; std::ostream &operator<<(std::ostream &os, SpaceAddMode sam); std::istream &operator>>(std::istream &is, SpaceAddMode &sam); enum class SortMode { Type, Name, ModificationTime, CustomFormat, None }; std::ostream &operator<<(std::ostream &os, SortMode sm); std::istream &operator>>(std::istream &is, SortMode &sm); enum class DisplayMode { Classic, Columns }; std::ostream &operator<<(std::ostream &os, DisplayMode dm); std::istream &operator>>(std::istream &is, DisplayMode &dm); enum class Design { Classic, Alternative }; std::ostream &operator<<(std::ostream &os, Design ui); std::istream &operator>>(std::istream &is, Design &ui); enum class VisualizerType { Wave, WaveFilled, # ifdef HAVE_FFTW3_H Spectrum, # endif // HAVE_FFTW3_H Ellipse }; std::ostream &operator<<(std::ostream &os, VisualizerType vt); std::istream &operator>>(std::istream &is, VisualizerType &vt); #endif // NCMPCPP_ENUMS_H
/* Copyright (C) 1998, 1999, 2001 Thorsten Kukuk This file is part of the yp-tools. Author: Thorsten Kukuk <kukuk@suse.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <unistd.h> #include <string.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #else #include "lib/getopt.h" #endif #include <locale.h> #include <libintl.h> #include <rpcsvc/ypclnt.h> #ifndef _ #define _(String) gettext (String) #endif /* Name and version of program. */ /* Print the version information. */ static void print_version (const char *progname) { fprintf (stdout, "%s (%s) %s\n", progname, PACKAGE, VERSION); fprintf (stdout, gettext ("\ Copyright (C) %s Thorsten Kukuk.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ "), "1998"); /* fprintf (stdout, _("Written by %s.\n"), "Thorsten Kukuk"); */ } static void print_usage (FILE *stream, const char *progname) { fprintf (stream, _("Usage: %s [domain]\n"), progname); } static void print_help (void) { print_usage (stdout, "domainname"); fputs (_("domainname - set or display name of current domain\n\n"), stdout); fputs (_(" -?, --help Give this help list\n"), stdout); fputs (_(" --usage Give a short usage message\n"), stdout); fputs (_(" --version Print program version\n"), stdout); } static void print_help_yp (const char *progname) { print_usage (stdout, progname); fprintf (stderr, _("%s - set or display name of current NIS domain\n\n"), progname); fputs (_(" -?, --help Give this help list\n"), stdout); fputs (_(" --usage Give a short usage message\n"), stdout); fputs (_(" --version Print program version\n"), stdout); } static void print_error (const char *progname) { print_usage (stderr, progname); fprintf (stderr, _("Try `%s --help' or `%s --usage' for more information.\n"), progname, progname); } int main (int argc, char **argv) { char *progname, *s; int use_nis = 0; setlocale (LC_MESSAGES, ""); setlocale (LC_CTYPE, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); if ((s = strrchr (argv[0], '/')) != NULL) progname = s + 1; else progname = argv[0]; if (strcmp (progname, "ypdomainname") == 0 || strcmp (progname, "nisdomainname") == 0) use_nis = 1; while (1) { int c; int option_index = 0; static struct option long_options[] = { {"version", no_argument, NULL, '\255'}, {"usage", no_argument, NULL, '\254'}, {"help", no_argument, NULL, '?'}, {NULL, 0, NULL, '\0'} }; c = getopt_long (argc, argv, "?", long_options, &option_index); if (c == (-1)) break; switch (c) { case '?': if (use_nis) print_help_yp (progname); else print_help (); return 0; case '\255': print_version (progname); return 0; case '\254': print_usage (stdout, progname); return 0; default: print_usage (stderr, progname); return 1; } } argc -= optind; argv += optind; if (argc > 1) { print_error (progname); return 1; } else if (argc == 1) { char buf[strlen (argv[0]) + 1]; char *p; strcpy (buf, argv[0]); if ((p = strchr (buf, '\n')) != NULL) *p = 0; if (setdomainname (buf, strlen (buf)) < 0) { perror ("setdomainname"); return 1; } } else { if (use_nis) { char *domainname; int error; if ((error = yp_get_default_domain (&domainname)) != 0) { fputs (yperr_string (error), stderr); fputs ("\n", stderr); return 1; } fputs (domainname, stdout); } else { char buf[256]; if (getdomainname (buf, 256) < 0) { perror ("getdomainname"); return 1; } fputs (buf, stdout); } fputs ("\n", stdout); } return 0; }
/* * filesystemwatcher.h * Copyright 2011, Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> * * This file is part of Tiled. * * 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 FILESYSTEMWATCHER_H #define FILESYSTEMWATCHER_H #include <QMap> #include <QObject> class QFileSystemWatcher; namespace Tiled { namespace Internal { /** * A wrapper around QFileSystemWatcher that deals gracefully with files being * watched multiple times. It also doesn't start complaining when a file * doesn't exist. * * It's meant to be used as drop-in replacement for QFileSystemWatcher. */ class FileSystemWatcher : public QObject { Q_OBJECT public: explicit FileSystemWatcher(QObject *parent = 0); void addPath(const QString &path); void removePath(const QString &path); signals: void fileChanged(const QString &path); void directoryChanged(const QString &path); private slots: void onFileChanged(const QString &path); void onDirectoryChanged(const QString &path); private: QFileSystemWatcher *mWatcher; QMap<QString, int> mWatchCount; }; } // namespace Internal } // namespace Tiled #endif // FILESYSTEMWATCHER_H
/********************************************************************* * * Copyright (C) 2014 Exor International, Inc. * All Rights Reserved. * * File: I2CSeeprom.h * * Description: Contains all definitions regarding the layout of * the I2C SEEPROM memory on carrier board containing * the factory parameters. * Rev. history: * 05/05/10: Created G.Pavoni Exor S.p.a. *********************************************************************/ #ifndef _I2CSEEPROMFACTORY #define _I2CSEEPROMFACTORY // I2C SEEPROM slave address #ifndef SEEPROM_I2C_ADDRESS #define SEEPROM_I2C_ADDRESS 0x54 #endif #ifndef ADP_I2C_ADDRESS #define ADP_I2C_ADDRESS 0x56 #endif #ifndef PL_I2C_ADDRESS #define PL_I2C_ADDRESS 0x57 #endif #ifndef LEDDIMM_I2C_ADDRESS #define LEDDIMM_I2C_ADDRESS 0x60 #endif #define SEEPROM_I2C_BAUD_INDEX (0) #define SEEPROM_I2C_DEVICE (OMAP_DEVICE_I2C2) /*======================================================================= * Layout of I2C memory *======================================================================= */ #define FACTORY_SECTION_SIZE 128 /* First part of I2C = factory section */ #define FACTORY_SECTION_SIZE_3 64 /* First part of I2C = factory section (version 3)*/ /* Header */ #define SIGNATURE1_POS 0 #define SIGNATURE2_POS 1 #define VERSION_POS 2 #define CKSUM_POS 3 /* Data */ #define SEEPROMID_POS 4 #define DISPID_POS 5 #define AXLL_POS 6 #define AXLH_POS 7 #define AXRL_POS 8 #define AXRH_POS 9 #define AXBL_POS 10 #define AXBH_POS 11 #define AXTL_POS 12 #define AXTH_POS 13 #define GXRESL_POS 14 #define GXRESH_POS 15 #define GYRESL_POS 16 #define GYRESH_POS 17 #define HWDAY_POS 18 #define HWMONTH_POS 19 #define HWYEAR_POS 20 #define HWSERNUML_POS 21 #define HWSERNUMM_POS 22 #define HWSERNUMH_POS 23 #define MACID0_POS 24 #define MACID1_POS 25 #define MACID2_POS 26 #define MACID3_POS 27 #define MACID4_POS 28 #define MACID5_POS 29 /* pos 30 ... 31 is RFU */ /* pos 32 ... 79 is reserved for protocol flags */ /* pos 80 ... is RFU */ /*======================================================================= * I2C pre-defined / fixed values *======================================================================= */ #define SIGNATURE1_VAL 0xaa #define SIGNATURE2_VAL 0x55 #define VERSION_VAL 2 #define SEEPROMID_VAL 0x00 #define RFU_VAL 0xff #define ETOP504_VAL 103 #define ETOP507_VAL 104 #define EPALM504_VAL 106 #define EPALMSHD4_VAL 107 #define HW01_VAL 108 #define TWS05_VAL 109 #define DEFAULT_TCH_VAL 0 #define AMTUSB_TCH_VAL 1 #define ZXYUSB_TCH_VAL 2 #define MXT5_TCH_VAL 4 #define MXT10_TCH_VAL 5 /*======================================================================= * User info section *======================================================================= */ #define BLDIMM_POS 128 #define CONTRAST_POS 129 #define BLIGHT_TIME1 130 #define BLIGHT_TIME2 131 #define BLIGHT_TIME3 132 #define BLIGHT_TIME4 133 #define BACKLIGHT_HOUR_COUNTER_OFFSET_I2C 130 // Format 3 SEEPROM specific define #define BACKLIGHT_HOUR_CHK_OFFSET_I2C 134 #define SYSTEM_HOUR_COUNTER_OFFSET_I2C 136 #define SYSTEM_HOUR_CHK_OFFSET_I2C 140 #define HWPICKPANELCODE_POS 4 #define TOUCHID_POS 21 #define WIFIMACID0_POS 55 #define WIFIMACID1_POS 56 #define WIFIMACID2_POS 57 #define WIFIMACID3_POS 58 #define WIFIMACID4_POS 59 #define WIFIMACID5_POS 60 /*======================================================================= * Plugin module factory section *======================================================================= */ #define SEE_FORMAT_REV 2 /* Format Revision. If > 1 is 24MHz compatible */ #define SEE_CHKSM_START 4 /* start of area covered by checksum */ #define SEE_NAME_OFF 10 /* module name */ #define SEE_CODE_OFF 26 /* hw code */ #define SEE_SUBCODE_OFF 27 /* hw subcode */ #define SEE_XILCODE_OFF 29 /* XIL code */ #define SEE_XILSUBCODE_OFF 30 /* XIL subcode */ #define SEE_FUNCT_AREA_OFF 36 /* Function Area (bit-wide) */ #define SEE_FACTORYSIZE 64 /* Length of the factory section */ #endif /* _I2CSEEPROMFACTORY */
#include<bst.h> #include<math.h> #include<string.h> /* * Disclaimer: The indices differ from the high-level pseudo-code description * found in the book [1]. * * Here, e[i,j] is the expected value for the tree containing keys i to j-1, * since the first key is p_0 and not p_1 as in the book. w[.,.] and root[.,.] * are defined similarly. * */ /* * This version swaps the r and j loop form 100_ref_bottomup.c */ #define STRIDE (n+1) #define IDX(i,j) ((i)*STRIDE + j) typedef struct { double* e; double* w; int* r; size_t n; } segments_t; void* bst_alloc_103_why_would_you_block( size_t n ) { segments_t* mem = (segments_t*) malloc( sizeof(segments_t) ); size_t sz = (n+1)*(n+1); // XXX: for testing: calloc mem->e = (double*) calloc(1, sz * sizeof(double) ); mem->w = (double*) calloc(1, sz * sizeof(double) ); mem->r = (int*) calloc(1, sz * sizeof(int) ); mem->n = n; memset( mem->r, -1, sz * sizeof(int) ); return mem; } double bst_compute_103_why_would_you_block( void*_bst_obj, double* p, double* q, size_t nn ) { segments_t* mem = (segments_t*) _bst_obj; int n; int i, l, r, j; double t, t_min, w_cur; int r_min; double* e = mem->e, *w = mem->w; int* root = mem->r; double e_ir; // initialization // mem->n = nn; n = nn; // subtractions with n potentially negative. say hello to all the bugs e[IDX(n,n)] = q[n]; for (i = n-1; i >= 0; --i) { e[IDX(i,i)] = q[i]; w[IDX(i,i)] = q[i]; for (j = i+1; j < n+1; ++j) { e[IDX(i,j)] = INFINITY; w[IDX(i,j)] = w[IDX(i,j-1)] + p[j-1] + q[j]; } for (r = i; r < n; ++r) { e_ir = e[IDX(i,r)]; for (j = r+1; j < n+1; ++j) { t = e_ir + e[IDX(r+1,j)] + w[IDX(i,j)]; if (t < e[IDX(i,j)]) { e[IDX(i,j)] = t; root[IDX(i,j)] = r; } } } } return e[IDX(0,n)]; } size_t bst_get_root_103_why_would_you_block( void* _bst_obj, size_t i, size_t j ) { // [i,j], in table: [i-1, j]+1 segments_t *mem = _bst_obj; size_t n = mem->n; int *root = mem->r; return (size_t) root[(i-1)*(n+1)+j]+1; } void bst_free_103_why_would_you_block( void* _mem ) { segments_t* mem = (segments_t*) _mem; /* size_t n = mem->n; for (size_t i=0; i<=n; ++i) { for (size_t j=0; j<=n; ++j) { printf(" %.3lf", mem->e[i*(n+1)+j]); } printf("\n"); } */ free( mem->e ); free( mem->w ); free( mem->r ); free( mem ); } size_t bst_flops_103_why_would_you_block( size_t n ) { size_t n3 = n*n*n; size_t n2 = n*n; return (size_t) ( n3/3.0 + 2*n2 + 5.0*n/3 ); }
#pragma once #include "api.h" #include "SimulationModule.h" #include <string> #include <vector> #include <string> #include <sstream> using namespace std; class PER_STR : public SimulationModule { private: /// number of soil layers int m_nLayers; float m_upSoilDepth; int m_dt; int m_nCells; float m_frozenT; float **m_ks; float **m_porosity; float **m_fc; float **m_poreIndex; float **m_sm; float *m_rootDepth; float *m_soilT; float *m_infil; float **m_perc; public: PER_STR(void); ~PER_STR(void); virtual int Execute(); virtual void SetValue(const char* key, float data); virtual void Set1DData(const char* key, int nRows, float* data); virtual void Set2DData(const char* key, int nrows, int ncols, float** data); virtual void Get2DData(const char* key, int *nRows, int *nCols, float*** data); private: /** * @brief check the input data. Make sure all the input data is available. * * @return bool The validity of the input data. */ bool CheckInputData(void); /** * @brief checke the input size. Make sure all the input data have same dimension. * * @param key The key of the input data * @param n The input data dimension * @return bool The validity of the dimension */ bool CheckInputSize(const char*,int); static string toString(float value); };
/* * dyngen defines for micro operation code * * Copyright (c) 2003 Fabrice Bellard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined(__DYNGEN_EXEC_H__) #define __DYNGEN_EXEC_H__ /* prevent Solaris from trying to typedef FILE in gcc's include/floatingpoint.h which will conflict with the definition down below */ #ifdef __sun__ #define _FILEDEFED #endif /* NOTE: standard headers should be used with special care at this point because host CPU registers are used as global variables. Some host headers do not allow that. */ #include <stddef.h> #include <stdint.h> #include <stdbool.h> #ifdef __OpenBSD__ #include <sys/types.h> #endif /* XXX: This may be wrong for 64-bit ILP32 hosts. */ typedef void * host_reg_t; #ifdef CONFIG_BSD typedef struct __sFILE FILE; extern int fprintf(FILE *, const char *, ...); extern int fputs(const char *, FILE *); extern int printf(const char *, ...); #elif defined(__linux__) #include <stdio.h> #else typedef struct FILE FILE; extern int fprintf(FILE *, const char *, ...); extern int fputs(const char *, FILE *); extern int printf(const char *, ...); #endif #if defined(__i386__) #define AREG0 "ebp" #elif defined(__x86_64__) #define AREG0 "r14" #elif defined(_ARCH_PPC) #define AREG0 "r27" #elif defined(__arm__) #define AREG0 "r7" #elif defined(__hppa__) #define AREG0 "r17" #elif defined(__mips__) #define AREG0 "s0" #elif defined(__sparc__) #ifdef CONFIG_SOLARIS #define AREG0 "g2" #else #ifdef __sparc_v9__ #define AREG0 "g5" #else #define AREG0 "g6" #endif #endif #elif defined(__s390__) #define AREG0 "r10" #elif defined(__alpha__) /* Note $15 is the frame pointer, so anything in op-i386.c that would require a frame pointer, like alloca, would probably loose. */ #define AREG0 "$15" #elif defined(__mc68000) #define AREG0 "%a5" #elif defined(__ia64__) #define AREG0 "r7" #else #error unsupported CPU #endif #define xglue(x, y) x ## y #define glue(x, y) xglue(x, y) #define stringify(s) tostring(s) #define tostring(s) #s /* The return address may point to the start of the next instruction. Subtracting one gets us the call instruction itself. */ #if defined(__s390__) && !defined(__s390x__) # define GETPC() ((void*)(((unsigned long)__builtin_return_address(0) & 0x7fffffffUL) - 1)) #elif defined(__arm__) /* Thumb return addresses have the low bit set, so we need to subtract two. This is still safe in ARM mode because instructions are 4 bytes. */ # define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 2)) #else # define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 1)) #endif #endif /* !defined(__DYNGEN_EXEC_H__) */
/* * 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 __WIKIPAD_STYLESCHEME_ACTION_H__ #define __WIKIPAD_STYLESCHEME_ACTION_H__ 1 #include <gtk/gtk.h> #include <gtksourceview/gtksourcestylescheme.h> G_BEGIN_DECLS #define WIKIPAD_TYPE_STYLE_SCHEME_ACTION (wikipad_style_scheme_action_get_type ()) #define WIKIPAD_STYLE_SCHEME_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIKIPAD_TYPE_STYLE_SCHEME_ACTION, WikipadStyleSchemeAction)) #define WIKIPAD_STYLE_SCHEME_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIKIPAD_TYPE_STYLE_SCHEME_ACTION, WikipadStyleSchemeActionClass)) #define WIKIPAD_IS_STYLE_SCHEME_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIKIPAD_TYPE_STYLE_SCHEME_ACTION)) #define WIKIPAD_IS_STYLE_SCHEME_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIKIPAD_TYPE_STYLE_SCHEME_ACTION)) #define WIKIPAD_STYLE_SCHEME_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIKIPAD_TYPE_STYLE_SCHEME_ACTION, WikipadStyleSchemeActionClass)) typedef struct WikipadStyleSchemeAction_ WikipadStyleSchemeAction; typedef struct WikipadStyleSchemeActionClass_ WikipadStyleSchemeActionClass; GType wikipad_style_scheme_action_get_type (void); GtkAction *wikipad_style_scheme_action_new (GtkSourceStyleScheme *scheme); GtkSourceStyleScheme *wikipad_style_scheme_action_get_style_scheme (WikipadStyleSchemeAction *action); G_END_DECLS #endif /* __WIKIPAD_STYLESCHEME_ACTION_H__ */
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id$ * * Copyright (C) 2013 by Amaury Pouly * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef POWERMGMT_TARGET_H #define POWERMGMT_TARGET_H #include "config.h" #include "powermgmt-imx233.h" /* Sony NWZ-E360/NWZ-E370 settings: * - current ramp slope: * - conditioning threshold voltage: * - conditioning max voltage: * - conditioning current: * - conditioning timeout: * - charging voltage: * - charging current: * - charging threshold current: * - charging timeout: * - top off period: * - high die temperature: * - low die temperature: * - safe die temperature current: * - battery temperature channel: * - high battery temperature: * - low battery temperature: * - safe battery temperature current: * - low DCDC battery voltage: */ #define IMX233_CHARGE_CURRENT 260 #define IMX233_STOP_CURRENT 20 #define IMX233_TOPOFF_TIMEOUT (30 * 60 * HZ) #define IMX233_CHARGING_TIMEOUT (4 * 3600 * HZ) #define IMX233_DIE_TEMP_HIGH 91 #define IMX233_DIE_TEMP_LOW 56 #define IMX233_BATT_TEMP_SENSOR 0 #define IMX233_BATT_TEMP_HIGH 2400 #define IMX233_BATT_TEMP_LOW 2300 #endif /* POWERMGMT_TARGET_H */
#pragma once #define DEFINE_FLOAT3SWIZZLE_METHOD( FLOAT3SWIZZLE_METHOD_NAME, FLOAT3SWIZZLE_METHOD_RETURN_TYPE ) \ FLOAT3SWIZZLE_METHOD_RETURN_TYPE FLOAT3SWIZZLE_METHOD_NAME () const \ { \ T t = *this; \ return t. FLOAT3SWIZZLE_METHOD_NAME (); \ } #define DEFINE_FLOAT3SWIZZLE_METHOD_DIADIC( FLOAT3SWIZZLE_METHOD_NAME, FLOAT3SWIZZLE_METHOD_RETURN_TYPE ) \ FLOAT3SWIZZLE_METHOD_RETURN_TYPE FLOAT3SWIZZLE_METHOD_NAME (const T& o) const \ { \ T t = *this; \ return t. FLOAT3SWIZZLE_METHOD_NAME (o); \ } namespace Gears { namespace Math { template<int nBase, class T, int s0=0, int s1=0, int s2=0, int s3=0> class float3swizzle : public floatswizzle<nBase, T, int3, bool3, s0, s1, s2, s3> { public: inline float3swizzle& operator =(const T& o) { floatswizzle<nBase, T, int3, bool3, s0, s1, s2, s3>::operator=(o); return *this; } DEFINE_FLOAT3SWIZZLE_METHOD_DIADIC(cross, T) }; }} // namespace Gears::Math
/* ATE -- Are They Equivalent? Copyright (C) 2009 leafduo.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 FORMULA_H #define FORMULA_H #include <string> #include <vector> #include <list> #include <istream> #include <ostream> #include <bitset> class Formula { private: //inline bool isRPN() const; inline bool empty() const; bool evaluate() const; void convertRPN(); inline bool isOperator(char ch) const; inline bool isOperand(char ch) const; static inline bool setValue(); static inline char getVar(char ch); std::string replace() const; void initVar(); void initMaxVar(const Formula f) const; static unsigned var; static unsigned maxVar; std::vector<char> privateVariable; static std::vector<char> variable; static std::bitset<26> value; static void tolower(char& ch); std::string formula; std::string RPN; public: Formula(); ~Formula(); Formula(const std::string& str); Formula(const Formula& f); bool operator==(const Formula& f) const; Formula& operator=(const Formula& f); Formula& operator=(const char str[]); friend std::istream& operator>>(std::istream& in, Formula& f); friend std::ostream& operator<<(std::ostream& out, const Formula& f); }; inline bool Formula::empty() const { return formula.empty(); } /*inline bool Formula::isRPN() const { return !RPN.empty(); }*/ inline bool Formula::isOperator(char ch) const { if ('^' == ch || '&' == ch || '|' == ch || '-' == ch || '!' == ch) return true; else return false; } inline bool Formula::isOperand(char ch) const { if (isalpha(ch) || '0' == ch || '1' == ch) return true; else return false; } inline bool Formula::setValue() { std::bitset<26> tmp(var); value = tmp; } inline char Formula::getVar(char ch) { std::vector<char>::iterator found = std::find(variable.begin(), variable.end(), ch); if (value[found - variable.begin()]) return '1'; else return '0'; } #endif
/* Verify that RTLD_NOLOAD works as expected. Copyright (C) 2016-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <dlfcn.h> #include <stdio.h> #include <gnu/lib-names.h> static int do_test (void) { /* Test that no object is loaded with RTLD_NOLOAD. */ void *h1 = dlopen (LIBM_SO, RTLD_LAZY | RTLD_NOLOAD); if (h1 != NULL) { printf ("h1: DSO has been loaded while it should have not\n"); return 1; } /* This used to segfault in some glibc versions. */ void *h2 = dlopen (LIBM_SO, RTLD_LAZY | RTLD_NOLOAD | RTLD_NODELETE); if (h2 != NULL) { printf ("h2: DSO has been loaded while it should have not\n"); return 1; } /* Test that loading an already loaded object returns the same. */ void *h3 = dlopen (LIBM_SO, RTLD_LAZY); if (h3 == NULL) { printf ("h3: failed to open DSO: %s\n", dlerror ()); return 1; } void *h4 = dlopen (LIBM_SO, RTLD_LAZY | RTLD_NOLOAD); if (h4 == NULL) { printf ("h4: failed to open DSO: %s\n", dlerror ()); return 1; } if (h4 != h3) { printf ("h4: should return the same object\n"); return 1; } /* Cleanup */ if (dlclose (h3) != 0) { printf ("h3: dlclose failed: %s\n", dlerror ()); return 1; } return 0; } #include <support/test-driver.c>
/* * syscall-embedded module interface * * This file is part of OTAWA * Copyright (c) 2011, IRIT UPS. * * GLISS 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. * * GLISS 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 OTAWA; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef GLISS_SYSCALL_EMBEDDED_H #define GLISS_SYSCALL_EMBEDDED_H #include "api.h" #include "mem.h" #if defined(__cplusplus) extern "C" { #endif #define GLISS_SYSCALL_STATE #define GLISS_SYSCALL_INIT(pf) #define GLISS_SYSCALL_DESTROY(pf) void gliss_syscall(gliss_inst_t *inst, gliss_state_t *state); void gliss_set_brk(gliss_platform_t *pf, gliss_address_t address); #if defined(__cplusplus) } #endif #endif /* GLISS_SYSCALL_LINUX_H */
///////////////////////////////////////////////////////////////////////////// // Name: wx/generic/hyperlink.h // Purpose: Hyperlink control // Author: David Norris <danorris@gmail.com>, Otto Wyss // Modified by: Ryan Norton, Francesco Montorsi // Created: 04/02/2005 // RCS-ID: $Id: hyperlink.h 67948 2011-06-15 21:56:23Z VZ $ // Copyright: (c) 2005 David Norris // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GENERICHYPERLINKCTRL_H_ #define _WX_GENERICHYPERLINKCTRL_H_ // ---------------------------------------------------------------------------- // wxGenericHyperlinkCtrl // ---------------------------------------------------------------------------- class WXDLLIMPEXP_ADV wxGenericHyperlinkCtrl : public wxHyperlinkCtrlBase { public: // Default constructor (for two-step construction). wxGenericHyperlinkCtrl() { Init(); } // Constructor. wxGenericHyperlinkCtrl(wxWindow *parent, wxWindowID id, const wxString& label, const wxString& url, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHL_DEFAULT_STYLE, const wxString& name = wxHyperlinkCtrlNameStr) { Init(); (void) Create(parent, id, label, url, pos, size, style, name); } // Creation function (for two-step construction). bool Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxString& url, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHL_DEFAULT_STYLE, const wxString& name = wxHyperlinkCtrlNameStr); // get/set wxColour GetHoverColour() const { return m_hoverColour; } void SetHoverColour(const wxColour &colour) { m_hoverColour = colour; } wxColour GetNormalColour() const { return m_normalColour; } void SetNormalColour(const wxColour &colour); wxColour GetVisitedColour() const { return m_visitedColour; } void SetVisitedColour(const wxColour &colour); wxString GetURL() const { return m_url; } void SetURL (const wxString &url) { m_url=url; } void SetVisited(bool visited = true) { m_visited=visited; } bool GetVisited() const { return m_visited; } // NOTE: also wxWindow::Set/GetLabel, wxWindow::Set/GetBackgroundColour, // wxWindow::Get/SetFont, wxWindow::Get/SetCursor are important ! protected: // Helper used by this class itself and native MSW implementation that // connects OnRightUp() and OnPopUpCopy() handlers. void ConnectMenuHandlers(); // event handlers // Renders the hyperlink. void OnPaint(wxPaintEvent& event); // Handle set/kill focus events (invalidate for painting focus rect) void OnFocus(wxFocusEvent& event); // Fire a HyperlinkEvent on space void OnChar(wxKeyEvent& event); // Returns the wxRect of the label of this hyperlink. // This is different from the clientsize's rectangle when // clientsize != bestsize and this rectangle is influenced // by the alignment of the label (wxHL_ALIGN_*). wxRect GetLabelRect() const; // If the click originates inside the bounding box of the label, // a flag is set so that an event will be fired when the left // button is released. void OnLeftDown(wxMouseEvent& event); // If the click both originated and finished inside the bounding box // of the label, a HyperlinkEvent is fired. void OnLeftUp(wxMouseEvent& event); void OnRightUp(wxMouseEvent& event); // Changes the cursor to a hand, if the mouse is inside the label's // bounding box. void OnMotion(wxMouseEvent& event); // Changes the cursor back to the default, if necessary. void OnLeaveWindow(wxMouseEvent& event); // handles "Copy URL" menuitem void OnPopUpCopy(wxCommandEvent& event); // overridden base class virtuals // Returns the best size for the window, which is the size needed // to display the text label. virtual wxSize DoGetBestClientSize() const; // creates a context menu with "Copy URL" menuitem virtual void DoContextMenu(const wxPoint &); private: // Common part of all ctors. void Init(); // URL associated with the link. This is transmitted inside // the HyperlinkEvent fired when the user clicks on the label. wxString m_url; // Foreground colours for various link types. // NOTE: wxWindow::m_backgroundColour is used for background, // wxWindow::m_foregroundColour is used to render non-visited links wxColour m_hoverColour; wxColour m_normalColour; wxColour m_visitedColour; // True if the mouse cursor is inside the label's bounding box. bool m_rollover; // True if the link has been clicked before. bool m_visited; // True if a click is in progress (left button down) and the click // originated inside the label's bounding box. bool m_clicking; }; #endif // _WX_GENERICHYPERLINKCTRL_H_
/* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2010-06-12 * Description : Special line edit for adding or creatingtags * * Copyright (C) 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de> * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef ADDTAGSLINEEDIT_H #define ADDTAGSLINEEDIT_H #include <QLineEdit> // Local includes #include "taggingaction.h" namespace Digikam { class AlbumFilterModel; class TAlbum; class TagModel; class TagPropertiesFilterModel; class TagTreeView; class TagModelCompletion; class AddTagsLineEdit : public QLineEdit { Q_OBJECT public: explicit AddTagsLineEdit(QWidget* const parent = 0); ~AddTagsLineEdit(); /** Set the tag model to use for completion. * The line edit only needs one model and used the model last set. * From the method giving three models, it will use a non-null model, * filter models having precedence. */ void setModel(TagModel* model); void setModel(AlbumFilterModel* model); void setModel(TagModel* model, TagPropertiesFilterModel* filteredModel, AlbumFilterModel* filterModel); /** Reads a tag treeview and takes the currently selected tag into account * when suggesting a parent tag for a new tag, and a default action. */ void setTagTreeView(TagTreeView* treeView); /** * Sets the currently selected tagging action to the given tag */ void setCurrentTag(TAlbum* album); void setCompleter(TagModelCompletion* c); void setAllowExceedBound(bool value); void setCurrentTaggingAction(const TaggingAction& action); TaggingAction currentTaggingAction() const; public Q_SLOTS: /** Set a parent tag for suggesting a parent tag for a new tag, and a default action. * If you set a tag tree view, this is taken care for automatically. */ void slotSetParentTag(QModelIndex index); void setParentTag(TAlbum* album); void slotReturnPressed(const QString& text); Q_SIGNALS: /// Emitted when the user activates an action (typically, by pressing return) void taggingActionActivated(const TaggingAction& action); /// Emitted when an action is selected. This already happens if anything is typed. void taggingActionSelected(const TaggingAction& action); void taggingActionFinished(); protected Q_SLOTS: void completerActivated(QModelIndex index); protected: void focusInEvent(QFocusEvent* f); void keyPressEvent(QKeyEvent* e); // void setCompletionObject(KCompletion* comp, bool dontuse=false); private: class Private; Private* const d; }; } // namespace Digikam #endif // ADDTAGSLINEEDIT_H
#include <linux/kernel.h> #include <linux/sched.h> #include <linux/types.h> #include <asm/byteorder.h> #define add_ssaaaa(sh, sl, ah, al, bh, bl) ({ \ unsigned int __sh = (ah); \ unsigned int __sl = (al); \ asm volatile( \ " alr %1,%3\n" \ " brc 12,0f\n" \ " ahi %0,1\n" \ "0: alr %0,%2" \ : "+&d" (__sh), "+d" (__sl) \ : "d" (bh), "d" (bl) : "cc"); \ (sh) = __sh; \ (sl) = __sl; \ }) #define sub_ddmmss(sh, sl, ah, al, bh, bl) ({ \ unsigned int __sh = (ah); \ unsigned int __sl = (al); \ asm volatile( \ " slr %1,%3\n" \ " brc 3,0f\n" \ " ahi %0,-1\n" \ "0: slr %0,%2" \ : "+&d" (__sh), "+d" (__sl) \ : "d" (bh), "d" (bl) : "cc"); \ (sh) = __sh; \ (sl) = __sl; \ }) /* a umul b = a mul b + (a>=2<<31) ? b<<32:0 + (b>=2<<31) ? a<<32:0 */ #define umul_ppmm(wh, wl, u, v) ({ \ unsigned int __wh = u; \ unsigned int __wl = v; \ asm volatile( \ " ltr 1,%0\n" \ " mr 0,%1\n" \ " jnm 0f\n" \ " alr 0,%1\n" \ "0: ltr %1,%1\n" \ " jnm 1f\n" \ " alr 0,%0\n" \ "1: lr %0,0\n" \ " lr %1,1\n" \ : "+d" (__wh), "+d" (__wl) \ : : "0", "1", "cc"); \ wh = __wh; \ wl = __wl; \ }) #ifdef __s390x__ #define udiv_qrnnd(q, r, n1, n0, d) \ do { unsigned long __n; \ unsigned int __r, __d; \ __n = ((unsigned long)(n1) << 32) + n0; \ __d = (d); \ (q) = __n / __d; \ (r) = __n % __d; \ } while (0) #else #define udiv_qrnnd(q, r, n1, n0, d) \ do { unsigned int __r; \ (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ (r) = __r; \ } while (0) extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int, unsigned int , unsigned int); #endif #define UDIV_NEEDS_NORMALIZATION 0 #define abort() return 0 #define __BYTE_ORDER __BIG_ENDIAN
/* ---------------------------------------------------------------------- LIGGGHTS - LAMMPS Improved for General Granular and Granular Heat Transfer Simulations LIGGGHTS is part of the CFDEMproject www.liggghts.com | www.cfdem.com Christoph Kloss, christoph.kloss@cfdem.com Copyright 2009-2012 JKU Linz Copyright 2012- DCS Computing GmbH, Linz LIGGGHTS is based on LAMMPS LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. See the README file in the top-level directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing authors: Christoph Kloss (JKU Linz, DCS Computing GmbH, Linz) Richard Berger (JKU Linz) ------------------------------------------------------------------------- */ #ifdef NORMAL_MODEL NORMAL_MODEL(HERTZ_STIFFNESS,hertz/stiffness,4) #else #ifndef NORMAL_MODEL_HERTZ_STIFFNESS_H_ #define NORMAL_MODEL_HERTZ_STIFFNESS_H_ #include "contact_models.h" #include "global_properties.h" #include "math.h" namespace ContactModels { template<typename Style> class NormalModel<HERTZ_STIFFNESS, Style> : protected Pointers { public: static const int MASK = CM_REGISTER_SETTINGS | CM_CONNECT_TO_PROPERTIES | CM_COLLISION; NormalModel(LAMMPS * lmp, IContactHistorySetup*) : Pointers(lmp), k_n(NULL), k_t(NULL), gamma_n(NULL), gamma_t(NULL), tangential_damping(false) { } void registerSettings(Settings & settings) { settings.registerOnOff("tangential_damping", tangential_damping, true); } void connectToProperties(PropertyRegistry & registry) { registry.registerProperty("k_n", &MODEL_PARAMS::createKn); registry.registerProperty("k_t", &MODEL_PARAMS::createKt); registry.registerProperty("gamma_n", &MODEL_PARAMS::createGamman); registry.registerProperty("gamma_t", &MODEL_PARAMS::createGammat); registry.connect("k_n", k_n); registry.connect("k_t", k_t); registry.connect("gamma_n", gamma_n); registry.connect("gamma_t", gamma_t); } inline void collision(CollisionData & cdata, ForceData & i_forces, ForceData & j_forces) { const int itype = cdata.itype; const int jtype = cdata.jtype; double meff=cdata.meff; double reff = cdata.is_wall ? cdata.radi : (cdata.radi*cdata.radj/(cdata.radi+cdata.radj)); const double polyhertz = sqrt(reff*cdata.deltan); double kn = polyhertz*k_n[itype][jtype]; double kt = polyhertz*k_t[itype][jtype]; double gamman = polyhertz*meff*gamma_n[itype][jtype]; double gammat = polyhertz*meff*gamma_t[itype][jtype]; if(!tangential_damping) gammat = 0.0; // convert Kn and Kt from pressure units to force/distance^2 kn /= force->nktv2p; kt /= force->nktv2p; const double Fn_damping = -gamman*cdata.vn; const double Fn_contact = kn*(cdata.radsum-cdata.r); const double Fn = Fn_contact + Fn_damping; cdata.Fn = Fn; cdata.kn = kn; cdata.kt = kt; cdata.gamman = gamman; cdata.gammat = gammat; // apply normal force if(cdata.is_wall) { const double Fn_ = Fn * cdata.area_ratio; i_forces.delta_F[0] = Fn_ * cdata.en[0]; i_forces.delta_F[1] = Fn_ * cdata.en[1]; i_forces.delta_F[2] = Fn_ * cdata.en[2]; } else { i_forces.delta_F[0] = cdata.Fn * cdata.en[0]; i_forces.delta_F[1] = cdata.Fn * cdata.en[1]; i_forces.delta_F[2] = cdata.Fn * cdata.en[2]; j_forces.delta_F[0] = -i_forces.delta_F[0]; j_forces.delta_F[1] = -i_forces.delta_F[1]; j_forces.delta_F[2] = -i_forces.delta_F[2]; } } void noCollision(ContactData&, ForceData&, ForceData&){} void beginPass(CollisionData&, ForceData&, ForceData&){} void endPass(CollisionData&, ForceData&, ForceData&){} protected: double ** k_n; double ** k_t; double ** gamma_n; double ** gamma_t; bool tangential_damping; }; } #endif // NORMAL_MODEL_HERTZ_STIFFNESS_H_ #endif
#ifndef _SSDSIM_H_ #define _SSDSIM_H_ #include "SimParameters.h" #include "FTL.h" #include "Stat.h" #include "Cache.h" #include <GL/glut.h> class SSDSim { public: SSDSim(SimParameters& s, Stat& st); ~SSDSim(void); // Starts the simulation void start(); // Glut functions (standard stuff) void renderScene2 (void); // Update the window size of the heat map window void updateHeatmapWindowSize (int w, int h) { hmw_w = w; hmw_h = h; } protected: SimParameters& sp; Stat& stat; Flash f; Cache c; FTL ftl; // --- Big OpenGL functions // run this for trace files void start1(); // run this for synthetic files void start2(); // Function for the glut void glutStart2(); // This is one step of the simulation inline int simStep2 (); // --- Helper OpenGL functions // Draws the writeblock into the currrent selected window void drawWriteblocks(); // Draws the heatmap void drawHeatmap(); // This is the array of the heatmap that we will be using int hm_w, hm_h; int hmw_w, hmw_h; unsigned char* heatmap_buffer; // Draws the block stack of block b in location (x,y) void drawBlockStack (int b, int blockUseCount, float x, float y); // start time for the percent complete calculations clock_t start_time; // calculate the percentage complete and the start time inline void printPercentComplete (long long int i); // --------------------------------------------------------------------------- // End of simulation check functions // --------------------------------------------------------------------------- void simCheck(); // Check that the mapping table points to a page with the right sector bool mapPageSectorCheck(); // Check that the hash data stored matches the sector and timestamp bool hashDataCheck(); // The hash for the current event. The size of the hash will be determined by // the hash function to use in the sim parameters char* hash; // calls the HashData class to perform the hashing void hashEvent (Event& e); // The workload object that we will use to create events Workload *w; // GLUT variable // simulation running index; long long int sim_i; // The indices of the glut windows int glwin_writeblocks; int glwin_heatmap; }; #endif