text
stringlengths
4
6.14k
/* * ===================================================================================== * * Filename: consfuntable.c * * Description: * * Version: 1.0 * Created: 12/07/2012 06:38:13 PM * Revision: none * Compiler: gcc * * Author: Liyun Dai (pku), dlyun2009@gmail.com * Company: * * ===================================================================================== */ #include "monconstfun_table.h" fn_ptr_t getconsFunById(const int id) { switch (id) { case 1: return homog; case 2: return Khomog; case 3: return symm; case 4: return linCons; } return NULL; }
#define CONFIG_SECURITY_SELINUX 1
#ifndef INCLUDED_XMALLOC_H #define INCLUDED_XMALLOC_H #ifndef __GNUC__ #define __attribute__(foo) #endif extern void *xmalloc (unsigned size); extern void *xzmalloc (unsigned size); extern void *xrealloc (void *ptr, unsigned size); extern char *xstrdup (const char *str); extern char *xstrndup (const char *str, unsigned len); //extern void *fs_get (unsigned size); //extern void fs_give (void **ptr); /* Functions using xmalloc.h must provide a function called fatal() conforming to the following: */ extern void fatal(const char *fatal_message, int fatal_code) __attribute__ ((noreturn)); #endif /* INCLUDED_XMALLOC_H */
#include "BBSLIB.inc" void trimend(char* src,int lenth); int main() { FILE *fp; int n; char s1[256]; char brd[256],id[16], title[256]; char title_in_url[240]; char path[]="etc/posts/day"; html_init(); fp=fopen(path, "r"); if(fp==NULL) return 1; fgets(s1, 255, fp); fgets(s1, 255, fp); //head printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/transitional.dtd\"> " "<html><head><title>Ê®´ó»°Ìâ</title><meta http-equiv=\"content-type\" content=\"text/html; charset=gb18030\">" "<meta HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\" /><meta name=\"%s\" content=\"%s top10bless\">" "<style type=\"text/css\">\nbody{padding: 0px;background-color: #FFF;font: 100.01% \"Trebuchet MS\",Verdana,Arial,sans-serif}" "h1,h2,p{margin: 0 10px}h1{font-size: 250%;color: #FFF}h2{font-size: 200%;color: #f0f0f0}p{padding-bottom:1em}" "h2{padding-top: 0.3em}div#nifty{ margin: auto auto;background: #0000CC;width: 508px; text-align: center}" "b.rtop, b.rbottom{display:block;background: #FFF}b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden; background: #0000CC}" "b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px}" ".top10title { font-size: 12px; color: #3333FF; text-decoration: none; background-color: #ECF2FF; text-align: left}" ".top10id { font-size: 12px; color: #888888; text-decoration: none; background-color: #ECF2FF; font-family: \"Arial\", \"Helvetica\", \"sans-serif\";text-align: left}" ".top10board { font-size: 12px; color: #9999FF; text-decoration: none; background-color: #ECF2FF; font-family: \"Courier New\", \"Courier\", \"mono\"; font-style: italic; font-weight: bold;text-align: left}" ".top10 { font-size: 18pt; color: #FFFFFF; text-decoration: none; background-color: #0000CC; font-family: \"ÐÂËÎÌå\", \"ËÎÌå\", \"Fixedsys\"; text-align: center; font-weight: bold}" "div#blesstop{ margin: auto auto;background: #CC3300;width: 508px; text-align: center}" "b.rtopbless, b.rbottombless{display:block;background: #FFF}b.rtopbless b, b.rbottombless b{display:block;height: 1px;overflow: hidden; background: #CC3300}" "b.r1{margin: 0 5px}b.r2{margin: 0 3px}b.r3{margin: 0 2px}b.rtopbless b.r4, b.rbottombless b.r4{margin: 0 1px;height: 2px}" ".top10blesstitlebless { font-size: 12px; color: #FF3300; text-decoration: none; background-color: #FFFBFB; text-align: left}" ".top10blessidbless { font-size: 12px; color: #009933; text-decoration: none; background-color: #FFFBFB; font-family: \"Arial\", \"Helvetica\", \"sans-serif\";text-align: left}" ".top10blessboardbless { font-size: 12px; color: #9999FF; text-decoration: none; background-color: #FFFBFB; font-family: \"Courier New\", \"Courier\", \"mono\"; font-style: italic; font-weight: bold;text-align: left}" ".top10bless { font-size: 18pt; color: #FFFFFF; text-decoration: none; background-color: #CC3300; font-family: \"ÐÂËÎÌå\", \"ËÎÌå\", \"Fixedsys\"; text-align: center; font-weight: bold}" ".top10blessboardblesslink { font-size: 14.7px; color: #FFFFFF; text-decoration: none; background-color: #CC3300; font-family: \"¿¬Ìå_GB2312\"; text-align: center; font-weight: bold }" ".star { color: #FF9966; font-weight: bold}</style></head>",BBSID,BBSID); printf("<body><div id=\"nifty\"><b class=\"rtop\"><b class=\"r1\"></b><b class=\"r2\"></b><b class=\"r3\"></b><b class=\"r4\"></b></b>" "<div align=\"center\"><table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>" "<td colspan=\"3\" class=\"top10\"> ÈÈÃÅ»°ÌâÖӵ㲥±¨ </td></tr><tr height=\"5px\"></tr>"); for(n=1; n<=10; n++) { if(fgets(s1, 255, fp)<=0)break; sscanf(s1+45, "%s", brd); sscanf(s1+122, "%s", id); if(fgets(s1, 255, fp)<=0)break; strsncpy(title, s1+27, 60); trimend(title,59); kill_quotation_mark(title_in_url,title); printf("<tr><td class=\"top10board\"><a href=\"/cgi-bin/bbs/bbsdoc?board=%s\" class=\"top10board\">%s</a></td>" "<td class=\"top10title\"><a href=\"/cgi-bin/bbs/newcon?board=%s&amp;title=%s\" class=\"top10title\">¡ð%s </a> " "</td><td class=\"top10id\"> <a href=\"/cgi-bin/bbs/bbsqry?userid=%s\" class=\"top10id\">%s</a></td></tr>", brd,brd,brd,title_in_url,title,id,id); } fclose(fp); printf("</table></div><b class=\"rbottom\"><b class=\"r4\"></b><b class=\"r3\"></b><b class=\"r2\"></b><b class=\"r1\"></b></b>" "</div><p></p><p></p><div id=\"blesstop\"><b class=\"rtopbless\"><b class=\"r1\"></b><b class=\"r2\"></b><b class=\"r3\"></b><b class=\"r4\"></b></b>" "<div align=\"center\"><table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr> " "<td colspan=\"2\" class=\"top10bless\">±¾ÈÕÊ®´óÖÔÐÄ×£¸£</td></tr><tr>" "<td colspan=\"2\" class=\"top10blessboardblesslink\" height=\"22px\"><a href=\"/cgi-bin/bbs/bbstdoc?board=Blessing\" class=\"top10blessboardblesslink\">»¶Ó­¹âÁÙBlessing¡¤ÐÇÓïÐÄÔ¸ </a></td>" "</tr>"); fp=fopen("etc/bless/day", "r"); if(fp==NULL) return 1; fgets(s1, 255, fp); fgets(s1, 255, fp); for(n=1; n<=10; n++) { if(fgets(s1, 255, fp)<=0)break; sscanf(s1+45, "%s", brd); sscanf(s1+122, "%s", id); if(fgets(s1, 255, fp)<=0)break; strsncpy(title, s1+27, 60); trimend(title,59); kill_quotation_mark(title_in_url,title); printf("<tr><td class=\"top10blesstitlebless\"><a href=\"/cgi-bin/bbs/newcon?board=Blessing&amp;title=%s\" class=\"top10blesstitlebless\">" "<span class=\"star\">¡ï&nbsp;</span>%s </a></td><td class=\"top10blessidbless\">" "<a href=\"/cgi-bin/bbs/bbsqry?userid=%s\" class=\"top10blessidbless\">%s</a></td></tr>", title_in_url,title,id,id); } printf("</table>"); fclose(fp); printf("</table></div><b class=\"rbottombless\"><b class=\"r4\"></b><b class=\"r3\"></b><b class=\"r2\"></b><b class=\"r1\"></b></b>" "</div></body></html>"); return 0; } void trimend(char* src,int lenth) { char * p; for (p=src+lenth;(*p==0x20||(!*p))&&p>src;p--) *p=0; return; }
#ifndef LOWER_BOUND_POLICY_MODE #define LOWER_BOUND_POLICY_MODE #include "lower_bound/lower_bound_policy.h" /* This class refines PolicyLowerBound to define the best action of a particle * set as the best action for the mode of the set. As the computation of this * action is problem-specific, it is further delegated to the model. * * Implementation note: The problem state must define implicit conversions * to int because this module uses state-indexed tables of size |S| to * compute the mode in linear time. Therefore it is unsuitable for problems * with large state spaces. * * Space complexity: O(|S|) * Time complexity (per query): O(Number of particles * search_depth) */ template<typename T> class ModePolicyLowerBound : public PolicyLowerBound<T> { public: ModePolicyLowerBound(const RandomStreams& streams, int num_states) : PolicyLowerBound<T>(streams), state_weight_(num_states) {} // Computes the mode and queries the model for the best action for it. int Action(const History& history, const vector<Particle<T>*>& particles, const Model<T>& model) const; private: mutable vector<double> state_weight_; }; template<typename T> int ModePolicyLowerBound<T>::Action( const History& history, const vector<Particle<T>*>& particles, const Model<T>& model) const { T mode = 0; for (auto p: particles) { state_weight_[p->state] += p->wt; if (state_weight_[p->state] > state_weight_[mode]) mode = p->state; } for (auto p: particles) state_weight_[p->state] = 0; return model.DefaultActionForState(mode); } #endif
/* * include/asm-arm/arch-mp2530/regs-dma.h * * Copyright. 2003-2007 AESOP-Embedded project * http://www.aesop-embedded.org/mp2530/index.html * * godori(Ko Hyun Chul), omega5 - project manager * nautilus_79(Lee Jang Ho) - main programmer * amphell(Bang Chang Hyeok) - Hardware Engineer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __ASM_ARM_REGS_DMA_H #define __ASM_ARM_REGS_DMA_H #include <asm/arch/wincetype.h> /* DMA */ #define POLLUX_DMA_BASE(x) (POLLUX_VA_DMA+(x)*0x80) #define POLLUX_DMA_SRCADDR (0x00) #define POLLUX_DMA_DSTADDR (0x04) #define POLLUX_DMA_LENGTH (0x08) #define POLLUX_DMA_REQESTID (0x0a) #define POLLUX_DMA_MODE (0x0c) #define POLLUX_DMA_INTPEND (1<<17) #define POLLUX_DMA_INTMASK (1<<18) #define POLLUX_NUM_DMA (8) #define MAX_TRANSFER_SIZE (0x10000) /// @brief DMA Transfer Mode. enum OPMODE { OPMODE_MEM_TO_MEM = 0, ///< Memory to Memory operation OPMODE_MEM_TO_IO = 1, ///< Memory to Peripheral operation OPMODE_IO_TO_MEM = 2, ///< Peripheral to Memory operation OPMODE_FORCED32 = 0x7FFFFFFF }; //------------------------------------------------------------------------------ /// @brief DMA03 register list. //------------------------------------------------------------------------------ struct dma_regset_t { volatile U32 DMASRCADDR; ///< 0x00 : Source Address Register volatile U32 DMADSTADDR; ///< 0x04 : Destination Address Register volatile U16 DMALENGTH; ///< 0x08 : Transfer Length Register volatile U16 DMAREQID; ///< 0x0A : Peripheral ID Register volatile U32 DMAMODE; ///< 0x0C : DMA Mode Register }; //------------------------------------------------------------------------------ // DMA peripheral index of modules for the DMA controller. //------------------------------------------------------------------------------ enum { DMAINDEX_OF_UART0_MODULE_TX = 0, DMAINDEX_OF_UART0_MODULE_RX = 1, DMAINDEX_OF_UART1_MODULE_TX = 2, DMAINDEX_OF_UART1_MODULE_RX = 3, DMAINDEX_OF_UART2_MODULE_TX = 4, DMAINDEX_OF_UART2_MODULE_RX = 5, DMAINDEX_OF_UART3_MODULE_TX = 6, DMAINDEX_OF_UART3_MODULE_RX = 7, DMAINDEX_OF_USBDEVICE_MODULE_EP1 = 12, DMAINDEX_OF_USBDEVICE_MODULE_EP2 = 13, DMAINDEX_OF_SDHC0_MODULE = 16, DMAINDEX_OF_SSPSPI0_MODULE_TX = 18, DMAINDEX_OF_SSPSPI0_MODULE_RX = 19, DMAINDEX_OF_SSPSPI1_MODULE_TX = 20, DMAINDEX_OF_SSPSPI1_MODULE_RX = 21, DMAINDEX_OF_AUDIO_MODULE_PCMOUT = 24, DMAINDEX_OF_AUDIO_MODULE_PCMIN = 26, DMAINDEX_OF_SDHC1_MODULE = 30, DMAINDEX_OF_MCUS_MODULE = 31 }; #endif // __ASM_ARM_REGS_DMA_H
/* * arch/arm/mach-tegra/tegra_pmqos.h * * Copyright (C) 2012 Paul Reioux (aka Faux123) * * Author: * faux123 <reioux@gmail.com> * * History: * -original version (Paul Reioux) * -cleaned since oc was reworked (Dennis Rassmann) * -added comment for T3_VARIANT_BOOST (Dennis Rassmann) * -adapted for grouper (Dennis Rassmann) * -removed distinction between 0boost and xboost * -minimized version * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* in kHz */ #ifdef CONFIG_CPU_OVERCLOCK #define T3_CPU_FREQ_MAX_0 1600000 #define T3_CPU_FREQ_MAX 1600000 #define T3_CPU_FREQ_MAX_OC 1600000 #else #define T3_CPU_FREQ_MAX_0 1500000 #define T3_CPU_FREQ_MAX 1500000 #define T3_CPU_FREQ_MAX_OC 1500000 #endif /* any caps will be respected */ #define T3_CPU_FREQ_BOOST 1300000 #define T3_CPU_MIN_FREQ 51000 #define T3_SUSPEND_FREQ 340000 #define T3_GMODE_MIN_FREQ 51000 // used for governors ideal or idle freq #define GOV_IDLE_FREQ 475000 // default without 620LP #define T3_LP_MAX_FREQ_DEFAULT 475000 // sysfs to change available #define SUSPEND_ONLINE_CPUS_MAX 2 // f_mtp.c #define MTP_CPU_FREQ_MIN 1150000 #define MTP_ONLINE_CPUS_MIN 2 // tlv320aic3008.c - sysfs to change available #define AUD_CPU_FREQ_MIN 102000 // android.c #define USB_TP_CPU_FREQ_MIN 475000 // tegra_udc.h #define TEGRA_GADGET_CPU_FREQ_MIN 475000 // tegra_hsuart.c - not automatic must be enabled via sysfs // we dont need that on enrc2b #define TI_A2DP_CPU_FREQ_MIN 102000 // tegra_hsuart_brcm.c - not automatic must be enabled via sysfs // sysfs to change available #define A2DP_CPU_FREQ_MIN 204000 #define OPP_CPU_FREQ_MIN 475000 // wl_android.c #define WIFI_CPU_FREQ_MIN 1150000 #define WIFI_ONLINE_CPUS_MIN 2 // usbnet.c #define USBNET_CPU_FREQ_MIN 475000 #define USBNET_ONLINE_CPUS_MIN 2 // tegra_camera.c #define CAMERA_CPU_FREQ_MIN 760000 #define CAMERA_ONLINE_CPUS_MIN 3 extern unsigned int tegra_pmqos_cpu_freq_limits[]; extern unsigned int tegra_pmqos_cpu_freq_limits_min[]; extern unsigned int tegra_cpu_freq_max(unsigned int cpu); extern unsigned int tegra_get_suspend_boost_freq(void); extern unsigned int tegra_lpmode_freq_max(void); extern void tegra_lpmode_freq_max_changed(void);
/* * presence module - presence server implementation * * Copyright (C) 2006 Voice Sistem S.R.L. * * This file is part of opensips, a free SIP server. * * opensips 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 * * opensips 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 * * History: * -------- * 2006-08-15 initial version (Anca Vamanu) */ #ifndef UTILS_FUNC_H #define UTILS_FUNC_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include "../../mem/mem.h" #include "../../dprint.h" #include "../../str.h" #include "../../parser/msg_parser.h" #define LCONTACT_BUF_SIZE 1024 #define BAD_EVENT_CODE 489 static inline int uandd_to_uri(str user, str domain, str *out) { int size; if(out==0) return -1; size = user.len + domain.len+7; out->s = (char*)pkg_malloc(size); if(out->s == NULL) { LM_ERR("no more memory\n"); return -1; } strcpy(out->s,"sip:"); out->len = 4; if( user.len != 0) { memcpy(out->s+out->len, user.s, user.len); out->len += user.len; out->s[out->len++] = '@'; } memcpy(out->s + out->len, domain.s, domain.len); out->len += domain.len; out->s[out->len] = '\0'; return 0; } /* Build an contact URI but without the "transport" param - this is to be * added when a send is done, depending on the used interface. */ static inline int get_local_contact(struct socket_info *sock, str* contact) { static char buf[LCONTACT_BUF_SIZE]; contact->s = buf; contact->len= 0; memset(buf, 0, LCONTACT_BUF_SIZE); /* write "sip:ip" */ memcpy(contact->s+contact->len, "sip:", 4); contact->len+= 4; /* if advertised address is set for this interface, use this one */ if (sock->adv_name_str.s) { memcpy(contact->s+contact->len, sock->adv_name_str.s, sock->adv_name_str.len); contact->len += sock->adv_name_str.len; } else { memcpy(contact->s+contact->len, sock->address_str.s, sock->address_str.len); contact->len += sock->address_str.len; } if(contact->len> LCONTACT_BUF_SIZE - 21) { LM_ERR("buffer overflow\n"); return -1; } /* write ":port" if port defined */ if (sock->adv_name_str.s) { if(sock->adv_port_str.s) { *(contact->s+(contact->len++)) = ':'; memcpy(contact->s+contact->len, sock->adv_port_str.s, sock->adv_port_str.len); contact->len += sock->adv_port_str.len; } } else if (sock->port_no_str.len) { *(contact->s+(contact->len++)) = ':'; memcpy(contact->s+contact->len, sock->port_no_str.s, sock->port_no_str.len); contact->len += sock->port_no_str.len; } return 0; } int a_to_i (char *s,int len); void to64frombits(unsigned char *out, const unsigned char *in, int inlen); int send_error_reply(struct sip_msg* msg, int reply_code, str reply_str); #endif
/**************************************************************************\ * * This file is part of the Coin 3D visualization library. * Copyright (C) 1998-2008 by Kongsberg SIM. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. * See the file LICENSE.GPL at the root directory of this source * distribution for additional information about the GNU GPL. * * For using Coin with software that can not be combined with the GNU * GPL, and for taking advantage of the additional benefits of our * support services, please contact Kongsberg SIM about acquiring * a Coin Professional Edition License. * * See http://www.coin3d.org/ for more information. * * Kongsberg SIM, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY. * http://www.sim.no/ sales@sim.no coin-support@coin3d.org * \**************************************************************************/ #ifndef COIN_SOVRMLLOD_H #define COIN_SOVRMLLOD_H #include <Inventor/nodes/SoSubNode.h> #include <Inventor/nodes/SoGroup.h> #include <Inventor/fields/SoMFFloat.h> #include <Inventor/fields/SoSFVec3f.h> #include <Inventor/fields/SoMFNode.h> class SoVRMLLODP; class COIN_DLL_API SoVRMLLOD : public SoGroup { typedef SoGroup inherited; SO_NODE_HEADER(SoVRMLLOD); public: static void initClass(void); SoVRMLLOD(void); SoVRMLLOD(int levels); SoMFFloat range; SoSFVec3f center; SoMFNode level; virtual SbBool affectsState(void) const; void addLevel(SoNode * level); void insertLevel(SoNode * level, int idx); SoNode * getLevel(int idx) const; int findLevel(const SoNode * level) const; int getNumLevels(void) const; void removeLevel(int idx); void removeLevel(SoNode * level); void removeAllLevels(void); void replaceLevel(int idx, SoNode * level); void replaceLevel(SoNode * old, SoNode * level); virtual void doAction(SoAction * action); virtual void callback(SoCallbackAction * action); virtual void GLRender(SoGLRenderAction * action); virtual void rayPick(SoRayPickAction * action); virtual void getBoundingBox(SoGetBoundingBoxAction * action); virtual void search(SoSearchAction * action); virtual void write(SoWriteAction * action); virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action); virtual void audioRender(SoAudioRenderAction * action); virtual void GLRenderBelowPath(SoGLRenderAction * action); virtual void GLRenderInPath(SoGLRenderAction * action); virtual void GLRenderOffPath(SoGLRenderAction * action); void addChild(SoNode * child); void insertChild(SoNode * child, int idx); SoNode * getChild(int idx) const; int findChild(const SoNode * child) const; int getNumChildren(void) const; void removeChild(int idx); void removeChild(SoNode * child); void removeAllChildren(void); void replaceChild(int idx, SoNode * child); void replaceChild(SoNode * old, SoNode * child); virtual SoChildList * getChildren(void) const; protected: virtual ~SoVRMLLOD(); virtual void notify(SoNotList * list); virtual SbBool readInstance(SoInput * in, unsigned short flags); virtual void copyContents(const SoFieldContainer * from, SbBool copyConn); virtual int whichToTraverse(SoAction * action); private: void commonConstructor(void); SoVRMLLODP * pimpl; friend class SoVRMLLODP; }; // class SoVRMLLOD #endif // ! COIN_SOVRMLLOD_H
/* * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like. Any license provided herein, whether implied or * otherwise, applies only to this software file. Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA 94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ #ifndef __XFS_SUPPORT_MRLOCK_H__ #define __XFS_SUPPORT_MRLOCK_H__ #include <linux/version.h> #include <linux/time.h> #include <linux/wait.h> #include <asm/atomic.h> #include <asm/semaphore.h> /* * Implement mrlocks on Linux that work for XFS. * * These are sleep locks and not spinlocks. If one wants read/write spinlocks, * use read_lock, write_lock, ... see spinlock.h. */ typedef struct mrlock_s { int mr_count; unsigned short mr_reads_waiting; unsigned short mr_writes_waiting; wait_queue_head_t mr_readerq; wait_queue_head_t mr_writerq; spinlock_t mr_lock; } mrlock_t; #define MR_ACCESS 1 #define MR_UPDATE 2 #define MRLOCK_BARRIER 0x1 #define MRLOCK_ALLOW_EQUAL_PRI 0x8 /* * mraccessf/mrupdatef take flags to be passed in while sleeping; * only PLTWAIT is currently supported. */ extern void mraccessf(mrlock_t *, int); extern void mrupdatef(mrlock_t *, int); extern void mrlock(mrlock_t *, int, int); extern void mrunlock(mrlock_t *); extern void mraccunlock(mrlock_t *); extern int mrtryupdate(mrlock_t *); extern int mrtryaccess(mrlock_t *); extern int mrtrypromote(mrlock_t *); extern void mrdemote(mrlock_t *); extern int ismrlocked(mrlock_t *, int); extern void mrlock_init(mrlock_t *, int type, char *name, long sequence); extern void mrfree(mrlock_t *); #define mrinit(mrp, name) mrlock_init(mrp, MRLOCK_BARRIER, name, -1) #define mraccess(mrp) mraccessf(mrp, 0) /* grab for READ/ACCESS */ #define mrupdate(mrp) mrupdatef(mrp, 0) /* grab for WRITE/UPDATE */ #define mrislocked_access(mrp) ((mrp)->mr_count > 0) #define mrislocked_update(mrp) ((mrp)->mr_count < 0) #endif /* __XFS_SUPPORT_MRLOCK_H__ */
/* file_dlg.h * Declarations of utilities to use when constructing file selection dialogs * * $Id$ * * 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. */ /** @defgroup filesel_dialog_group File Selection Dialogs * * Dialogs are specially created windows and are related to their parent windows (usually the main window). * See: @ref howto_window_page for details. * * File selection dialogs are created using file_selection_new(). * * - "Browse" file_selection_browse() * - "Open Capture File" file_open_cmd() * - "Save Capture File As" file_save_as_cmd() * - "Import Color Filters" file_color_import_cmd_cb() * - "Export Color Filters" file_color_export_cmd_cb() * - "Save TCP Follow Stream As" follow_save_as_cmd_cb() * - "Export Selected Packet Bytes" savehex_cb() * - "Save Data As CSV" save_csv_as_cb() * - "Save Payload As ..." on_save_bt_clicked() * - "Save selected stream in rtpdump" rtpstream_on_save() * */ /** @file * Utilities for file selection dialog boxes. Depending on the window * functions in gui_utils.h, see: @ref howto_window_page for details. * @ingroup filesel_dialog_group */ #ifndef __FILE_DLG_H__ #define __FILE_DLG_H__ /** the action a file selection is designed for */ typedef enum { FILE_SELECTION_OPEN, /**< open a file */ FILE_SELECTION_READ_BROWSE, /**< browse for a file to read */ FILE_SELECTION_SAVE, /**< save/export a file */ FILE_SELECTION_WRITE_BROWSE, /**< browse for a file to write to */ FILE_SELECTION_CREATE_FOLDER /**< browse for a dir. to save in */ } file_selection_action_t; /** Create a file selection dialog box window that belongs to Wireshark's * main window. See window_new() for usage. * * @param title the title for the new file selection dialog * @param action the desired action * @return the newly created file selection dialog */ extern GtkWidget *file_selection_new(const gchar *title, file_selection_action_t action); /** Set the current folder for a file selection dialog. * * @param fs the file selection dialog from file_selection_new() * @param filename the folder to set * @return TRUE if the folder could be changed successfully */ extern gboolean file_selection_set_current_folder(GtkWidget *fs, const gchar *filename); /** Set the current file for a file selection dialog. * * @param fs the file selection dialog from file_selection_new() * @param filename the folder to set * @return TRUE if the folder could be changed successfully */ #define file_selection_set_current_file(chooser, filename) \ gtk_file_chooser_set_filename(chooser, filename) /** Set the "extra" widget for a file selection dialog. This is needed to support * user-supplied options. * * @param fs the file selection dialog from file_selection_new() * @param extra the widget to set */ extern void file_selection_set_extra_widget(GtkWidget *fs, GtkWidget *extra); /** Run the dialog, and handle some common operations, such as, if the * user selects a directory, browsing that directory, and handling * shortcuts on Windows. * @param fs the file selection dialog from file_selection_new() * @return the pathname of the selected file if the user selected a * file, NULL if they cancelled or closed the dialog. */ extern gchar *file_selection_run(GtkWidget *fs); #ifndef _WIN32 /** If the specified file doesn't exist, return TRUE. * If it exists and is neither user-immutable nor not writable, return * TRUE. * Otherwise, as the user whether they want to overwrite it anyway, and * return TRUE if the file should be overwritten and FALSE otherwise. * * @param chooser_w the GtkFileChooser used to select the file in question * @param cf_name the current name chosen */ extern gboolean file_target_unwritable_ui(GtkWidget *chooser_w, char *cf_name); #endif /** The function file_selection_browse() will g_object_set_data() itself on it's parent window. * When destroying the parent window, it can close the corresponding file selection. */ #define E_FILE_SEL_DIALOG_PTR_KEY "file_sel_dialog_ptr" /** Browse the files and fill in the associated text entry. * * @param file_bt the button that called us (to get the toplevel widget) * @param file_te the GtkEntry the dialog will have to fill in the filename * @param title the title for the file selection dialog * @param action the desired action */ extern void file_selection_browse(GtkWidget *file_bt, GtkWidget *file_te, const char *title, file_selection_action_t action); /** Set the latest opened directory. * Will already be done when using file_selection_new(). * * @param dirname the dirname */ extern void set_last_open_dir(const char *dirname); #endif
/* This file is part of the KDE libraries Copyright (C) 2002-2005 Hamish Rodda <rodda@kde.org> Copyright (C) 2003 Anakim Border <aborder@sources.sourceforge.net> * * 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 _KATE_LINELAYOUT_H_ #define _KATE_LINELAYOUT_H_ #include <QSharedData> #include <QExplicitlySharedDataPointer> #include "katetextline.h" #include <ktexteditor/cursor.h> class QTextLayout; namespace KTextEditor { class DocumentPrivate; } class KateTextLayout; class KateRenderer; class KateLineLayout : public QSharedData { public: KateLineLayout(KateRenderer &renderer); ~KateLineLayout(); KTextEditor::DocumentPrivate *doc() const; void debugOutput() const; void clear(); bool isValid() const; bool isOutsideDocument() const; bool isRightToLeft() const; bool includesCursor(const KTextEditor::Cursor &realCursor) const; friend bool operator> (const KateLineLayout &r, const KTextEditor::Cursor &c); friend bool operator>= (const KateLineLayout &r, const KTextEditor::Cursor &c); friend bool operator< (const KateLineLayout &r, const KTextEditor::Cursor &c); friend bool operator<= (const KateLineLayout &r, const KTextEditor::Cursor &c); const Kate::TextLine &textLine(bool forceReload = false) const; int length() const; int line() const; /** * Only pass virtualLine if you know it (and thus we shouldn't try to look it up) */ void setLine(int line, int virtualLine = -1); KTextEditor::Cursor start() const; int virtualLine() const; void setVirtualLine(int virtualLine); bool isDirty(int viewLine) const; bool setDirty(int viewLine, bool dirty = true); int width() const; int widthOfLastLine() const; int viewLineCount() const; KateTextLayout viewLine(int viewLine) const; int viewLineForColumn(int column) const; bool startsInvisibleBlock() const; // This variable is used as follows: // non-dynamic-wrapping mode: unused // dynamic wrapping mode: // first viewLine of a line: the X position of the first non-whitespace char // subsequent viewLines: the X offset from the left of the display. // // this is used to provide a dynamic-wrapping-retains-indent feature. int shiftX() const; void setShiftX(int shiftX); QTextLayout *layout() const; void setLayout(QTextLayout *layout); void invalidateLayout(); bool isLayoutDirty() const; void setLayoutDirty(bool dirty = true); bool usePlainTextLine() const; void setUsePlainTextLine(bool plain = true); private: // Disable copy KateLineLayout(const KateLineLayout &copy); QTextLayout *takeLayout() const; KateRenderer &m_renderer; mutable Kate::TextLine m_textLine; int m_line; int m_virtualLine; int m_shiftX; QTextLayout *m_layout; QList<bool> m_dirtyList; bool m_layoutDirty; bool m_usePlainTextLine; }; typedef QExplicitlySharedDataPointer<KateLineLayout> KateLineLayoutPtr; #endif
#import <Cocoa/Cocoa.h> #import "Mouse.h" #import "Terminal.h" @interface NSObject (TTLogicalScreen) - (NSValue*) MouseTerm_initVars2; - (void) MouseTerm_setNaturalEmojiWidth: (BOOL) emojiFix; - (BOOL) MouseTerm_getNaturalEmojiWidth; - (unsigned long long)MouseTerm_logicalWidthForCharacter:(int)arg1; - (unsigned long long)MouseTerm_displayWidthForCharacter:(int)arg1; @end @interface NSView (MTView) - (id) MouseTerm_colorForANSIColor:(unsigned int)index; - (id) MouseTerm_colorForANSIColor:(unsigned int)index adjustedRelativeToColor:(id)bgColor; - (id) MouseTerm_colorForExtendedANSIColor:(unsigned long long)index adjustedRelativeToColor:(id)bgColor withProfile:(id)profile; - (NSData*) MouseTerm_codeForX: (unsigned int) x Y: (unsigned int) y modifier: (char) modflag button: (MouseButton) button motion: (BOOL) motion release: (BOOL) release; + (void) MouseTerm_setMouseEnabled: (BOOL) value; + (BOOL) MouseTerm_getMouseEnabled; + (void) MouseTerm_setBase64CopyEnabled: (BOOL) value; + (BOOL) MouseTerm_getBase64CopyEnabled; + (void) MouseTerm_setBase64PasteEnabled: (BOOL) value; + (BOOL) MouseTerm_getBase64PasteEnabled; - (NSScroller*) MouseTerm_scroller; - (BOOL) MouseTerm_shouldIgnore: (NSEvent*) event button: (MouseButton) button; - (BOOL) MouseTerm_shouldIgnoreDown: (NSEvent*) event button: (MouseButton) button; - (BOOL) MouseTerm_shouldIgnoreMoved: (NSEvent*) event; - (Position) MouseTerm_currentPosition: (NSEvent*) event; - (BOOL) MouseTerm_buttonDown: (NSEvent*) event button: (MouseButton) button; - (BOOL) MouseTerm_buttonDragged: (NSEvent*) event button: (MouseButton) button; - (BOOL) MouseTerm_buttonUp: (NSEvent*) event button: (MouseButton) button; - (void) MouseTerm_mouseDown: (NSEvent*) event; - (void) MouseTerm_mouseMoved: (NSEvent*) event; - (void) MouseTerm_mouseDragged: (NSEvent*) event; - (void) MouseTerm_mouseUp: (NSEvent*) event; - (void) MouseTerm_rightMouseDown: (NSEvent*) event; - (void) MouseTerm_rightMouseDragged: (NSEvent*) event; - (void) MouseTerm_rightMouseUp: (NSEvent*) event; - (void) MouseTerm_otherMouseDown: (NSEvent*) event; - (void) MouseTerm_otherMouseDragged: (NSEvent*) event; - (void) MouseTerm_otherMouseUp: (NSEvent*) event; - (void) MouseTerm_scrollWheel: (NSEvent*) event; - (BOOL) MouseTerm_windowDidBecomeKey: (id) arg1; - (BOOL) MouseTerm_windowDidResignKey: (id) arg1; - (BOOL) MouseTerm_acceptsFirstResponder; - (BOOL) MouseTerm_becomeFirstResponder; - (BOOL) MouseTerm_resignFirstResponder; @end
#include "meta.h" #include "../util.h" /* B1S (found in 7 Wonders of the Ancient World) */ VGMSTREAM * init_vgmstream_ps2_b1s(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[260]; int channel_count; off_t start_offset; /* check extension, case insensitive */ streamFile->get_name(streamFile,filename,sizeof(filename)); if (strcasecmp("b1s",filename_extension(filename))) goto fail; if ((read_32bitLE(0x04,streamFile)+0x18) != get_streamfile_size(streamFile)) goto fail; channel_count = read_32bitLE(0x14,streamFile); /* build the VGMSTREAM */ vgmstream = allocate_vgmstream(channel_count,0); if (!vgmstream) goto fail; /* fill in the vital statistics */ start_offset = 0x18; vgmstream->channels = channel_count; vgmstream->sample_rate = read_32bitBE(0x10,streamFile); vgmstream->coding_type = coding_PSX; vgmstream->num_samples = read_32bitLE(0x04,streamFile)/16/channel_count*28; vgmstream->layout_type = layout_interleave; vgmstream->interleave_block_size = read_32bitLE(0x0C,streamFile); vgmstream->meta_type = meta_PS2_B1S; /* open the file for reading */ { int i; STREAMFILE * file; file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE); if (!file) goto fail; for (i=0;i<channel_count;i++) { vgmstream->ch[i].streamfile = file; vgmstream->ch[i].channel_start_offset= vgmstream->ch[i].offset=start_offset+ vgmstream->interleave_block_size*i; } } return vgmstream; /* clean up anything we may have opened */ fail: if (vgmstream) close_vgmstream(vgmstream); return NULL; }
// image.h - API for working with images // Copyright ©2011 Guff <cassmacguff@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 LUALOCK_CLIB_IMAGE_H #define LUALOCK_CLIB_IMAGE_H #include <lualib.h> #include <lauxlib.h> #include "misc.h" typedef struct { GdkPixbuf *pbuf; layer_t *layer; cairo_surface_t *surface; gdouble rotation; } image_t; gdouble image_get_width(image_t *image); gdouble image_get_height(image_t *image); void lualock_lua_image_init(lua_State *L); #endif
/* gEDA - GPL Electronic Design Automation * gschem - gEDA Schematic Capture * Copyright (C) 1998-2010 Ales Hvezda * Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 */ /*! \file x_aligncb.c * * \brief A GtkComboBox with the gschem text alignments. */ #include <config.h> #include <version.h> #include <missing.h> #include <stdio.h> #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif #ifdef HAVE_STRING_H #include <string.h> #endif #include "gschem.h" /*! \brief The columns in the GtkListStore */ enum { COLUMN_NAME, COLUMN_ALIGN, COLUMN_COUNT }; /*! \brief Stores the list of alignments for use by the GtkComboBox */ static GtkListStore* align_list_store = NULL; /*! \brief Create the alignment combo box list store for the text property dialog * * \return A GtkListStore with gschem text alignment entries. */ static GtkListStore * create_align_list_store () { GtkTreeIter iter; GtkListStore *store; store = gtk_list_store_new (COLUMN_COUNT, G_TYPE_STRING, G_TYPE_INT); /* Upper row */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Upper Left"), COLUMN_ALIGN, UPPER_LEFT, -1); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Upper Middle"), COLUMN_ALIGN, UPPER_MIDDLE, -1); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Upper Right"), COLUMN_ALIGN, UPPER_RIGHT, -1); /* Middle row */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Middle Left"), COLUMN_ALIGN, MIDDLE_LEFT, -1); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Middle Middle"), COLUMN_ALIGN, MIDDLE_MIDDLE, -1); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Middle Right"), COLUMN_ALIGN, MIDDLE_RIGHT, -1); /* Lower row */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Lower Left"), COLUMN_ALIGN, LOWER_LEFT, -1); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Lower Middle"), COLUMN_ALIGN, LOWER_MIDDLE, -1); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_NAME, _("Lower Right"), COLUMN_ALIGN, LOWER_RIGHT, -1); return store; } /*! \brief Create a ComboBox with the gschem alignments. * * \return A GtkWidget for selecting text alignments. */ GtkWidget* x_aligncb_new () { GtkCellRenderer *cell; GtkComboBox *combo; if (align_list_store == NULL) { align_list_store = create_align_list_store (); } combo = GTK_COMBO_BOX (gtk_combo_box_new_with_model (GTK_TREE_MODEL (align_list_store))); gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 3); cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, "text", COLUMN_NAME, NULL); return GTK_WIDGET (combo); } /*! \brief Get the currently selected text alignment * * \param [in,out] widget The text alignment combo box * \return The currently selected text alignment */ int x_aligncb_get_align (GtkWidget *widget) { int align = -1; GtkTreeIter iter; GValue value = {0}; if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX(widget), &iter)) { gtk_tree_model_get_value (GTK_TREE_MODEL (align_list_store), &iter, COLUMN_ALIGN, &value); align = g_value_get_int (&value); g_value_unset (&value); } return align; } /*! \brief Select the given text alignment * * \par Function Description * Selects the given text alignment. With an invalid alignment, this * function does nothing. * * \param [in,out] widget The text alignment combo box * \param [in] align The text alignment to select */ void x_aligncb_set_align (GtkWidget *widget, int align) { GtkTreeIter iter; gboolean success; GValue value = {0}; g_return_if_fail (align_list_store != NULL); success = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (align_list_store), &iter); while (success) { gtk_tree_model_get_value (GTK_TREE_MODEL (align_list_store), &iter, COLUMN_ALIGN, &value); if (g_value_get_int (&value) == align) { g_value_unset (&value); gtk_combo_box_set_active_iter (GTK_COMBO_BOX (widget), &iter); break; } g_value_unset (&value); success = gtk_tree_model_iter_next (GTK_TREE_MODEL (align_list_store), &iter); } }
#ifndef __SYS_TIME_H__ #define __SYS_TIME_H__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include <stddef.h> typedef unsigned long clock_t; typedef long time_t; typedef int64_t suseconds_t; struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec; /* microseconds */ }; struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of DST correction */ }; int gettimeofday(struct timeval *tv, struct timezone *tz); int settimeofday(const struct timeval *tv, const struct timezone *tz); struct tm *localtime(const time_t *tp); size_t strftime(char *s, size_t max, const char *fmt, const struct tm *tm); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __SYS_TIME_H__ */
/******************************************************************************\ This file is part of the FAHViewer. The FAHViewer displays 3D views of Folding@home proteins. Copyright (c) 2016-2020, foldingathome.org Copyright (c) 2003-2016, Stanford University 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. For information regarding this software email: Joseph Coffland joseph@cauldrondevelopment.com \******************************************************************************/ #pragma once #include <fah/viewer/pyon/Object.h> #include <cbang/StdTypes.h> #include <cbang/geom/Vector.h> #include <iostream> #include <string> namespace FAH { class Atom : public PyON::Object { public: enum { HYDROGEN = 1, CARBON = 6, NITROGEN = 7, OXYGEN = 8, SULFUR = 16, HEAVY = 999, }; protected: std::string type; unsigned number; float charge; float radius; float mass; unsigned index; public: Atom() : number(0), charge(0), radius(0), mass(0), index(0) {} Atom(const cb::JSON::Value &value, float scale = 1) : number(0), charge(0), radius(0), mass(0), index(0) {loadJSON(value, scale);} Atom(const std::string &type, float charge = 0, float radius = 0, float mass = 0, unsigned number = 0); const std::string &getType() const {return type;} void setType(const std::string &type) {this->type = type;} unsigned getNumber() const {return number;} void setNumber(unsigned number) {this->number = number;} float getCharge() const {return charge;} float getRadius() const {return radius;} float getMass() const {return mass;} void setIndex(unsigned index) {this->index = index;} unsigned getIndex() const {return index;} static float chargeFromNumber(unsigned number); static float radiusFromNumber(unsigned number); static float massFromNumber(unsigned number); static unsigned numberFromName(const std::string &name); void setDataFromNumber(unsigned number); double averageBondLength(const Atom &atom) const; // From PyONObject const char *getPyONType() const {return "atom";} cb::SmartPointer<cb::JSON::Value> getJSON() const; void loadJSON(const cb::JSON::Value &value) {loadJSON(value, 1);} void loadJSON(const cb::JSON::Value &value, float scale); }; }
// ********************************************************************** // // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef REQUEST_H #define REQUEST_H #include <IceUtil/Thread.h> #include <IceUtil/Monitor.h> #include <Ice/Ice.h> #include <deque> namespace Glacier2 { class Instance; typedef IceUtil::Handle<Instance> InstancePtr; class Request; typedef IceUtil::Handle<Request> RequestPtr; class RequestQueueThread; typedef IceUtil::Handle<RequestQueueThread> RequestQueueThreadPtr; class Request : public Ice::LocalObject { public: Request(const Ice::ObjectPrx&, const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&, bool, const Ice::Context&, const Ice::AMD_Object_ice_invokePtr&); Ice::AsyncResultPtr invoke(const Ice::Callback_Object_ice_invokePtr& callback); bool override(const RequestPtr&) const; const Ice::ObjectPrx& getProxy() const { return _proxy; } bool hasOverride() const { return !_override.empty(); } private: friend class RequestQueue; void response(bool, const std::pair<const Ice::Byte*, const Ice::Byte*>&); void exception(const Ice::Exception&); void queued(); const Ice::ObjectPrx _proxy; const Ice::ByteSeq _inParams; const Ice::Current _current; const bool _forwardContext; const Ice::Context _sslContext; const std::string _override; const Ice::AMD_Object_ice_invokePtr _amdCB; }; class RequestQueue : public IceUtil::Mutex, public IceUtil::Shared { public: RequestQueue(const RequestQueueThreadPtr&, const InstancePtr&, const Ice::ConnectionPtr&); bool addRequest(const RequestPtr&); void flushRequests(std::set<Ice::ObjectPrx>&); private: void flush(); void flush(std::set<Ice::ObjectPrx>&); void response(bool, const std::pair<const Ice::Byte*, const Ice::Byte*>&, const RequestPtr&); void exception(const Ice::Exception&, const RequestPtr&); void sent(bool, const RequestPtr&); const RequestQueueThreadPtr _requestQueueThread; const InstancePtr _instance; const Ice::ConnectionPtr _connection; const Ice::Callback_Object_ice_invokePtr _callback; const Ice::Callback_Connection_flushBatchRequestsPtr _flushCallback; std::deque<RequestPtr> _requests; bool _pendingSend; RequestPtr _pendingSendRequest; }; typedef IceUtil::Handle<RequestQueue> RequestQueuePtr; class RequestQueueThread : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex> { public: RequestQueueThread(const IceUtil::Time&); virtual ~RequestQueueThread(); void flushRequestQueue(const RequestQueuePtr&); void destroy(); virtual void run(); private: const IceUtil::Time _sleepTime; bool _destroy; bool _sleep; IceUtil::Time _sleepDuration; std::vector<RequestQueuePtr> _queues; }; } #endif
/*************************************************************************** * Copyright 2010 by Davide Bettio <davide.bettio@kdemail.net> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * *************************************************************************** * Name: fluxos.h * ***************************************************************************/ #ifndef _SYS_FLUXOS_H #define _SYS_FLUXOS_H #include <unistd.h> extern int reboot(int magic, int magic2, int cmd, void *arg); #endif
#ifndef _LINUX_CISREG_H #define _LINUX_CISREG_H #define CISREG_COR 0x00 #define CISREG_CCSR 0x02 #define CISREG_PRR 0x04 #define CISREG_SCR 0x06 #define CISREG_ESR 0x08 #define CISREG_IOBASE_0 0x0a #define CISREG_IOBASE_1 0x0c #define CISREG_IOBASE_2 0x0e #define CISREG_IOBASE_3 0x10 #define CISREG_IOSIZE 0x12 #define COR_CONFIG_MASK 0x3f #define COR_MFC_CONFIG_MASK 0x38 #define COR_FUNC_ENA 0x01 #define COR_ADDR_DECODE 0x02 #define COR_IREQ_ENA 0x04 #define COR_LEVEL_REQ 0x40 #define COR_SOFT_RESET 0x80 #define CCSR_INTR_ACK 0x01 #define CCSR_INTR_PENDING 0x02 #define CCSR_POWER_DOWN 0x04 #define CCSR_AUDIO_ENA 0x08 #define CCSR_IOIS8 0x20 #define CCSR_SIGCHG_ENA 0x40 #define CCSR_CHANGED 0x80 #define PRR_WP_STATUS 0x01 #define PRR_READY_STATUS 0x02 #define PRR_BVD2_STATUS 0x04 #define PRR_BVD1_STATUS 0x08 #define PRR_WP_EVENT 0x10 #define PRR_READY_EVENT 0x20 #define PRR_BVD2_EVENT 0x40 #define PRR_BVD1_EVENT 0x80 #define SCR_SOCKET_NUM 0x0f #define SCR_COPY_NUM 0x70 #define ESR_REQ_ATTN_ENA 0x01 #define ESR_REQ_ATTN 0x10 #define CBFN_EVENT 0x00 #define CBFN_MASK 0x04 #define CBFN_STATE 0x08 #define CBFN_FORCE 0x0c #define CBFN_WP 0x0001 #define CBFN_READY 0x0002 #define CBFN_BVD2 0x0004 #define CBFN_BVD1 0x0008 #define CBFN_GWAKE 0x0010 #define CBFN_INTR 0x8000 #define FEMR_BAM_ENA 0x0020 #define FEMR_PWM_ENA 0x0040 #define FEMR_WKUP_MASK 0x4000 #define CISREG_ICTRL0 0x02 /* control registers */ #define CISREG_ICTRL1 0x03 #define CISREG_IADDR0 0x04 /* address registers */ #define CISREG_IADDR1 0x05 #define CISREG_IADDR2 0x06 #define CISREG_IADDR3 0x07 #define CISREG_IDATA0 0x08 /* data registers */ #define CISREG_IDATA1 0x09 #define ICTRL0_COMMON 0x01 #define ICTRL0_AUTOINC 0x02 #define ICTRL0_BYTEGRAN 0x04 #endif /* _LINUX_CISREG_H */
/* * Copyright (C) 2007 The MATE Foundation * Written by Thomas Wood <thos@gnome.org> * 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., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ void style_init (AppearanceData *data); void style_shutdown (AppearanceData *data);
/* savefile.c - Part of IMSKPE Copyright (C) 2004 Andreas Madsack 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 */ /** * @file savefile.c * @author Andreas Madsack * * @brief wrapper for save/export of files * * */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <gtk/gtk.h> #include <stdio.h> #include <string.h> #include <malloc.h> #include "loadpar.h" #include "graphics.h" #include "support.h" #include "loadfile.h" #include "savefile.h" /** * Wrapper for saving files. * At this moment it only saves PAR-Files * * @param filename */ void FileSave(char *filename) { char *tmp; FILE *outfp; int i,j; typValueList *pnt[PARAMETERS]; typValueList *p_pnt[PARAMETERS]; GList *vl[PARAMETERS]; int y; if(!FileIsDefined()) { // no file opened ?? // no file created? // houston we have a ... printf("filedatapointer is NULL! why?\n"); } if(strlen(filename)>1) { tmp=g_malloc (sizeof (char)*(strlen(filename))); strcpy(tmp,filename); } else { tmp=g_malloc (sizeof (char)*(strlen(FileGetFilename()))); strcpy(tmp,FileGetFilename()); } FileSetFilename(tmp); outfp = fopen(tmp,"w"); if(outfp==NULL) { DialogErrorOK (_("Can't open output parameter file.")); free(tmp); return; } /* write "header" */ fprintf(outfp,"/* Produced by imskpe */\n"); fprintf(outfp,"/* DU : %d */\n",FileGetDuration()); fprintf(outfp,"/* UI : %d */\n",FileGetUpdateInterval()); fprintf(outfp,"/* SR : %d */\n",FileGetSamplingRate()); fprintf(outfp,"/* NF : %d */\n",FileGetNumberFormants()); fprintf(outfp,"/* SS : %d */\n",FileGetVoiceSource()); fprintf(outfp,"/* CP : %d */\n",FileGetBranches()); /* write values */ for(j=0;j<PARAMETERS;j++) { vl[j]=(GList *) g_list_first (CurveSearchByNr(FileGetCurvesPointer(),j)->points); p_pnt[j]=(typValueList *)vl[j]->data; pnt[j]=(typValueList *)vl[j]->data; } for(i=0;i<FileGetDuration();i+=FileGetUpdateInterval()) { fprintf(outfp,"%5d: ",i); for(j=0;j<PARAMETERS;j++) { if(pnt[j]->time<i) { p_pnt[j]=pnt[j]; if(vl[j]->next != NULL) { vl[j]=vl[j]->next; pnt[j]=(typValueList *)vl[j]->data; } } if((pnt[j]->time-p_pnt[j]->time)==0) { /* to prevent from div by 0 */ y=pnt[j]->value; } else { y=p_pnt[j]->value + (int)((float)(pnt[j]->value-p_pnt[j]->value)/(float)(pnt[j]->time-p_pnt[j]->time)*(float)(i-p_pnt[j]->time)); } fprintf(outfp,"%d ",y); } fprintf(outfp,"\n"); } fclose(outfp); }
/* * Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> * * 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 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 _SID_H_ #define _SID_H_ #include <qstring.h> class SID { public: SID(); SID( const QString &sid ); SID( const SID &sid ); ~SID(); bool operator== ( const SID &sid ) const; bool operator!= ( const SID &sid ) const; bool isEmpty() const; void setSID( const QString &sid ); void setRID( const QString &rid ); void setRID( uint rid ); void setDOM( const QString &dom ); const QString &getSID() const; uint getRID() const ; const QString &getDOM() const; static uint uid2rid( uint uid ); static uint gid2rid( uint gid ); static void setAlgRidBase( uint base ) { mAlgRidBase = base; }; static uint getAlgRidBase() { return mAlgRidBase; }; private: void updateSID(); QString mSid, mDom; uint mRid; static uint mAlgRidBase; }; #endif //_SID_H_
/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Michael Wirth * Co-authors: * ... * */ #ifndef _NewNewHumanController_H__ #define _NewNewHumanController_H__ #include "OrxonoxPrereqs.h" #include "util/Math.h" #include "core/ClassTreeMask.h" #include "HumanController.h" namespace orxonox { class _OrxonoxExport NewHumanController : public HumanController { public: NewHumanController(Context* context); virtual ~NewHumanController(); virtual void tick(float dt); virtual void frontback(const Vector2& value); virtual void yaw(const Vector2& value); virtual void pitch(const Vector2& value); static void accelerate(); static void decelerate(); virtual void doFire(unsigned int firemode); virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage); static void unfire(); virtual void doUnfire(); void centerCursor(); static void changeMode(); virtual void changedControllableEntity(); virtual void doPauseControl(); virtual void doResumeControl(); float getCurrentYaw(){ return this->currentYaw_; } float getCurrentPitch(){ return this->currentPitch_; } protected: void updateTarget(); void alignArrows(); void showOverlays(); void hideOverlays(); void hideArrows(); unsigned int controlMode_; static NewHumanController* localController_s; private: float currentYaw_; float currentPitch_; OrxonoxOverlay* crossHairOverlay_; OrxonoxOverlay* centerOverlay_; OrxonoxOverlay* damageOverlayTop_; OrxonoxOverlay* damageOverlayRight_; OrxonoxOverlay* damageOverlayBottom_; OrxonoxOverlay* damageOverlayLeft_; float damageOverlayTime_; float damageOverlayTT_; float damageOverlayTR_; float damageOverlayTB_; float damageOverlayTL_; OrxonoxOverlay* arrowsOverlay1_; OrxonoxOverlay* arrowsOverlay2_; OrxonoxOverlay* arrowsOverlay3_; OrxonoxOverlay* arrowsOverlay4_; float overlaySize_; float arrowsSize_; bool accelerating_; float acceleration_; int firemode_; bool showArrows_; bool showDamageOverlay_; bool showOverlays_; ClassTreeMask targetMask_; }; } #endif /* _NewHumanController_H__ */
/*---------------------------------------------------------------------------* *--- (c) Martin Vuagnoux, Cambridge University, UK. ---* *--- Aug.2004 ---* *---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------* * NAME : transmit.h * DESCRIPTION: define send/recv functions *---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------* * NAME: send_fuzz() * DESC: send a buffer using tcp/udp or file method: * tcp: just use send() * udp: use sendto with sockaddr initialized in udp_client/server_fuzz * file: use fwrite with stream opened in file_fuzz() * RETN: 0 if everything is OK, -1 if ERROR. *---------------------------------------------------------------------------*/ int send_fuzz(config *conf, struct struct_block *block); /*---------------------------------------------------------------------------* * NAME: recv_fuzz() * DESC: recv a buffer using tcp/udp or file method: * tcp: just use recv() * udp: use recvfrom with sockaddr initialized in udp_client/server_fuzz * file: ignored * RETN: number of bytes received *---------------------------------------------------------------------------*/ int recv_fuzz(config *conf, struct struct_block *block, unsigned char *buffer);
void emesh_post_recv(EMeshComm *c, EMeshUnpack *u) { UC(comm_post_recv(u->hbuf, c->pp)); } void emesh_post_send(EMeshPack *p, EMeshComm *c) { UC(comm_buffer_set(p->nbags, p->hbags, p->hbuf)); UC(comm_post_send(p->hbuf, c->pp)); } void emesh_wait_recv(EMeshComm *c, EMeshUnpack *u) { UC(comm_wait_recv(c->pp, u->hbuf)); UC(comm_buffer_get(u->hbuf, u->nbags, u->hbags)); } void emesh_wait_send(EMeshComm *c) { UC(comm_wait_send(c->pp)); } /* momentum */ void emesh_post_recv(EMeshCommM *c, EMeshUnpackM *u) { UC(comm_post_recv(u->hbuf, c->comm)); } void emesh_post_send(EMeshPackM *p, EMeshCommM *c) { UC(comm_buffer_set(p->nbags, p->hbags, p->hbuf)); UC(comm_post_send(p->hbuf, c->comm)); } void emesh_wait_recv(EMeshCommM *c, EMeshUnpackM *u) { UC(comm_wait_recv(c->comm, u->hbuf)); UC(comm_buffer_get(u->hbuf, u->nbags, u->hbags)); } void emesh_wait_send(EMeshCommM *c) { UC(comm_wait_send(c->comm)); }
///////////////////////////////////////////////////////////// // EXAMPLE PROGRAM #1 // 02.2008 aralbrec // // Ten software-rotated masked sprites move in straight lines // at various speeds, bouncing off screen edges. All ten // share the same sprite graphic which is not animated in // this first test program. ///////////////////////////////////////////////////////////// // zcc +ts2068 -vn ex1.c -o ex1.bin -create-app -lsp1 -lmalloc #include <sprites/sp1.h> #include <malloc.h> #include <ts2068.h> #include <string.h> #pragma output STACKPTR=47104 // place stack at $b800 at startup long heap; // malloc's heap pointer // Memory Allocation Policy // the sp1 library will call these functions // to allocate and deallocate dynamic memory void *u_malloc(uint size) { return malloc(size); } void u_free(void *addr) { free(addr); } // Clipping Rectangle for Sprites struct sp1_Rect cr = {0, 0, 64, 24}; // rectangle covering the full screen // Table Holding Movement Data for Each Sprite struct sprentry { struct sp1_ss *s; // sprite handle returned by sp1_CreateSpr() char dx; // signed horizontal speed in pixels char dy; // signed vertical speed in pixels }; struct sprentry sprtbl[] = { // doubled the dx speed compared to spectrum {0,2,0}, {0,0,1}, {0,2,2}, {0,4,1}, {0,2,3}, // because we're traversing double the horizontal res {0,6,1}, {0,4,3}, {0,6,2}, {0,2,1}, {0,4,2} }; // A Hashed UDG for Background uchar hash[] = {0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa}; // Attach C Variable to Sprite Graphics Declared in ASM at End of File extern uchar gr_window[]; // gr_window will hold the address of the asm label _gr_window main() { uchar i; struct sp1_ss *s; struct sprentry *se; void *temp; #asm di #endasm // Initialize MALLOC.LIB heap = 0L; // heap is empty sbrk(40000, 5000); // add 40000-44999 to malloc // Set 512x192 Video Mode memset(16384, 0, 6144); // clear both halves of the display file before switching video mode memset(24576, 0, 6144); ts_vmod(PAPER_BLACK | VMOD_HIRES); // select 64-col mode with black background // Initialize SP1.LIB sp1_Initialize(SP1_IFLAG_MAKE_ROTTBL | SP1_IFLAG_OVERWRITE_TILES | SP1_IFLAG_OVERWRITE_DFILE, ' '); sp1_TileEntry(' ', hash); // redefine graphic associated with space character sp1_Invalidate(&cr); // invalidate entire screen so that it is all initially drawn sp1_UpdateNow(); // draw screen area managed by sp1 now // Create Ten Masked Software-Rotated Sprites for (i=0; i!=10; i++) { s = sprtbl[i].s = sp1_CreateSpr(SP1_DRAW_MASK2LB, SP1_TYPE_2BYTE, 3, 0, i); sp1_AddColSpr(s, SP1_DRAW_MASK2, 0, 48, i); sp1_AddColSpr(s, SP1_DRAW_MASK2RB, 0, 0, i); sp1_MoveSprAbs(s, &cr, gr_window, 10, 14, 0, 4); }; while (1) { // main loop sp1_UpdateNow(); // draw screen now for (i=0; i!=10; i++) { // move all sprites se = &sprtbl[i]; sp1_MoveSprRel(se->s, &cr, 0, 0, 0, se->dy, se->dx); if (se->s->row > 21) // if sprite went off screen, reverse direction se->dy = - se->dy; if (se->s->col > 61) // notice if coord moves less than 0, it becomes se->dx = - se->dx; // 255 which is also caught by these cases } } // end main loop } #asm defb @11111111, @00000000 defb @11111111, @00000000 defb @11111111, @00000000 defb @11111111, @00000000 defb @11111111, @00000000 defb @11111111, @00000000 defb @11111111, @00000000 ; ASM source file created by SevenuP v1.20 ; SevenuP (C) Copyright 2002-2006 by Jaime Tejedor Gomez, aka Metalbrain ;GRAPHIC DATA: ;Pixel Size: ( 16, 24) ;Char Size: ( 2, 3) ;Sort Priorities: Mask, Char line, Y char, X char ;Data Outputted: Gfx ;Interleave: Sprite ;Mask: Yes, before graphic ._gr_window DEFB 128,127, 0,192, 0,191, 30,161 DEFB 30,161, 30,161, 30,161, 0,191 DEFB 0,191, 30,161, 30,161, 30,161 DEFB 30,161, 0,191, 0,192,128,127 DEFB 255, 0,255, 0,255, 0,255, 0 DEFB 255, 0,255, 0,255, 0,255, 0 DEFB 1,254, 0, 3, 0,253,120,133 DEFB 120,133,120,133,120,133, 0,253 DEFB 0,253,120,133,120,133,120,133 DEFB 120,133, 0,253, 0, 3, 1,254 DEFB 255, 0,255, 0,255, 0,255, 0 DEFB 255, 0,255, 0,255, 0,255, 0 #endasm
#ifndef __TEXT_FILE_H__ #define __TEXT_FILE_H__ /*LICENSE_START*/ /* * Copyright (C) 2014 Washington University School of Medicine * * 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. */ /*LICENSE_END*/ #include <AString.h> #include "DataFile.h" namespace caret { /** * A simple text file. */ class TextFile : public DataFile { public: TextFile(); virtual ~TextFile(); private: TextFile(const TextFile&); TextFile& operator=(const TextFile&); public: virtual void clear(); virtual bool isEmpty() const; virtual void readFile(const AString& filename); virtual void writeFile(const AString& filename); virtual AString toString() const; AString getText() const; std::vector<AString> getTextLines() const; void replaceText(const AString& text); void addText(const AString& text); void addLine(const AString& text); private: AString text; }; } // namespace #endif // __TEXT_FILE_H__
// // DotParser.h // Project // // Created by ycc on 13-9-9. // // #ifndef __Project__DotParser__ #define __Project__DotParser__ #include <iostream> #include <map> #include <string> #include <vector> #include <iostream> #include <graphviz/cgraph.h> using namespace std; class DotNode; class DotEdge { private: Agedge_t *e; public: //Add Other attribute here, such as weight, label. DotEdge(Agedge_t *_e); DotNode GetHead(); DotNode GetTail(); }; class DotNode { public: Agnode_t *n; string label; DotNode(Agnode_t *_n); bool operator<(const DotNode &x) const; //used for map }; class DotGraph { private: Agraph_t *g; map<DotNode, vector<DotEdge>*> OutputEdge; map<DotNode, vector<DotEdge>*> InputEdge; vector<DotEdge>& GetEdgeVec(DotNode n, bool IsIn); public: vector<DotNode> Node; DotGraph(Agraph_t *_g); DotGraph(string DotFile); vector<DotEdge>& GetInEdgeVec(DotNode node); //get all input edge for node vector<DotEdge>& GetOutEdgeVec(DotNode node); //get all output edge for node }; #endif /* defined(__Project__DotParser__) */
#ifndef DIV_H_ #define DIV_H_ #include "DoubleOperandQuadruple.h" namespace codegen { class Div: public DoubleOperandQuadruple { public: Div(std::string leftOperand, std::string rightOperand, std::string result); virtual ~Div() = default; void generateCode(AssemblyGenerator& generator) const override; private: void print(std::ostream& stream) const override; }; } // namespace codegen #endif // DIV_H_
/* Solution by Colin Barker (colin.barker@wanadoo.fr) * using the driver from the solution by Paul Griffiths. */ /* EX3_1.C ======= Suggested solution to Exercise 3-1 */ #include <stdio.h> #include <time.h> int binsearch(int x, int v[], int n); /* Original K&R function */ int binsearch2(int x, int v[], int n); /* Our new function */ #define MAX_ELEMENT 20000 /* Outputs approximation of processor time required for our two binary search functions. We search for the element -1, to time the functions' worst case performance (i.e. element not found in test data) */ int main(void) { int testdata[MAX_ELEMENT]; int index; /* Index of found element in test data */ int n = -1; /* Element to search for */ int i; clock_t time_taken; /* Initialize test data */ for ( i = 0; i < MAX_ELEMENT; ++i ) testdata[i] = i; /* Output approximation of time taken for 100,000 iterations of binsearch() */ for ( i = 0, time_taken = clock(); i < 100000; ++i ) { index = binsearch(n, testdata, MAX_ELEMENT); } time_taken = clock() - time_taken; if ( index < 0 ) printf("Element %d not found.\n", n); else printf("Element %d found at index %d.\n", n, index); printf("binsearch() took %lu clocks (%lu seconds)\n", (unsigned long) time_taken, (unsigned long) time_taken / CLOCKS_PER_SEC); /* Output approximation of time taken for 100,000 iterations of binsearch2() */ for ( i = 0, time_taken = clock(); i < 100000; ++i ) { index = binsearch2(n, testdata, MAX_ELEMENT); } time_taken = clock() - time_taken; if ( index < 0 ) printf("Element %d not found.\n", n); else printf("Element %d found at index %d.\n", n, index); printf("binsearch2() took %lu clocks (%lu seconds)\n", (unsigned long) time_taken, (unsigned long) time_taken / CLOCKS_PER_SEC); return 0; } /* Performs a binary search for element x in array v[], which has n elements */ int binsearch(int x, int v[], int n) { int low, mid, high; low = 0; high = n - 1; while ( low <= high ) { mid = (low+high) / 2; if ( x < v[mid] ) high = mid - 1; else if ( x > v[mid] ) low = mid + 1; else return mid; } return -1; } int binsearch2(int x, int v[], int n) { int low, high, mid; low = -1; high = n; while (low + 1 < high) { mid = (low + high) / 2; if (v[mid] < x) low = mid; else high = mid; } if (high == n || v[high] != x) return -1; else return high; }
/* ********************************************************************************************************* * LINUX-KERNEL * newbie Linux Platform Develop Kits * Kernel Module * * (c) Copyright 2006-2011, kevin.z China * All Rights Reserved * * File : standby_ir.h * By : kevin.z * Version : v1.0 * Date : 2011-5-31 15:15 * Descript: * Update : date auther ver notes ********************************************************************************************************* */ #ifndef __STANDBY_IR_H__ #define __STANDBY_IR_H__ #include "standby_cfg.h" #define IR_RXINT_ROI_EN (1<<0) //FIFO overrun #define IR_RXINT_RPEI_EN (1<<1) //receiver packet end interrupt #define IR_RXINT_RAI_EN (1<<4) //RX fifo available interrupt #define IR_RXINT_DRQ_EN (1<<5) //DRQ enable #define IR_RXINT_ALL_MASK (IR_RXINT_ROI_EN | IR_RXINT_RPEI_EN | IR_RXINT_RAI_EN | (IR_RXINT_DRQ_EN)) #define IR_RXINT_RAL_MASK (0x3f<<8) #define IR_RXSTA_RPE_MASK (1<<1) //packet end flag #define IR_RXSTA_ALL_MASK (0x1f) #define IR_RXSTA_RAC_MASK (0x7f<<8) /* rxFIFO Available Counter.0:no data,64:64 byte in rxFIFO */ #define IR_REG_RXFIFO (SW_VA_IR0_IO_BASE + 0x20) //define ir controller registers typedef struct __STANDBY_IR_REG { volatile __u32 CIR_Ctl; volatile __u32 CIR_Reserve0[3]; volatile __u32 CIR_RxCtl; volatile __u32 CIR_Reserve1[3]; volatile __u32 CIR_RxFifo; volatile __u32 CIR_Reserve2[2]; volatile __u32 CIR_RxInt; volatile __u32 CIR_RxSta; volatile __u32 CIR_Config; } __standby_ir_reg_t; struct standby_ir_buffer { unsigned long dcnt; /*Packet Count*/ unsigned char buf[STANDBY_IR_BUF_SIZE]; }; extern __s32 standby_ir_init(void); extern __s32 standby_ir_exit(void); extern __s32 standby_ir_detect(void); extern __s32 standby_ir_verify(void); #endif /*__STANDBY_IR_H__*/
/**************************************************************** * * * Copyright 2001, 2004 Sanchez Computer Associates, Inc. * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "gtm_socket.h" #include <sys/un.h> #include <string.h> #include <errno.h> #include "gdsroot.h" #include "gtm_facility.h" #include "fileinfo.h" #include "gdsbt.h" #include "gdsfhead.h" #include "filestruct.h" #include "mutex.h" #include "eintr_wrappers.h" #ifndef MUTEX_MSEM_WAKE GBLREF int mutex_sock_fd; GBLREF struct sockaddr_un mutex_wake_this_proc; GBLREF int mutex_wake_this_proc_len; GBLREF int mutex_wake_this_proc_prefix_len; GBLREF uint4 process_id; void mutex_wake_proc(sm_int_ptr_t pid, int mutex_wake_instance) { /* * Wakeup process by sending a message over waiting process's socket. * The waiting process (in select) is woken up on sensing input on its * socket. The message is not relevant, a character will achieve the * objective. But, we will send the waking process's pid which might * be of use for debugging. */ unsigned char mutex_wake_this_proc_str[2 * sizeof(pid_t) + 1]; mutex_wake_msg_t msg; int sendto_res; /* Set up the socket structure for sending */ strcpy(mutex_wake_this_proc.sun_path + mutex_wake_this_proc_prefix_len, (char *)pid2ascx(mutex_wake_this_proc_str, *pid)); msg.pid = process_id; msg.mutex_wake_instance = mutex_wake_instance; SENDTO_SOCK(mutex_sock_fd, (char *)&msg, sizeof(msg), 0, (struct sockaddr *)&mutex_wake_this_proc, mutex_wake_this_proc_len, sendto_res); return; } #else void #ifdef POSIX_MSEM mutex_wake_proc(sem_t *mutex_wake_msem_ptr) #else mutex_wake_proc(msemaphore *mutex_wake_msem_ptr) #endif { /* Unlock the memsem to wake the proc waiting on it */ int rc; error_def(ERR_TEXT); /* * CAUTION : man pages on beowulf and hrothgar do not * mention anything about msem_unlock being interrupted. * It is being assumed here that msem_unlock, if interrupted * returns -1 and sets errno to EINTR. If the behavior is * undefined when interrupted, processes waiting to be woken * up may hang, and WE ARE TOAST!!! */ /* * Additonal note: this was converted to an EINTR wrapper macro. */ do { rc = MSEM_UNLOCK(mutex_wake_msem_ptr); } while (-1 == rc && EINTR == errno); if (0 > rc) rts_error(VARLSTCNT(5) ERR_TEXT, 2, RTS_ERROR_TEXT("Mutual Exclusion subsytem : Error with msem_unlock/sem_post"), errno); return; } #endif
#pragma once #include "widget.h" #include <string> #include <rfe/core/thread_queue.h> #include <future> namespace rfe { namespace ui { class window : public widget { void *m_handle = nullptr; public: thread_queue thread; window(bool make_thread = true); virtual ~window() = default; data_event<std::string, combined_data<std::string>> title{}; data_event<color4f> clear_color; data_event<f64> clear_depth; data_event<u8> clear_stencil; public: template<typename Type, typename = std::enable_if_t<std::is_base_of<graphics::draw_context, Type>::value>> void make_dc(graphics::draw_context::settings cfg = {}, bool create_thread = true) { std::shared_ptr<graphics::draw_context> dc = std::make_shared<Type>(this); if (create_thread) { dc->thread = make_thread_queue(make_thread); } dc->thread.invoke([=] { dc->create(cfg); }); set_dc(dc); } protected: void create(); event_result doclose() override; void remove_dc(); public: void focus() override; void* handle() const; using widget::operator+=; }; } }
#pragma once #include <features.h>
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS PairStyle(lj/cut/coul/dsf,PairLJCutCoulDSF) #else #ifndef LMP_PAIR_LJ_CUT_COUL_DSF_H #define LMP_PAIR_LJ_CUT_COUL_DSF_H #include "pair.h" namespace LAMMPS_NS { class PairLJCutCoulDSF : public Pair { public: PairLJCutCoulDSF(class LAMMPS *); ~PairLJCutCoulDSF(); void compute(int, int); void settings(int, char **); void coeff(int, char **); void init_style(); double init_one(int, int); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); double single(int, int, int, int, double, double, double, double &); void *extract(const char *, int &); protected: double cut_lj_global; double **cut_lj,**cut_ljsq; double **epsilon,**sigma; double **lj1,**lj2,**lj3,**lj4,**offset; double cut_coul,cut_coulsq; double alpha; double f_shift,e_shift; void allocate(); }; } #endif #endif /* ERROR/WARNING messages: E: Illegal ... command UNDOCUMENTED E: Incorrect args for pair coefficients UNDOCUMENTED E: Pair style lj/cut/coul/dsf requires atom attribute q UNDOCUMENTED */
/* * Copyright (C) 2008-2009 Martin Willi * Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ #include "eap_aka_3gpp2_plugin.h" #include "eap_aka_3gpp2_card.h" #include "eap_aka_3gpp2_provider.h" #include "eap_aka_3gpp2_functions.h" #include <daemon.h> typedef struct private_eap_aka_3gpp2_t private_eap_aka_3gpp2_t; /** * Private data of an eap_aka_3gpp2_t object. */ struct private_eap_aka_3gpp2_t { /** * Public eap_aka_3gpp2_plugin_t interface. */ eap_aka_3gpp2_plugin_t public; /** * SIM card */ eap_aka_3gpp2_card_t *card; /** * SIM provider */ eap_aka_3gpp2_provider_t *provider; /** * AKA functions */ eap_aka_3gpp2_functions_t *functions; }; /** * Implementation of eap_aka_3gpp2_t.destroy. */ static void destroy(private_eap_aka_3gpp2_t *this) { charon->sim->remove_card(charon->sim, &this->card->card); charon->sim->remove_provider(charon->sim, &this->provider->provider); this->card->destroy(this->card); this->provider->destroy(this->provider); this->functions->destroy(this->functions); free(this); } /** * See header */ plugin_t *eap_aka_3gpp2_plugin_create() { private_eap_aka_3gpp2_t *this = malloc_thing(private_eap_aka_3gpp2_t); this->public.plugin.destroy = (void(*)(plugin_t*))destroy; this->functions = eap_aka_3gpp2_functions_create(); if (!this->functions) { free(this); return NULL; } this->card = eap_aka_3gpp2_card_create(this->functions); this->provider = eap_aka_3gpp2_provider_create(this->functions); charon->sim->add_card(charon->sim, &this->card->card); charon->sim->add_provider(charon->sim, &this->provider->provider); return &this->public.plugin; }
/* belle-sip - SIP (RFC3261) library. Copyright (C) 2010-2018 Belledonne Communications SARL 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 belle_sip_resolver_h #define belle_sip_resolver_h typedef struct belle_sip_dns_srv belle_sip_dns_srv_t; #define BELLE_SIP_DNS_SRV(obj) BELLE_SIP_CAST(obj,belle_sip_dns_srv_t) typedef struct belle_sip_resolver_context belle_sip_resolver_context_t; #define BELLE_SIP_RESOLVER_CONTEXT(obj) BELLE_SIP_CAST(obj,belle_sip_resolver_context_t) /** * Callback prototype for asynchronous DNS SRV resolution. * The srv_list contains struct dns_srv elements that must be taken and (possibly later) freed by the callee, using belle_sip_free(). */ typedef void (*belle_sip_resolver_srv_callback_t)(void *data, const char *name, belle_sip_list_t *srv_list, uint32_t ttl); /** * Callback prototype for asynchronous DNS A and AAAA resolution. * The ai_list contains addrinfo elements that must be taken and (possibly later) freed by the callee, using freeaddrinfo(). * These elements are linked by their ai_next field. **/ typedef void (*belle_sip_resolver_callback_t)(void *data, const char *name, struct addrinfo *ai_list, uint32_t ttl); BELLE_SIP_BEGIN_DECLS BELLESIP_EXPORT const char *belle_sip_dns_srv_get_target(const belle_sip_dns_srv_t *obj); BELLESIP_EXPORT unsigned short belle_sip_dns_srv_get_priority(const belle_sip_dns_srv_t *obj); BELLESIP_EXPORT unsigned short belle_sip_dns_srv_get_weight(const belle_sip_dns_srv_t *obj); BELLESIP_EXPORT unsigned short belle_sip_dns_srv_get_port(const belle_sip_dns_srv_t *obj); /** * Asynchronously performs DNS SRV followed A/AAAA query. Automatically fallbacks to A/AAAA if SRV isn't found. * @param stack the belle_sip_stack_t, used to schedule asynchronous execution. * @param service the queried service ("sip", "stun", "turn"...) * @param transport the queried transport ("udp", "tcp", "tls") * @param name the SIP domain name * @param port a port that will be filled in the addrinfo list returned by the callback, for the case where no SRV records are found. * @param family address family expected in the addrinfo result list. AF_INET or AF_INET6. If AF_INET6 is used but no IPv6 records are found, the IPv4 addresses * will be returned as IPv6 with v4 mapping (AI_V4MAPPED). * @param cb a callback function that will be called to notify the results. * @param data a user pointer passed through the callback as first argument. * @return a #belle_sip_resolver_context_t that can be used to cancel the resolution if needed. The context must have been ref'd with belle_sip_object_ref(). **/ BELLESIP_EXPORT belle_sip_resolver_context_t * belle_sip_stack_resolve(belle_sip_stack_t *stack, const char *service, const char *transport, const char *name, int port, int family, belle_sip_resolver_callback_t cb, void *data); /** * Asynchronously performs DNS A or AAAA query. * @param stack the belle_sip_stack_t, used to schedule asynchronous execution. * @param name the SIP domain name * @param port a port that will be filled in the addrinfo list returned by the callback, for the case where no SRV records are found. * @param family address family expected in the addrinfo result list. AF_INET or AF_INET6. If AF_INET6 is used but no IPv4 records are found, the IPv4 addresses * will be returned as IPv6 with v4 mapping (AI_V4MAPPED). * @param cb a callback function that will be called to notify the results. * @param data a user pointer passed through the callback as first argument. * @return a #belle_sip_resolver_context_t that can be used to cancel the resolution if needed. The context must have been ref'd with belle_sip_object_ref(). **/ BELLESIP_EXPORT belle_sip_resolver_context_t * belle_sip_stack_resolve_a(belle_sip_stack_t *stack, const char *name, int port, int family, belle_sip_resolver_callback_t cb, void *data); /** * Asynchronously performs DNS SRV query. * @return a #belle_sip_resolver_context_t that can be used to cancel the resolution if needed. The context must have been ref'd with belle_sip_object_ref(). **/ BELLESIP_EXPORT belle_sip_resolver_context_t * belle_sip_stack_resolve_srv(belle_sip_stack_t *stack, const char *service, const char *transport, const char *name, belle_sip_resolver_srv_callback_t cb, void *data); /** * Cancel a pending asynchronous DNS query. The context is unref'd automatically, as a result the context shall no longer be used after this call. * If the query is already performed, cancellation has no effect, but context is unref'd anyway. **/ BELLESIP_EXPORT void belle_sip_resolver_context_cancel(belle_sip_resolver_context_t *ctx); /** * Lookups the source address from local interface that can be used to connect to a destination address. * local_port is only used to be assigned into the result source address. * This function always puts something in src and srclen (the loopback address) even if anything fails. * The return code is 0 if successful, or -errno if an error was encoutered. Typical error is -ENETUNREACH when IPv6 network is not reachable. **/ BELLESIP_EXPORT int belle_sip_get_src_addr_for(const struct sockaddr *dest, socklen_t destlen, struct sockaddr *src, socklen_t *srclen, int local_port); BELLE_SIP_END_DECLS #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) 2011. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ #ifndef _LIBMTK_CIPHER_EXPORT_H #define _LIBMTK_CIPHER_EXPORT_H #define HEVC_BLK_LEN (20480) // bytes #define HEVC_MOD "HEVC_MOD" #define HEVC_NANO 1000000000ULL #define HEVC_CIPHER_LEN (102400) // bytes typedef struct { unsigned char buf[HEVC_BLK_LEN]; unsigned int len; } HEVC_BLK; typedef enum { VIDEO_ENCRYPT_CODEC_NONE = 0x0, VIDEO_ENCRYPT_CODEC_HEVC_ENC = 0x1, VIDEO_ENCRYPT_CODEC_HEVC_DEC = 0x2, VIDEO_ENCRYPT_CODEC_MAX = 0xffffffff } VIDEO_ENCRYPT_CODEC_T; typedef int (*hevc_api_funp)(HEVC_BLK *p_hevc_blk); typedef int (*hevc_api_initk_funp)(unsigned char *key, unsigned int klen); #define SEC_OK 0x0 #define SEC_FAIL 0x1 /* HEVC shared lib*/ #define ERR_HEVC_NOT_CORRECT_MODE 0x10000 #define ERR_HEVC_DATA_NOT_ALIGNED 0x10001 #define ERR_HEVC_ENC_IOCTL_FAIL 0x10002 #define ERR_HEVC_DEC_IOCTL_FAIL 0x10002 #define ERR_HEVC_CIPHER_UT_FAIL 0x10003 #define ERR_HEVC_DATA_IS_NULL 0x10004 #define ERR_HEVC_DATA_LENGTH_NOT_VALID 0x10005 #define ERR_HEVC_SW_ENC_ERROR 0x10006 #define ERR_HEVC_SW_DEC_ERROR 0x10007 #define ERR_HEVC_INIT_SW_KEY_ERROR 0x10008 /* HEVC sample*/ #define ERR_HEVC_CIPHER_LIB_NOT_FOUND 0x20001 #define ERR_HEVC_SW_DEC_BLOCK_SYM_NOT_FOUND 0x20002 #define ERR_HEVC_HW_ENC_BLOCK_SYM_NOT_FOUND 0x20003 #define ERR_HEVC_INIT_SW_KEY_SYM_NOT_FOUND 0x20004 #define ERR_HEVC_INPUT_FILE_NOT_FOUND 0x20005 #define ERR_HEVC_OUTPUT_FILE_NOT_FOUND 0x20006 #define ERR_HEVC_SW_DEC_FILE_SYM_NOT_FOUND 0x20007 #define ERR_HEVC_SW_DEC_FILE_FAILED 0x20008 #define ERR_HEVC_UNKNOWN 0x2FFFF /* Define LOG LEVEL*/ #define SEC_LOG_TRACE 0 //For source code trace #define SEC_LOG_DEBUG 0 //For debug purpose #define SEC_LOG_ERROR 1 //For critical error dump #define SEC_LOG_INFO 1 //For information to know when processing in normal /* DEBUG MACRO */ #define SMSG_TRACE(...) \ do { if (SEC_LOG_TRACE) printf(__VA_ARGS__); } while (0) #define SMSG_DEBUG(...) \ do { if (SEC_LOG_DEBUG) printf(__VA_ARGS__); } while (0) #define SMSG_ERROR(...) \ do { if (SEC_LOG_ERROR) printf(__VA_ARGS__); } while (0) #define SMSG_INFO(...) \ do { if (SEC_LOG_INFO) printf(__VA_ARGS__); } while (0) #define HEVC_ENCRYTP_FILE_PATH "/data/mediaserver" #define HEVC_ENC_SW_ENCRYPT_FILE_PATH "/system/lib/libhevce_sb.ca7.android.so" #define HEVC_ENC_HW_ENCRYPT_FILE_PATH "/data/mediaserver/sb.ca7.android_hwenc.so" #define HEVC_ENC_HW_DECRYPT_FILE_PATH "/data/mediaserver/sb.ca7.android_hwdec.so" #define HEVC_DEC_SW_ENCRYTP_FILE_PATH "/system/lib/libHEVCdec_sa.ca7.android.so" #define HEVC_DEC_HW_ENCRYPT_FILE_PATH "/data/mediaserver/dec_sa.ca7.android_hwenc.so" #define HEVC_DEC_HW_DECRYPT_FILE_PATH "/data/mediaserver/dec_sa.ca7.android_hwdec.so" #endif /*_LIBMTK_CIPHER_EXPORT_H*/
/***************************************************************************/ /* ____Demonstrates passing a stream to another process____ */ /* Process 0 initializes a random number stream and prints a few random */ /* numbers. It then passes this stream to process 1, which recieves it */ /* and prints a few random numbers from this stream. */ /***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <mpi.h> /* MPI header file */ #define SIMPLE_SPRNG /* simple interface */ #include "sprng.h" /* SPRNG header file */ #define SEED 985456376 main(int argc, char *argv[]) { double rn; int i, myid, len, nprocs; MPI_Status status; char *packed; /************************** MPI calls ************************************/ MPI_Init(&argc, &argv); /* Initialize MPI */ MPI_Comm_rank(MPI_COMM_WORLD, &myid); /* find process id */ MPI_Comm_size(MPI_COMM_WORLD, &nprocs); /* find number of processes */ if(nprocs < 2) { fprintf(stderr,"ERROR: At least 2 processes required\n"); MPI_Finalize(); exit(1); } if (myid==0) /*********** process 0 sends stream to process 1 ***********/ { init_sprng(SEED,SPRNG_DEFAULT); /*initialize stream */ printf("Process %d: Print information about stream:\n",myid); print_sprng(); printf("Process %d: Print 2 random numbers in [0,1):\n", myid); for (i=0;i<2;i++) { rn = sprng(); /* generate double precision random number */ printf("Process %d: %f\n", myid, rn); } len = pack_sprng(&packed); /* pack stream into an array */ /* inform process 1 how many bytes process 0 will send. */ MPI_Send(&len, 1, MPI_INT, 1, 0, MPI_COMM_WORLD); MPI_Send(packed, len, MPI_BYTE, 1, 0, MPI_COMM_WORLD); /* send stream */ free(packed); /* free storage for array */ printf(" Process 0 sends stream to process 1\n"); } else if(myid == 1) /****** process 1 receives stream from process 0 *****/ { init_sprng(SEED,SPRNG_DEFAULT); /*initialize stream */ MPI_Recv(&len, 1, MPI_INT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status); /* receive buffer size required */ if ((packed = (char *) malloc(len)) == NULL) /* allocate array */ { fprintf(stderr,"ERROR: process %d: Cannot allocate memory\n", myid); MPI_Finalize(); exit(1); } MPI_Recv(packed, len, MPI_BYTE, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status); /* receive packed stream */ unpack_sprng(packed); /* unpack stream */ printf(" Process 1 has received the packed stream\n"); printf("Process %d: Print information about stream:\n",myid); print_sprng(); free(packed); /* free array of packed stream */ printf(" Process 1 prints 2 numbers from received stream:\n"); for (i=0;i<2;i++) { rn = sprng(); /* generate double precision random number */ printf("Process %d: %f\n", myid, rn); } } MPI_Finalize(); /* terminate MPI */ }
/* * Copyright (C) 2013 Alexander Krause <alexander.krause@ed-solutions.de> */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <errno.h> #include <limits.h> #include <time.h> #include "sdisp.h" #include "sdisp-private.h" void _sdisp_print_debug(sdisp_t *ctx, const char *txt) { if (ctx->debug) { if ((ctx == NULL) || (ctx->type_name==NULL)) { printf("[NULL] %s\n",txt); } else { printf("[%s] %s\n",ctx->type_name,txt); } } }
#include "rtdef.h" #include "uip-conf.h" #include "uip.h" #include "uip_netif.h" #include "uip_arp.h" #include "rtconfig.h" #include "uip_pbuf.h" void netif_set_default(struct netif *netif) { } unsigned char mymac[6]={0xcc,0xbb,0xaa,0x99,0x88,0x02}; unsigned char ReadButton(); void netif_set_addr(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw) { uip_ipaddr_t hipaddr; unsigned char tmp=0; //read button to differ mac/ip,fix me tmp=0x80 & ReadButton(); if(tmp) tmp=1; uip_ipaddr(hipaddr, RT_LWIP_IPADDR0,RT_LWIP_IPADDR1,RT_LWIP_IPADDR2,(RT_LWIP_IPADDR3+tmp)); uip_sethostaddr(hipaddr); uip_ipaddr(hipaddr, RT_LWIP_GWADDR0,RT_LWIP_GWADDR1,RT_LWIP_GWADDR2,RT_LWIP_GWADDR3); uip_setdraddr(hipaddr); uip_ipaddr(hipaddr, RT_LWIP_MSKADDR0,RT_LWIP_MSKADDR1,RT_LWIP_MSKADDR2,RT_LWIP_MSKADDR3); uip_setnetmask(hipaddr); uip_ethaddr.addr[0] = mymac[0]; uip_ethaddr.addr[1] = mymac[1]; uip_ethaddr.addr[2] = mymac[2]; uip_ethaddr.addr[3] = mymac[3]; uip_ethaddr.addr[4] = mymac[4]; uip_ethaddr.addr[5] = mymac[5]; uip_setethaddr(uip_ethaddr); return ; } struct netif * netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw, void *state, err_t (* init)(struct netif *netif), err_t (* input)(struct pbuf *p, struct netif *netif)) { //if (netif_add(netif, IP_ADDR_ANY, IP_ADDR_BROADCAST, IP_ADDR_ANY, dev, //eth_init, eth_input) == RT_NULL) // netif->uip_hostaddr = ipaddr; //netif->uip_draddr = netmask; // netif->uip_netmask = gw; // netif_set_addr(netif,ipaddr,netmask,gw); // call user specified initialization function for netif if (init(netif) != 0) { return RT_NULL; } netif->input = input; netif->state = state; netif_set_addr(netif,ipaddr,netmask,gw); return netif; } err_t etharp_output(struct netif *netif, struct pbuf *q, struct ip_addr *ipaddr) { return 0; }
/* Simulator CPU header for m32r. THIS FILE IS MACHINE GENERATED WITH CGEN. Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU simulators. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef M32R_CPUALL_H #define M32R_CPUALL_H /* Include files for each cpu family. */ #ifdef WANT_CPU_M32RBF #include "eng.h" #include "cgen-engine.h" #include "cpu.h" #include "decode.h" #endif #ifdef WANT_CPU_M32RXF #include "engx.h" #include "cgen-engine.h" #include "cpux.h" #include "decodex.h" #endif extern const MACH m32r_mach; extern const MACH m32rx_mach; #ifndef WANT_CPU /* The ARGBUF struct. */ struct argbuf { /* These are the baseclass definitions. */ IADDR addr; const IDESC *idesc; char trace_p; char profile_p; /* ??? Temporary hack for skip insns. */ char skip_count; char unused; /* cpu specific data follows */ }; #endif #ifndef WANT_CPU /* A cached insn. ??? SCACHE used to contain more than just argbuf. We could delete the type entirely and always just use ARGBUF, but for future concerns and as a level of abstraction it is left in. */ struct scache { struct argbuf argbuf; }; #endif #endif /* M32R_CPUALL_H */
/*************************************************************************** qgsauthimportcertdialog.h --------------------- begin : April 30, 2015 copyright : (C) 2015 by Boundless Spatial, Inc. USA author : Larry Shaffer email : lshaffer at boundlessgeo dot com *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSAUTHIMPORTCERTDIALOG_H #define QGSAUTHIMPORTCERTDIALOG_H #include <QDialog> #include "ui_qgsauthimportcertdialog.h" #include <QSslCertificate> #include "qgis_gui.h" class QPushButton; /** \ingroup gui * Widget for importing a certificate into the authentication database */ class GUI_EXPORT QgsAuthImportCertDialog : public QDialog, private Ui::QgsAuthImportCertDialog { Q_OBJECT public: //! Type of filter to apply to dialog enum CertFilter { NoFilter = 1, CaFilter = 2, }; //! Type of inputs for certificates enum CertInput { AllInputs = 1, FileInput = 2, TextInput = 3, }; /** * Construct a dialog for importing certificates * @param parent Parent widget * @param filter Certificate type filter to apply to dialog * @param input Type of input(s) for certificates */ explicit QgsAuthImportCertDialog( QWidget *parent = nullptr, QgsAuthImportCertDialog::CertFilter filter = NoFilter, QgsAuthImportCertDialog::CertInput input = AllInputs ); //! Get list of certificate objects to import const QList<QSslCertificate> certificatesToImport(); //! Get the file path to a certificate to import const QString certFileToImport(); //! Get certificate text to import const QString certTextToImport(); //! Whether to allow importation of invalid certificates (so trust policy can be overridden) bool allowInvalidCerts(); //! Defined trust policy for imported certificates QgsAuthCertUtils::CertTrustPolicy certTrustPolicy(); private slots: void updateGui(); void validateCertificates(); void on_btnImportFile_clicked(); void on_chkAllowInvalid_toggled( bool checked ); private: QString getOpenFileName( const QString &title, const QString &extfilter ); QPushButton *okButton(); QList<QSslCertificate> mCerts; QgsAuthImportCertDialog::CertFilter mFilter; QgsAuthImportCertDialog::CertInput mInput; bool mDisabled; QVBoxLayout *mAuthNotifyLayout = nullptr; QLabel *mAuthNotify = nullptr; }; #endif // QGSAUTHIMPORTCERTDIALOG_H
/* adler32.c -- compute the Adler-32 checksum of a data stream * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id: adler32.c,v 1.2 2005/08/15 16:11:23 johnmc Exp $ */ #define ZLIB_INTERNAL #include "zlib.h" #define BASE 65521UL /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ #define DO1(buf,i) {s1 += buf[i]; s2 += s1;} #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); #define DO16(buf) DO8(buf,0); DO8(buf,8); #ifdef NO_DIVIDE # define MOD(a) \ do { \ if (a >= (BASE << 16)) a -= (BASE << 16); \ if (a >= (BASE << 15)) a -= (BASE << 15); \ if (a >= (BASE << 14)) a -= (BASE << 14); \ if (a >= (BASE << 13)) a -= (BASE << 13); \ if (a >= (BASE << 12)) a -= (BASE << 12); \ if (a >= (BASE << 11)) a -= (BASE << 11); \ if (a >= (BASE << 10)) a -= (BASE << 10); \ if (a >= (BASE << 9)) a -= (BASE << 9); \ if (a >= (BASE << 8)) a -= (BASE << 8); \ if (a >= (BASE << 7)) a -= (BASE << 7); \ if (a >= (BASE << 6)) a -= (BASE << 6); \ if (a >= (BASE << 5)) a -= (BASE << 5); \ if (a >= (BASE << 4)) a -= (BASE << 4); \ if (a >= (BASE << 3)) a -= (BASE << 3); \ if (a >= (BASE << 2)) a -= (BASE << 2); \ if (a >= (BASE << 1)) a -= (BASE << 1); \ if (a >= BASE) a -= BASE; \ } while (0) #else # define MOD(a) a %= BASE #endif /* ========================================================================= */ uLong ZEXPORT adler32(adler, buf, len) uLong adler; const Bytef *buf; uInt len; { unsigned long s1 = adler & 0xffff; unsigned long s2 = (adler >> 16) & 0xffff; int k; if (buf == Z_NULL) return 1L; while (len > 0) { k = len < NMAX ? (int)len : NMAX; len -= k; while (k >= 16) { DO16(buf); buf += 16; k -= 16; } if (k != 0) do { s1 += *buf++; s2 += s1; } while (--k); MOD(s1); MOD(s2); } return (s2 << 16) | s1; }
#ifndef TSP_TSP_H #define TSP_TSP_H #include <pthread.h> /* dernier minimum trouvé */ extern int minimum; /********************************************/ struct arg_struct { int hops; /* Nb de ville dans le chemin path */ int len; /* Longueur du chemin path */ tsp_path_t path; /* Chemin */ int pere; }; /*********************************************/ int present (int city, int hops, tsp_path_t path); void* tsp (void* arguments); /*********************************************/ typedef struct Cell{ pthread_t thread; int occupe; } Cell; /********************************************/ int getTID (void); #endif
/* USB support for the Cyberjack family of readers. * * Previous version were (C) 2004-2005 by Harald Welte <laforge@gnumonks.org> * This version is a rewrite (asynchronous USB is no longer needed). * * (C) 2007 Martin Preuss <martin@libchipcard.de> * * Distributed and licensed under the terms of GNU LGPL, Version 2.1 */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <inttypes.h> #include "ausb_l.h" #include "ausb_libusb0_l.h" #include "ausb_libusb1_l.h" #include <string.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <signal.h> #include <errno.h> #include <sys/ioctl.h> #include <time.h> #include <assert.h> #ifdef HAVE_HAL # include <hal/libhal.h> # include <dbus/dbus.h> #endif #define DEBUGP(ah, format, ...) {\ char dbg_buffer[256]; \ \ snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\ __FILE__":%5d: " format , __LINE__ , ##__VA_ARGS__); \ dbg_buffer[sizeof(dbg_buffer)-1]=0; \ ausb_log(ah, dbg_buffer, NULL, 0);\ } #define DEBUGL(ah, text, pData, ulDataLen) {\ char dbg_buffer[256]; \ \ snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\ __FILE__":%5d: %s", __LINE__ , text); \ dbg_buffer[sizeof(dbg_buffer)-1]=0; \ ausb_log(ah, dbg_buffer, pData, ulDataLen);\ } static AUSB_LOG_FN ausb_log_fn=NULL; void ausb_set_log_fn(AUSB_LOG_FN fn) { ausb_log_fn=fn; } void ausb_log(ausb_dev_handle *ah, const char *text, const void *pData, uint32_t ulDataLen) { if (ausb_log_fn) ausb_log_fn(ah, text, pData, ulDataLen); } int ausb_register_callback(ausb_dev_handle *ah, AUSB_CALLBACK callback, void *userdata){ DEBUGP(ah, "registering callback:%p\n", callback); ah->cb.handler=callback; ah->cb.userdata=userdata; return 0; } int ausb_claim_interface(ausb_dev_handle *ah, int interface){ DEBUGP(ah, "ausb_claim_interface\n"); if (ah->claimInterfaceFn) return ah->claimInterfaceFn(ah, interface); DEBUGP(ah, "callback for ausb_claim_interface not set\n"); return -1; } int ausb_release_interface(ausb_dev_handle *ah, int interface){ DEBUGP(ah, "ausb_release_interface\n"); if (ah->releaseInterfaceFn) return ah->releaseInterfaceFn(ah, interface); DEBUGP(ah, "callback for ausb_release_interface not set\n"); return -1; } int ausb_set_configuration(ausb_dev_handle *ah, int configuration){ DEBUGP(ah, "ausb_set_configuration\n"); if (ah->setConfigurationFn) return ah->setConfigurationFn(ah, configuration); DEBUGP(ah, "callback for ausb_set_configuration not set\n"); return -1; } ausb_dev_handle *ausb_open(rsct_usbdev_t *dev, int t) { ausb_dev_handle *ah=NULL; int rv; /*fprintf(stderr, "Opening device...\n");*/ ah=malloc(sizeof *ah); if (ah==0) { DEBUGP(ah, "memory full\n"); return 0; } memset(ah, 0, sizeof(*ah)); ah->pid=dev->productId; ah->device=*dev; switch(t) { case 1: #ifdef USE_USB1 rv=ausb11_extend(ah); #else rv=ausb1_extend(ah); #endif break; case 2: DEBUGP(ah, "This type is no longer supported.\n"); rv=-1; break; case 3: #ifdef USE_USB1 rv=ausb31_extend(ah); #else rv=ausb3_extend(ah); #endif break; default: DEBUGP(ah, "Invalid type %d\n", t); rv=-1; break; } if (rv) { DEBUGP(ah, "Could not extend as type %d (%d)\n", t, rv); free(ah); return 0; } return ah; } int ausb_close(ausb_dev_handle *ah) { DEBUGP(ah, "ausb_close\n"); if (ah->closeFn) ah->closeFn(ah); free(ah); return 0; } int ausb_start_interrupt(ausb_dev_handle *ah, int ep) { DEBUGP(ah, "ausb_start_interrupt\n"); if (ah->startInterruptFn) return ah->startInterruptFn(ah, ep); return 0; } int ausb_stop_interrupt(ausb_dev_handle *ah) { DEBUGP(ah, "ausb_stop_interrupt\n"); if (ah->stopInterruptFn) return ah->stopInterruptFn(ah); return 0; } int ausb_bulk_write(ausb_dev_handle *ah, int ep, char *bytes, int size, int timeout) { DEBUGL(ah, "Write:", bytes, size); if (ah->bulkWriteFn) return ah->bulkWriteFn(ah, ep, bytes, size, timeout); return -1; } int ausb_bulk_read(ausb_dev_handle *ah, int ep, char *bytes, int size, int timeout) { if (ah->bulkReadFn) { int rv; DEBUGP(ah, "Reading up to %d bytes", size); rv=ah->bulkReadFn(ah, ep, bytes, size, timeout); if (rv>=0) { DEBUGL(ah, "Read:", bytes, rv); } return rv; } return -1; } int ausb_reset(ausb_dev_handle *ah){ DEBUGP(ah, "ausb_reset\n"); if (ah->resetFn) return ah->resetFn(ah); else return -1; } int ausb_reset_endpoint(ausb_dev_handle *ah, unsigned int ep){ DEBUGP(ah, "ausb_reset_endpoint\n"); if (ah->resetEndpointFn) return ah->resetEndpointFn(ah, ep); else return -1; } int ausb_clear_halt(ausb_dev_handle *ah, unsigned int ep){ DEBUGP(ah, "ausb_clear_halt\n"); if (ah->clearHaltFn) return ah->clearHaltFn(ah, ep); else return -1; } int ausb_reset_pipe(ausb_dev_handle *ah, int ep){ DEBUGP(ah, "ausb_reset_pipe\n"); if (ah->resetPipeFn) return ah->resetPipeFn(ah, ep); else return -1; } int ausb_get_kernel_driver_name(ausb_dev_handle *ah, int interface, char *name, unsigned int namelen){ DEBUGP(ah, "ausb_get_kernel_driver_name\n"); if (ah->getKernelDriverNameFn) return ah->getKernelDriverNameFn(ah, interface, name, namelen); return -1; } int ausb_detach_kernel_driver(ausb_dev_handle *ah, int interface){ DEBUGP(ah, "ausb_detach_kernel_driver\n"); if (ah->detachKernelDriverFn) return ah->detachKernelDriverFn(ah, interface); return -1; } int ausb_reattach_kernel_driver(ausb_dev_handle *ah, int interface){ DEBUGP(ah, "ausb_reattach_kernel_driver\n"); if (ah->reattachKernelDriverFn) return ah->reattachKernelDriverFn(ah, interface); return -1; } int ausb_init(void) { #ifdef USE_USB1 return ausb_libusb1_init(); #else return ausb_libusb0_init(); #endif } int ausb_fini(void){ #ifdef USE_USB1 return ausb_libusb1_fini(); #else return ausb_libusb0_fini(); #endif }
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* Rosegarden A MIDI and audio sequencer and musical notation editor. Copyright 2000-2014 the Rosegarden development team. Other copyrights also apply to some parts of this work. Please see the AUTHORS file and individual file headers for details. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information. */ #ifndef RG_VELOCITYCOLOUR_H #define RG_VELOCITYCOLOUR_H #include <QColor> namespace Rosegarden { /** * Returns a QColour according to a formula. We provide three colours * to mix, a maximum value and three knees at which points the * intermediate colours max out. Play around to your satisfaction. */ class VelocityColour { public: VelocityColour(const QColor &loud, const QColor &medium, const QColor &quiet, int maximum, int loudKnee, int mediumKnee, int quietKnee); ~VelocityColour(); const QColor& getColour(int value); int getLoudKnee() const { return m_loudKnee; } int getMediumKnee() const { return m_mediumKnee; } int getQuietKnee() const { return m_quietKnee; } QColor getLoudColour() const { return m_loudColour; } QColor getMediumColour() const { return m_mediumColour; } QColor getQuietColour() const { return m_quietColour; } int getMaxValue() const { return m_maximum; } private: QColor m_loudColour; QColor m_mediumColour; QColor m_quietColour; int m_loudKnee; int m_mediumKnee; int m_quietKnee; int m_maximum; // the mixed colour that we can return QColor m_mixedColour; int m_loStartRed; int m_loStartGreen; int m_loStartBlue; int m_loStepRed; int m_loStepGreen; int m_loStepBlue; int m_hiStartRed; int m_hiStartGreen; int m_hiStartBlue; int m_hiStepRed; int m_hiStepGreen; int m_hiStepBlue; int m_multiplyFactor; }; } #endif
// // Orientation.h // viewer // // Created by Sam Anklesaria on 11/21/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> #import "EAGLView.h" @interface Orientation : UIViewController { EAGLView *glView; } @property (nonatomic, retain) IBOutlet EAGLView *glView; @end
#ifndef __CREATE_PARENT_H__ #define __CREATE_PARENT_H__ /* * KFontInst - KDE Font Installer * * Copyright 2003-2007 Craig Drummond <craig@kde.org> * * ---- * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include <QX11Info> #include <X11/Xlib.h> #include <fixx11h.h> // // *Very* hacky way to get some KDE dialogs to appear to be transient // for 'xid' // // Create's a QWidget with size 0/0 and no border, makes this transient // for xid, and all other widgets can use this as their parent... static QWidget * createParent(int xid) { if(!xid) return NULL; QWidget *parent=new QWidget(NULL, Qt::FramelessWindowHint); parent->resize(1, 1); parent->show(); XWindowAttributes attr; int rx, ry; Window junkwin; XSetTransientForHint(QX11Info::display(), parent->winId(), xid); if(XGetWindowAttributes(QX11Info::display(), xid, &attr)) { XTranslateCoordinates(QX11Info::display(), xid, attr.root, -attr.border_width, -16, &rx, &ry, &junkwin); rx=(rx+(attr.width/2)); if(rx<0) rx=0; ry=(ry+(attr.height/2)); if(ry<0) ry=0; parent->move(rx, ry); } parent->setWindowOpacity(0); return parent; } #endif
/* * This file is part of the coreboot project. * * Copyright (C) 2009 coresystems GmbH * Copyright (C) 2009 Libra Li <libra.li@technexion.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "registers.h" /* setup interrupt handlers for mainboard */ extern void mainboard_interrupt_handlers(int intXX, void *intXX_func);
/***************************************************************************** 1 Í·Îļþ°üº¬ *****************************************************************************/ #include "GmmInc.h" #include "GmmCasGlobal.h" #include "GmmCasTimer.h" #include "GmmCasSend.h" #include "GmmCasComm.h" #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /***************************************************************************** ЭÒéÕ»´òÓ¡´òµã·½Ê½ÏµÄ.CÎļþºê¶¨Òå *****************************************************************************/ /*lint -e767 ÐÞ¸ÄÈË:luojian 107747;¼ìÊÓÈË:sunshaohua65952;Ô­Òò:LOG·½°¸Éè¼ÆÐèÒª*/ #define THIS_FILE_ID PS_FILE_ID_GMM_CASTIMER_C /*lint +e767 ÐÞ¸ÄÈË:luojian 107747;¼ìÊÓÈË:sunshaohua*/ VOS_VOID GMM_TimReadyExpired(VOS_VOID) { VOS_UINT32 ulT3311Status; VOS_UINT32 ulT3302Status; if (GMM_DEREGISTERED_NORMAL_SERVICE == g_GmmGlobalCtrl.ucState) { gstGmmCasGlobalCtrl.GmmSrvState = GMM_IU_PMM_DETACHED; } else { gstGmmCasGlobalCtrl.GmmSrvState = GMM_AGB_GPRS_STANDBY; } /* WCDMAģʽ£¬ÓÉHSS 4100 V100R001´úÂë´¦Àí */ if (NAS_MML_NET_RAT_TYPE_WCDMA == NAS_MML_GetCurrNetRatType()) { /* ÔÚ×¢²á״̬,²¢ÇÒ·þÎñ״̬ÊÇ¿ÕÏÐ̬ʱ,Æô¶¯3312 */ if ((0x20 == (g_GmmGlobalCtrl.ucState & 0xF0)) && (GMM_FALSE == g_GmmGlobalCtrl.ucSigConFlg) && (GMM_TRUE != g_GmmRauCtrl.ucT3312ExpiredFlg )) { #if (FEATURE_LTE == FEATURE_ON) if (GMM_TIMER_T3312_FLG != (GMM_TIMER_T3312_FLG & g_GmmTimerMng.ulTimerRunMask)) { NAS_GMM_SndLmmTimerInfoNotify(GMM_TIMER_T3312, GMM_LMM_TIMER_START); } #endif Gmm_TimerStart(GMM_TIMER_T3312); } return; /* ²»Ðè´¦Àí·µ»Ø */ } if (GMM_DEREGISTERED_NORMAL_SERVICE == g_GmmGlobalCtrl.ucState) { gstGmmCasGlobalCtrl.GmmSrvState = GMM_IU_PMM_DETACHED; } else { ulT3311Status = NAS_GMM_QryTimerStatus(GMM_TIMER_T3311); ulT3302Status = NAS_GMM_QryTimerStatus(GMM_TIMER_T3302); if ((GMM_REGISTERED_ATTEMPTING_TO_UPDATE_MM == g_GmmGlobalCtrl.ucState) || (GMM_REGISTERED_ATTEMPTING_TO_UPDATE == g_GmmGlobalCtrl.ucState)) { if ((VOS_FALSE == ulT3311Status) && (VOS_FALSE == ulT3302Status)) { #if (FEATURE_LTE == FEATURE_ON) if (GMM_TIMER_T3312_FLG != (GMM_TIMER_T3312_FLG & g_GmmTimerMng.ulTimerRunMask)) { NAS_GMM_SndLmmTimerInfoNotify(GMM_TIMER_T3312, GMM_LMM_TIMER_START); } #endif Gmm_TimerStart(GMM_TIMER_T3312); } } else { if ((0x10 != (g_GmmGlobalCtrl.ucState & 0xF0)) && (GMM_REGISTERED_INITIATED != g_GmmGlobalCtrl.ucState)) { #if (FEATURE_LTE == FEATURE_ON) if (GMM_TIMER_T3312_FLG != (GMM_TIMER_T3312_FLG & g_GmmTimerMng.ulTimerRunMask)) { NAS_GMM_SndLmmTimerInfoNotify(GMM_TIMER_T3312, GMM_LMM_TIMER_START); } #endif Gmm_TimerStart(GMM_TIMER_T3312); } } gstGmmCasGlobalCtrl.GmmSrvState = GMM_AGB_GPRS_STANDBY; } NAS_GMM_SndGasInfoChangeReq(NAS_GSM_MASK_GSM_GMM_STATE); return; } VOS_VOID GMM_TimRauRspExpired(VOS_VOID) { gstGmmCasGlobalCtrl.ucRabmRauRspRcvdFlg = VOS_TRUE; /* ²»ÐèÒªµÈ´ýWRRµÄ»Ø¸´ÏûÏ¢£¬»òÕßÒѾ­ÊÕµ½WRRµÄ»Ø¸´ÏûÏ¢£¬½øÐÐRAUÁ÷³Ì½áÊøµÄÏàÓ¦´¦Àí */ if ( (VOS_FALSE == g_GmmInterRatInfoCtrl.ucRauCmpWaitInterRatCnfMsg) || (VOS_TRUE == g_GmmInterRatInfoCtrl.ucInterRatCnfMsgRcvdFlg)) { NAS_GMM_RauCompleteHandling(); } return; } #ifdef __cplusplus #if __cplusplus } #endif #endif
/* arch/arm/mach-omap2/board-espresso10.h * * Copyright (C) 2011 Samsung Electronics Co, Ltd. * * Based on mach-omap2/board-espresso.h * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __BOARD_ESPRESSO10_H__ #define __BOARD_ESPRESSO10_H__ #include <linux/serial_core.h> extern struct class *sec_class; /* GT-P5100 / GT-P5110 / GT-5113 */ /* Reference Device */ #define SEC_MACHINE_ESPRESSO10 0x02 /* Non-Modem Device */ #define SEC_MACHINE_ESPRESSO10_WIFI 0x04 /* Non-Modem Device for Best Buy */ #define SEC_MACHINE_ESPRESSO10_USA_BBY 0x06 enum espresso10_adc_ch { REMOTE_SENSE = 0, ADC_CHECK_1, /* TA detection */ ACCESSORY_ID, /* OTG detection */ EAR_ADC_35, /* Earjack detection */ }; /** @category common */ unsigned int omap4_espresso10_get_board_type(void); /** @category LCD, HDMI */ void omap4_espresso10_display_init(void); void omap4_espresso10_display_early_init(void); void omap4_espresso10_memory_display_init(void); /** @category Key, TSP, Touch-Key */ void omap4_espresso10_input_init(void); void omap4_espresso10_tsp_ta_detect(int); /** @category Jack, Dock */ void omap4_espresso10_jack_init(void); /** @category Charger, Battery */ void omap4_espresso10_power_init(void); /** @category Motion Sensor */ void omap4_espresso10_sensors_init(void); void omap4_espresso_set_chager_type(int type); /** @category mUSB-IC, USB-OTG */ void omap4_espresso10_connector_init(void); int omap4_espresso10_get_adc(enum espresso10_adc_ch ch); void omap4_espresso10_usb_detected(int cable_type); /** @category LPDDR2 */ void omap4_espresso10_emif_init(void); /** @category I2c, UART(GPS) */ void omap4_espresso10_serial_init(void); /** @category TWL6030, TWL6040 */ void omap4_espresso10_pmic_init(void); /** @category MMCHS, WiFi */ void omap4_espresso10_sdio_init(void); extern struct mmc_platform_data espresso10_wifi_data; /** @category WiFi */ void omap4_espresso10_wifi_init(void); /** @category Bluetooth */ void bcm_bt_lpm_exit_lpm_locked(struct uart_port *uport); /** @category charger */ void omap4_espresso10_charger_init(void); /** @category modem*/ void omap4_espresso10_none_modem_init(void); void check_jig_status(int status); void notify_dock_status(int status); #endif /* __BOARD_ESPRESSO_H__ */
/* * libretroshare/src/serialiser: itempriorities.h * * 3P/PQI network interface for RetroShare. * * Copyright 2011-2011 by Cyril Soler * * 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; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA. * * Please report all bugs and problems to "csoler@users.sourceforge.net" * */ #pragma once #include <stdint.h> // This file centralises QoS priorities for all transfer RsItems. // const uint8_t QOS_PRIORITY_UNKNOWN = 0 ; const uint8_t QOS_PRIORITY_DEFAULT = 3 ; const uint8_t QOS_PRIORITY_TOP = 9 ; // Turtle traffic // const uint8_t QOS_PRIORITY_RS_TURTLE_OPEN_TUNNEL = 6 ; const uint8_t QOS_PRIORITY_RS_TURTLE_TUNNEL_OK = 6 ; const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST = 6 ; const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST= 5 ; const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 3 ; const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_DATA = 3 ; const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 3 ; const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 5 ; const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 3 ; const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_ITEM = 3 ; const uint8_t QOS_PRIORITY_RS_TURTLE_FORWARD_FILE_DATA= 3 ; const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_DATA = 5 ; // File transfer // const uint8_t QOS_PRIORITY_RS_FILE_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_FILE_CRC_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_CHUNK_CRC_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_FILE_MAP_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_CACHE_REQUEST = 4 ; const uint8_t QOS_PRIORITY_RS_FILE_DATA = 3 ; const uint8_t QOS_PRIORITY_RS_FILE_CRC = 3 ; const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 5 ; const uint8_t QOS_PRIORITY_RS_FILE_MAP = 3 ; const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; // Discovery // const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ; const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ; const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 1 ; const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 1 ; const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority. const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ; const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 1 ; // Heartbeat. // const uint8_t QOS_PRIORITY_RS_HEARTBEAT_PULSE = 8 ; // Chat/Msgs // const uint8_t QOS_PRIORITY_RS_CHAT_ITEM = 7 ; const uint8_t QOS_PRIORITY_RS_CHAT_AVATAR_ITEM = 2 ; const uint8_t QOS_PRIORITY_RS_MSG_ITEM = 2 ; // depreciated. const uint8_t QOS_PRIORITY_RS_MAIL_ITEM = 2 ; // new mail service const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ; // RTT // const uint8_t QOS_PRIORITY_RS_RTT_PING = 9 ; // BanList // const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 2 ; // Bandwidth Control. // const uint8_t QOS_PRIORITY_RS_BWCTRL_ALLOWED_ITEM = 9 ; // Dsdv Routing // const uint8_t QOS_PRIORITY_RS_DSDV_ROUTE = 4 ; const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ; // GXS // const uint8_t QOS_PRIORITY_RS_GXS_NET = 3 ; // GXS Reputation. const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 2; // Service Info / Control. const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 7;
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Edin Kadribasic <edink@emini.dk> | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_PDO_PGSQL_H #define PHP_PDO_PGSQL_H #include <libpq-fe.h> extern zend_module_entry pdo_pgsql_module_entry; #define phpext_pdo_pgsql_ptr &pdo_pgsql_module_entry #ifdef ZTS #include "TSRM.h" #endif PHP_MINIT_FUNCTION(pdo_pgsql); PHP_MSHUTDOWN_FUNCTION(pdo_pgsql); PHP_MINFO_FUNCTION(pdo_pgsql); #endif /* PHP_PDO_PGSQL_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */
#ifndef SPRITE_SET_H #define SPRITE_SET_H #include <vector> #include "Shape.h" namespace rgl { // // SPRITESET // class SpriteSet : public Shape { private: ARRAY<Vertex> vertex; ARRAY<float> size; public: SpriteSet(Material& material, int nvertex, double* vertex, int nsize, double* size, int ignoreExtent, int count = 0, Shape** shapelist = NULL, double* userMatrix = NULL); ~SpriteSet(); /** * overload **/ virtual void render(RenderContext* renderContext); virtual void getTypeName(char* buffer, int buflen) { strncpy(buffer, "sprites", buflen); }; virtual int getElementCount(void); int getAttributeCount(AABox& bbox, AttribID attrib); void getAttribute(AABox& bbox, AttribID attrib, int first, int count, double* result); String getTextAttribute(AABox& bbox, AttribID attrib, int index); /** * location of individual items **/ virtual Vertex getElementCenter(int index); /** * begin sending items **/ virtual void drawBegin(RenderContext* renderContext); /** * send one item **/ virtual void drawElement(RenderContext* renderContext, int index); /** * end sending items **/ virtual void drawEnd(RenderContext* renderContext); /** * extract individual shape */ virtual Shape* get_shape(int id); private: GLdouble userMatrix[16]; /* Transformation for 3D sprites */ Matrix4x4 m; /* Modelview matrix cache */ bool doTex; std::vector<Shape*> shapes; }; } // namespace rgl #endif // SPRITE_SET_H
#ifndef ECP_WII_JOINT_GENERATOR_H #define ECP_WII_JOINT_GENERATOR_H #include "base/ecp/ecp_generator.h" #include "application/wii_teach/sensor/ecp_mp_s_wiimote.h" #include "application/wii_teach/generator/ecp_g_wii.h" namespace mrrocpp { namespace ecp { namespace irp6ot_m { namespace generator { /** @addtogroup wii_teach * * @{ */ class wii_joint : public generator::wii { public: /** * Tworzy generator odtwarzajacy orientacje kontrolera * @param zadanie * @param major_axis wartosc wiekszej polosi * @param minor_axis wartosc mniejszej polosi * @author jedrzej */ wii_joint (common::task::task& _ecp_task,ecp_mp::sensor::wiimote* _wiimote); /** * Generuje pierwszy krok * @author jedrzej */ virtual bool first_step(); void preset_position(void); virtual void set_position(bool changed); }; /** @} */ // end of wii_teach } } // namespace irp6ot } // namespace ecp } // namespace mrrocpp #endif //ECP_WII_JOINT_GENERATOR_H
/* * OSPF Flooding -- RFC2328 Section 13. * Copyright (C) 1999, 2000 Toshiaki Takada * * This file is part of GNU Zebra. * * GNU Zebra is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2, or (at your * option) any later version. * * GNU Zebra is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; see the file COPYING; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _ZEBRA_OSPF_FLOOD_H #define _ZEBRA_OSPF_FLOOD_H extern int ospf_flood(struct ospf *, struct ospf_neighbor *, struct ospf_lsa *, struct ospf_lsa *); extern int ospf_flood_through(struct ospf *, struct ospf_neighbor *, struct ospf_lsa *); extern int ospf_flood_through_area(struct ospf_area *, struct ospf_neighbor *, struct ospf_lsa *); extern int ospf_flood_through_as(struct ospf *, struct ospf_neighbor *, struct ospf_lsa *); extern unsigned long ospf_ls_request_count(struct ospf_neighbor *); extern int ospf_ls_request_isempty(struct ospf_neighbor *); extern struct ospf_lsa *ospf_ls_request_new(struct lsa_header *); extern void ospf_ls_request_free(struct ospf_lsa *); extern void ospf_ls_request_add(struct ospf_neighbor *, struct ospf_lsa *); extern void ospf_ls_request_delete(struct ospf_neighbor *, struct ospf_lsa *); extern void ospf_ls_request_delete_all(struct ospf_neighbor *); extern struct ospf_lsa *ospf_ls_request_lookup(struct ospf_neighbor *, struct ospf_lsa *); extern unsigned long ospf_ls_retransmit_count(struct ospf_neighbor *); extern unsigned long ospf_ls_retransmit_count_self(struct ospf_neighbor *, int); extern int ospf_ls_retransmit_isempty(struct ospf_neighbor *); extern void ospf_ls_retransmit_add(struct ospf_neighbor *, struct ospf_lsa *); extern void ospf_ls_retransmit_delete(struct ospf_neighbor *, struct ospf_lsa *); extern void ospf_ls_retransmit_clear(struct ospf_neighbor *); extern struct ospf_lsa *ospf_ls_retransmit_lookup(struct ospf_neighbor *, struct ospf_lsa *); extern void ospf_ls_retransmit_delete_nbr_area(struct ospf_area *, struct ospf_lsa *); extern void ospf_ls_retransmit_delete_nbr_as(struct ospf *, struct ospf_lsa *); extern void ospf_ls_retransmit_add_nbr_all(struct ospf_interface *, struct ospf_lsa *); extern void ospf_flood_lsa_area(struct ospf_lsa *, struct ospf_area *); extern void ospf_flood_lsa_as(struct ospf_lsa *); extern void ospf_lsa_flush_area(struct ospf_lsa *, struct ospf_area *); extern void ospf_lsa_flush_as(struct ospf *, struct ospf_lsa *); extern void ospf_lsa_flush(struct ospf *, struct ospf_lsa *); extern struct external_info *ospf_external_info_check(struct ospf_lsa *); extern void ospf_lsdb_init(struct ospf_lsdb *); #endif /* _ZEBRA_OSPF_FLOOD_H */
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) 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." ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "MVDataManager/mvdatamanager.h" #include "../matrixTools/parser.h" #include "Dialogs/importdilaog.h" QT_BEGIN_NAMESPACE class QAction; class QListWidget; class QMenu; class QTextEdit; class PlotWidget; class EventViewer; class MaskManager; QT_END_NAMESPACE //! [0] class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); void showWelcome(); public slots: void centerMainWindowGeometry(); private slots: void tryClose(); void save(); void about(); void openFile(); void import(); void raiseEVDock(); void raiseDMDock(); void raisePlotDock(); void raiseMMDock(); void updateOutput(); private: void createActions(); void createMenus(); void createToolBars(); void createStatusBar(); void createDockWindows(); QDesktopWidget *desktop; QProcess *process; QTextEdit *outputLog; MVdataManager *dataManager; QDockWidget * DMdock; QDockWidget * PlotDock; QDockWidget * eventViewerDock; //QDockWidget * maskEditorDock; MaskManager * maskManager; QDockWidget * MMDock; PlotWidget * plotWidget; EventViewer * eventViewer; // checkableMatrix * maskMatrix; QList<QTabBar*> tabBars; QMenu *fileMenu; //QMenu *editMenu; QMenu *analyzerMenu; QMenu *DMmenu; QMenu * MMmenu; QMenu *viewMenu; QMenu *helpMenu; QToolBar *fileToolBar; QToolBar *DMtoolBar; QToolBar *MMtoolBar; QToolBar *viewToolBar; QToolBar *editToolBar; //actions from DataManager QAction *newDataSetAct; QAction *rmDataSetAct; QAction *rmAllDataSetAct; QAction *plotDataSetAct; QAction *saveDataSetAct; QAction *inspectEventAct; QAction *renameDataSetAct; //actions from MaskManager QAction * newMaskSetAct; QAction * renameMaskSetAct; QAction * editMaskAct; QAction * printMaskAct; QAction * rmMaskSetAct; //action toggle view QAction *DMviewAct; QAction *MMviewAct; QAction *plotViewAct; QAction *EVviewAct; QAction *saveAct; QAction *undoAct; QAction *aboutAct; QAction *aboutQtAct; QAction *quitAct; QAction *openFileAct; QAction *importAct; }; //! [0] #endif
/* Company : Nequeo Pty Ltd, http://www.nequeo.com.au/ * Copyright : Copyright © Nequeo Pty Ltd 2015 http://www.nequeo.com.au/ * * File : SdpSession.h * Purpose : SIP SdpSession class. * */ /* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #ifndef _SDPSESSION_H #define _SDPSESSION_H #include "stdafx.h" #include "Call.h" #include "CallInfo.h" #include "SipEventType.h" #include "pjsua2.hpp" using namespace System; using namespace System::Collections; using namespace System::Collections::Generic; namespace Nequeo { namespace Net { namespace PjSip { /// <summary> /// This structure describes SDP session description. /// </summary> public ref class SdpSession sealed { public: /// <summary> /// This structure describes SDP session description. /// </summary> SdpSession(); /// <summary> /// Gets or sets the whole SDP as a string. /// </summary> property String^ WholeSdp { String^ get(); void set(String^ value); } private: String^ _wholeSdp; }; } } } #endif
/***************************************************************************** Copyright (C) 2013, 2014 Facebook, Inc. All Rights Reserved. Copyright (C) 2014, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA *****************************************************************************/ #ifndef btr0defragment_h #define btr0defragment_h #include "btr0pcur.h" /* Max number of pages to consider at once during defragmentation. */ #define BTR_DEFRAGMENT_MAX_N_PAGES 32 /** stats in btr_defragment */ extern Atomic_counter<ulint> btr_defragment_compression_failures; extern Atomic_counter<ulint> btr_defragment_failures; extern Atomic_counter<ulint> btr_defragment_count; /******************************************************************//** Initialize defragmentation. */ void btr_defragment_init(void); /******************************************************************//** Shutdown defragmentation. */ void btr_defragment_shutdown(); /******************************************************************//** Check whether the given index is in btr_defragment_wq. */ bool btr_defragment_find_index( dict_index_t* index); /*!< Index to find. */ /******************************************************************//** Add an index to btr_defragment_wq. Return a pointer to os_event if this is a synchronized defragmentation. */ os_event_t btr_defragment_add_index( dict_index_t* index, /*!< index to be added */ dberr_t* err); /*!< out: error code */ /******************************************************************//** When table is dropped, this function is called to mark a table as removed in btr_efragment_wq. The difference between this function and the remove_index function is this will not NULL the event. */ void btr_defragment_remove_table( dict_table_t* table); /*!< Index to be removed. */ /******************************************************************//** Mark an index as removed from btr_defragment_wq. */ void btr_defragment_remove_index( dict_index_t* index); /*!< Index to be removed. */ /*********************************************************************//** Check whether we should save defragmentation statistics to persistent storage.*/ UNIV_INTERN void btr_defragment_save_defrag_stats_if_needed( dict_index_t* index); /*!< in: index */ /* Stop defragmentation.*/ void btr_defragment_end(); extern bool btr_defragment_active; #endif
// +------------------------------------------------------------------+ // | ____ _ _ __ __ _ __ | // | / ___| |__ ___ ___| | __ | \/ | |/ / | // | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | // | | |___| | | | __/ (__| < | | | | . \ | // | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | // | | // | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | // +------------------------------------------------------------------+ // // This file is part of Check_MK. // The official homepage is at http://mathias-kettner.de/check_mk. // // check_mk 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 in version 2. check_mk is distributed // in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- // out even the implied warranty of MERCHANTABILITY or FITNESS FOR A // PARTICULAR PURPOSE. See the GNU General Public License for more de- // tails. You should have received a copy of the GNU General Public // License along with GNU Make; see the file COPYING. If not, write // to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA. #ifndef HostServiceState_h #define HostServiceState_h #include "config.h" // IWYU pragma: keep #include <cstring> #include <ctime> #include <vector> #include "nagios.h" // IWYU pragma: keep class HostServiceState; typedef std::vector<HostServiceState *> HostServices; typedef void *HostServiceKey; class HostServiceState { public: bool _is_host; time_t _time; int _lineno; time_t _from; time_t _until; time_t _duration; double _duration_part; // Do not change order within this block! // These durations will be bzero'd time_t _duration_state_UNMONITORED; double _duration_part_UNMONITORED; time_t _duration_state_OK; double _duration_part_OK; time_t _duration_state_WARNING; double _duration_part_WARNING; time_t _duration_state_CRITICAL; double _duration_part_CRITICAL; time_t _duration_state_UNKNOWN; double _duration_part_UNKNOWN; // State information int _host_down; // used if service int _state; // -1/0/1/2/3 int _in_notification_period; int _in_service_period; int _in_downtime; int _in_host_downtime; int _is_flapping; // Service information HostServices _services; // Absent state handling bool _may_no_longer_exist; bool _has_vanished; time_t _last_known_time; const char *_debug_info; // NOTE: _log_output is the *only* pointer in this class to an object we // own, all other pointers are to foreign objects. This ownership is // unfortunate and complicates things quite a lot, see the corresponding // TODO in TableStateHistory::updateHostServiceState. char *_log_output; const char *_notification_period; // may be "": -> no period known, we // assume "always" const char *_service_period; // may be "": -> no period known, we assume "always" host *_host; service *_service; const char *_host_name; // Fallback if host no longer exists const char *_service_description; // Fallback if service no longer exists HostServiceState() { bzero(this, sizeof(HostServiceState)); } ~HostServiceState(); #ifdef CMC void computePerStateDurations(); #endif }; #endif // HostServiceState_h
// // Copyright (C) 2011 David Eckhoff <eckhoff@cs.fau.de> // // Documentation for these modules is at http://veins.car2x.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // /* * Based on Decider80211.h from Karl Wessel * and modifications by Christopher Saloman */ #ifndef DECIDER80211_H_ #define DECIDER80211_H_ #include <BaseDecider.h> #include <Consts80211p.h> #include <Mac80211pToPhy11pInterface.h> #include <Decider80211pToPhy80211pInterface.h> #ifndef DBG_D11P #define DBG_D11P EV #endif //#define DBG_D11P std::cerr << "[" << simTime().raw() << "] " << myPath << ".Dec " class Decider80211p: public BaseDecider { public: enum Decider80211ControlKinds { NOTHING = 22100, BITERROR, //the phy has recognized a bit error in the packet LAST_DECIDER_80211_CONTROL_KIND, RECWHILESEND }; protected: // threshold value for checking a SNR-map (SNR-threshold) double snrThreshold; /** @brief The center frequency on which the decider listens for signals */ double centerFrequency; double myBusyTime; double myStartTime; std::string myPath; Decider80211pToPhy80211pInterface* phy11p; std::map<AirFrame*,int> signalStates; protected: /** * @brief Checks a mapping against a specific threshold (element-wise). * * @return true , if every entry of the mapping is above threshold * false , otherwise * * */ virtual DeciderResult* checkIfSignalOk(AirFrame* frame); virtual simtime_t processNewSignal(AirFrame* frame); /** * @brief Processes a received AirFrame. * * The SNR-mapping for the Signal is created and checked against the Deciders * SNR-threshold. Depending on that the received AirFrame is either sent up * to the MAC-Layer or dropped. * * @return usually return a value for: 'do not pass it again' */ virtual simtime_t processSignalEnd(AirFrame* frame); /** @brief computes if packet is ok or has errors*/ bool packetOk(double snirMin, int lengthMPDU, double bitrate); /** * @brief Calculates the RSSI value for the passed ChannelSenseRequest. * * This method is called by BaseDecider when it answers a ChannelSenseRequest * and can be overridden by sub classing Deciders. * * Returns the maximum RSSI value inside the ChannelSenseRequest time * interval and the channel the Decider currently listens to. */ virtual double calcChannelSenseRSSI(simtime_t_cref min, simtime_t_cref max); public: /** * @brief Initializes the Decider with a pointer to its PhyLayer and * specific values for threshold and sensitivity */ Decider80211p(DeciderToPhyInterface* phy, double sensitivity, double centerFrequency, int myIndex = -1, bool debug = false): BaseDecider(phy, sensitivity, myIndex, debug), centerFrequency(centerFrequency), myBusyTime(0), myStartTime(simTime().dbl()) { phy11p = dynamic_cast<Decider80211pToPhy80211pInterface*>(phy); assert(phy11p); } void setPath(std::string myPath) { this->myPath = myPath; } bool cca(simtime_t_cref, AirFrame*); int getSignalState(AirFrame* frame); virtual ~Decider80211p(); void changeFrequency(double freq); void setChannelIdleStatus(bool isIdle); }; #endif /* DECIDER80211_H_ */
/* Copyright (C) Hongsen Liao Institute of Computer Graphics and Computer Aided Design School of Software, Tsinghua University Contact: liaohs082@gmail.com All rights reserved. */ #ifndef DENSITY_RENDERING_WIDGET_H_ #define DENSITY_RENDERING_WIDGET_H_ #include <vtk3DWidget.h> #include <vector> using namespace std; class vtkActor; class vtkPolyDataMapper; class vtkPolyData; class DensityRenderingWidget : public vtk3DWidget { public: static DensityRenderingWidget* New(); vtkTypeMacro(DensityRenderingWidget, vtk3DWidget); void SetData(vector<vector<float>>& pos, vector<int>& cluster_index); virtual void SetEnabled(int enabled); virtual void PlaceWidget(double bounds[6]) {} protected: DensityRenderingWidget(); ~DensityRenderingWidget(); private: vtkActor* actor_ = NULL; vtkPolyDataMapper* data_mapper_ = NULL; vtkPolyData* polydata_ = NULL; vector<vector<float>> point_pos_; vector<int> cluster_index_; vector<float> adaptive_rate_; void BuildRepresentation(); }; #endif
/* linux/arch/arm/mach-s5pv310/bootmem-smdkv310.c * * Copyright (c) 2009 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * Bootmem helper functions for smdkv310 * * 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/mm.h> #include <linux/bootmem.h> #include <linux/swap.h> #include <asm/setup.h> #include <linux/io.h> #include <mach/memory.h> #include <plat/media.h> #include <mach/media.h> struct s5p_media_device media_devs[] = { #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMD { .id = S5P_MDEV_FIMD, .name = "fimd", .bank = 1, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMD * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_S5P_PMEM_MEMSIZE_PMEM { .id = S5P_MDEV_PMEM, .name = "pmem", .bank = 1, .memsize = CONFIG_S5P_PMEM_MEMSIZE_PMEM * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC0 { .id = S5P_MDEV_FIMC0, .name = "fimc0", .bank = 1, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC0 * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC1 { .id = S5P_MDEV_FIMC1, .name = "fimc1", .bank = 1, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC1 * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC2 { .id = S5P_MDEV_FIMC2, .name = "fimc2", .bank = 1, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC2 * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC3 { .id = S5P_MDEV_FIMC3, .name = "fimc3", .bank = 1, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC3 * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_JPEG { .id = S5P_MDEV_JPEG, .name = "jpeg", .bank = 0, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_JPEG * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC { .id = S5P_MDEV_MFC, .name = "mfc", .bank = 0, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC0 { .id = S5P_MDEV_MFC, .name = "mfc", .bank = 0, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC0 * SZ_1K, .paddr = 0, }, #endif #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC1 { .id = S5P_MDEV_MFC, .name = "mfc", .bank = 1, .memsize = CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC1 * SZ_1K, .paddr = 0, }, #endif }; int nr_media_devs = (sizeof(media_devs) / sizeof(media_devs[0]));
/* * Copyright (C) 2010 Pengutronix * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.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. */ #include <linux/dma-mapping.h> #include <mach-imx/hardware.h> #include <mach-imx/devices-common.h> #define imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) \ { \ .id = _id, \ .iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \ .iosize = _size, \ .irq = soc ## _INT_SDHC ## _hwid, \ .dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \ } #define imx_mxc_mmc_data_entry(soc, _id, _hwid, _size) \ [_id] = imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) #ifdef CONFIG_SOC_IMX21 const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = { #define imx21_mxc_mmc_data_entry(_id, _hwid) \ imx_mxc_mmc_data_entry(MX21, _id, _hwid, SZ_4K) imx21_mxc_mmc_data_entry(0, 1), imx21_mxc_mmc_data_entry(1, 2), }; #endif /* ifdef CONFIG_SOC_IMX21 */ #ifdef CONFIG_SOC_IMX27 const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = { #define imx27_mxc_mmc_data_entry(_id, _hwid) \ imx_mxc_mmc_data_entry(MX27, _id, _hwid, SZ_4K) imx27_mxc_mmc_data_entry(0, 1), imx27_mxc_mmc_data_entry(1, 2), }; #endif /* ifdef CONFIG_SOC_IMX27 */ #ifdef CONFIG_SOC_IMX31 const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = { #define imx31_mxc_mmc_data_entry(_id, _hwid) \ imx_mxc_mmc_data_entry(MX31, _id, _hwid, SZ_16K) imx31_mxc_mmc_data_entry(0, 1), imx31_mxc_mmc_data_entry(1, 2), }; #endif /* ifdef CONFIG_SOC_IMX31 */ struct platform_device *__init imx_add_mxc_mmc( const struct imx_mxc_mmc_data *data, const struct imxmmc_platform_data *pdata) { struct resource res[] = { { .start = data->iobase, .end = data->iobase + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .start = data->irq, .end = data->irq, .flags = IORESOURCE_IRQ, }, { .start = data->dmareq, .end = data->dmareq, .flags = IORESOURCE_DMA, }, }; return imx_add_platform_device_dmamask("mxc-mmc", data->id, res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32)); }
/* * arch/sh/kernel/cpu/sh3/clock-sh7712.c * * SH7712 support for the clock framework * * Copyright (C) 2007 Andrew Murray <amurray@mpc-data.co.uk> * * Based on arch/sh/kernel/cpu/sh3/clock-sh3.c * Copyright (C) 2005 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/init.h> #include <linux/kernel.h> #include <asm/clock.h> #include <asm/freq.h> #include <asm/io.h> static int multipliers[] = { 1, 2, 3 }; static int divisors[] = { 1, 2, 3, 4, 6 }; static void master_clk_init(struct clk *clk) { int frqcr = __raw_readw(FRQCR); int idx = (frqcr & 0x0300) >> 8; clk->rate *= multipliers[idx]; } static struct sh_clk_ops sh7712_master_clk_ops = { .init = master_clk_init, }; static unsigned long module_clk_recalc(struct clk *clk) { int frqcr = __raw_readw(FRQCR); int idx = frqcr & 0x0007; return clk->parent->rate / divisors[idx]; } static struct sh_clk_ops sh7712_module_clk_ops = { .recalc = module_clk_recalc, }; static unsigned long cpu_clk_recalc(struct clk *clk) { int frqcr = __raw_readw(FRQCR); int idx = (frqcr & 0x0030) >> 4; return clk->parent->rate / divisors[idx]; } static struct sh_clk_ops sh7712_cpu_clk_ops = { .recalc = cpu_clk_recalc, }; static struct sh_clk_ops *sh7712_clk_ops[] = { &sh7712_master_clk_ops, &sh7712_module_clk_ops, &sh7712_cpu_clk_ops, }; void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) { if (idx < ARRAY_SIZE(sh7712_clk_ops)) *ops = sh7712_clk_ops[idx]; }
/* * MALLOC_INFO Shell Command Implmentation * * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <inttypes.h> #include <rtems.h> #include <rtems/malloc.h> #include <rtems/shell.h> #include "internal.h" extern int malloc_info( region_information_block * ); extern void rtems_shell_print_unified_work_area_message(void); int rtems_shell_main_malloc_info( int argc, char *argv[] ) { if ( argc == 2 ) { rtems_shell_print_unified_work_area_message(); if ( !strcmp( argv[1], "info" ) ) { region_information_block info; malloc_info( &info ); rtems_shell_print_heap_info( "free", &info.Free ); rtems_shell_print_heap_info( "used", &info.Used ); return 0; } else if ( !strcmp( argv[1], "stats" ) ) { malloc_report_statistics_with_plugin( stdout, (rtems_printk_plugin_t) fprintf ); return 0; } } fprintf( stderr, "%s: [info|stats]\n", argv[0] ); return -1; } rtems_shell_cmd_t rtems_shell_MALLOC_INFO_Command = { "malloc", /* name */ "[info|stats]", /* usage */ "mem", /* topic */ rtems_shell_main_malloc_info, /* command */ NULL, /* alias */ NULL /* next */ };
/* $Id: test1.c 53 2007-03-10 14:46:36Z bja $ * * Copyright (C) 2007, Joel Andersson <bja@kth.se> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include "wiimote.h" #include "wiimote_api.h" int main(int argc, char **argv) { wiimote_t wiimote = WIIMOTE_INIT; wiimote_report_t report = WIIMOTE_REPORT_INIT; if (argc < 2) { fprintf(stderr, "Usage: test1 BDADDR\n"); exit(1); } /* Print help information. */ printf("test1 - libwiimote test application\n\n"); printf(" A - Enable accelerometer\n"); printf(" B - Enable ir-sensor\n"); printf(" 1 - Enable rumble\n"); printf(" + - Increment leds\n"); printf(" - - Decrement leds\n"); printf(" Home - Exit\n\n"); printf("Press buttons 1 and 2 on the wiimote now to connect.\n"); /* Connect the wiimote specified on the command line. */ if (wiimote_connect(&wiimote, argv[1]) < 0) { fprintf(stderr, "unable to open wiimote: %s\n", wiimote_get_error()); exit(1); } /* Activate the first led on the wiimote. It will take effect on the next call to wiimote_update. */ wiimote.led.one = 1; while (wiimote_is_open(&wiimote)) { /* The wiimote_update function is used to synchronize the wiimote object with the real wiimote. It should be called as often as possible in order to minimize latency. */ if (wiimote_update(&wiimote) < 0) { wiimote_disconnect(&wiimote); break; } /* The wiimote object has member 'keys' which keep track of the current key state. */ if (wiimote.keys.home) { wiimote_disconnect(&wiimote); } /* To see if a specific key has been pressed you can either test a specific member of the 'keys' structure, or compare them all at once with a bit mask. See wiimote_event.h for details. */ if (wiimote.keys.bits & WIIMOTE_KEY_1) { /* This will activate the rumble feature on the next update. The wiimote will rumble until the 'one' key is released. */ wiimote.rumble = 1; } else { /* Disable rumble on the next update. */ wiimote.rumble = 0; } /* Prepare and send a status report request. */ if (wiimote.keys.two) { report.channel = WIIMOTE_RID_STATUS; if (wiimote_report(&wiimote, &report, sizeof (report.status)) < 0) { wiimote_perror("unable to get status report"); } } /* Activate the IR-sensor when the 'B' key is pressed. */ if (wiimote.keys.b) { wiimote.mode.ir = 1; } else { wiimote.mode.ir = 0; } /* Activate the accelerometer when the 'A' key is pressed. */ if (wiimote.keys.a) { wiimote.mode.acc = 1; } else { wiimote.mode.acc = 0; } /* Change the LEDs on the wiimote when the plus and minus keys are pressed. */ if (wiimote.keys.plus) { wiimote.led.bits += 1; } if (wiimote.keys.minus) { wiimote.led.bits -= 1; } /* Print the current state of the wiimote. */ fprintf(stderr, "MODE %02x\n", wiimote.mode.bits); fprintf(stderr, "BAT %02x\n", wiimote.battery); fprintf(stderr, "KEYS %04x one=%d two=%d a=%d b=%d <=%d >=%d ^=%d v=%d h=%d +=%d -=%d\n", wiimote.keys.bits, wiimote.keys.one, wiimote.keys.two, wiimote.keys.a, wiimote.keys.b, wiimote.keys.left, wiimote.keys.right, wiimote.keys.up, wiimote.keys.down, wiimote.keys.home, wiimote.keys.plus, wiimote.keys.minus); fprintf(stderr, "JOY1 joyx=%03d joyy=%03d x=%03d y=%03d z=%03d keys.z=%d keys.c=%d\n", wiimote.ext.nunchuk.joyx, wiimote.ext.nunchuk.joyy, wiimote.ext.nunchuk.axis.x, wiimote.ext.nunchuk.axis.y, wiimote.ext.nunchuk.axis.z, wiimote.ext.nunchuk.keys.z, wiimote.ext.nunchuk.keys.c); fprintf(stderr, "JOY2 joyx=%03d joyy=%03d\n", wiimote.ext.classic.joyx1, wiimote.ext.classic.joyy1); fprintf(stderr, "JOY3 joyx=%03d joyy=%03d\n", wiimote.ext.classic.joyx2, wiimote.ext.classic.joyy2); fprintf(stderr, "AXIS x=%03d y=%03d z=%03d\n", wiimote.axis.x, wiimote.axis.y, wiimote.axis.z); #ifdef _ENABLE_TILT fprintf(stderr, "TILT x=%.3f y=%.3f z=%.3f\n", wiimote.tilt.x, wiimote.tilt.y, wiimote.tilt.z); #endif #ifdef _ENABLE_FORCE fprintf(stderr, "FORCE x=%.3f y=%.3f z=%.3f (sum=%.3f)\n", wiimote.force.x, wiimote.force.y, wiimote.force.z, sqrt(wiimote.force.x*wiimote.force.x+wiimote.force.y*wiimote.force.y+wiimote.force.z*wiimote.force.z)); #endif fprintf(stderr, "IR1 x=%04d y=%04d ss=%d\n", wiimote.ir1.x, wiimote.ir1.y, wiimote.ir1.size); fprintf(stderr, "IR2 x=%04d y=%04d ss=%d\n", wiimote.ir2.x, wiimote.ir2.y, wiimote.ir2.size); fprintf(stderr, "IR3 x=%04d y=%04d ss=%d\n", wiimote.ir3.x, wiimote.ir3.y, wiimote.ir3.size); fprintf(stderr, "IR4 x=%04d y=%04d ss=%d\n", wiimote.ir4.x, wiimote.ir4.y, wiimote.ir4.size); fprintf(stderr, "\n"); } return 0; }
/* * (c) BayCom GmbH, http://www.baycom.de, info@baycom.de * * See the COPYING file for copyright information and * how to reach the author. * */ typedef struct { struct list list; pthread_t ci_recv_thread; char uuid[UUID_SIZE]; SOCKET fd_ci; int recv_run; int device; int connected; recv_cacaps_t *cacaps; u_int8_t *txdata; u_int8_t *rxdata; int (*handle_ci_slot[CA_MAX_SLOTS]) (ci_pdu_t *tpdu, void *context); void *handle_ci_slot_context[CA_MAX_SLOTS]; } ci_dev_t; DLL_SYMBOL int ci_register_handler(ci_dev_t *c, int slot, int (*p) (ci_pdu_t *, void *), void *context); DLL_SYMBOL int ci_unregister_handler(ci_dev_t *c, int slot); DLL_SYMBOL int ci_write_pdu(ci_dev_t *c, ci_pdu_t *tpdu); DLL_SYMBOL ci_dev_t *ci_find_dev_by_uuid (char *uuid); DLL_SYMBOL int ci_init (int ca_enable, char *intf, int p); DLL_SYMBOL void ci_exit (void);
/* * Asterisk -- An open source telephony toolkit. * * Copyright (C) 2007, Digium, Inc. * * See http://www.iaxproxy.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. */ /*! \file * * \brief Dialplan group functions check if a dialplan entry exists * * \author Gregory Nietsky AKA irroot <gregory@networksentry.co.za> * \author Russell Bryant <russell@digium.com> * * \ingroup functions */ #include "iaxproxy.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision: 211580 $") #include "iaxproxy/module.h" #include "iaxproxy/channel.h" #include "iaxproxy/pbx.h" #include "iaxproxy/app.h" /*** DOCUMENTATION <function name="DIALPLAN_EXISTS" language="en_US"> <synopsis> Checks the existence of a dialplan target. </synopsis> <syntax> <parameter name="context" required="true" /> <parameter name="extension" /> <parameter name="priority" /> </syntax> <description> <para>This function returns <literal>1</literal> if the target exits. Otherwise, it returns <literal>0</literal>.</para> </description> </function> ***/ static int isexten_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { char *parse; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(context); AST_APP_ARG(exten); AST_APP_ARG(priority); ); strcpy(buf, "0"); if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "DIALPLAN_EXISTS() requires an argument\n"); return -1; } parse = ast_strdupa(data); AST_STANDARD_APP_ARGS(args, parse); if (!ast_strlen_zero(args.priority)) { int priority_num; if (sscanf(args.priority, "%30d", &priority_num) == 1 && priority_num > 0) { int res; res = ast_exists_extension(chan, args.context, args.exten, priority_num, chan->cid.cid_num); if (res) strcpy(buf, "1"); } else { int res; res = ast_findlabel_extension(chan, args.context, args.exten, args.priority, chan->cid.cid_num); if (res > 0) strcpy(buf, "1"); } } else if (!ast_strlen_zero(args.exten)) { int res; res = ast_exists_extension(chan, args.context, args.exten, 1, chan->cid.cid_num); if (res) strcpy(buf, "1"); } else if (!ast_strlen_zero(args.context)) { if (ast_context_find(args.context)) strcpy(buf, "1"); } else { ast_log(LOG_ERROR, "Invalid arguments provided to DIALPLAN_EXISTS\n"); return -1; } return 0; } static struct ast_custom_function isexten_function = { .name = "DIALPLAN_EXISTS", .read = isexten_function_read, }; static int unload_module(void) { return ast_custom_function_unregister(&isexten_function); } static int load_module(void) { return ast_custom_function_register(&isexten_function); } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan Context/Extension/Priority Checking Functions");
/* * (C) 2007-2010 Taobao 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. * * * Version: $Id$ * * Authors: * duolong <duolong@taobao.com> * */ #ifndef TBSYS_RUNNABLE_H_ #define TBSYS_RUNNABLE_H_ namespace tbsys { /** * @brief RunnableÊÇÒ»¸ö³éÏóÀ࣬ËüÓµÓÐÒ»¸örun´¿Ðé·½·¨ * Ö÷ÒªÓÃÓÚThreadÀà */ class Runnable { public: /* * Îö¹¹ */ virtual ~Runnable() { } /** * ÔËÐÐÈë¿Úº¯Êý */ virtual void run(CThread *thread, void *arg) = 0; }; } #endif /*RUNNABLE_H_*/
// vim: ts=4 sw=4 expandtab ft=c // Copyright (C) 2008 The University of Melbourne. // This file may only be copied under the terms of the GNU Library General // Public License - see the file COPYING.LIB in the Mercury distribution. #include "mercury_backjump.h" #include "mercury_thread.h" #if defined(MR_THREAD_SAFE) #include <pthread.h> #endif // The low-level C counterparts to these globals are the `backjump_handler' // and `backjump_next_choice_id' fields of the MR_Context structure. // (See mercury_context.h for details.) #if defined(MR_HIGHLEVEL_CODE) #if defined(MR_THREAD_SAFE) MercuryThreadKey MR_backjump_handler_key; MercuryThreadKey MR_backjump_next_choice_id_key; #else // not MR_THREAD_SAFE MR_BackJumpHandler *MR_backjump_handler; MR_BackJumpChoiceId MR_backjump_next_choice_id = 0; #endif // not MR_THREAD_SAFE #endif // not MR_HIGHLEVEL_CODE #if defined(MR_HIGHLEVEL_CODE) && defined(MR_THREAD_SAFE) MR_BackJumpChoiceId MR_get_tl_backjump_next_choice_id(void) { MR_BackJumpChoiceId new_choice_id; // NOTE: this only works because sizeof(MR_Integer) == sizeof(void *). new_choice_id = (MR_Integer) MR_GETSPECIFIC(MR_backjump_next_choice_id_key); pthread_setspecific(MR_backjump_next_choice_id_key, (void *)(new_choice_id + 1)); return new_choice_id; } #endif // MR_HIGLEVEL_CODE && MR_THREAD_SAFE ////////////////////////////////////////////////////////////////////////////
/*! * \file tpm.h * \brief TPM Peripheral API * * \addtogroup tpm_peripheral * @{ */ #ifndef _TPM_H_ #define _TPM_H_ #include <stdbool.h> #include <stdint.h> #include "v1_2.h" #include "lgr_vector.h" #include "core_cm0plus.h" #include "cmsis_gcc.h" #include "ringbuffer.h" #include "port.h" extern uint32_t tpm_clock_input; // TPM0 Status control register #define TPM0_PS (0b000 << 0) #define TPM0_CMOD (0b01 << 3) #define TPM0_SC (TPM0_CMOD | TPM0_PS) #define TPM0_TOIE (0b1 << 6) #define TPM0_TOIE_MASK (~(0b1 << 6)) // TPM0 Configuration #define TPM0_DBGMODE (0b11 << 6) // Debug mode #define TPM0_CONF_LGR (TPM0_DBGMODE) // TPM Status #define TPM_STATUS_TOF 0b11111111 #define TPM_SC_TOF (1 << 7) #define TPM_C0SC_CHF (11 << 6) #define TPM_SC_DISABLE 0b00000000 #define TPM_SC_SET_CMOD (01 << 3) void isr_tpm0(void) __attribute__((interrupt("IRQ"))); void tpm0_init(bool ); void wait_n_ms(uint32_t ); #ifdef TPM_TEST void tpm0_test_loop(void); #endif #endif /*! @} */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright (C) 2004 Nokia Corporation. * * This program 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; version 2 of the * License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser 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 __DBUS_UTILS_H__ #define __DBUS_UTILS_H__ #include <libmatevfs/mate-vfs.h> #include <dbus/dbus-glib-lowlevel.h> gboolean dbus_utils_message_iter_append_file_info (DBusMessageIter *iter, const MateVFSFileInfo *info); gboolean dbus_utils_message_append_file_info (DBusMessage *message, const MateVFSFileInfo *info); MateVFSFileInfo *dbus_utils_message_iter_get_file_info (DBusMessageIter *dict); GList * dbus_utils_message_get_file_info_list (DBusMessage *message); void dbus_utils_message_append_volume_list (DBusMessage *message, GList *volumes); void dbus_utils_message_append_drive_list (DBusMessage *message, GList *drives); void dbus_utils_message_append_volume (DBusMessage *message, MateVFSVolume *volume); void dbus_utils_message_append_drive (DBusMessage *message, MateVFSDrive *drive); void dbus_util_reply_result (DBusConnection *conn, DBusMessage *message, MateVFSResult result); void dbus_util_reply_id (DBusConnection *conn, DBusMessage *message, gint32 id); void dbus_util_start_track_name (DBusConnection *conn, const char *name); void dbus_util_stop_track_name (DBusConnection *conn, const char *name); #endif /* __DBUS_UTILS_H__ */
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <wctype.h> #include <wchar.h> #include <string.h> #include <locale.h> #include "uli_list.h" #include "W_Word.h" #include "words_list.h" #include "hash_table.h" int check_for_close_positions(UnsgLongIntList* list1,UnsgLongIntList* list2,int range) { unsigned long int loop_value; int found; UnsgLongIntCell* loop_cell1,*loop_cell2; found = 0; loop_cell1 = getCell_UnsgLongIntList(list1,0); while(loop_cell1 != NULL) { loop_value = getValue_UnsgLongIntCell(loop_cell1); if(getIndexOf_UnsgLongIntList(list2,loop_value + range,1) != -1) { return 1; } loop_cell1 = getNextCell_UnsgLongIntCell(loop_cell1); } return 0; } char** check_for_close_word(W_Word* word1,W_Word** words_vector,int words_vector_length,int space,int is_position_restrictive,int* files_result_count) { TextReference* loop_ref; UnsgLongIntList* loop_ulist,*loop_ulist2; UnsgLongIntCell* loop_ucell; char** result_files; long int reference_count; int i,c,found_words_count,close_found_words_count,check,str_len; unsigned long int loop_pos_value; char* loop_filename; found_words_count = 0; close_found_words_count = 0; reference_count = getReferenceCount_W_Word(word1); result_files = (char**) malloc(sizeof(char*)*(reference_count)); loop_ref = getReference_W_Word(word1,0); c = 0; while(loop_ref != NULL) { loop_filename = getFileName_TextReference(loop_ref); loop_ulist = getWordPosition_TextReference(loop_ref); //wprintf(L"FILE NAME: %s\n",loop_filename); for(i=0;i<words_vector_length;i++) { //print_W_Word(words_vector[i]); //wprintf(L"\n"); loop_ulist2 = getPositionsByFile_W_Word(words_vector[i],loop_filename,1); if(loop_ulist2 != NULL && loop_ulist != NULL) { //report_UnsgLongIntList(loop_ulist2); // wprintf(L"\n"); found_words_count++; if(is_position_restrictive == 1) { check = check_for_close_positions(loop_ulist,loop_ulist2,i * space); if(check == 1) { close_found_words_count += check; } else { break; } } } else { break; } } //wprintf(L"|||%d:%d\n",found_words_count,reference_count); if((is_position_restrictive == 1 && close_found_words_count == words_vector_length) || (is_position_restrictive == 0 && found_words_count == words_vector_length)) { str_len = strlen(loop_filename); result_files[c] = (char*) malloc(sizeof(char)*(str_len+1)); strncpy(result_files[c],loop_filename,str_len+1); c++; } found_words_count = 0; close_found_words_count = 0; loop_ref = getNext_TextReference(loop_ref); } *files_result_count = c; return result_files; } W_Word** retrive_references_hash_search(HashTable* hash_table,WordsList* query_words,int* number_words_found,W_Word* (*search)(HashTable*,wchar_t*)) { W_Word** found_words; WordsListCell* loop_cell; W_Word* loop_word,*found_word; int i,query_words_length; long int *text_pos_index; query_words_length = get_length_WordsList(query_words); found_words = (W_Word**) malloc(sizeof(W_Word*)*query_words_length); i = 0; // wprintf(L"saçdkhaljsd"); // wprintf(L":||%ld\n",query_words_length); loop_cell = getCell_WordsList(query_words,0); while(loop_cell != NULL && i < query_words_length) { loop_word = getWord_WordsListCell(loop_cell); // wprintf(L"%ls\n",get_str_W_Word(loop_word)); found_words[i] = (*search)(hash_table,get_str_W_Word(loop_word)); if(found_words[i] == NULL) { *number_words_found = 0; free(found_words); return NULL; } loop_cell = getNextCell_WordsListCell(loop_cell); i++; } *number_words_found = i; return found_words; } char** hash_search(HashTable* hash_table,WordsList* query_words,int position_restrictive_flag,int search_type,int* number_results) { W_Word** found_words = NULL; char** files_found = NULL; int files_found_count; int i,number_words_found; number_words_found = 0; switch(search_type) { case 0: found_words = retrive_references_hash_search(hash_table,query_words,&number_words_found,listSearchW_Word_HashTable); break; case 1: found_words = retrive_references_hash_search(hash_table,query_words,&number_words_found,linearSearchW_Word_HashTable); break; case 2: found_words = retrive_references_hash_search(hash_table,query_words,&number_words_found,doubleSearchW_Word_HashTable); break; } if(number_words_found > 0) { files_found_count = 0; files_found = NULL; files_found = check_for_close_word(found_words[0],found_words,number_words_found,1,position_restrictive_flag,&number_words_found); *number_results = number_words_found; } if(found_words != NULL) free(found_words); return files_found; }
/** * @file ProjectFilePathsDlg.h * * @brief Declaration file for ProjectFilePathsDlg dialog */ // RCS ID line follows -- this is updated by CVS // $Id: ProjectFilePathsDlg.h 3375 2006-07-19 11:58:51Z kimmov $ #ifndef _PROJECTFILEPATHSDLG_H_ #define _PROJECTFILEPATHSDLG_H_ /** * @brief Dialog allowing user to load, edit and save project files. */ class ProjectFilePathsDlg : public CPropertyPage { DECLARE_DYNCREATE(ProjectFilePathsDlg) public: ProjectFilePathsDlg(); // standard constructor CString GetFilePath(); // Dialog Data //{{AFX_DATA(SaveClosingDlg) enum { IDD = IDD_PROJFILES_PATHS }; CString m_sLeftFile; CString m_sRightFile; CString m_sFilter; BOOL m_bIncludeSubfolders; BOOL m_bLeftPathReadOnly; BOOL m_bRightPathReadOnly; //}}AFX_DATA protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Generated message map functions //{{AFX_MSG(ProjectFilePathsDlg) afx_msg BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() CString AskProjectFileName(BOOL bOpen); // Implementation data private: CString m_sProjFilePath; /**< (Last/current) Path for project file */ public: void SetPaths(LPCTSTR left, LPCTSTR right); afx_msg void OnBnClickedProjLfileBrowse(); afx_msg void OnBnClickedProjRfileBrowse(); afx_msg void OnBnClickedProjFilterSelect(); afx_msg void OnBnClickedProjOpen(); afx_msg void OnBnClickedProjSave(); }; #endif // _PROJECTFILEPATHSDLG_H_
/* * Generated by asn1c-0.9.22 (http://lionet.info/asn1c) * From ASN.1 module "PKIXCMP" * found in "lpa2.asn1" * `asn1c -S/skeletons` */ #ifndef _RevDetails_H_ #define _RevDetails_H_ #include <asn_application.h> /* Including external dependencies */ #include "CertTemplate.h" #include "ReasonFlags.h" #include <GeneralizedTime.h> #include <constr_SEQUENCE.h> #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct Extensions; /* RevDetails */ typedef struct RevDetails { CertTemplate_t certDetails; ReasonFlags_t *revocationReason /* OPTIONAL */; GeneralizedTime_t *badSinceDate /* OPTIONAL */; struct Extensions *crlEntryDetails /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } RevDetails_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_RevDetails; #ifdef __cplusplus } #endif /* Referred external types */ #include "Extensions.h" #endif /* _RevDetails_H_ */
/* * startmenu.h * * Copyright (C) 1995-2001 Kenichi Kourai * * 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 qvwm; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _STARTMENU_H_ #define _STARTMENU_H_ #include "menu.h" class QvImage; class StartMenu : public Menu { private: Window logo; // window for logo mark in the left side Window* itemFocus; // transparent window for each item // this includes the parts of logo. private: static QvImage* imgLogoMark; // logo mark static QvImage* imgStart[2]; static const int LOGO_WIDTH = 21; public: StartMenu(MenuElem* mItem); ~StartMenu(); void MapMenu(); void UnmapMenu(); void DrawMenu(Window win); int FindItem(Window win); void ExecFunction(FuncNumber fn, int num); static void Initialize(); }; #endif // _STARTMENU_H_
#include <string.h> void *memcpy(void *dst, const void *src, size_t len) { char *tmp = dst; const char *s = src; while(len--) { *tmp++ = *s++; } return dst; } int strlen(const char *str) { int i = 0; char *tmp = (char *)str; while(*tmp != '\0') { tmp++; i++; } return i; } int strcmp(const char *str1, const char *str2) { while(*str1++ == *str2++) { if (*str1 == '\0') { break; } } return *str1 - *str2; } void *memset(void *str, int ch, size_t n) { int i; char *tmp = (char *)str; for (i = 0; i < n; i++) { *tmp++ = ch; } return str; }
// license:BSD-3-Clause // copyright-holders:Curt Coder /********************************************************************** XL 80 cartridge emulation **********************************************************************/ #pragma once #ifndef __XL80__ #define __XL80__ #include "emu.h" #include "exp.h" #include "video/mc6845.h" //************************************************************************** // TYPE DEFINITIONS //************************************************************************** // ======================> c64_xl80_device class c64_xl80_device : public device_t, public device_c64_expansion_card_interface { public: // construction/destruction c64_xl80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; virtual machine_config_constructor device_mconfig_additions() const override; // not really public MC6845_UPDATE_ROW( crtc_update_row ); protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; // device_c64_expansion_card_interface overrides virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override { return 1; } virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override { return 0; } private: required_device<h46505_device> m_crtc; required_device<palette_device> m_palette; required_memory_region m_char_rom; optional_shared_ptr<UINT8> m_ram; }; // device type definition extern const device_type C64_XL80; #endif
// ImGui Win32 + DirectX11 binding // In this binding, ImTextureID is used to store a 'ID3D11ShaderResourceView*' texture identifier. Read the FAQ about ImTextureID in imgui.cpp. // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui struct ID3D11Device; struct ID3D11DeviceContext; struct IDXGISwapChain; #include "../imgui.h" IMGUI_API bool ImGui_ImplDX11_Init (IDXGISwapChain* pSwapChain, ID3D11Device* device, ID3D11DeviceContext* device_context); IMGUI_API void ImGui_ImplDX11_Shutdown (); IMGUI_API void ImGui_ImplDX11_NewFrame (); // Use if you want to reset your rendering device without losing ImGui state. IMGUI_API void ImGui_ImplDX11_InvalidateDeviceObjects(); IMGUI_API bool ImGui_ImplDX11_CreateDeviceObjects(); // Handler for Win32 messages, update mouse/keyboard data. // You may or not need this for your implementation, but it can serve as reference for handling inputs. // Commented out to avoid dragging dependencies on <windows.h> types. You can copy the extern declaration in your code. /* IMGUI_API LRESULT ImGui_ImplDX11_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); */
/* * Copyright (C) 2006, 2018 by Rafael Santiago * * This is a free software. You can redistribute it and/or modify under * the terms of the GNU General Public License version 2. * */ #ifndef KRYPTOS_KRYPTOS_RC6_H #define KRYPTOS_KRYPTOS_RC6_H 1 #include <kryptos_types.h> #define KRYPTOS_RC6_BLOCKSIZE 16 KRYPTOS_DECL_CUSTOM_BLOCK_CIPHER_SETUP(rc6_128, ktask, int *rounds) KRYPTOS_DECL_BLOCK_CIPHER_PROCESSOR(rc6_128) KRYPTOS_DECL_CUSTOM_BLOCK_CIPHER_GCM_E(rc6_128, void *rounds) KRYPTOS_DECL_CUSTOM_BLOCK_CIPHER_SETUP(rc6_192, ktask, int *rounds) KRYPTOS_DECL_BLOCK_CIPHER_PROCESSOR(rc6_192) KRYPTOS_DECL_CUSTOM_BLOCK_CIPHER_GCM_E(rc6_192, void *rounds) KRYPTOS_DECL_CUSTOM_BLOCK_CIPHER_SETUP(rc6_256, ktask, int *rounds) KRYPTOS_DECL_BLOCK_CIPHER_PROCESSOR(rc6_256) KRYPTOS_DECL_CUSTOM_BLOCK_CIPHER_GCM_E(rc6_256, void *rounds) #endif
/* * Copyright (C) 2013-2020 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * This code is a complete clean re-write of the stress tool by * Colin Ian King <colin.king@canonical.com> and attempts to be * backwardly compatible with the stress tool by Amos Waterland * <apw@rossby.metr.ou.edu> but has more stress tests and more * functionality. * */ #include <unistd.h> int main(void) { return fchmodat(0, "", 0, 0); }
/***************************************************************************** * dbus-tracklist.h : dbus control module (mpris v1.0) - /TrackList object ***************************************************************************** * Copyright © 2006-2008 Rafaël Carré * Copyright © 2007-2010 Mirsal Ennaime * Copyright © 2009-2010 The VideoLAN team * $Id$ * * Authors: Mirsal ENNAIME <mirsal dot ennaime at gmail dot 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 _VLC_DBUS_TRACKLIST_H #define _VLC_DBUS_TRACKLIST_H #include <vlc_common.h> #include <vlc_interface.h> #include "dbus_common.h" #define DBUS_MPRIS_TRACKLIST_INTERFACE "org.freedesktop.MediaPlayer" #define DBUS_MPRIS_TRACKLIST_PATH "/TrackList" /* Handle incoming dbus messages */ DBusHandlerResult handle_tracklist ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this ); static const DBusObjectPathVTable dbus_mpris_tracklist_vtable = { NULL, handle_tracklist, /* handler function */ NULL, NULL, NULL, NULL }; int TrackListChangeEmit( intf_thread_t *, int, int ); #endif //dbus_tracklist.h
/* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson * Copyright (C) 2011-2013 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Convenience routines for manipulating files */ /* This .h cannot be included by itself; #include "share/grabbag.h" instead. */ #ifndef GRABAG__FILE_H #define GRABAG__FILE_H /* needed because of off_t */ #if HAVE_CONFIG_H # include <config.h> #endif #include <sys/types.h> /* for off_t */ #include <stdio.h> /* for FILE */ #include "FLAC/ordinals.h" #include "share/compat.h" #ifdef __cplusplus extern "C" { #endif void grabbag__file_copy_metadata(const char *srcpath, const char *destpath); FLAC__off_t grabbag__file_get_filesize(const char *srcpath); const char *grabbag__file_get_basename(const char *srcpath); /* read_only == false means "make file writable by user" * read_only == true means "make file read-only for everyone" */ FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only); /* returns true iff stat() succeeds for both files and they have the same device and inode. */ /* on windows, uses GetFileInformationByHandle() to compare */ FLAC__bool grabbag__file_are_same(const char *f1, const char *f2); /* attempts to make writable before unlinking */ FLAC__bool grabbag__file_remove_file(const char *filename); /* these will forcibly set stdin/stdout to binary mode (for OSes that require it) */ FILE *grabbag__file_get_binary_stdin(void); FILE *grabbag__file_get_binary_stdout(void); #ifdef __cplusplus } #endif #endif
#ifndef XPPAUT_ABORT_H #define XPPAUT_ABORT_H /* --- Functions --- */ int get_command_width(void); void plot_command(int nit, int icount, int cwidth); int my_abort(void); #endif /* XPPAUT_ABORT_H */
/***************************************************************************** * Free42 -- an HP-42S calculator simulator * Copyright (C) 2004-2019 Thomas Okken * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see http://www.gnu.org/licenses/. *****************************************************************************/ #import <UIKit/UIKit.h> @class RootViewController; @interface Free42AppDelegate : NSObject <UIApplicationDelegate> { RootViewController *rootViewController; } @property (nonatomic, retain) IBOutlet RootViewController *rootViewController; + (const char *) getVersion; @end
/* * kprobe - kprobe demo * * Written in 2012 by Prashant P Shah <pshah.mumbai@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kprobes.h> static struct kprobe kp; static unsigned int counter = 0; static int Pre_handler(struct kprobe *p, struct pt_regs *regs) { printk(KERN_INFO "mykprobe: %s = %d\n", __FUNCTION__, counter++); return 0; } static void Post_handler(struct kprobe *p, struct pt_regs *regs, unsigned long flags) { printk(KERN_INFO "mykprobe: %s = %d\n", __FUNCTION__, counter++); } static int __init mykprobe_init(void) { printk(KERN_INFO "mykprobe: %s\n", __FUNCTION__); kp.pre_handler = Pre_handler; kp.post_handler = Post_handler; kp.addr = (kprobe_opcode_t *)0xffffffff81445ce0; /* from /proc/kallsyms */ register_kprobe(&kp); return 0; } static void __exit mykprobe_exit(void) { printk(KERN_INFO "mykprobe: %s\n", __FUNCTION__); unregister_kprobe(&kp); } module_init(mykprobe_init); module_exit(mykprobe_exit); MODULE_LICENSE("Dual MIT/GPL"); MODULE_AUTHOR("Me");
/* * Copyright (C) 2018, STMicroelectronics - All Rights Reserved * Author(s): Antonio Borneo <borneo.antonio@gmail.com> for STMicroelectronics * * 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/>. */ /* * The content of this file is mainly copied/inspired from Linux kernel * code in include/linux/types.h include/linux/bitmap.h include/linux/bitops.h */ #ifndef OPENOCD_HELPER_BITS_H #define OPENOCD_HELPER_BITS_H #include <helper/types.h> #define BIT(nr) (1UL << (nr)) #define BITS_PER_BYTE 8 #define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define DECLARE_BITMAP(name, bits) unsigned long name[BITS_TO_LONGS(bits)] /** * bitmap_zero - Clears all the bits in memory * @param dst the address of the bitmap * @param nbits the number of bits to clear */ static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) { unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); memset(dst, 0, len); } /** * clear_bit - Clear a bit in memory * @param nr the bit to set * @param addr the address to start counting from */ static inline void clear_bit(unsigned int nr, volatile unsigned long *addr) { unsigned long mask = BIT_MASK(nr); unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); *p &= ~mask; } /** * set_bit - Set a bit in memory * @param nr the bit to set * @param addr the address to start counting from */ static inline void set_bit(unsigned int nr, volatile unsigned long *addr) { unsigned long mask = BIT_MASK(nr); unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); *p |= mask; } /** * test_bit - Determine whether a bit is set * @param nr bit number to test * @param addr Address to start counting from */ static inline int test_bit(unsigned int nr, const volatile unsigned long *addr) { return 1UL & (addr[BIT_WORD(nr)] >> (nr % BITS_PER_LONG)); } #endif /* OPENOCD_HELPER_BITS_H */
/*! \file debug.h * \b 接口说明: * * * \b 功能描述: * * 调试信息打印 * * \b 历史记录: * * <作者> <时间> <修改记录> <br> * zuokongxiao 2014-06-12 创建文件 <br> */ #ifndef __DEBUG_H #define __DEBUG_H /******************************************************************************/ /* 头文件 */ /******************************************************************************/ #include <stdio.h> #include <string.h> #include <ctype.h> #include <errno.h> /******************************************************************************/ /* 宏定义 */ /******************************************************************************/ /*! 配置是否输出调试信息 */ #define PRINTF_MSG_EN (1) /*! 配置是否输出调试信息 */ #define DEBUG_MSG_EN (2) /*! 配置是否输出错误信息 */ #define ERROR_MSG_EN (1) /*! printf 宏定义 */ #if PRINTF_MSG_EN > 0 #define PRINTF_MSG(arg...) printf(##arg) #else #define PRINTF_MSG(arg...) ((void)0) #endif /*! 调试信息 */ #if DEBUG_MSG_EN == 1 //普通打印 #define PRINTF_MSG(arg...) printf(##arg) #elif DEBUG_MSG_EN == 2 //打印文件名、行号 #define DEBUG_MSG(format,arg...) do{ \ print_run_time(__FILE__, __LINE__); \ printf(format, ##arg); \ } while(0) #elif DEBUG_MSG_EN == 3 //打印文件名、行号、函数名 #define DEBUG_MSG(format,arg...) do{ \ print_run_time(__FILE__, __LINE__); \ printf("[F:%s] "format, __FUNCTION__, ##arg); \ } while(0) #else #define DEBUG_MSG(arg) ((void)0) #endif /*! 错误信息 */ #if ERROR_MSG_EN == 1 #define ERROR_MSG(format,arg...) do{ \ print_run_time(__FILE__, __LINE__); \ printf("[E:%s] "format, strerror(errno), ##arg); \ } while(0) #else #define ERROR_MSG() ((void)0) #endif /******************************************************************************/ /* 外部接口函数声明 */ /******************************************************************************/ void print_run_time(char *pFile, int lLine); #endif /*!< end __DEBUG_H */ /********************************end of file***********************************/
#include "armsim.h" int main(int argc, char *argv[]) { printf("%d\n%s\n%s\n",argc+1,argv[0],argv[1]); return 0; }
#ifndef DEF_TRANSMOGRIFICATION_H #define DEF_TRANSMOGRIFICATION_H #define PRESETS // comment this line to disable preset feature totally #define MAX_OPTIONS 25 // do not alter class Item; class Player; class WorldSession; struct ItemTemplate; enum TransmogTrinityStrings // Language.h might have same entries, appears when executing SQL, change if needed { LANG_ERR_TRANSMOG_OK = 11100, // change this LANG_ERR_TRANSMOG_INVALID_SLOT, LANG_ERR_TRANSMOG_INVALID_SRC_ENTRY, LANG_ERR_TRANSMOG_MISSING_SRC_ITEM, LANG_ERR_TRANSMOG_MISSING_DEST_ITEM, LANG_ERR_TRANSMOG_INVALID_ITEMS, LANG_ERR_TRANSMOG_NOT_ENOUGH_MONEY, LANG_ERR_TRANSMOG_NOT_ENOUGH_TOKENS, LANG_ERR_UNTRANSMOG_OK, LANG_ERR_UNTRANSMOG_NO_TRANSMOGS, #ifdef PRESETS LANG_PRESET_ERR_INVALID_NAME, #endif }; class Transmogrification { private: Transmogrification() { }; ~Transmogrification() { }; Transmogrification(const Transmogrification&); Transmogrification& operator=(const Transmogrification&); public: static Transmogrification* instance() { // Thread safe in C++11 standard static Transmogrification instance; return &instance; } #ifdef PRESETS bool EnableSetInfo; uint32 SetNpcText; bool EnableSets; uint8 MaxSets; float SetCostModifier; int32 SetCopperCost; void LoadPlayerSets(Player* player); void PresetTransmog(Player* player, Item* itemTransmogrified, uint32 fakeEntry, uint8 slot); #endif bool EnableTransmogInfo; uint32 TransmogNpcText; // Use IsAllowed() and IsNotAllowed() // these are thread unsafe, but assumed to be static data so it should be safe std::set<uint32> Allowed; std::set<uint32> NotAllowed; float ScaledCostModifier; int32 CopperCost; bool RequireToken; uint32 TokenEntry; uint32 TokenAmount; bool AllowPoor; bool AllowCommon; bool AllowUncommon; bool AllowRare; bool AllowEpic; bool AllowLegendary; bool AllowArtifact; bool AllowHeirloom; bool AllowMixedArmorTypes; bool AllowMixedWeaponTypes; bool AllowFishingPoles; bool IgnoreReqRace; bool IgnoreReqClass; bool IgnoreReqSkill; bool IgnoreReqSpell; bool IgnoreReqLevel; bool IgnoreReqEvent; bool IgnoreReqStats; bool IsAllowed(uint32 entry) const; bool IsNotAllowed(uint32 entry) const; bool IsAllowedQuality(uint32 quality) const; bool IsRangedWeapon(uint32 Class, uint32 SubClass) const; void LoadConfig(bool reload); // thread unsafe std::string GetItemIcon(uint32 entry, uint32 width, uint32 height, int x, int y) const; std::string GetSlotIcon(uint8 slot, uint32 width, uint32 height, int x, int y) const; const char * GetSlotName(uint8 slot, WorldSession* session) const; std::string GetItemLink(Item* item, WorldSession* session) const; std::string GetItemLink(uint32 entry, WorldSession* session) const; uint32 GetFakeEntry(const Item* item); void UpdateItem(Player* player, Item* item) const; void DeleteFakeEntry(Player* player, Item* item); void SetFakeEntry(Player* player, Item* item, uint32 entry); TransmogTrinityStrings Transmogrify(Player* player, uint64 itemGUID, uint8 slot, bool no_cost = false); bool CanTransmogrifyItemWithItem(Player* player, ItemTemplate const* destination, ItemTemplate const* source) const; bool SuitableForTransmogrification(Player* player, ItemTemplate const* proto) const; // bool CanBeTransmogrified(Item const* item); // bool CanTransmogrify(Item const* item); uint32 GetSpecialPrice(ItemTemplate const* proto) const; std::vector<uint64> GetItemList(const Player* player) const; }; #define sTransmogrification Transmogrification::instance() #endif
#ifndef ES705_RWDB_H #define ES705_RWDB_H /* MQ100 states */ #define MQ100_STATE_RESET (0) #define MQ100_STATE_NORMAL (1) struct es705_rwdb_device_callbacks; /** * Register rdb callbacks * @param callbacks - structure containing * callbacks from es705 rdb/wdb driver * @return */ int es705_rdb_register(const struct es705_rwdb_device_callbacks *callbacks); /** * Note: can we expect all of these * functions to be executed in process context? */ struct es705_rwdb_device_callbacks { /** * cookie using for callbacks */ void *priv; /** * Callback when firmware has been downloaded, device has been * initialized and is ready for rdb/wdb * * @param es705_priv - es705 private data. this cookie will be * returned with all calls to es705_wdb * @return on success, a pointer to the callee's private data, * this cookie must be returned with every other callback * on failure, return NULL */ void * (*probe)(void *es705_priv); /** * This function is called when audience driver * has detected the an interrupt from the device * @param priv - cookie returned from probe() */ void (*intr)(void *priv); /** * Callback whenever the device state changes. * e.g. when firmware has been downloaded * Use MQ100_STATE_XXX values for state param. * @param priv - cookie returned from probe() */ void (*status)(void *priv, u8 state); }; /* * Writes buf to es705 using wdb * this function will prepend 0x802F 0xffff * @param: buf - wdb data * @param: len - length * @return: no. of bytes written */ int es705_wdb(const void *buf, int len); /* * Reads buf from es705 using rdb * @param: buf - rdb data Max Size supported * - 2*PAGE_SIZE Ensure buffer allocated has enough space * for rdb * @param: id - type specifier * @return: no. of bytes read */ int es705_rdb(void *buf, int id); int es705_rdb_register(const struct es705_rwdb_device_callbacks *callbacks); #endif
/********************************************************************** ** Copyright (C) 2001 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef LIBFLASH_PLUGIN_H #define LIBFLASH_PLUGIN_H #include <qstring.h> #include <qapplication.h> #include "flash.h" #include <qpe/mediaplayerplugininterface.h> class LibFlashPlugin : public MediaPlayerDecoder { public: LibFlashPlugin(); ~LibFlashPlugin() { close(); } const char *pluginName() { return "LibFlashPlugin: " PLUGIN_NAME " " FLASH_VERSION_STRING; } const char *pluginComment() { return "This is the libflash library: " PLUGIN_NAME " " FLASH_VERSION_STRING; } double pluginVersion() { return 1.0; } bool isFileSupported( const QString& fileName ) { return fileName.right(4) == ".swf"; } bool open( const QString& fileName ); bool close() { FlashClose( file ); file = NULL; return TRUE; } bool isOpen() { return file != NULL; } const QString &fileInfo() { return strInfo = qApp->translate( "MediaPlayer", "No Information Available", "media plugin text" ); } // If decoder doesn't support audio then return 0 here int audioStreams() { return 1; } int audioChannels( int /*stream*/ ) { return 2; } int audioFrequency( int /*stream*/ ) { return 44100; } int audioSamples( int /*stream*/ ) { return 1000000; } bool audioSetSample( long sample, int stream ); long audioGetSample( int stream ); //bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); //bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); //bool audioReadSamples( short *output, int channel, long samples, int stream ); //bool audioReReadSamples( short *output, int channel, long samples, int stream ); // If decoder doesn't support video then return 0 here int videoStreams(); int videoWidth( int stream ); int videoHeight( int stream ); double videoFrameRate( int stream ); int videoFrames( int stream ); bool videoSetFrame( long frame, int stream ); long videoGetFrame( int stream ); bool videoReadFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, ColorFormat color_model, int stream ); bool videoReadScaledFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, ColorFormat color_model, int stream ); bool videoReadYUVFrame( char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h, int stream ); // Profiling double getTime(); // Ignore if these aren't supported bool setSMP( int cpus ); bool setMMX( bool useMMX ); // Capabilities bool supportsAudio() { return TRUE; } bool supportsVideo() { return TRUE; } bool supportsYUV() { return TRUE; } bool supportsMMX() { return TRUE; } bool supportsSMP() { return TRUE; } bool supportsStereo() { return TRUE; } bool supportsScaling() { return TRUE; } private: FlashHandle file; FlashDisplay *fd; QString strInfo; }; #endif
#ifndef SELECTMAP_H #define SELECTMAP_H #include <QDialog> #include <QHash> #include <QSqlDatabase> #include <QSqlRelationalTableModel> #include <QSqlQuery> #include <QSqlError> #include <QSqlResult> #include <QString> namespace Ui { class SelectMap; } class SelectMap : public QDialog { Q_OBJECT public: explicit SelectMap(QWidget *parent = 0); ~SelectMap(); int id; void setup(QString table); private: Ui::SelectMap *ui; private slots: void on_buttonBox_rejected(); void on_buttonBox_accepted(); }; #endif // SELECTMAP_H
// pk 4/05 int MatrixExpEigenPrepare void MatrixExp(Matrix& A, Real t, Matrix& Exp); void Eigenvector(Matrix& A, Real ev, ColumnVector& C, Matrix& A_inv, bool right); int MatrixExpEigenPrepare(Matrix& A, ColumnVector& V, Matrix& U, Matrix& Uinv, SimpleIntArray& Cplx); void MatrixExpEigen(Matrix& Mexp, ColumnVector& V, Matrix& U, Matrix& Uinv, SimpleIntArray& Cplx, Real t); void LUDecompose(Matrix& A, SimpleIntArray& Indx, double& pd); void InvertMatrix(Matrix& A, Matrix& A_inv); void LUBackSubst(Matrix& A, SimpleIntArray& Indx, ColumnVector& B); // body file: nm_exp.cpp
/* File: WaveDriverAirportExtreme.h Program: KisMAC Author: Michael Roßberg mick@binaervarianz.de Changes: Vitalii Parovishnyk(1012-2015) Description: KisMAC is a wireless stumbler for MacOS X. This file is part of KisMAC. Most parts of this file are based on aircrack by Christophe Devine. KisMAC 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; KisMAC 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 KisMAC; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import "WaveDriver.h" enum APExtType { APExtTypeUnknown, APExtTypeBcm, APExtTypeAth5414 }; #define DLT_PRISM_HEADER 119 #define DLT_IEEE802_11 105 #define DLT_IEEE802_11_RADIO_AVS 163 #define DLT_IEEE802_11_RADIO 127 #define DLT_TYPE_ERR -1 @class CWInterface; @interface WaveDriverAirportExtreme : WaveDriver { enum APExtType _apeType; int DLTType; CWInterface * airportInterface; } @end
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2022 UniPro <ugene@unipro.ru> * http://ugene.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef _U2_MYSQL_ASSEMBLY_ADAPTER_H_ #define _U2_MYSQL_ASSEMBLY_ADAPTER_H_ #include <U2Core/U2Assembly.h> #include "MysqlHelpers.h" #include "util/AssemblyAdapter.h" #include "util/AssemblyPackAlgorithm.h" namespace U2 { class U2OpStatus; class U2AssemblyReadsImportInfo; class MysqlAssemblyAdapter : public AssemblyAdapter { public: MysqlAssemblyAdapter(const U2DataId& assemblyId, const AssemblyCompressor* compressor, MysqlDbRef* ref); protected: MysqlDbRef* db; }; class MysqlAssemblyNameFilter : public MysqlRSFilter<U2AssemblyRead> { public: MysqlAssemblyNameFilter(const QByteArray& expectedName); virtual bool filter(const U2AssemblyRead& r); protected: QByteArray name; }; class MysqlSimpleAssemblyReadLoader : public MysqlRSLoader<U2AssemblyRead> { public: U2AssemblyRead load(U2SqlQuery* q); }; class MysqlSimpleAssemblyReadPackedDataLoader : public MysqlRSLoader<PackAlgorithmData> { public: virtual PackAlgorithmData load(U2SqlQuery* q); }; } // namespace U2 #endif // _U2_MYSQL_ASSEMBLY_ADAPTER_H_