text
stringlengths
4
6.14k
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>. */ #include <grub/term.h> #include <grub/err.h> #include <grub/mm.h> #include <grub/misc.h> #include <grub/env.h> #include <grub/time.h> struct grub_term_output *grub_term_outputs_disabled; struct grub_term_input *grub_term_inputs_disabled; struct grub_term_output *grub_term_outputs; struct grub_term_input *grub_term_inputs; /* Current color state. */ grub_uint8_t grub_term_normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR; grub_uint8_t grub_term_highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR; void (*grub_term_poll_usb) (int wait_for_completion) = NULL; void (*grub_net_poll_cards_idle) (void) = NULL; /* Put a Unicode character. */ static void grub_putcode_dumb (grub_uint32_t code, struct grub_term_output *term) { struct grub_unicode_glyph c = { .base = code, .variant = 0, .attributes = 0, .ncomb = 0, .combining = 0, .estimated_width = 1 }; if (code == '\t' && term->getxy) { int n; n = GRUB_TERM_TAB_WIDTH - ((term->getxy (term) >> 8) % GRUB_TERM_TAB_WIDTH); while (n--) grub_putcode_dumb (' ', term); return; } (term->putchar) (term, &c); if (code == '\n') grub_putcode_dumb ('\r', term); } static void grub_xputs_dumb (const char *str) { for (; *str; str++) { grub_term_output_t term; grub_uint32_t code = *str; if (code > 0x7f) code = '?'; FOR_ACTIVE_TERM_OUTPUTS(term) grub_putcode_dumb (code, term); } } void (*grub_xputs) (const char *str) = grub_xputs_dumb; int grub_getkey_noblock (void) { grub_term_input_t term; if (grub_term_poll_usb) grub_term_poll_usb (0); if (grub_net_poll_cards_idle) grub_net_poll_cards_idle (); FOR_ACTIVE_TERM_INPUTS(term) { int key = term->getkey (term); if (key != GRUB_TERM_NO_KEY) return key; } return GRUB_TERM_NO_KEY; } int grub_getkey (void) { int ret; grub_refresh (); while (1) { ret = grub_getkey_noblock (); if (ret != GRUB_TERM_NO_KEY) return ret; grub_cpu_idle (); } } void grub_refresh (void) { struct grub_term_output *term; FOR_ACTIVE_TERM_OUTPUTS(term) grub_term_refresh (term); }
#ifndef MISSION_SERVICE_H #define MISSION_SERVICE_H // Qt #include <QObject> // Internal #include "dto_traits.h" #include "mission_item.h" namespace domain { class MissionService: public QObject { Q_OBJECT public: explicit MissionService(QObject* parent = nullptr); ~MissionService() override; dto::MissionPtr mission(int id) const; dto::MissionItemPtr missionItem(int id) const; dto::MissionAssignmentPtr assignment(int id) const; dto::MissionAssignmentPtr missionAssignment(int missionId) const; dto::MissionAssignmentPtr vehicleAssignment(int vehicleId) const; dto::MissionItemPtrList missionItems(int missionId) const; dto::MissionItemPtr missionItem(int missionId, int sequence) const; dto::MissionPtrList missions() const; dto::MissionItemPtrList missionItems() const; dto::MissionAssignmentPtrList missionAssignments() const; dto::MissionItemPtr currentWaypoint(int vehicleId) const; int isCurrentForVehicle(const dto::MissionItemPtr& item) const; dto::MissionItemPtr addNewMissionItem(int missionId, dto::MissionItem::Command command, int sequence, const QGeoCoordinate& coordinate = QGeoCoordinate()); void addNewMission(const QString& name, const QGeoCoordinate& coordinate); bool save(const dto::MissionPtr& mission); bool save(const dto::MissionItemPtr& item); bool save(const dto::MissionAssignmentPtr& assignment); bool remove(const dto::MissionPtr& mission); bool remove(const dto::MissionItemPtr& item); bool remove(const dto::MissionAssignmentPtr& assignment); public slots: void unload(const dto::MissionPtr& mission); void unload(const dto::MissionItemPtr& item); void unload(const dto::MissionAssignmentPtr& assignment); void fixMissionItemOrder(int missionId); void fixMissionItemCount(int missionId); void assign(int missionId, int vehicleId); void unassign(int missionId); void setCurrentItem(int vehicleId, const dto::MissionItemPtr& current); void swapItems(const dto::MissionItemPtr& first, const dto::MissionItemPtr& second); void onVehicleChanged(const dto::VehiclePtr& vehicle); signals: void missionAdded(dto::MissionPtr mission); void missionRemoved(dto::MissionPtr mission); void missionChanged(dto::MissionPtr mission); void missionItemAdded(dto::MissionItemPtr item); void missionItemRemoved(dto::MissionItemPtr item); void missionItemChanged(dto::MissionItemPtr item); void currentItemChanged(int vehicleId, dto::MissionItemPtr oldOne, dto::MissionItemPtr newOne); void assignmentAdded(dto::MissionAssignmentPtr assignment); void assignmentRemoved(dto::MissionAssignmentPtr assignment); void assignmentChanged(dto::MissionAssignmentPtr assignment); void download(dto::MissionAssignmentPtr assignment); void upload(dto::MissionAssignmentPtr assignment); void cancelSync(dto::MissionAssignmentPtr assignment); private: class Impl; QScopedPointer<Impl> const d; }; } #endif // MISSION_SERVICE_H
#include <boost/filesystem.hpp> #include <utility> #include "OpenCLWrapper/Device.h" namespace fs = boost::filesystem; std::pair<unsigned int, unsigned int> readAMDRegistersNumber( const Device& device, const std::string& kernelName); std::pair<unsigned int, unsigned int> readOldAMDRegistersNumber( const Device& device, const std::string& kernelName); std::pair<unsigned int, unsigned int> readNewAMDRegistersNumber( const Device& device, const std::string& kernelName); void checkDirectory(const fs::path& directory); fs::path getIsaFile(const fs::path& directory, const std::string& kernelName); unsigned int getRegistersNumber(const std::string& isaContent, const std::string registerTypeName); unsigned int getOldRegistersNumber(const std::string& isaContent, const std::string registerTypeName);
#include "../includes/cfrtil.h" void CfrTil_CommentToEndOfLine ( ) { ReadLiner_CommentToEndOfLine ( _Context_->ReadLiner0 ) ; String_RemoveEndWhitespaceAndAddNewline ( _CfrTil_->SourceCodeScratchPad ) ; _CfrTil_UnAppendTokenFromSourceCode ( _Context_->Lexer0->OriginalToken ) ; SC_ScratchPadIndex_Init ( ) ; SetState ( _Context_->Lexer0, END_OF_LINE, true ) ; } void CfrTil_ParenthesisComment ( ) { while ( 1 ) { int inChar = ReadLine_PeekNextChar ( _Context_->ReadLiner0 ) ; if ( ( inChar == - 1 ) || ( inChar == eof ) ) break ; char * token = ( char* ) Lexer_ReadToken ( _Context_->Lexer0 ) ; if ( strcmp ( token, "*/" ) == 0 ) return ; } } void CfrTil_If_ConditionalInterpret ( ) { _CfrTil_ConditionalInterpret ( 1 ) ; } void CfrTil_Else_ConditionalInterpret ( ) { _CfrTil_ConditionalInterpret ( 0 ) ; } void CfrTil_Interpreter_IsDone ( ) { _DataStack_Push ( Interpreter_GetState ( _Context_->Interpreter0, END_OF_FILE | END_OF_STRING | INTERPRETER_DONE ) ) ; } void CfrTil_Interpreter_Done ( ) { Interpreter_SetState ( _Context_->Interpreter0, INTERPRETER_DONE, true ) ; } void CfrTil_Interpreter_Init ( ) { Interpreter_Init ( _Context_->Interpreter0 ) ; } void CfrTil_InterpretNextToken ( ) { Interpreter_InterpretNextToken ( _Context_->Interpreter0 ) ; } void CfrTil_Interpret ( ) { _Context_InterpretFile ( _Context_ ) ; } void CfrTil_InterpretPromptedLine ( ) { _DoPrompt ( ) ; Context_Interpret ( _CfrTil_->Context0 ) ; } void CfrTil_InterpretString ( ) { _InterpretString ( ( byte* ) _DataStack_Pop ( ) ) ; } void CfrTil_Interpreter_EvalWord ( ) { _Interpreter_Do_MorphismWord ( _Context_->Interpreter0, ( Word* ) _DataStack_Pop ( ) ) ; } void CfrTil_InterpretALiteralToken ( ) { Lexer_ObjectToken_New ( _Context_->Lexer0, ( byte* ) _DataStack_Pop ( ), 1 ) ; } void _CfrTil_Interpret ( CfrTil * cfrTil ) { do { _CfrTil_Init_SessionCore ( cfrTil, 1, 1 ) ; Context_Interpret ( cfrTil->Context0 ) ; } while ( GetState ( cfrTil, CFRTIL_RUN ) ) ; } void CfrTil_InterpreterRun ( ) { _CfrTil_Interpret ( _CfrTil_ ) ; } void CfrTil_InterpreterStop ( ) { SetState ( _Context_->Interpreter0, INTERPRETER_DONE, true ) ; SetState ( _CfrTil_, CFRTIL_RUN, false ) ; }
/** * Copyright (C) 2009 Alex Revetchi * * Siplexd is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _LOGGER_H #define _LOGGER_H #include <syslog.h> #ifdef __cplusplus extern "C" { #endif #define RC_OK (0) #define RC_ERR (-1) enum logLEVEL { lvlFATAL, lvlERROR, lvlWARNING, lvlINFO, lvlDEBUG }; void log_init(void); void log_main ( const char* label, const int log_level, const char* const file, const size_t line, const char* format, ... ); void log_flush(void); #if defined(DEBUG) #define logDEBUG(L...)\ log_main("DEBUG:", lvlDEBUG, __FILE__, __LINE__,L) /* Trace function entry */ #define __tri(__FNAME__)\ static const char* __fname = (#__FNAME__"(...)");\ logDEBUG("Entering %s ...", __fname) /* Trace function exit */ #define __tre(opr)\ logDEBUG("Exiting %s ...", __fname);\ opr #else #define logDEBUG(L...) 0 #define __tri(name) 0 #define __tre(opr) opr #endif #define logINFO(L...)\ log_main("INFO:", lvlINFO, __FILE__, __LINE__,L) #define logWARNING(L...)\ log_main("WARNING:", lvlWARNING, __FILE__, __LINE__,L) #define logERROR(L...)\ log_main("ERROR:", lvlERROR, __FILE__, __LINE__,L) #define logFATAL(L...)\ log_main("FATAL:", lvlFATAL, __FILE__, __LINE__,L) #ifdef __cplusplus } #endif #endif /* _LOGGER_H */
#ifndef MFD_TMIO_H #define MFD_TMIO_H #include <linux/device.h> #include <linux/fb.h> #include <linux/io.h> #include <linux/jiffies.h> #include <linux/mmc/card.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #define tmio_ioread8(addr) readb(addr) #define tmio_ioread16(addr) readw(addr) #define tmio_ioread16_rep(r, b, l) readsw(r, b, l) #define tmio_ioread32(addr) \ (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16)) #define tmio_iowrite8(val, addr) writeb((val), (addr)) #define tmio_iowrite16(val, addr) writew((val), (addr)) #define tmio_iowrite16_rep(r, b, l) writesw(r, b, l) #define tmio_iowrite32(val, addr) \ do { \ writew((val), (addr)); \ writew((val) >> 16, (addr) + 2); \ } while (0) #define CNF_CMD 0x04 #define CNF_CTL_BASE 0x10 #define CNF_INT_PIN 0x3d #define CNF_STOP_CLK_CTL 0x40 #define CNF_GCLK_CTL 0x41 #define CNF_SD_CLK_MODE 0x42 #define CNF_PIN_STATUS 0x44 #define CNF_PWR_CTL_1 0x48 #define CNF_PWR_CTL_2 0x49 #define CNF_PWR_CTL_3 0x4a #define CNF_CARD_DETECT_MODE 0x4c #define CNF_SD_SLOT 0x50 #define CNF_EXT_GCLK_CTL_1 0xf0 #define CNF_EXT_GCLK_CTL_2 0xf1 #define CNF_EXT_GCLK_CTL_3 0xf9 #define CNF_SD_LED_EN_1 0xfa #define CNF_SD_LED_EN_2 0xfe #define SDCREN 0x2 /* Enable access to MMC CTL regs. (flag in COMMAND_REG)*/ #define sd_config_write8(base, shift, reg, val) \ tmio_iowrite8((val), (base) + ((reg) << (shift))) #define sd_config_write16(base, shift, reg, val) \ tmio_iowrite16((val), (base) + ((reg) << (shift))) #define sd_config_write32(base, shift, reg, val) \ do { \ tmio_iowrite16((val), (base) + ((reg) << (shift))); \ tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ } while (0) /* tmio MMC platform flags */ #define TMIO_MMC_WRPROTECT_DISABLE (1 << 0) /* * Some controllers can support a 2-byte block size when the bus width * is configured in 4-bit mode. */ #define TMIO_MMC_BLKSZ_2BYTES (1 << 1) /* * Some controllers can support SDIO IRQ signalling. */ #define TMIO_MMC_SDIO_IRQ (1 << 2) /* Some features are only available or tested on RCar Gen2 or later */ #define TMIO_MMC_MIN_RCAR2 (1 << 3) /* * Some controllers require waiting for the SD bus to become * idle before writing to some registers. */ #define TMIO_MMC_HAS_IDLE_WAIT (1 << 4) /* * A GPIO is used for card hotplug detection. We need an extra flag for this, * because 0 is a valid GPIO number too, and requiring users to specify * cd_gpio < 0 to disable GPIO hotplug would break backwards compatibility. */ #define TMIO_MMC_USE_GPIO_CD (1 << 5) /* * Some controllers doesn't have over 0x100 register. * it is used to checking accessibility of * CTL_SD_CARD_CLK_CTL / CTL_CLK_AND_WAIT_CTL */ #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) /* * Some controllers have CMD12 automatically * issue/non-issue register */ #define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) /* * Some controllers needs to set 1 on SDIO status reserved bits */ #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) /* * Some controllers allows to set SDx actual clock */ #define TMIO_MMC_CLK_ACTUAL (1 << 10) int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); struct dma_chan; /* * data for the MMC controller */ struct tmio_mmc_data { void *chan_priv_tx; void *chan_priv_rx; unsigned int hclk; unsigned long capabilities; unsigned long capabilities2; unsigned long flags; u32 ocr_mask; /* available voltages */ unsigned int cd_gpio; int alignment_shift; dma_addr_t dma_rx_offset; void (*set_pwr)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state); }; /* * data for the NAND controller */ struct tmio_nand_data { struct nand_bbt_descr *badblock_pattern; struct mtd_partition *partition; unsigned int num_partitions; }; #define FBIO_TMIO_ACC_WRITE 0x7C639300 #define FBIO_TMIO_ACC_SYNC 0x7C639301 struct tmio_fb_data { int (*lcd_set_power)(struct platform_device *fb_dev, bool on); int (*lcd_mode)(struct platform_device *fb_dev, const struct fb_videomode *mode); int num_modes; struct fb_videomode *modes; /* in mm: size of screen */ int height; int width; }; #endif
/* * Copyright (C) 2015 Adrien Vergé * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <openssl/err.h> #include <openssl/ssl.h> #include <string.h> #define ERR_SSL_AGAIN 0 #define ERR_SSL_CLOSED -1 #define ERR_SSL_CERT -2 #define ERR_SSL_EOF -3 #define ERR_SSL_PROTOCOL -4 #define ERR_SSL_SEE_ERRNO -5 #define ERR_SSL_SEE_SSLERR -6 #define ERR_SSL_UNKNOWN -7 static inline const char *err_ssl_str(int code) { if (code == ERR_SSL_AGAIN) return "Try again"; else if (code == ERR_SSL_CLOSED) return "Connection closed"; else if (code == ERR_SSL_CERT) return "Want X509 lookup"; else if (code == ERR_SSL_EOF) return "Protocol violation with EOF"; else if (code == ERR_SSL_PROTOCOL) return "Protocol error"; else if (code == ERR_SSL_SEE_ERRNO) return strerror(errno); else if (code == ERR_SSL_SEE_SSLERR) return ERR_error_string(ERR_peek_last_error(), NULL); return "unknown"; } static inline int handle_ssl_error(SSL *ssl, int ret) { int code; if (SSL_get_shutdown(ssl) & SSL_RECEIVED_SHUTDOWN) return ERR_SSL_CLOSED; code = SSL_get_error(ssl, ret); if (code == SSL_ERROR_WANT_READ || code == SSL_ERROR_WANT_WRITE) return ERR_SSL_AGAIN; // The caller should try again if (code == SSL_ERROR_ZERO_RETURN) return ERR_SSL_CLOSED; if (code == SSL_ERROR_WANT_X509_LOOKUP) return ERR_SSL_CERT; if (code == SSL_ERROR_SYSCALL) { if (ERR_peek_last_error() != 0) return ERR_SSL_SEE_SSLERR; if (ret == 0) return ERR_SSL_EOF; if (errno == EAGAIN || errno == ERESTART || errno == EINTR) return ERR_SSL_AGAIN; // The caller should try again if (errno == EPIPE) return ERR_SSL_CLOSED; return ERR_SSL_SEE_ERRNO; } if (code == SSL_ERROR_SSL) return ERR_SSL_PROTOCOL; return ERR_SSL_UNKNOWN; } /* * Reads data from the SSL connection. * * @return > 0 in case of success (number of bytes transfered) * ERR_SSL_AGAIN if the caller should try again * < 0 in case of error */ static inline int safe_ssl_read(SSL *ssl, uint8_t *buf, int bufsize) { int ret; ret = SSL_read(ssl, buf, bufsize); if (ret > 0) return ret; return handle_ssl_error(ssl, ret); } /* * Reads all data from the SSL connection. * * @return 1 in case of success * < 0 in case of error */ static inline int safe_ssl_read_all(SSL *ssl, uint8_t *buf, int bufsize) { int ret, n = 0; while (n < bufsize) { ret = safe_ssl_read(ssl, &buf[n], bufsize - n); if (ret == ERR_SSL_AGAIN) continue; else if (ret < 0) return ret; n += ret; } return 1; } /* * Writes data to the SSL connection. * * Since SSL_MODE_ENABLE_PARTIAL_WRITE is not set by default (see man * SSL_get_mode), SSL_write() will only report success once the complete chunk * has been written. * * @return > 0 in case of success (number of bytes transfered) * ERR_SSL_AGAIN if the caller should try again * < 0 in case of error */ static inline int safe_ssl_write(SSL *ssl, const uint8_t *buf, int n) { int ret; ret = SSL_write(ssl, buf, n); if (ret > 0) return ret; return handle_ssl_error(ssl, ret); }
/* This file is part of Stirrup. Stirrup is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Stirrup 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 Stirrup. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LOGGING_H #define LOGGING_H #include <Arduino.h> #define INFO_SYMBOL "[info]" #define WARNING_SYMBOL "[/warning/]" #define ERROR_SYMBOL "[!ERROR!]" class Logging { public: static void info(String message); static void info_nonl(String message); static void warning(String message); static void error(String message); }; #endif
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * Roadmap * Copyright (C) Álvaro Peña 2012 <alvaropg@oriwork> * Roadmap is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Roadmap 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 _ROADMAP_ENGINE_H_ #define _ROADMAP_ENGINE_H_ #include <glib-object.h> G_BEGIN_DECLS #define ROADMAP_TYPE_ENGINE (roadmap_engine_get_type ()) #define ROADMAP_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ROADMAP_TYPE_ENGINE, RoadmapEngine)) #define ROADMAP_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ROADMAP_TYPE_ENGINE, RoadmapEngineClass)) #define ROADMAP_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ROADMAP_TYPE_ENGINE)) #define ROADMAP_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ROADMAP_TYPE_ENGINE)) #define ROADMAP_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ROADMAP_TYPE_ENGINE, RoadmapEngineClass)) typedef struct _RoadmapEngineClass RoadmapEngineClass; typedef struct _RoadmapEngine RoadmapEngine; typedef struct _RoadmapEnginePrivate RoadmapEnginePrivate; struct _RoadmapEngineClass { GObjectClass parent_class; }; struct _RoadmapEngine { GObject parent_instance; RoadmapEnginePrivate *priv; }; GType roadmap_engine_get_type (void) G_GNUC_CONST; GList *roadmap_engine_get_tickets (RoadmapEngine *self, gchar *username); RoadmapEngine *roadmap_engine_new (); G_END_DECLS #endif /* _ROADMAP_ENGINE_H_ */
#include "rb_includes.h" /* @overload valid_encoding? * @return [Boolean] True if the receiver contains only valid UTF-8 * sequences */ VALUE rb_u_string_valid_encoding(VALUE self) { const struct rb_u_string *string = RVAL2USTRING(self); return u_valid(USTRING_STR(string), USTRING_LENGTH(string), NULL) ? Qtrue : Qfalse; }
#include <CODEPORTS/codeports.h> #include "codeports.h" void INPUT_Init(void) { } void INPUT_Final(void) { }
// include/kernel/process.h // include/kernel/process.h is part of Kylux. // // Kylux is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Kylux 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 Kylux. If not, see <http://www.gnu.org/licenses/>. // Author: Kyle Racette // Date: 2010-02-16 14:16 #ifndef KERNEL_PROCESS_H #define KERNEL_PROCESS_H #include "type.h" #include "common.h" #include "kernel/pagemap.h" #include "kernel/heap.h" #include "lib/kernel/list.h" #include "arch/x86/isr.h" #define PROCESS_MAGIC 0xDEADBABE struct process { /* Stack */ int magic; /* Should always equal PROCESS_MAGIC */ struct heap heap; struct list_elem sched_elem; struct registers regs; //struct pagemap pm; /* TODO: Use a page directory for now until swapping is implemented */ struct pagedir* pd; }; /* Turns the current execution into a process */ void init_process (); #endif // KERNEL_PROCESS_H
/* EQEMu: Everquest Server Emulator Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY except by those people which sell it, which are required to give you total support for your newly bought product; 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 _EQE_QUESTPARSERCOLLECTION_H #define _EQE_QUESTPARSERCOLLECTION_H #include "../common/types.h" #include "encounter.h" #include "beacon.h" #include "client.h" #include "corpse.h" #include "doors.h" #include "groups.h" #include "mob.h" #include "object.h" #include "raids.h" #include "trap.h" #include "quest_interface.h" #include "zone_config.h" #include <list> #include <map> #define QuestFailedToLoad 0xFFFFFFFF #define QuestUnloaded 0x00 extern const ZoneConfig *Config; class Client; class Mob; class NPC; class QuestInterface; namespace EQ { class Any; class ItemInstance; } class QuestParserCollection { public: QuestParserCollection(); ~QuestParserCollection(); void RegisterQuestInterface(QuestInterface *qi, std::string ext); void UnRegisterQuestInterface(QuestInterface *qi, std::string ext); void ClearInterfaces(); void AddVar(std::string name, std::string val); void Init(); void ReloadQuests(bool reset_timers = true); void RemoveEncounter(const std::string name); bool HasQuestSub(uint32 npcid, QuestEventID evt); bool PlayerHasQuestSub(QuestEventID evt); bool SpellHasQuestSub(uint32 spell_id, QuestEventID evt); bool ItemHasQuestSub(EQ::ItemInstance *itm, QuestEventID evt); int EventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers = nullptr); int EventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers = nullptr); int EventItem(QuestEventID evt, Client *client, EQ::ItemInstance *item, Mob *mob, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers = nullptr); int EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data, std::vector<EQ::Any> *extra_pointers = nullptr); int EventEncounter(QuestEventID evt, std::string encounter_name, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers = nullptr); void GetErrors(std::list<std::string> &err); /* Internally used memory reference for all Perl Event Export Settings Some exports are very taxing on CPU given how much an event is called. These are loaded via DB and have defaults loaded in PerlEventExportSettingsDefaults. Database loaded via Database::LoadPerlEventExportSettings(log_settings) */ struct PerlEventExportSettings { uint8 qglobals; uint8 mob; uint8 zone; uint8 item; uint8 event_variables; }; PerlEventExportSettings perl_event_export_settings[_LargestEventID]; void LoadPerlEventExportSettings(PerlEventExportSettings* perl_event_export_settings); private: bool HasQuestSubLocal(uint32 npcid, QuestEventID evt); bool HasQuestSubGlobal(QuestEventID evt); bool PlayerHasQuestSubLocal(QuestEventID evt); bool PlayerHasQuestSubGlobal(QuestEventID evt); int EventNPCLocal(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); int EventNPCGlobal(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); int EventPlayerLocal(QuestEventID evt, Client *client, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); int EventPlayerGlobal(QuestEventID evt, Client *client, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); QuestInterface *GetQIByNPCQuest(uint32 npcid, std::string &filename); QuestInterface *GetQIByGlobalNPCQuest(std::string &filename); QuestInterface *GetQIByPlayerQuest(std::string &filename); QuestInterface *GetQIByGlobalPlayerQuest(std::string &filename); QuestInterface *GetQIBySpellQuest(uint32 spell_id, std::string &filename); QuestInterface *GetQIByItemQuest(std::string item_script, std::string &filename); QuestInterface *GetQIByEncounterQuest(std::string encounter_name, std::string &filename); int DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); int DispatchEventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); int DispatchEventItem(QuestEventID evt, Client *client, EQ::ItemInstance *item, Mob *mob, std::string data, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); int DispatchEventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data, std::vector<EQ::Any> *extra_pointers); std::map<uint32, QuestInterface*> _interfaces; std::map<uint32, std::string> _extensions; std::list<QuestInterface*> _load_precedence; //0x00 = Unloaded //0xFFFFFFFF = Failed to Load std::map<uint32, uint32> _npc_quest_status; uint32 _global_npc_quest_status; uint32 _player_quest_status; uint32 _global_player_quest_status; std::map<uint32, uint32> _spell_quest_status; std::map<uint32, uint32> _item_quest_status; std::map<std::string, uint32> _encounter_quest_status; }; extern QuestParserCollection *parse; #endif
/* * GrWebSDR: a web SDR receiver * * Copyright (C) 2017 Ondřej Lysoněk * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING). If not, * see <http://www.gnu.org/licenses/>. */ #ifndef GLOBALS_H #define GLOBALS_H #include <config.h> #include "receiver.h" #include <unordered_map> #include <string> #include <libwebsockets.h> #include <vector> #define STREAM_NAME_LEN 8 typedef struct { std::string label; std::string description; int freq_converter_offset; } source_info_t; extern std::unordered_map<std::string, receiver::sptr> receiver_map; extern std::vector<osmosdr::source::sptr> osmosdr_sources; extern std::vector<source_info_t> sources_info; extern gr::top_block_sptr topbl; extern struct lws_context *ws_context; extern const struct lws_protocols protocols[]; extern struct lws_pollfd *pollfds; extern int *fd_lookup; extern int count_pollfds; extern int max_fds; extern struct lws **fd2wsi; #endif
#pragma once #include <common/platform_fiber.h> #include <libcpu/cpu.h> #include <libcpu/be2_struct.h> namespace cafe::kernel { #ifndef DECAF_KERNEL_LLE struct HostContext; #endif struct Context { static constexpr uint64_t Tag = 0x4F53436F6E747874ull; //! Should always be set to the value OSContext::Tag. be2_val<uint64_t> tag; be2_array<uint32_t, 32> gpr; be2_val<uint32_t> cr; be2_val<uint32_t> lr; be2_val<uint32_t> ctr; be2_val<uint32_t> xer; be2_val<uint32_t> srr0; be2_val<uint32_t> srr1; //These are only set during an exception be2_val<uint32_t> dsisr; be2_val<uint32_t> dar; be2_val<uint32_t> exceptionType; UNKNOWN(0x8); be2_val<uint32_t> fpscr; be2_array<double, 32> fpr; be2_val<uint16_t> spinLockCount; be2_val<uint16_t> state; be2_array<uint32_t, 8> gqr; be2_val<uint32_t> pir; be2_array<double, 32> psf; be2_array<int64_t, 3> coretime; be2_val<int64_t> starttime; be2_val<int32_t> error; be2_val<uint32_t> attr; #ifdef DECAF_KERNEL_LLE be2_val<uint32_t> pmc1; be2_val<uint32_t> pmc2; be2_val<uint32_t> pmc3; be2_val<uint32_t> pmc4; #else HostContext *hostContext; be2_val<uint32_t> nia; be2_val<uint32_t> cia; #endif be2_val<uint32_t> mmcr0; be2_val<uint32_t> mmcr1; }; CHECK_OFFSET(Context, 0x00, tag); CHECK_OFFSET(Context, 0x08, gpr); CHECK_OFFSET(Context, 0x88, cr); CHECK_OFFSET(Context, 0x8c, lr); CHECK_OFFSET(Context, 0x90, ctr); CHECK_OFFSET(Context, 0x94, xer); CHECK_OFFSET(Context, 0x98, srr0); CHECK_OFFSET(Context, 0x9c, srr1); CHECK_OFFSET(Context, 0xA0, dsisr); CHECK_OFFSET(Context, 0xA4, dar); CHECK_OFFSET(Context, 0xA8, exceptionType); CHECK_OFFSET(Context, 0xb4, fpscr); CHECK_OFFSET(Context, 0xb8, fpr); CHECK_OFFSET(Context, 0x1b8, spinLockCount); CHECK_OFFSET(Context, 0x1ba, state); CHECK_OFFSET(Context, 0x1bc, gqr); CHECK_OFFSET(Context, 0x1DC, pir); CHECK_OFFSET(Context, 0x1e0, psf); CHECK_OFFSET(Context, 0x2e0, coretime); CHECK_OFFSET(Context, 0x2f8, starttime); CHECK_OFFSET(Context, 0x300, error); #ifdef DECAF_KERNEL_LLE CHECK_OFFSET(Context, 0x308, pmc1); CHECK_OFFSET(Context, 0x30c, pmc2); CHECK_OFFSET(Context, 0x310, pmc3); CHECK_OFFSET(Context, 0x314, pmc4); #endif CHECK_OFFSET(Context, 0x318, mmcr0); CHECK_OFFSET(Context, 0x31c, mmcr1); CHECK_SIZE(Context, 0x320); void copyContextToCpu(virt_ptr<Context> context); void copyContextFromCpu(virt_ptr<Context> context); void exitThreadNoLock(); void resetFaultedContextFiber(virt_ptr<Context> context, platform::FiberEntryPoint entry, void *param); void setContextFiberEntry(virt_ptr<Context> context, platform::FiberEntryPoint entry, void *param); virt_ptr<Context> getCurrentContext(); void switchContext(virt_ptr<Context> next); void hijackCurrentHostContext(virt_ptr<Context> context); void sleepCurrentContext(); void wakeCurrentContext(); namespace internal { void initialiseCoreContext(cpu::Core *core); void initialiseStaticContextData(); } // namespace internal } // namespace cafe::kernel
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <qmakeevaluator.h> #include <QObject> #include <QProcessEnvironment> #include <QtTest/QtTest> class tst_qmakelib : public QObject { Q_OBJECT public: tst_qmakelib() {} virtual ~tst_qmakelib() {} private slots: void initTestCase(); void cleanupTestCase(); void quoteArgUnix_data(); void quoteArgUnix(); void quoteArgWin_data(); void quoteArgWin(); void pathUtils(); void proString(); void proStringList(); void proParser_data(); void proParser(); void proEval_data(); void proEval(); private: void addParseOperators(); void addParseValues(); void addParseConditions(); void addParseControlStatements(); void addParseBraces(); void addParseCustomFunctions(); void addParseAbuse(); void addAssignments(); void addExpansions(); void addControlStructs(); void addReplaceFunctions(const QString &qindir); void addTestFunctions(const QString &qindir); QProcessEnvironment m_env; QHash<ProKey, ProString> m_prop; QString m_indir, m_outdir; }; class QMakeTestHandler : public QMakeHandler { public: QMakeTestHandler() : QMakeHandler(), printed(false) {} virtual void message(int type, const QString &msg, const QString &fileName, int lineNo) { print(fileName, lineNo, type, msg); } virtual void fileMessage(int type, const QString &msg) { Q_UNUSED(type) doPrint(msg); } virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {} virtual void doneWithEval(ProFile *) {} void setExpectedMessages(const QStringList &msgs) { expected = msgs; } QStringList expectedMessages() const { return expected; } bool printedMessages() const { return printed; } private: void print(const QString &fileName, int lineNo, int type, const QString &msg); void doPrint(const QString &msg); QStringList expected; bool printed; };
/** * This header is generated by class-dump-z 0.2-0. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ #import "PLUIImageViewController.h" #import "UIImagePickerControllerDelegate.h" #import "PhotoLibrary-Structs.h" #import "UINavigationControllerDelegate.h" @class UINavigationItem, NSDictionary, UIImagePickerController; @interface PLUIEditVideoViewController : PLUIImageViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate> { NSDictionary* _options; UIImagePickerController* _imagePicker; UINavigationItem* _navItem; id _delegate; unsigned _canCreateMetadata; } // inherited: -(BOOL)_displaysFullScreen; -(BOOL)_editingForThirdParty; -(void)_setupNavigationItemAndTrimTitle:(id)title; -(instancetype)initWithPhoto:(id)photo trimTitle:(id)title; -(instancetype)initWithProperties:(id)properties; -(id)navigationItem; -(id)delegate; -(void)setDelegate:(id)delegate; // inherited: -(void)dealloc; -(void)setImagePickerOptions:(id)options; -(id)imagePickerOptions; // inherited: -(id)_trimMessage; -(id)imagePickerController; // inherited: -(void)didChooseVideoAtPath:(id)path options:(id)options; // inherited: -(void)videoRemakerDidEndRemaking:(id)videoRemaker temporaryPath:(id)path; -(void)_cancelTrim:(id)trim; // inherited: -(int)cropOverlayMode; // inherited: -(CGRect)previewFrame; -(void)_trimVideo:(id)video; // inherited: -(float)videoViewScrubberYOrigin:(id)origin; // inherited: -(BOOL)videoViewCanCreateMetadata:(id)metadata; -(void)videoViewPlaybackDidFail:(id)videoViewPlayback; @end
/******************************************************************************* * * * F1LT - unofficial Formula 1 live timing application * * Copyright (C) 2012-2013 Mariusz Pilarek (pieczaro@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 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * * * *******************************************************************************/ #ifndef LTFILESMANAGER_H #define LTFILESMANAGER_H #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QStringList> #include <QObject> class LTFilesManager : public QObject { Q_OBJECT public: explicit LTFilesManager(QObject *parent = 0); signals: void ltListObtained(QStringList); void ltFileObtained(QByteArray); void downloadProgress ( qint64 bytesReceived, qint64 bytesTotal ); void error ( QNetworkReply::NetworkError code ); public slots: void getLTList(); void getLTFile(QString); void cancel(); void finishedLTList(); void finishedLTFile(); private: QNetworkAccessManager manager; QNetworkRequest req; QNetworkReply *reply; }; #endif // LTFILESMANAGER_H
/* midi.h * * Adlib OPL2/OPL3 FM synthesizer chipset test program. * Play MIDI file using the OPLx synthesizer (well, poorly anyway) * (C) 2010-2012 Jonathan Campbell. * Hackipedia DOS library. * * This code is licensed under the LGPL. * <insert LGPL legal text here> * * Compiles for intended target environments: * - MS-DOS [pure DOS mode, or Windows or OS/2 DOS Box] */ #ifndef __MIDI__ #define __MIDI__ #include <stdio.h> #include <conio.h> /* this is where Open Watcom hides the outp() etc. functions */ #include <stdlib.h> #include <string.h> #include <unistd.h> #include <malloc.h> #include <ctype.h> #include <fcntl.h> #include <math.h> #include <dos.h> //#include "src/lib/doslib/vga.h" #include "src/lib/doslib/dos.h" #include "src/lib/16_head.h" #include "src/lib/doslib/8254.h" /* 8254 timer */ #include "src/lib/doslib/8259.h" //#include "src/lib/doslib/vgagui.h" //#include "src/lib/doslib/vgatty.h" #include "src/lib/doslib/adlib.h" /* one per OPL channel */ struct midi_note { unsigned char note_number; unsigned char note_velocity; unsigned char note_track; /* from what MIDI track */ unsigned char note_channel; /* from what MIDI channel */ unsigned int busy:1; /* if occupied */ }; struct midi_channel { unsigned char program; }; struct midi_track { /* track data, raw */ unsigned char* raw; /* raw data base */ unsigned char* fence; /* raw data end (last byte + 1) */ unsigned char* read; /* raw data read ptr */ /* state */ unsigned long us_per_quarter_note; /* Microseconds per quarter note (def 120 BPM) */ unsigned long us_tick_cnt_mtpq; /* Microseconds advanced (up to 10000 us or one unit at 100Hz) x ticks per quarter note */ unsigned long wait; unsigned char last_status; /* MIDI last status byte */ unsigned int eof:1; /* we hit the end of the track */ }; #define MIDI_MAX_CHANNELS 16 #define MIDI_MAX_TRACKS 64 extern struct midi_note midi_notes[ADLIB_FM_VOICES]; extern struct midi_channel midi_ch[MIDI_MAX_CHANNELS]; extern struct midi_track midi_trk[MIDI_MAX_TRACKS]; static void (interrupt *old_irq0)(); static volatile unsigned long irq0_ticks=0; static volatile unsigned int irq0_cnt=0,irq0_add=0,irq0_max=0; static volatile unsigned char midi_playing=0; int load_midi_file(const char *path); void interrupt irq0(); void adlib_shut_up(); void midi_reset_tracks(); void midi_reset_channels(); void midi_tick(); #endif /* __MIDI__ */
/* =========================================================================== ARX FATALIS GPL Source Code Copyright (C) 1999-2010 Arkane Studios SA, a ZeniMax Media company. This file is part of the Arx Fatalis GPL Source Code ('Arx Fatalis Source Code'). Arx Fatalis Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Arx Fatalis Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Arx Fatalis Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Arx Fatalis Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Arx Fatalis Source Code. If not, please request a copy in writing from Arkane Studios at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing Arkane Studios, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ ////////////////////////////////////////////////////////////////////////////////////// // @@ @@@ @@@ @@ @@@@@ // // @@@ @@@@@@ @@@ @@ @@@@ @@@ @@@ // // @@@ @@@@@@@ @@@ @@@@ @@@@ @@ @@@@ // // @@@ @@ @@@@ @@@ @@@@@ @@@@@@ @@@ @@@ // // @@@@@ @@ @@@@ @@@ @@@@@ @@@@@@@ @@@ @ @@@ // // @@@@@ @@ @@@@ @@@@@@@@ @@@@ @@@ @@@@@ @@ @@@@@@@ // // @@ @@@ @@ @@@@ @@@@@@@ @@@ @@@ @@@@@@ @@ @@@@ // // @@@ @@@ @@@ @@@@ @@@@@ @@@@@@@@@ @@@@@@@ @@@ @@@@ // // @@@ @@@@ @@@@@@@ @@@@@@ @@@ @@@@ @@@ @@@ @@@ @@@@ // // @@@@@@@@ @@@@@ @@@@@@@@@@ @@@ @@@ @@@ @@@ @@@ @@@@@ // // @@@ @@@@ @@@@ @@@ @@@@@@@ @@@ @@@ @@@@ @@@ @@@@ @@@@@ // //@@@ @@@@ @@@@@ @@@ @@@@@@ @@ @@@ @@@@ @@@@@@@ @@@@@ @@@@@ // //@@@ @@@@@ @@@@@ @@@@ @@@ @@ @@ @@@@ @@@@@@@ @@@@@@@@@ // //@@@ @@@@ @@@@@@@ @@@@ @@ @@ @@@@ @@@@@ @@@@@ // //@@@ @@@@ @@@@@@@ @@@@ @@ @@ @@@@ @@@@@ @@ // //@@@ @@@ @@@ @@@@@ @@ @@@ // // @@@ @@@ @@ @@ STUDIOS // ////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// // HERMESMain ////////////////////////////////////////////////////////////////////////////////////// // // Description: // HUM...hum... // // Updates: (date) (person) (update) // // Code: Sébastien Scieux // // Copyright (c) 1999 ARKANE Studios SA. All rights reserved ////////////////////////////////////////////////////////////////////////////////////// #ifndef HERMES_PAK_H #define HERMES_PAK_H #include "hermes_pack_public.h" #include <vector> using namespace std; extern char PAK_WORKDIR[256]; extern ULONG g_pak_workdir_len; #define LOAD_TRUEFILE 1 #define LOAD_PACK 2 #define LOAD_PACK_THEN_TRUEFILE 3 #define LOAD_TRUEFILE_THEN_PACK 4 extern long CURRENT_LOADMODE; extern EVE_LOADPACK *pLoadPack; void * PAK_FileLoadMalloc(char *name,long * SizeLoadMalloc=NULL); void * PAK_FileLoadMallocZero(char *name,long * SizeLoadMalloc=NULL); // use only for READ !!!! void PAK_SetLoadMode(long mode,char * pakfile,char * workdir=NULL); ANY_FILE PAK_fopen(const char *filename, const char *mode ); size_t PAK_fread(void *buffer, size_t size, size_t count, ANY_FILE stream );; int PAK_fclose(ANY_FILE stream); long PAK_ftell(ANY_FILE stream); long PAK_DirectoryExist(char *name); long PAK_FileExist(char *name); int PAK_fseek(ANY_FILE fic,long offset,int origin); void PAK_NotFoundInit(char * fic); bool PAK_NotFound(char * fic); void PAK_Close(); //----------------------------------------------------------------------------- class PakManager { public: vector<EVE_LOADPACK*> vLoadPak; public: PakManager(); ~PakManager(); bool AddPak(char *); bool RemovePak(char *); bool Read(char *,void *); void* ReadAlloc(char *,int *); int GetSize(char *); PACK_FILE* fOpen(char *); int fClose(PACK_FILE *); int fRead(void *, int, int, PACK_FILE *); int fSeek(PACK_FILE *,int,int); int fTell(PACK_FILE *); vector<EVE_REPERTOIRE*>* ExistDirectory(char *_lpszName); bool ExistFile(char *_lpszName); }; #endif
// <osiris_sps_source_header> // This file is part of Osiris Serverless Portal System. // Copyright (C)2005-2012 Osiris Team (info@osiris-sps.org) / http://www.osiris-sps.org ) // // Osiris Serverless Portal System is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Osiris Serverless Portal System 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 Osiris Serverless Portal System. If not, see <http://www.gnu.org/licenses/>. // </osiris_sps_source_header> #ifndef _SEARCH_MODELOPTIONS_H #define _SEARCH_MODELOPTIONS_H #include "isearchoptions.h" ////////////////////////////////////////////////////////////////////// OS_NAMESPACE_BEGIN() ////////////////////////////////////////////////////////////////////// class EngineExport SearchModelOptions : public ISearchOptions { typedef ISearchOptions OptionsBase; // Construction public: SearchModelOptions(); virtual ~SearchModelOptions(); }; ////////////////////////////////////////////////////////////////////// OS_NAMESPACE_END() ////////////////////////////////////////////////////////////////////// #endif // _SEARCH_MODELOPTIONS_H
/* SPDX-FileCopyrightText: 2010 Till Theato <root@ttill.de> SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ #ifndef CHOOSECOLORWIDGET_H #define CHOOSECOLORWIDGET_H #include <QWidget> class KColorButton; /** @class ChooseColorWidget @brief Provides options to choose a color. Two mechanisms are provided: color-picking directly on the screen and choosing from a list @author Till Theato */ class ChooseColorWidget : public QWidget { Q_OBJECT public: /** @brief Sets up the widget. * @param name (optional) What the color will be used for (name of the parameter) * @param color (optional) initial color * @param comment (optional) Comment about the parameter * @param alphaEnabled (optional) Should transparent colors be enabled * @param parent(optional) Parent widget */ explicit ChooseColorWidget(const QString &name = QString(), const QString &color = QStringLiteral("0xffffffff"), const QString &comment = QString(), bool alphaEnabled = false, QWidget *parent = nullptr); /** @brief Gets the chosen color. */ QString getColor() const; private: KColorButton *m_button; public slots: void slotColorModified(const QColor &color); private slots: /** @brief Updates the different color choosing options to have all selected @param color. */ void setColor(const QColor &color); signals: /** @brief Emitted whenever a different color was chosen. */ void modified(QColor = QColor()); void disableCurrentFilter(bool); void valueChanged(); }; #endif
/* -- translated by f2c (version 20050501). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "config.h" #include "arpack_internal.h" #include "f2c.h" /* Subroutine */ int igraphdlasrt_(char *id, integer *n, doublereal *d__, integer * info) { /* System generated locals */ integer i__1, i__2; /* Local variables */ static integer i__, j; static doublereal d1, d2, d3; static integer dir; static doublereal tmp; static integer endd; extern logical igraphlsame_(char *, char *); static integer stack[64] /* was [2][32] */; static doublereal dmnmx; static integer start; extern /* Subroutine */ int igraphxerbla_(char *, integer *); static integer stkpnt; /* -- LAPACK routine (version 3.0) -- */ /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */ /* Courant Institute, Argonne National Lab, and Rice University */ /* September 30, 1994 */ /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Purpose */ /* ======= */ /* Sort the numbers in D in increasing order (if ID = 'I') or */ /* in decreasing order (if ID = 'D' ). */ /* Use Quick Sort, reverting to Insertion sort on arrays of */ /* size <= 20. Dimension of STACK limits N to about 2**32. */ /* Arguments */ /* ========= */ /* ID (input) CHARACTER*1 */ /* = 'I': sort D in increasing order; */ /* = 'D': sort D in decreasing order. */ /* N (input) INTEGER */ /* The length of the array D. */ /* D (input/output) DOUBLE PRECISION array, dimension (N) */ /* On entry, the array to be sorted. */ /* On exit, D has been sorted into increasing order */ /* (D(1) <= ... <= D(N) ) or into decreasing order */ /* (D(1) >= ... >= D(N) ), depending on ID. */ /* INFO (output) INTEGER */ /* = 0: successful exit */ /* < 0: if INFO = -i, the i-th argument had an illegal value */ /* ===================================================================== */ /* .. Parameters .. */ /* .. */ /* .. Local Scalars .. */ /* .. */ /* .. Local Arrays .. */ /* .. */ /* .. External Functions .. */ /* .. */ /* .. External Subroutines .. */ /* .. */ /* .. Executable Statements .. */ /* Test the input paramters. */ /* Parameter adjustments */ --d__; /* Function Body */ *info = 0; dir = -1; if (igraphlsame_(id, "D")) { dir = 0; } else if (igraphlsame_(id, "I")) { dir = 1; } if (dir == -1) { *info = -1; } else if (*n < 0) { *info = -2; } if (*info != 0) { i__1 = -(*info); igraphxerbla_("DLASRT", &i__1); return 0; } /* Quick return if possible */ if (*n <= 1) { return 0; } stkpnt = 1; stack[0] = 1; stack[1] = *n; L10: start = stack[(stkpnt << 1) - 2]; endd = stack[(stkpnt << 1) - 1]; --stkpnt; if (endd - start <= 20 && endd - start > 0) { /* Do Insertion sort on D( START:ENDD ) */ if (dir == 0) { /* Sort into decreasing order */ i__1 = endd; for (i__ = start + 1; i__ <= i__1; ++i__) { i__2 = start + 1; for (j = i__; j >= i__2; --j) { if (d__[j] > d__[j - 1]) { dmnmx = d__[j]; d__[j] = d__[j - 1]; d__[j - 1] = dmnmx; } else { goto L30; } /* L20: */ } L30: ; } } else { /* Sort into increasing order */ i__1 = endd; for (i__ = start + 1; i__ <= i__1; ++i__) { i__2 = start + 1; for (j = i__; j >= i__2; --j) { if (d__[j] < d__[j - 1]) { dmnmx = d__[j]; d__[j] = d__[j - 1]; d__[j - 1] = dmnmx; } else { goto L50; } /* L40: */ } L50: ; } } } else if (endd - start > 20) { /* Partition D( START:ENDD ) and stack parts, largest one first */ /* Choose partition entry as median of 3 */ d1 = d__[start]; d2 = d__[endd]; i__ = (start + endd) / 2; d3 = d__[i__]; if (d1 < d2) { if (d3 < d1) { dmnmx = d1; } else if (d3 < d2) { dmnmx = d3; } else { dmnmx = d2; } } else { if (d3 < d2) { dmnmx = d2; } else if (d3 < d1) { dmnmx = d3; } else { dmnmx = d1; } } if (dir == 0) { /* Sort into decreasing order */ i__ = start - 1; j = endd + 1; L60: L70: --j; if (d__[j] < dmnmx) { goto L70; } L80: ++i__; if (d__[i__] > dmnmx) { goto L80; } if (i__ < j) { tmp = d__[i__]; d__[i__] = d__[j]; d__[j] = tmp; goto L60; } if (j - start > endd - j - 1) { ++stkpnt; stack[(stkpnt << 1) - 2] = start; stack[(stkpnt << 1) - 1] = j; ++stkpnt; stack[(stkpnt << 1) - 2] = j + 1; stack[(stkpnt << 1) - 1] = endd; } else { ++stkpnt; stack[(stkpnt << 1) - 2] = j + 1; stack[(stkpnt << 1) - 1] = endd; ++stkpnt; stack[(stkpnt << 1) - 2] = start; stack[(stkpnt << 1) - 1] = j; } } else { /* Sort into increasing order */ i__ = start - 1; j = endd + 1; L90: L100: --j; if (d__[j] > dmnmx) { goto L100; } L110: ++i__; if (d__[i__] < dmnmx) { goto L110; } if (i__ < j) { tmp = d__[i__]; d__[i__] = d__[j]; d__[j] = tmp; goto L90; } if (j - start > endd - j - 1) { ++stkpnt; stack[(stkpnt << 1) - 2] = start; stack[(stkpnt << 1) - 1] = j; ++stkpnt; stack[(stkpnt << 1) - 2] = j + 1; stack[(stkpnt << 1) - 1] = endd; } else { ++stkpnt; stack[(stkpnt << 1) - 2] = j + 1; stack[(stkpnt << 1) - 1] = endd; ++stkpnt; stack[(stkpnt << 1) - 2] = start; stack[(stkpnt << 1) - 1] = j; } } } if (stkpnt > 0) { goto L10; } return 0; /* End of DLASRT */ } /* igraphdlasrt_ */
/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ #ifdef __SUNPRO_C #pragma align 4 (_iconPause) #endif #ifdef __GNUC__ static const guint8 _iconPause[] __attribute__ ((__aligned__ (4))) = #else static const guint8 _iconPause[] = #endif { "" /* Pixbuf magic (0x47646b50) */ "GdkP" /* length: header (24) + pixel_data (677) */ "\0\0\2\275" /* pixdata_type (0x2010002) */ "\2\1\0\2" /* rowstride (64) */ "\0\0\0@" /* width (16) */ "\0\0\0\20" /* height (16) */ "\0\0\0\20" /* pixel_data: */ "\204\377\377\377\0\10""6\242\306.<\245\307\257>\245\307\343A\245\306" "\377>\243\304\3778\240\302\3432\234\277\257+\231\275.\207\377\377\377" "\0\4=\245\310\257@\247\310\377$\231\300\377\24\222\274\377\202\21\221" "\273\377\4\24\222\273\377\37\226\274\3770\232\274\377+\227\273\257\204" "\377\377\377\0\3|\303\332\10B\250\311\343/\237\303\377\210\21\221\273" "\377\3\"\224\272\377*\224\267\343B\224\257\10\202\377\377\377\0\2=\245" "\310\257/\237\303\377\212\21\221\273\377\5\37\222\270\377#\221\264\257" "\377\377\377\0A\250\3115@\247\310\377\214\21\221\273\377\4\"\217\263" "\377\40\215\2615:\244\307\272$\231\300\377\203\21\221\273\377\2\377\377" "\377\377\374\376\376\377\202\21\221\273\377\2\363\372\374\377\361\370" "\373\377\203\21\221\273\377\4\27\217\267\377\34\214\261\272B\247\310" "\344\24\222\274\377\203\21\221\273\377\7\375\376\376\377\372\375\375" "\377\15i\210\377\21\221\273\377\361\371\373\377\356\367\372\377\15i\210" "\377\202\21\221\273\377\3\22\221\272\377\34\210\254\344A\245\306\377" "\204\21\221\273\377\7\372\375\376\377\367\373\375\377\15i\210\377\21" "\221\273\377\357\367\372\377\354\366\371\377\15i\210\377\203\21\221\273" "\377\2\32\206\251\377>\243\304\377\204\21\221\273\377\7\370\374\375\377" "\365\372\374\377\15i\210\377\21\221\273\377\354\366\372\377\351\365\371" "\377\15i\210\377\203\21\221\273\377\3\30\204\250\377;\241\302\344\24" "\222\273\377\203\21\221\273\377\7\365\372\374\377\362\371\373\377\15" "i\210\377\21\221\273\377\352\365\371\377\347\364\370\377\15i\210\377" "\202\21\221\273\377\4\21\220\272\377\25\202\246\3440\234\277\272\37\226" "\274\377\203\21\221\273\377\7\363\371\373\377\360\370\373\377\15i\210" "\377\21\221\273\377\347\364\370\377\344\363\367\377\15i\210\377\202\21" "\221\273\377\4\23\213\263\377\22\204\251\2723\234\27640\232\274\377\204" "\21\221\273\377\202\15i\210\377\202\21\221\273\377\202\15i\210\377\202" "\21\221\273\377\5\22\202\247\377\20\177\2444\377\377\377\0+\227\273\257" "\"\224\272\377\212\21\221\273\377\2\22\207\256\377\20\201\247\257\202" "\377\377\377\0\3M\235\267\10*\224\267\343\37\222\270\377\210\21\221\273" "\377\3\22\207\256\377\20\177\244\343\15i\210\10\204\377\377\377\0\4#" "\221\264\257\"\217\263\377\27\217\267\377\22\221\272\377\202\21\221\273" "\377\4\21\220\272\377\23\213\263\377\22\202\247\377\20\201\247\257\207" "\377\377\377\0\10\35\216\263-\35\213\260\257\33\211\255\343\32\206\251" "\377\30\204\250\377\25\203\250\343\22\203\250\257\20\203\251-\204\377" "\377\377\0"};
/* **************************************************************************** * eID Middleware Project. * Copyright (C) 2008-2009 FedICT. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version * 3.0 as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, see * http://www.gnu.org/licenses/. **************************************************************************** */
// Copyright (c) 2005 - 2017 Settlers Freaks (sf-team at siedler25.org) // // This file is part of Return To The Roots. // // Return To The Roots 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. // // Return To The Roots 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 Return To The Roots. If not, see <http://www.gnu.org/licenses/>. #ifndef iwWARES_H_INCLUDED #define iwWARES_H_INCLUDED #pragma once #include "IngameWindow.h" class glFont; struct Inventory; class GamePlayer; class iwWares : public IngameWindow { protected: const Inventory& inventory; /// Warenbestand const GamePlayer& player; unsigned pageWares, pagePeople; public: iwWares(unsigned id, const DrawPoint& pos, const Extent& size, const std::string& title, bool allow_outhousing, const glFont* font, const Inventory& inventory, const GamePlayer& player); protected: /// bestimmte Inventurseite zeigen. virtual void SetPage(unsigned page); /// Add a new page and return it. ID will be in range 100+ ctrlGroup& AddPage(); void Msg_ButtonClick(unsigned ctrl_id) override; void Msg_PaintBefore() override; unsigned GetCurPage() const { return curPage_; } private: unsigned curPage_; /// aktuelle Seite des Inventurfensters. unsigned numPages; /// maximale Seite des Inventurfensters. }; #endif // !iwINVENTORY_H_INCLUDED
//===-- sanitizer_suppressions.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Suppression parsing/matching code shared between TSan and LSan. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_SUPPRESSIONS_H #define SANITIZER_SUPPRESSIONS_H #include "sanitizer_common.h" #include "sanitizer_internal_defs.h" namespace __sanitizer { enum SuppressionType { SuppressionNone, SuppressionRace, SuppressionMutex, SuppressionThread, SuppressionSignal, SuppressionLeak, SuppressionLib, SuppressionDeadlock, SuppressionTypeCount }; struct Suppression { SuppressionType type; char *templ; unsigned hit_count; uptr weight; }; class SuppressionContext { public: SuppressionContext() : suppressions_(1), can_parse_(true) {} void Parse(const char *str); bool Match(const char* str, SuppressionType type, Suppression **s); uptr SuppressionCount() const; const Suppression *SuppressionAt(uptr i) const; void GetMatched(InternalMmapVector<Suppression *> *matched); private: InternalMmapVector<Suppression> suppressions_; bool can_parse_; friend class SuppressionContextTest; }; const char *SuppressionTypeString(SuppressionType t); bool TemplateMatch(char *templ, const char *str); } // namespace __sanitizer #endif // SANITIZER_SUPPRESSIONS_H
/*************************************************************************** * Copyright (C) 2011 by A.R. Offringa * * offringa@astro.rug.nl * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef MS_ROW_DATAEXT_H #define MS_ROW_DATAEXT_H #include "msrowdata.h" #include "../util/serializable.h" class MSRowDataExt : public Serializable { public: MSRowDataExt() : _data() { } MSRowDataExt(unsigned polarizationCount, unsigned channelCount) : _data(polarizationCount, channelCount) { } MSRowDataExt(const MSRowDataExt &source) : _data(source._data), _antenna1(source._antenna1), _antenna2(source._antenna2), _timeOffsetIndex(source._timeOffsetIndex), _u(source._u), _v(source._v), _w(source._w), _time(source._time) { } MSRowDataExt &operator=(const MSRowDataExt &source) { _data = source._data; _antenna1 = source._antenna1; _antenna2 = source._antenna2; _timeOffsetIndex = source._timeOffsetIndex; _u = source._u; _v = source._v; _w = source._w; _time = source._time; return *this; } const MSRowData &Data() const { return _data; } MSRowData &Data() { return _data; } unsigned Antenna1() const { return _antenna1; } unsigned Antenna2() const { return _antenna2; } double U() const { return _u; } double V() const { return _v; } double W() const { return _w; } double Time() const { return _time; } size_t TimeOffsetIndex() const { return _timeOffsetIndex; } void SetU(double u) { _u = u; } void SetV(double v) { _v = v; } void SetW(double w) { _w = w; } void SetAntenna1(double antenna1) { _antenna1 = antenna1; } void SetAntenna2(double antenna2) { _antenna2 = antenna2; } void SetTime(double time) { _time = time; } void SetTimeOffsetIndex(size_t timeOffsetIndex) { _timeOffsetIndex = timeOffsetIndex; } virtual void Serialize(std::ostream &stream) const { _data.Serialize(stream); SerializeToUInt32(stream, _antenna1); SerializeToUInt32(stream, _antenna2); SerializeToUInt64(stream, _timeOffsetIndex); SerializeToDouble(stream, _u); SerializeToDouble(stream, _v); SerializeToDouble(stream, _w); SerializeToDouble(stream, _time); } virtual void Unserialize(std::istream &stream) { _data.Unserialize(stream); _antenna1 = UnserializeUInt32(stream); _antenna2 = UnserializeUInt32(stream); _timeOffsetIndex = UnserializeUInt64(stream); _u = UnserializeDouble(stream); _v = UnserializeDouble(stream); _w = UnserializeDouble(stream); _time = UnserializeDouble(stream); } private: MSRowData _data; unsigned _antenna1, _antenna2; size_t _timeOffsetIndex; double _u, _v, _w; double _time; }; #endif
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "NGAP-IEs" * found in "../support/ngap-r16.1.0/38413-g10.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps` */ #include "NGAP_TNLAssociationUsage.h" /* * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ static asn_oer_constraints_t asn_OER_type_NGAP_TNLAssociationUsage_constr_1 CC_NOTUSED = { { 0, 0 }, -1}; asn_per_constraints_t asn_PER_type_NGAP_TNLAssociationUsage_constr_1 CC_NOTUSED = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static const asn_INTEGER_enum_map_t asn_MAP_NGAP_TNLAssociationUsage_value2enum_1[] = { { 0, 2, "ue" }, { 1, 6, "non-ue" }, { 2, 4, "both" } /* This list is extensible */ }; static const unsigned int asn_MAP_NGAP_TNLAssociationUsage_enum2value_1[] = { 2, /* both(2) */ 1, /* non-ue(1) */ 0 /* ue(0) */ /* This list is extensible */ }; const asn_INTEGER_specifics_t asn_SPC_NGAP_TNLAssociationUsage_specs_1 = { asn_MAP_NGAP_TNLAssociationUsage_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_NGAP_TNLAssociationUsage_enum2value_1, /* N => "tag"; sorted by N */ 3, /* Number of elements in the maps */ 4, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 }; static const ber_tlv_tag_t asn_DEF_NGAP_TNLAssociationUsage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) }; asn_TYPE_descriptor_t asn_DEF_NGAP_TNLAssociationUsage = { "TNLAssociationUsage", "TNLAssociationUsage", &asn_OP_NativeEnumerated, asn_DEF_NGAP_TNLAssociationUsage_tags_1, sizeof(asn_DEF_NGAP_TNLAssociationUsage_tags_1) /sizeof(asn_DEF_NGAP_TNLAssociationUsage_tags_1[0]), /* 1 */ asn_DEF_NGAP_TNLAssociationUsage_tags_1, /* Same as above */ sizeof(asn_DEF_NGAP_TNLAssociationUsage_tags_1) /sizeof(asn_DEF_NGAP_TNLAssociationUsage_tags_1[0]), /* 1 */ { &asn_OER_type_NGAP_TNLAssociationUsage_constr_1, &asn_PER_type_NGAP_TNLAssociationUsage_constr_1, NativeEnumerated_constraint }, 0, 0, /* Defined elsewhere */ &asn_SPC_NGAP_TNLAssociationUsage_specs_1 /* Additional specs */ };
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers /***************************************************************************** * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. * * OpenRCT2 is the work of many authors, a full list can be found in contributors.md * For more information, visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion #include "../addresses.h" #include "../config.h" #include "../editor.h" #include "../game.h" #include "../input.h" #include "../interface/themes.h" #include "../interface/widget.h" #include "../interface/window.h" #include "../localisation/localisation.h" #include "../sprites.h" #include "../title.h" #include "dropdown.h" enum { WIDX_START_NEW_GAME, WIDX_CONTINUE_SAVED_GAME, WIDX_MULTIPLAYER, WIDX_SHOW_TUTORIAL, WIDX_GAME_TOOLS }; static rct_widget window_title_menu_widgets[] = { { WWT_IMGBTN, 2, 0, 0, 0, 81, SPR_MENU_NEW_GAME, STR_START_NEW_GAME_TIP }, { WWT_IMGBTN, 2, 0, 0, 0, 81, SPR_MENU_LOAD_GAME, STR_CONTINUE_SAVED_GAME_TIP }, { WWT_IMGBTN, 2, 0, 0, 0, 81, SPR_G2_MENU_MULTIPLAYER, STR_SHOW_MULTIPLAYER_TIP }, { WWT_IMGBTN, 2, 0, 0, 0, 81, SPR_MENU_TUTORIAL, STR_SHOW_TUTORIAL_TIP }, { WWT_IMGBTN, 2, 0, 0, 0, 81, SPR_MENU_TOOLBOX, STR_GAME_TOOLS }, { WIDGETS_END }, }; static void window_title_menu_mouseup(rct_window *w, int widgetIndex); static void window_title_menu_mousedown(int widgetIndex, rct_window*w, rct_widget* widget); static void window_title_menu_dropdown(rct_window *w, int widgetIndex, int dropdownIndex); static void window_title_menu_cursor(rct_window *w, int widgetIndex, int x, int y, int *cursorId); static void window_title_menu_paint(rct_window *w, rct_drawpixelinfo *dpi); static void window_title_menu_invalidate(rct_window *w); static rct_window_event_list window_title_menu_events = { NULL, window_title_menu_mouseup, NULL, window_title_menu_mousedown, window_title_menu_dropdown, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, window_title_menu_cursor, NULL, window_title_menu_invalidate, window_title_menu_paint, NULL }; /** * Creates the window containing the menu buttons on the title screen. * rct2: 0x0066B5C0 (part of 0x0066B3E8) */ void window_title_menu_open() { rct_window* window; window = window_create( 0, gScreenHeight - 142, 0, 100, &window_title_menu_events, WC_TITLE_MENU, WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND ); window->widgets = window_title_menu_widgets; window->enabled_widgets = ( (1 << WIDX_START_NEW_GAME) | (1 << WIDX_CONTINUE_SAVED_GAME) | #ifndef DISABLE_NETWORK (1 << WIDX_MULTIPLAYER) | #endif // Disable tutorial // (1 << WIDX_SHOW_TUTORIAL) | (1 << WIDX_GAME_TOOLS) ); int i = 0; int x = 0; for (rct_widget *widget = window->widgets; widget->type != WWT_LAST; widget++) { if (widget_is_enabled(window, i)) { widget->left = x; widget->right = x + 81; x += 82; } else { widget->type = WWT_EMPTY; } i++; } window->width = x; window->x = (gScreenWidth - window->width) / 2; window_init_scroll_widgets(window); } static void window_title_menu_scenarioselect_callback(const utf8 *path) { if (!scenario_load_and_play_from_path(path)) { title_load(); } } static void window_title_menu_mouseup(rct_window *w, int widgetIndex) { switch (widgetIndex) { case WIDX_START_NEW_GAME: window_scenarioselect_open(window_title_menu_scenarioselect_callback); break; case WIDX_CONTINUE_SAVED_GAME: game_do_command(0, 1, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 0, 0); break; case WIDX_MULTIPLAYER: window_server_list_open(); break; } } static void window_title_menu_mousedown(int widgetIndex, rct_window*w, rct_widget* widget) { if (widgetIndex == WIDX_GAME_TOOLS) { gDropdownItemsFormat[0] = STR_SCENARIO_EDITOR; gDropdownItemsFormat[1] = STR_CONVERT_SAVED_GAME_TO_SCENARIO; gDropdownItemsFormat[2] = STR_ROLLER_COASTER_DESIGNER; gDropdownItemsFormat[3] = STR_TRACK_DESIGNS_MANAGER; window_dropdown_show_text( w->x + widget->left, w->y + widget->top, widget->bottom - widget->top + 1, w->colours[0] | 0x80, DROPDOWN_FLAG_STAY_OPEN, 4 ); } } static void window_title_menu_dropdown(rct_window *w, int widgetIndex, int dropdownIndex) { if (widgetIndex == WIDX_GAME_TOOLS) { switch (dropdownIndex) { case 0: editor_load(); break; case 1: editor_convert_save_to_scenario(); break; case 2: trackdesigner_load(); break; case 3: trackmanager_load(); break; } } } static void window_title_menu_cursor(rct_window *w, int widgetIndex, int x, int y, int *cursorId) { gTooltipTimeout = 2000; } static void window_title_menu_paint(rct_window *w, rct_drawpixelinfo *dpi) { gfx_fill_rect(dpi, w->x, w->y, w->x + w->width - 1, w->y + 82 - 1, 0x2000000 | 51); window_draw_widgets(w, dpi); } static void window_title_menu_invalidate(rct_window *w) { colour_scheme_update(w); }
#include <gtk/gtk.h> void on_top1_activate (GtkMenuItem *menuitem, gpointer user_data); void on_bottom1_activate (GtkMenuItem *menuitem, gpointer user_data); void on_left1_activate (GtkMenuItem *menuitem, gpointer user_data); void on_right1_activate (GtkMenuItem *menuitem, gpointer user_data); void on_cont1_activate (GtkMenuItem *menuitem, gpointer user_data); void on_discont1_activate (GtkMenuItem *menuitem, gpointer user_data); void on_delay1_activate (GtkMenuItem *menuitem, gpointer user_data); void on_btnQuit_clicked (GtkButton *button, gpointer user_data); void on_window1_destroy (GtkObject *object, gpointer user_data); void on_hscale3_value_changed (GtkRange *range, gpointer user_data); void on_hscrollbar1_value_changed (GtkRange *range, gpointer user_data); void on_vscale1_value_changed (GtkRange *range, gpointer user_data); void on_checkbutton1_toggled (GtkToggleButton *togglebutton, gpointer user_data); void on_hscale2_value_changed (GtkRange *range, gpointer user_data); void on_hscale1_value_changed (GtkRange *range, gpointer user_data);
/* -*- c++ -*- */ /* * Copyright 2017 Moritz Luca Schmid, Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT). * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_DAB_TIME_INTERLEAVE_BB_H #define INCLUDED_DAB_TIME_INTERLEAVE_BB_H #include <dab/api.h> #include <gnuradio/sync_block.h> namespace gr { namespace dab { /*! \brief applies time interleaving to a vector * * applies time interleaving to a vector with its arg_max[scrambling_vector] successors, the scrambling_vector describes which vector element comes from which successor * * @param vector_length length of input vectors * @param scrambling_vector vector with scrambling parameters (see DAB standard p.138) * */ class DAB_API time_interleave_bb : virtual public gr::sync_block { public: typedef boost::shared_ptr<time_interleave_bb> sptr; /*! * \brief Return a shared_ptr to a new instance of dab::time_interleave_bb. * * To avoid accidental use of raw pointers, dab::time_interleave_bb's * constructor is in a private implementation * class. dab::time_interleave_bb::make is the public interface for * creating new instances. */ static sptr make(int vector_length, const std::vector<unsigned char> &scrambling_vector); }; } // namespace dab } // namespace gr #endif /* INCLUDED_DAB_TIME_INTERLEAVE_BB_H */
/* * QRAP Project * * Version : 0.1 * Date : 2008/04/01 * License : GNU GPLv3 * File : cRapLinks.h * Copyright : (c) University of Pretoria * Authors : Roeland van Nieukerk (roeland.frans@gmail.com) * Description : This class displays all the tables related to * links and allows the user to edit the tables. * *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; See the GNU General Public License for * * more details * * * ************************************************************************* */ #ifndef Qrap_cRapLinks_h #define Qrap_cRapLinks_h //include Qt headers #include <QWidget> #include <QGridLayout> #include <QVBoxLayout> #include <QListWidget> #include <QListWidgetItem> #include <QTableWidget> #include <QTableWidgetItem> #include <QPushButton> #include <QStringList> #include <QMap> #include <QMessageBox> #include <QAction> #include <QProgressBar> #include <QClipboard> #include <QHeaderView> #include <QMessageBox> //include local headers #include "ComboDelegate.h" #include "MainWindow.h" #include "RapDbCommunicator.h" #include "cRapTableTab.h" namespace Qrap { /** * The cRapLinks class inherits the basic Qt Widget class and this class is responsible * for providing the user a logical navigation experience through the Qrap system. It allows * the user to navigate the system on a hierarchical level based on the selected site. */ class cRapLinks : public QWidget { Q_OBJECT public slots: /** * Public SLOT - This slot is responsible for inserting a new row into the table and the database engine. */ void InsertRow (); /** * Public SLOT - This slot is responsible for deleting the selected set of rows from the database engine. */ void DeleteRows (); /** * Public SLOT - This slot is responisible for reloading the contents of the current table. */ void ReloadTable (); /** * Public SLOT - This slot will load all the contents for a particular table. */ void ShowAllContents (); /** * Public SLOT - This slot is responsible for copying the current cell data into the clipboard. */ void Copy (); /** * Public SLOT - This slot is responsible for pasting the current string into the current cell. */ void Paste (); /** * Public SLOT - This slot is responsible for cutting the data from a current cell. */ void Cut (); /** * Public SLOT - This slot is responsible for creating the search dialog and such that this user can perform * a search on the currently selected table. */ void Search (); /** * Public SLOT - This slot will execute the search query and populate the table view. */ void ExecuteSearch (std::string search); public: /** * The constructor is responsible for setting up the layout structure and the * creating the widgets. */ cRapLinks (QWidget* parent=0); /** * The destructor. */ ~cRapLinks (); /** * This function returns the name of the currently selected table */ QString getCurrentTableName () { return mTables.key(mCurrentTable); } private slots: /** * Private SLOT - This slot is responsible for handeling a selection change in the * tables list and making the respective table visible. */ void TableSelectionChanged (); /** * Private SLOT - This slot is called whenever an item in a table is changed, it will update the * database with the new changes. */ void UpdateDatabase (int row, int col); private: /** * This function will populate the table list with the relevant table names. */ void PopulateTableList (); QMap<QString,cRapTableTab*> mTables; ///< A string map that contains all the RapTableTab widgets. QListWidget* mTableList; ///< A Qt4 pointer to a list widget that will display all the available tables that contain all the needed information related to different sites. QGridLayout* mMainLayout; ///< A Qt4 pointer to a gird layout widget that contains all the widgets widgets. cRapTableTab* mCurrentTable; ///< A pointer to a RapTableTab class that stores the currently selected table. bool mInsertingRow; ///< Keeps track whether a row is being inserted or not. QProgressBar* mProgress; ///< A pointer to a Qt4 progress bar widget that indicates the progress of loading data. RapDbCommunicator* mDbCommunicator; ///< A pointer to a RapDbCommunicator class that handles interaction with the database engine. bool tableViewSelected; ///< A boolean that checks if the table view of any form is selected. }; } #endif
/* pybind11/functional.h: std::function<> support Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #pragma once #include "pybind11.h" #include <functional> NAMESPACE_BEGIN(pybind11) NAMESPACE_BEGIN(detail) template <typename Return, typename... Args> struct type_caster<std::function<Return(Args...)>> { typedef std::function<Return(Args...)> type; typedef typename std::conditional<std::is_same<Return, void>::value, void_type, Return>::type retval_type; public: bool load(handle src_, bool) { if (src_.is_none()) return true; src_ = detail::get_function(src_); if (!src_ || !PyCallable_Check(src_.ptr())) return false; /* When passing a C++ function as an argument to another C++ function via Python, every function call would normally involve a full C++ -> Python -> C++ roundtrip, which can be prohibitive. Here, we try to at least detect the case where the function is stateless (i.e. function pointer or lambda function without captured variables), in which case the roundtrip can be avoided. */ if (PyCFunction_Check(src_.ptr())) { auto c = reinterpret_borrow<capsule>(PyCFunction_GetSelf(src_.ptr())); auto rec = (function_record *) c; using FunctionType = Return (*) (Args...); if (rec && rec->is_stateless && rec->data[1] == &typeid(FunctionType)) { struct capture { FunctionType f; }; value = ((capture *) &rec->data)->f; return true; } } auto src = reinterpret_borrow<object>(src_); value = [src](Args... args) -> Return { gil_scoped_acquire acq; object retval(src(std::move(args)...)); /* Visual studio 2015 parser issue: need parentheses around this expression */ return (retval.template cast<Return>()); }; return true; } template <typename Func> static handle cast(Func &&f_, return_value_policy policy, handle /* parent */) { if (!f_) return none().inc_ref(); auto result = f_.template target<Return (*)(Args...)>(); if (result) return cpp_function(*result, policy).release(); else return cpp_function(std::forward<Func>(f_), policy).release(); } PYBIND11_TYPE_CASTER(type, _("Callable[[") + type_caster<std::tuple<Args...>>::element_names() + _("], ") + type_caster<retval_type>::name() + _("]")); }; NAMESPACE_END(detail) NAMESPACE_END(pybind11)
//<FLAGS> //#define __GPU //#define __NOPROTO //<\FLAGS> //<INCLUDES> #include "fargo3d.h" #define LEFT 0 #define RIGHT 1 #define DOWN 2 #define UP 3 //<\INCLUDES> void boundary_%side () { //<USER_DEFINED> %ifields; %ofields; //<\USER_DEFINED> //<INTERNAL> int i; int j; int k; int jact; int jgh; int kact; int kgh; %internal; //<\INTERNAL> //<EXTERNAL> %pointerfield; int size_x = Nx+2*NGHX; int size_y = %size_y; int size_z = %size_z; int nx = Nx; int ny = Ny; int nz = Nz; int nghy = NGHY; int nghz = NGHZ; int pitch = Pitch_cpu; int stride = Stride_cpu; real dx = Dx; %global; //<\EXTERNAL> //<CONSTANT> // real xmin(Nx+2*NGHX+1); // real ymin(Ny+2*NGHY+1); // real zmin(Nz+2*NGHZ+1); //<\CONSTANT> //<MAIN_LOOP> i = j = k = 0; #ifdef Z for(k=0; k<size_z; k++) { #endif #ifdef Y for(j=0; j<size_y; j++) { #endif #ifdef X for(i=0; i<size_x; i++) { #endif //<#> %boundaries; //<\#> #ifdef X } #endif #ifdef Y } #endif #ifdef Z } #endif //<\MAIN_LOOP> }
#include <stdio.h> #include <string.h> #define BUFLEN 20000 int main (int argv) {char buffer [BUFLEN]; int i; char c; char *cc; int letter_ya; FILE *fp; //printf("argv=%i\n", argv); if (argv>=2) { printf("This is filtr for munin plugin \"plugin_balderdash_mud.sh\" by prool\n\ Prool: http://prool.kharkov.org http://mud.kharkov.org proolix <dog> gmail <dot> com\n\ Exit: control D TWICE!!!\n\ "); return 2; } letter_ya=0; for(i=0;i<BUFLEN;i++) buffer[i]=0; i=0; while (1) { c=getchar(); if (c==-1) { if (letter_ya==1) break; else letter_ya=1; } else letter_ya=0; //printf("input %i\n", c); buffer[i++]=c; if (i>=(BUFLEN-1)) break; } //printf("buffer=''%s''\n", buffer); cc=strstr(buffer,"ÓÍÅÒÔÎÙÈ"); //if (cc) printf("cc!=0\n"); else printf("cc==0\n"); //printf("'%s'\n", cc+8); if (cc) i=atoi(cc+9); else i=0; printf("vmudtest.value %i\n", i); #if 1 // debug output fp=fopen("/tmp/file3.txt","a"); if (fp!=NULL) { fprintf(fp,"vmudtest.value %i\n",i); fclose(fp); } #endif }
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Controls.WebView/1.3.1/WebViewNavActions.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Fuse.Triggers.Actions.TriggerAction.h> namespace g{namespace Fuse{namespace Controls{struct WebView;}}} namespace g{namespace Fuse{namespace Triggers{namespace Actions{struct WebViewNavAction;}}}} namespace g{namespace Fuse{struct Node;}} namespace g{ namespace Fuse{ namespace Triggers{ namespace Actions{ // public abstract class WebViewNavAction :9 // { struct WebViewNavAction_type : ::g::Fuse::Triggers::Actions::TriggerAction_type { void(*fp_Execute)(::g::Fuse::Triggers::Actions::WebViewNavAction*, ::g::Fuse::Controls::WebView*); }; WebViewNavAction_type* WebViewNavAction_typeof(); void WebViewNavAction__Perform_fn(WebViewNavAction* __this, ::g::Fuse::Node* target); struct WebViewNavAction : ::g::Fuse::Triggers::Actions::TriggerAction { void Execute(::g::Fuse::Controls::WebView* webview) { (((WebViewNavAction_type*)__type)->fp_Execute)(this, webview); } }; // } }}}} // ::g::Fuse::Triggers::Actions
/* * Copyright (C) 2010 Zdenek Crha * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <gdk/gdkkeysyms.h> #include "src/frontend/cntl_application.h" #include "test/frontend/test_cntl_application.h" #include "test/common/common.h" /** * \brief Test to create application controller * * Test that specific data structure is correctly allocated and reset. */ START_TEST(test_create_controller) { RCode result; CntlGeneric *cntl = NULL; cntl = cntl_create(CNTL_APPLICATION); ck_assert( NULL != cntl ); ck_assert_int_eq( CNTL_APPLICATION, cntl->type ); ck_assert_int_eq( 1, cntl->reference ); ck_assert( NULL == cntl->view ); ck_assert( NULL != cntl->automaton ); ck_assert( NULL == cntl->specific_data ); // try controller destruction result = cntl_destroy(cntl); ck_assert_int_eq( FAIL, result ); ck_assert_int_eq( TRUE, error_is_error() ); error_reset(); // try controller dereference result = cntl_unref(cntl); ck_assert_int_eq( TRUE, result ); } END_TEST /** * \brief Create test suite for application controller module. * \return pointer to application controller suite */ Suite* create_cntl_application_suite (void) { Suite *suite = suite_create("CntlApplication"); TCase *tc_manage = tcase_create("Manage"); tcase_add_checked_fixture(tc_manage, common_setup, common_teardown); tcase_add_test(tc_manage, test_create_controller); suite_add_tcase(suite, tc_manage); return suite; }
// Copyright (c) 2009-2011, Tor M. Aamodt, Ivan Sham, Ali Bakhoda, // George L. Yuan, Wilson W.L. Fung // The University of British Columbia // All rights reserved. // // 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 The University of British Columbia 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 HOLDER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef DRAM_H #define DRAM_H #include "delayqueue.h" #include <set> #include <zlib.h> #include <stdio.h> #include <stdlib.h> #define READ 'R' //define read and write states #define WRITE 'W' #define BANK_IDLE 'I' #define BANK_ACTIVE 'A' class dram_req_t { public: dram_req_t( class mem_fetch *data ); unsigned int row; unsigned int col; unsigned int bk; unsigned int nbytes; unsigned int txbytes; unsigned int dqbytes; unsigned int age; unsigned int timestamp; unsigned char rw; //is the request a read or a write? unsigned long long int addr; unsigned int insertion_time; class mem_fetch * data; }; struct bankgrp_t { unsigned int CCDLc; unsigned int RTPLc; }; struct bank_t { unsigned int RCDc; unsigned int RCDWRc; unsigned int RASc; unsigned int RPc; unsigned int RCc; unsigned int WTPc; // write to precharge unsigned int RTPc; // read to precharge unsigned char rw; //is the bank reading or writing? unsigned char state; //is the bank active or idle? unsigned int curr_row; dram_req_t *mrq; unsigned int n_access; unsigned int n_writes; unsigned int n_idle; unsigned int bkgrpindex; }; struct mem_fetch; class dram_t { public: dram_t( unsigned int parition_id, const struct memory_config *config, class memory_stats_t *stats, class memory_partition_unit *mp ); bool full() const; void print( FILE* simFile ) const; void visualize() const; void print_stat( FILE* simFile ); unsigned que_length() const; bool returnq_full() const; unsigned int queue_limit() const; void visualizer_print( gzFile visualizer_file ); class mem_fetch* return_queue_pop(); class mem_fetch* return_queue_top(); void push( class mem_fetch *data ); void cycle(); void dram_log (int task); class memory_partition_unit *m_memory_partition_unit; unsigned int id; // Power Model void set_dram_power_stats(unsigned &cmd, unsigned &activity, unsigned &nop, unsigned &act, unsigned &pre, unsigned &rd, unsigned &wr, unsigned &req) const; private: void scheduler_fifo(); void scheduler_frfcfs(); const struct memory_config *m_config; bankgrp_t **bkgrp; bank_t **bk; unsigned int prio; unsigned int RRDc; unsigned int CCDc; unsigned int RTWc; //read to write penalty applies across banks unsigned int WTRc; //write to read penalty applies across banks unsigned char rw; //was last request a read or write? (important for RTW, WTR) unsigned int pending_writes; fifo_pipeline<dram_req_t> *rwq; fifo_pipeline<dram_req_t> *mrqq; //buffer to hold packets when DRAM processing is over //should be filled with dram clock and popped with l2or icnt clock fifo_pipeline<mem_fetch> *returnq; unsigned int dram_util_bins[10]; unsigned int dram_eff_bins[10]; unsigned int last_n_cmd, last_n_activity, last_bwutil; unsigned int n_cmd; unsigned int n_activity; unsigned int n_nop; unsigned int n_act; unsigned int n_pre; unsigned int n_rd; unsigned int n_wr; unsigned int n_req; unsigned int max_mrqs_temp; unsigned int bwutil; unsigned int max_mrqs; unsigned int ave_mrqs; class frfcfs_scheduler* m_frfcfs_scheduler; unsigned int n_cmd_partial; unsigned int n_activity_partial; unsigned int n_nop_partial; unsigned int n_act_partial; unsigned int n_pre_partial; unsigned int n_req_partial; unsigned int ave_mrqs_partial; unsigned int bwutil_partial; struct memory_stats_t *m_stats; class Stats* mrqq_Dist; //memory request queue inside DRAM friend class frfcfs_scheduler; }; #endif /*DRAM_H*/
/* * This software takes a midi file and creates animations from its notes. Copyright (C) 2016 Luiz Guilherme de Medeiros Ventura, Belo Horizonte, Brazil This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. * * Very, very, very helpful on working with midi messages: http://midifile.sapp.org/class/MidiMessage/ * Thanks to Craiggsappmidi (sapp.org) for the library used here. * Thanks to OpenCV library used as well to work with images and videos. */ #ifndef HELP_H #define HELP_H #include <QDialog> #include <string> namespace Ui { class Help; } class Help : public QDialog { Q_OBJECT public: explicit Help(std::string htmlStr, QWidget *parent = 0); ~Help(); private: Ui::Help *ui; }; #endif // HELP_H
/* * Copyright (C) 2013 Bartosz Golaszewski <bartekgola@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 3, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include "clientlist.h" int __bbusd_clientlist_add(bbus_client* cli, struct bbusd_clientlist* list) { struct bbusd_clientlist_elem* el; el = bbus_malloc(sizeof(struct bbusd_clientlist_elem)); if (el == NULL) return -1; el->cli = cli; bbus_list_push(list, el); return 0; } void __bbusd_clientlist_rm(struct bbusd_clientlist_elem** elem, struct bbusd_clientlist* list) { bbus_list_rm(list, *elem); bbus_free(*elem); }
/* This file is part of The Lost Souls Downfall prototype. The Lost Souls Downfall prototype is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The Lost Souls Downfall prototype 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 The Lost Souls Downfall prototype. If not, see <http://www.gnu.org/licenses/>. */ #include "../Threading/ThreadableInterface.h" #include "Thread.h" #include "Vm.h" namespace Lua { /** * A class that launches a Lua interpreter */ class Interpreter: public Threading::ThreadableInterface { public: Interpreter(Vm& vm); virtual void run(); private: std::unique_ptr<Thread> thread_; bool running_; }; }
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: mods/deathmatch/logic/CKeyBinds.h * PURPOSE: Server keybind manager class * DEVELOPERS: Jax <> * Cecill Etheredge <> * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ #ifndef __CKeyBinds_H #define __CKeyBinds_H #include "lua/LuaCommon.h" #include "lua/CLuaArguments.h" #include <list> #define NUMBER_OF_KEYS 123 enum eKeyBindType { KEY_BIND_FUNCTION = 0, KEY_BIND_CONTROL_FUNCTION, KEY_BIND_UNDEFINED, }; struct SBindableKey { char szKey [ 20 ]; }; struct SBindableGTAControl { char szControl [ 25 ]; }; class CKeyBind { public: inline CKeyBind ( void ) { boundKey = NULL; luaMain = NULL; beingDeleted = false; } virtual ~CKeyBind ( void ) {} inline bool IsBeingDeleted ( void ) { return beingDeleted; } SBindableKey* boundKey; CLuaMain* luaMain; bool beingDeleted; virtual eKeyBindType GetType ( void ) = 0; }; class CKeyBindWithState: public CKeyBind { public: inline CKeyBindWithState ( void ) { bHitState = true; } bool bHitState; }; class CFunctionBind { public: inline CFunctionBind ( void ) {} inline ~CFunctionBind ( void ) {} CLuaFunctionRef m_iLuaFunction; CLuaArguments m_Arguments; }; class CKeyFunctionBind: public CKeyBindWithState, public CFunctionBind { public: inline eKeyBindType GetType ( void ) { return KEY_BIND_FUNCTION; } }; class CControlFunctionBind: public CKeyBindWithState, public CFunctionBind { public: inline eKeyBindType GetType ( void ) { return KEY_BIND_CONTROL_FUNCTION; } SBindableGTAControl* boundControl; }; class CKeyBinds { public: CKeyBinds ( class CPlayer* pPlayer ); ~CKeyBinds ( void ); static SBindableKey* GetBindableFromKey ( const char* szKey ); static SBindableGTAControl* GetBindableFromControl ( const char* szControl ); // Basic funcs void Add ( CKeyBind* pKeyBind ); void Clear ( eKeyBindType bindType = KEY_BIND_UNDEFINED ); void Call ( CKeyBind* pKeyBind ); bool ProcessKey ( const char* szKey, bool bHitState, eKeyBindType bindType ); std::list < CKeyBind* > ::iterator IterBegin ( void ) { return m_List.begin (); } std::list < CKeyBind* > ::iterator IterEnd ( void ) { return m_List.end (); } // Key-function bind funcs bool AddKeyFunction ( const char* szKey, bool bHitState, CLuaMain* pLuaMain, const CLuaFunctionRef& iLuaFunction, CLuaArguments& Arguments ); bool AddKeyFunction ( SBindableKey* pKey, bool bHitState, CLuaMain* pLuaMain, const CLuaFunctionRef& iLuaFunction, CLuaArguments& Arguments ); bool RemoveKeyFunction ( const char* szKey, CLuaMain* pLuaMain, bool bCheckHitState = false, bool bHitState = true, const CLuaFunctionRef& iLuaFunction = CLuaFunctionRef () ); bool KeyFunctionExists ( const char* szKey, CLuaMain* pLuaMain = NULL, bool bCheckHitState = false, bool bHitState = true, const CLuaFunctionRef& iLuaFunction = CLuaFunctionRef () ); // Control-function bind funcs bool AddControlFunction ( const char* szControl, bool bHitState, CLuaMain* pLuaMain, const CLuaFunctionRef& iLuaFunction, CLuaArguments& Arguments ); bool AddControlFunction ( SBindableGTAControl* pControl, bool bHitState, CLuaMain* pLuaMain, const CLuaFunctionRef& iLuaFunction, CLuaArguments& Arguments ); bool RemoveControlFunction ( const char* szControl, CLuaMain* pLuaMain, bool bCheckHitState = false, bool bHitState = true, const CLuaFunctionRef& iLuaFunction = CLuaFunctionRef () ); bool ControlFunctionExists ( const char* szControl, CLuaMain* pLuaMain = NULL, bool bCheckHitState = false, bool bHitState = true, const CLuaFunctionRef& iLuaFunction = CLuaFunctionRef () ); void RemoveAllKeys ( CLuaMain* pLuaMain ); static bool IsMouse ( SBindableKey* pKey ); void RemoveDeletedBinds ( void ); protected: bool Remove ( CKeyBind* pKeyBind ); CPlayer* m_pPlayer; std::list < CKeyBind* > m_List; bool m_bProcessingKey; }; #endif
#include <stdlib.h> #include <event2/bufferevent.h> #include <event2/buffer.h> #include "client.h" struct client *all_clients; struct client * client_new_client(void) { struct client * c = calloc(1, sizeof(struct client)); if (all_clients) { c->prev = all_clients; all_clients->next = c; } c->next = NULL; all_clients = c; return c; } void client_free_client(struct client *c) { if (c->next != NULL) { c->next->prev = c->prev; } else { all_clients = c->prev; } if (c->prev != NULL) { c->prev->next = c->next; } //Free the socket bufferinfo, automatically disconnects. if (c->buf_event) { bufferevent_free(c->buf_event); } //If has server info, free it. if (c->info) { free(c->info); } free(c); } void client_free_all_clients(void) { struct client *temp = all_clients; while(temp) { temp = all_clients->prev; //Free the socket bufferinfo, automatically disconnects. if (all_clients->buf_event) { bufferevent_free(all_clients->buf_event); } //If has server info, free it. if (all_clients->info) { free(all_clients->info); } free(all_clients); all_clients = temp; } }
/* * Race Capture Firmware * * Copyright (C) 2016 Autosport Labs * * This file is part of the Race Capture firmware suite * * This is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. You should * have received a copy of the GNU General Public License along with * this code. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PREDICTIVE_TIMER_2_H_ #define PREDICTIVE_TIMER_2_H_ #include "cpp_guard.h" #include "dateTime.h" #include "geopoint.h" #include "gps.h" #include <stdbool.h> CPP_GUARD_BEGIN /** * Called when we finish a lap. Adds the final sample and adjusts sample rates * in preperation for the next lap. Must be called after #startLap is called. * @param gpsSnapshot The GPS state when the lap was completed. */ void finishLap(const GpsSnapshot *gpsSnapshot); /** * Called when we start a lap. This sets the appropriate timers and starts recording * of the times. This must be called before either #addGpsSample or #finishLap are * called. * @param point The position when the lap started. * @param time The time (millis) when the lap started. */ void startLap(const GeoPoint *point, const tiny_millis_t time); /** * Adds a new GPS sample to our record if the algorithm determines its time for one. * Must be invoked after the invocation of #startLap but before the invocation of * #finishLap * @param gpsSnapshot The GPS state when the lap was started. * @return TRUE if it was added, FALSE otherwise. */ bool addGpsSample(const GpsSnapshot *gpsSnapshot); /** * Calculates the split of your current time against the fast lap time at the position given. * @param point The position you are currently at. * @param time The time (millis) which the sample was taken. * @return The split between your current time and the fast lap time. Positive indicates you are * going faster than your fast lap, negative indicates slower. */ tiny_millis_t getSplitAgainstFastLap(const GeoPoint * point, tiny_millis_t time); /** * Figures out the predicted lap time. Call as much as you like... it will only do * calculations when new data is actually available. This minimizes inaccuracies and * allows for drivers to better see how their most recent driving affected their predicted * lap time. * @param point The current location of the car. * @param time The time (millis) which the sample was taken. * @return The predicted lap time. */ tiny_millis_t getPredictedTime(const GeoPoint * point, tiny_millis_t time); /** * Like #getPredictedTime but returns the value in minutes. Useful for logging compatibility. */ float getPredictedTimeInMinutes(); /** * Tells the caller if a predictive time is ready to be had. * @return True if it is, false otherwise. */ bool isPredictiveTimeAvailable(); /** * Resets the predictive timer logic to the initial state. */ void resetPredictiveTimer(); /** * Finds the percentage that currPt is between startPt and endPt.as a * projection of point c onto the vector formed between points s and e. * This method requires that point m be between the points s and e on * the earth's surface. If that requirement is met this method should * return a value between 0 and 1. Otherwise the value will be undefined. * those bounds then * @param s The start point. * @param e The end point. * @param m The middle point. * @return The percentage that projected point m lies between startPt * and endPt if the method * requirements were met. < 0 or > 1 otherwise. */ float distPctBtwnTwoPoints(const GeoPoint *s, const GeoPoint *e, const GeoPoint *m); CPP_GUARD_END #endif /* PREDICTIVE_TIMER_2_H_ */
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2017 - ROLI Ltd. JUCE is an open source library subject to commercial or open-source licensing. The code included in this file is provided under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license. Permission To use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted provided that the above copyright notice and this permission notice appear in all copies. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE DISCLAIMED. ============================================================================== */ #pragma once namespace juce { struct BlocksVersion { public: /** The main value in a version number x.0.0 */ int major = 0; /** The secondary value in a version number 1.x.0 */ int minor = 0; /** The tertiary value in a version number 1.0.x */ int patch = 0; /** The release tag for this version, such as "beta", "alpha", "rc", etc */ String releaseType; /** A numberical value assosiated with the release tag, such as "beta 4" */ int releaseCount = 0; /** The assosiated git commit that generated this firmware version */ String commit; /** Identify "forced" firmware builds **/ bool forced = false; String toString (bool extended = false) const; /** Constructs a version number from an formatted String */ BlocksVersion (const String&); /** Constructs a version number from another BlocksVersion */ BlocksVersion (const BlocksVersion& other) = default; /** Creates an empty version number **/ BlocksVersion() = default; /** Returns true if string format is valid */ static bool isValidVersion (const String& versionString); bool operator == (const BlocksVersion&) const; bool operator != (const BlocksVersion&) const; bool operator < (const BlocksVersion&) const; bool operator > (const BlocksVersion&) const; bool operator <= (const BlocksVersion&) const; bool operator >= (const BlocksVersion&) const; private: /** @internal */ bool evaluate (const String& versionString); bool releaseTypeGreaterThan (const BlocksVersion& otherReleaseType) const; bool isGreaterThan (const BlocksVersion& other) const; bool isEqualTo (const BlocksVersion& other) const; }; } // namespace juce
/** ****************************************************************************** * @file DMA2D/DMA2D_MemToMemWithBlending/Inc/stm32f4xx_it.h * @author MCD Application Team * @version V1.1.0 * @date 17-February-2017 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics 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 HOLDER 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IT_H #define __STM32F4xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void DMA2D_IRQHandler(void); void LTDC_IRQHandler(void); void LTDC_ER_IRQHandler(void); void DSI_IRQHandler(void); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define MATRIX_SIZE 4 #define MAT_MEMBER_CNT (MATRIX_SIZE*MATRIX_SIZE) #define CCOL iterator%MATRIX_SIZE #define CROW iterator/MATRIX_SIZE #define TCOL tempIndex%MATRIX_SIZE #define TROW tempIndex/MATRIX_SIZE #define MAX_INPUT_LEN 100 #define MAT_COUNT 6 typedef float mat[MATRIX_SIZE][MATRIX_SIZE]; void add_mat(mat* A, mat* B, mat* C); void sub_mat(mat* A, mat* B, mat* C); void mul_mat(mat* A, mat* B, mat* C); void mul_scalar(mat* A, float scalar, mat* B); void trans_mat(mat* A, mat* B); /* mymat.c */ void read_mat(); void print_mat(); mat* GetMatrixFromInput(); void ProcessCommand(char command[]); void clearBuffer();
/** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 \licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H #ifdef WIN32 # define __func__ __FUNCTION__ #endif /// \brief Macro for the debug log #ifdef ULTRACOPIER_DEBUG # include "DebugEngine.h" # if defined (__FILE__) && defined (__LINE__) # define ULTRACOPIER_DEBUGCONSOLE(a,b) DebugEngine::addDebugInformationStatic(a,__func__,b,__FILE__,__LINE__) # else # define ULTRACOPIER_DEBUGCONSOLE(a,b) DebugEngine::addDebugInformationStatic(a,__func__,b) # endif #else // ULTRACOPIER_DEBUG # define ULTRACOPIER_DEBUGCONSOLE(a,b) void() #endif // ULTRACOPIER_DEBUG #endif // DEBUGENGINEMACRO_H
/*========================================================================= Program: ParaView Module: vtkSequenceAnimationPlayer.h Copyright (c) Kitware, Inc. All rights reserved. See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkSequenceAnimationPlayer // .SECTION Description // #ifndef vtkSequenceAnimationPlayer_h #define vtkSequenceAnimationPlayer_h #include "vtkAnimationPlayer.h" #include "vtkPVAnimationModule.h" // needed for export macro class VTKPVANIMATION_EXPORT vtkSequenceAnimationPlayer : public vtkAnimationPlayer { public: static vtkSequenceAnimationPlayer* New(); vtkTypeMacro(vtkSequenceAnimationPlayer, vtkAnimationPlayer); void PrintSelf(ostream& os, vtkIndent indent); vtkSetClampMacro(NumberOfFrames, int, 2, VTK_INT_MAX); vtkGetMacro(NumberOfFrames, int); //BTX protected: vtkSequenceAnimationPlayer(); ~vtkSequenceAnimationPlayer(); virtual void StartLoop(double, double, double*); virtual void EndLoop() {}; // Description: // Return the next time given the current time. virtual double GetNextTime(double currentime); virtual double GoToNext(double start, double end, double currenttime); virtual double GoToPrevious(double start, double end, double currenttime); int NumberOfFrames; int MaxFrameWindow; double StartTime; double EndTime; int FrameNo; private: vtkSequenceAnimationPlayer(const vtkSequenceAnimationPlayer&); // Not implemented void operator=(const vtkSequenceAnimationPlayer&); // Not implemented //ETX }; #endif
/* -*- c++ -*- */ /* * Copyright 2018 <+YOU OR YOUR COMPANY+>. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_DOA_AUTOCORRELATE_SMOOTHING_H #define INCLUDED_DOA_AUTOCORRELATE_SMOOTHING_H #include <doa/api.h> #include <gnuradio/block.h> namespace gr { namespace doa { /*! * \brief <+description of block+> * \ingroup doa * */ class DOA_API autocorrelate_smoothing : virtual public gr::block { public: typedef boost::shared_ptr<autocorrelate_smoothing> sptr; /*! * \brief Return a shared_ptr to a new instance of doa::autocorrelate_smoothing. * * To avoid accidental use of raw pointers, doa::autocorrelate_smoothing's * constructor is in a private implementation * class. doa::autocorrelate_smoothing::make is the public interface for * creating new instances. */ static sptr make(int inputs, int snapshot_size, int overlap_size, int avg_method, int subspace_smoothing, int subarray_size); }; } // namespace doa } // namespace gr #endif /* INCLUDED_DOA_AUTOCORRELATE_SMOOTHING_H */
/////////////////////////////////////////////////////////////////////////// // C++ code generated with wxFormBuilder (version Feb 17 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __GUIFrame__ #define __GUIFrame__ // Define WX_GCH in order to support precompiled headers with GCC compiler. // You have to create the header "wx_pch.h" and include all files needed // for compile your gui inside it. // Then, compile it and place the file "wx_pch.h.gch" into the same // directory that "wx_pch.h". #ifdef WX_GCH #include <wx_pch.h> #else #include <wx/wx.h> #endif #include <wx/menu.h> /////////////////////////////////////////////////////////////////////////// #define idMenuQuit 1000 #define idMenuAbout 1001 #define idMenuOpenFilm 1002 #define idMenuOpenSub 1003 /////////////////////////////////////////////////////////////////////////////// /// Class GUIFrame /////////////////////////////////////////////////////////////////////////////// class GUIFrame : public wxFrame { DECLARE_EVENT_TABLE() private: // Private event handlers void _wxFB_OnClose( wxCloseEvent& event ){ OnClose( event ); } void _wxFB_OnQuit( wxCommandEvent& event ){ OnQuit( event ); } void _wxFB_OnAbout( wxCommandEvent& event ){ OnAbout( event ); } void _wxFB_OnOpenFilm( wxCommandEvent& event){OnOpenFilm(event);} void _wxFB_OnOpenSub( wxCommandEvent& event){OnOpenSub(event);} protected: wxMenuBar* mbar; wxStatusBar* statusBar; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } virtual void OnQuit( wxCommandEvent& event ){ event.Skip(); } virtual void OnAbout( wxCommandEvent& event ){ event.Skip(); } virtual void OnOpenFilm(wxCommandEvent& event){event.Skip();} virtual void OnOpenSub(wxCommandEvent& event){event.Skip();} public: GUIFrame( wxWindow* parent, int id = wxID_ANY, wxString title = wxT("ytsub"), wxPoint pos = wxDefaultPosition, wxSize size = wxSize( 481,466 ), int style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); }; #endif //__GUIFrame__
/* * @lc app=leetcode id=576 lang=c * * [576] Out of Boundary Paths * * autogenerated using scripts/convert.py */ int findPaths(int m, int n, int N, int i, int j) { int **dp, **dp_t, **t, **h, *temp, x, r, c, dr, dc, dirs[] = {0, -1, 0, 1, -1, 0, 1, 0}, ret = 0; if (! (m && n && N)) return 0; temp = (int *)calloc(2 * m * n, sizeof(int)); h = (int **)malloc(2 * m * sizeof(int *)); dp = h; dp_t = dp + m; for (x = 0; x < 2 * m; ++x) dp[x] = temp + x * n; dp[i][j] = 1; while (N--) { memset(*dp_t, 0, m * n * sizeof(int)); for (r = 0; r < m; ++r) { for (c = 0; c < n; ++c) { for (x = 0; x < 8; ++x) { dr = r + dirs[x]; dc = c + dirs[++x]; if (dr < 0 || dr >= m || dc < 0 || dc >= n) ret = (ret + dp[r][c]) % 1000000007; else dp_t[dr][dc] = (dp_t[dr][dc] + dp[r][c]) % 1000000007; } } } t = dp_t; dp_t = dp; dp = t; } free(temp); free(h); return ret; }
/** Copyright (c) 2015 Maciej Nabozny This file is part of KernelConnect project. KernelConnect is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. KernelConnect 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 KernelConnect. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PROCESSBUFFER_H #define PROCESSBUFFER_H #include <linux/list.h> #include <linux/thread_info.h> #include <linux/slab.h> #include <linux/sched.h> #include <linux/spinlock.h> #include <asm/spinlock.h> /** * @brief The message struct keeps single message. Use message_new and * message_destroy functions to create or remove message. */ struct message { unsigned int pid; unsigned long size; void *data; struct list_head list; }; extern struct list_head outgoing_buffer; extern struct list_head incoming_buffer; /** * @brief message_new allocate new message and assign given data to it * @param size size of data * @param data pointer to data * @return new message */ struct message *message_new(void *data, unsigned long size); /** * @brief message_destroy destroys message allocated by message_new * @param msg pointer to message object */ void message_destroy(struct message *msg); /** * @brief message_send Put new message into outgoing buffer. Used by all * redirected systemcalls acroos the kernel * @param msg */ void message_send(struct message *msg); /** * @brief message_get_sent get one message awaiting in outgoing buffer. Used in * device functions. */ struct message *message_get_sent(void); /** * @brief message_get Get message from buffer and remove it from buffer * @return pointer to message or null, if there is no new message */ struct message *message_get(void); /** * @brief message_put_incoming adds new message to incoming buffer * @param msg pointer to message */ void message_put_incoming(struct message *msg); #endif // PROCESSBUFFER_H
/* * include/configs/lager.h * This file is lager board configuration. * * Copyright (C) 2013, 2014 Renesas Electronics Corporation * * SPDX-License-Identifier: GPL-2.0 */ #ifndef __LAGER_H #define __LAGER_H #undef DEBUG #define CONFIG_R8A7790 #define CONFIG_ARCH_RMOBILE_BOARD_STRING "Lager" #include "rcar-gen2-common.h" #if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) #define CONFIG_SYS_TEXT_BASE 0xB0000000 #else #define CONFIG_SYS_TEXT_BASE 0xE8080000 #endif /* STACK */ #if defined(CONFIGF_RMOBILE_EXTRAM_BOOT) #define CONFIG_SYS_INIT_SP_ADDR 0xB003FFFC #else #define CONFIG_SYS_INIT_SP_ADDR 0xE827FFFC #endif #define STACK_AREA_SIZE 0xC000 #define LOW_LEVEL_MERAM_STACK \ (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4) /* MEMORY */ #define RCAR_GEN2_SDRAM_BASE 0x40000000 #define RCAR_GEN2_SDRAM_SIZE (2048u * 1024 * 1024) #define RCAR_GEN2_UBOOT_SDRAM_SIZE (512 * 1024 * 1024) /* SCIF */ #define CONFIG_SCIF_CONSOLE /* SPI */ #define CONFIG_SPI #define CONFIG_SH_QSPI /* SH Ether */ #define CONFIG_SH_ETHER #define CONFIG_SH_ETHER_USE_PORT 0 #define CONFIG_SH_ETHER_PHY_ADDR 0x1 #define CONFIG_SH_ETHER_PHY_MODE PHY_INTERFACE_MODE_RMII #define CONFIG_SH_ETHER_ALIGNE_SIZE 64 #define CONFIG_SH_ETHER_CACHE_WRITEBACK #define CONFIG_SH_ETHER_CACHE_INVALIDATE #define CONFIG_PHYLIB #define CONFIG_PHY_MICREL #define CONFIG_BITBANGMII #define CONFIG_BITBANGMII_MULTI /* I2C */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_RCAR #define CONFIG_SYS_RCAR_I2C0_SPEED 400000 #define CONFIG_SYS_RCAR_I2C1_SPEED 400000 #define CONFIG_SYS_RCAR_I2C2_SPEED 400000 #define CONFIG_SYS_RCAR_I2C3_SPEED 400000 #define CONFIF_SYS_RCAR_I2C_NUM_CONTROLLERS 4 #define CONFIG_SYS_I2C_POWERIC_ADDR 0x58 /* da9063 */ /* Board Clock */ #define RMOBILE_XTAL_CLK 20000000u #define CONFIG_SYS_CLK_FREQ RMOBILE_XTAL_CLK #define CONFIG_SH_TMU_CLK_FREQ (CONFIG_SYS_CLK_FREQ / 2) /* EXT / 2 */ #define CONFIG_PLL1_CLK_FREQ (CONFIG_SYS_CLK_FREQ * 156 / 2) #define CONFIG_PLL1_DIV2_CLK_FREQ (CONFIG_PLL1_CLK_FREQ / 2) #define CONFIG_MP_CLK_FREQ (CONFIG_PLL1_DIV2_CLK_FREQ / 15) #define CONFIG_HP_CLK_FREQ (CONFIG_PLL1_CLK_FREQ / 12) #define CONFIG_SYS_TMU_CLK_DIV 4 /* USB */ #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_RMOBILE #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 /* MMC */ #define CONFIG_SH_MMCIF #define CONFIG_SH_MMCIF_ADDR 0xEE220000 #define CONFIG_SH_MMCIF_CLK 97500000 /* Module stop status bits */ /* INTC-RT */ #define CONFIG_SMSTP0_ENA 0x00400000 /* MSIF */ #define CONFIG_SMSTP2_ENA 0x00002000 /* INTC-SYS, IRQC */ #define CONFIG_SMSTP4_ENA 0x00000180 /* SCIF0 */ #define CONFIG_SMSTP7_ENA 0x00200000 /* SDHI */ #define CONFIG_SH_SDHI_FREQ 97500000 #endif /* __LAGER_H */
/*************************************************************************** * * * Copyright (C) 2017 Seamly, LLC * * * * https://github.com/fashionfreedom/seamly2d * * * *************************************************************************** ** ** Seamly2D is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** Seamly2D 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 Seamly2D. If not, see <http://www.gnu.org/licenses/>. ** ************************************************************************** ************************************************************************ ** ** @file vcubicbezierpath.h ** @author Roman Telezhynskyi <dismine(at)gmail.com> ** @date 16 3, 2016 ** ** @brief ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. ** Copyright (C) 2016 Seamly2D project ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved. ** ** Seamly2D is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** Seamly2D 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 Seamly2D. If not, see <http://www.gnu.org/licenses/>. ** *************************************************************************/ #ifndef VCUBICBEZIERPATH_H #define VCUBICBEZIERPATH_H #include <qcompilerdetection.h> #include <QCoreApplication> #include <QPointF> #include <QSharedDataPointer> #include <QString> #include <QTypeInfo> #include <QVector> #include <QtGlobal> #include "vabstractcubicbezierpath.h" #include "vgeometrydef.h" #include "vpointf.h" class VCubicBezierPathData; class VCubicBezierPath : public VAbstractCubicBezierPath { Q_DECLARE_TR_FUNCTIONS(VCubicBezierPath) public: explicit VCubicBezierPath(quint32 idObject = 0, Draw mode = Draw::Calculation); VCubicBezierPath(const VCubicBezierPath &curve); VCubicBezierPath(const QVector<VPointF> &points, quint32 idObject = 0, Draw mode = Draw::Calculation); VCubicBezierPath Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const; VCubicBezierPath Flip(const QLineF &axis, const QString &prefix = QString()) const; VCubicBezierPath Move(qreal length, qreal angle, const QString &prefix = QString()) const; virtual ~VCubicBezierPath(); VCubicBezierPath &operator=(const VCubicBezierPath &curve); #ifdef Q_COMPILER_RVALUE_REFS VCubicBezierPath &operator=(VCubicBezierPath &&curve) Q_DECL_NOTHROW; #endif void Swap(VCubicBezierPath &curve) Q_DECL_NOTHROW; VPointF &operator[](int indx); const VPointF &at(int indx) const; void append(const VPointF &point); virtual qint32 CountSubSpl() const Q_DECL_OVERRIDE; virtual qint32 CountPoints() const Q_DECL_OVERRIDE; virtual void Clear() Q_DECL_OVERRIDE; virtual VSpline GetSpline(qint32 index) const Q_DECL_OVERRIDE; virtual qreal GetStartAngle () const Q_DECL_OVERRIDE; virtual qreal GetEndAngle () const Q_DECL_OVERRIDE; virtual qreal GetC1Length() const Q_DECL_OVERRIDE; virtual qreal GetC2Length() const Q_DECL_OVERRIDE; virtual QVector<VSplinePoint> GetSplinePath() const Q_DECL_OVERRIDE; QVector<VPointF> GetCubicPath() const; static qint32 CountSubSpl(qint32 size); static qint32 SubSplOffset(qint32 subSplIndex); static qint32 SubSplPointsCount(qint32 countSubSpl); protected: virtual VPointF FirstPoint() const Q_DECL_OVERRIDE; virtual VPointF LastPoint() const Q_DECL_OVERRIDE; private: QSharedDataPointer<VCubicBezierPathData> d; }; Q_DECLARE_TYPEINFO(VCubicBezierPath, Q_MOVABLE_TYPE); #endif // VCUBICBEZIERPATH_H
/* This file is part of the Neper software package. */ /* Copyright (C) 2003-2022, Romain Quey. */ /* See the COPYING file in the top-level directory. */ #ifdef __cplusplus extern "C" { #endif /// \file neut_polymod.h /// \brief /// \author Romain Quey /// \bug No known bugs #ifndef NEUT_POLYMOD_H #define NEUT_POLYMOD_H extern void neut_polymod_set_zero (struct POLYMOD *pPolymod); extern void neut_polymod_free (struct POLYMOD *pPolymod); extern void neut_polymod_faces_inter (struct POLYMOD Polymod, int p1, int p2, int p3, double *inter); #endif /* NEUT_POLYMOD_H */ #ifdef __cplusplus } #endif
/* ========================================================================== */ /* === umfpack_timer ======================================================== */ /* ========================================================================== */ /* -------------------------------------------------------------------------- */ /* UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE Dept, */ /* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */ /* web: http://www.cise.ufl.edu/research/sparse/umfpack */ /* -------------------------------------------------------------------------- */ double umfpack_timer ( void ) ; /* Syntax (for all versions: di, dl, zi, and zl): #include "umfpack.h" double t ; t = umfpack_timer ( ) ; Purpose: Returns the CPU time used by the process. Includes both "user" and "system" time (the latter is time spent by the system on behalf of the process, and is thus charged to the process). It does not return the wall clock time. See umfpack_tic and umfpack_toc (the file umfpack_tictoc.h) for the timer used internally by UMFPACK. This routine uses the Unix getrusage routine, if available. It is less subject to overflow than the ANSI C clock routine. If getrusage is not available, the portable ANSI C clock routine is used instead. Unfortunately, clock ( ) overflows if the CPU time exceeds 2147 seconds (about 36 minutes) when sizeof (clock_t) is 4 bytes. If you have getrusage, be sure to compile UMFPACK with the -DGETRUSAGE flag set; see umf_config.h and the User Guide for details. Even the getrusage routine can overlow. Arguments: None. */
/* * Xenomai Lab * Copyright (C) 2013 Jorge Azevedo * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SUPERBLOCK_H #define SUPERBLOCK_H #include "macros.h" #include <QString> class SuperBlock { public: SuperBlock(); SuperBlock(const QString& type, const QString& name, const qreal& X, const qreal& Y); void setType(const QString& type); QString type() const; void setName(const QString& name); QString name() const; void setX(qreal X); qreal X() const; void setY(qreal Y); qreal Y() const; friend QDebug operator<< (QDebug d, const SuperBlock &model); bool operator==(const SuperBlock &other) const; private: QString d_type; QString d_name; qreal x; qreal y; }; #endif // SUPERBLOCK_H
//Modified from: https://www.linuxvoice.com/be-a-kernel-hacker/ //License: GPL #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <string.h> int main(int argc, char ** argv) { int fd = open("/dev/reverse", O_RDWR); if(argc == 2) { printf("Word: %s\t\t", argv[1]); write(fd, argv[1], strlen(argv[1])); read(fd, argv[1], strlen(argv[1])); printf("Read: %s\n", argv[1]); return 0; } char *phrase = "are you as clever as i am"; int len = strlen(phrase); if(fork()) { while(1) { write(fd, phrase, len); sleep(1); } } else { char buf[len + 1]; while(1) { read(fd, buf, len); printf("Word: %s?\t\t", phrase); printf("Read: %s?\n", buf); sleep(1); } } }
/***************************************************************************** * * Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC * Produced at the Lawrence Livermore National Laboratory * LLNL-CODE-442911 * All rights reserved. * * This file is part of VisIt. For details, see https://visit.llnl.gov/. The * full copyright notice is contained in the file COPYRIGHT located at the root * of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html. * * 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 disclaimer below. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the disclaimer (as noted below) in the * documentation and/or other materials provided with the distribution. * - Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY, * LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * *****************************************************************************/ #ifndef SYMBOL_H #define SYMBOL_H #include <parser_exports.h> #include <vector> #include <string> #include <map> #include <visitstream.h> #define MAXSYMBOLS 64 struct SymbolSet; class Rule; class Dictionary; // **************************************************************************** // Class: Symbol // // Purpose: // Used for terminals and nonterminals when expressing and // parsing a grammar. // // Programmer: Jeremy Meredith // Creation: April 4, 2002 // // Modifications: // Jeremy Meredith, Wed Nov 24 12:04:23 PST 2004 // Added a new constructor due to some major refactoring. // // Jeremy Meredith, Wed Jun 8 11:28:01 PDT 2005 // Moved static data to a new Dictionary object. // // **************************************************************************** class PARSER_API Symbol { public: enum Type { Terminal, NonTerminal }; public: Symbol(Dictionary&,int tt); Symbol(Dictionary&,int tt, const std::string &s); Symbol(Dictionary&,const std::string &s); bool operator==(const Symbol &rhs) const; bool IsNullable(const std::vector<const Rule*>&) const; SymbolSet GetFirstSet(const std::vector<const Rule*>&) const; int GetIndex() const { return index; } bool IsTerminal() const { return type == Terminal; } bool IsNonTerminal() const { return type == NonTerminal; } friend ostream &operator<<(ostream&, const Symbol&); int GetTerminalType() const { return terminaltype; } std::string GetDisplayString() const { return displaystring; } private: Type type; int terminaltype; std::string displaystring; int index; }; #endif
/* * (C) Copyright 2010 * Texas Instruments Incorporated. * Steve Sakoman <steve@sakoman.com> * * Configuration settings for the TI OMAP4 Panda board. * See omap4_common.h for OMAP4 common part * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __CONFIG_PANDA_H #define __CONFIG_PANDA_H /* * High Level Configuration Options */ /* USB UHH support options */ #define CONFIG_CMD_USB #define CONFIG_USB_HOST #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_OMAP #define CONFIG_USB_STORAGE #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 1 #define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 62 /* USB Networking options */ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_SMSC95XX #define CONFIG_UBOOT_ENABLE_PADS_ALL #define CONFIG_CMD_PING #define CONFIG_CMD_DHCP #define CONFIG_USB_ULPI #define CONFIG_USB_ULPI_VIEWPORT_OMAP #include <configs/omap4_common.h> #define CONFIG_CMD_NET /* GPIO */ #define CONFIG_CMD_GPIO /* ENV related config options */ #define CONFIG_ENV_IS_NOWHERE #define CONFIG_SYS_PROMPT "Panda # " #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #endif /* __CONFIG_PANDA_H */
// // DeviceInfo.h // 智能控制系统 // // Created by rf on 15/7/17. // Copyright (c) 2015年 wangli. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreBluetooth/CoreBluetooth.h> @interface DeviceInfo : NSObject @property (nonatomic,strong) CBPeripheral* cb; @property (nonatomic,strong) NSString * macAddrss;// Mac address broadcasted by Bluetooth peripherals @property (nonatomic,copy) NSString * UUIDString;//UUID of Bluetooth peripherals @property (nonatomic,copy) NSString * localName;//Manufacturer identifier of the Bluetooth peripherals @property (nonatomic,copy) NSString * name; //The name of the Bluetooth peripherals @property (nonatomic,assign) NSInteger RSSI; @property (nonatomic, strong) NSDictionary * advertisementDic; @end
/* Copyright (C) 2015-2018 Jan Christian Rohde This file is part of netObservator. netObservator is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. netObservator 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 netObservator; if not, see http://www.gnu.org/licenses. */ #include <QVBoxLayout> #include <QScrollArea> #include "observers.h" #include "packetinfopresenter.h" #include "packetparser.h" #include "hostchart.h" #ifndef VIEW_H #define VIEW_H /*--------------------------------------------------------------------------*/ class View : public serverObserver { public: PacketParser *parser; std::function<void(QString&)> getContent; virtual void update(const serverState &state); void update(const parseInstruction &inst); void getSettings(const parseInstruction &inst) {instruction = inst; packetInfo->update(instruction.settings);} PacketInfoPresenter *packetInfo; protected: parseInstruction instruction; QStringList sliceNames; virtual void rewriteInfo(); virtual void init(); }; /*--------------------------------------------------------------------------*/ class DatabaseView : public View { public: DatabaseView(); ~DatabaseView() {} void rewriteInfo(); void setChartVisible(bool v); void compose(ViewComposition composition); TablePacketInfoPresenter tablePacketInfo; HostChart chart; QScrollArea *chartScene; QDialog * dialog; private: bool chartVisible; bool chartUpdated; void updateChart(); }; /*--------------------------------------------------------------------------*/ class StatisticsView : public View { public: StatisticsView(); ~StatisticsView() {} void update(const serverState &state); void update(column C); void setSliceNames(const QStringList &names) {sliceNames = names;} StatisticsPacketInfoPresenter statisticsPacketInfo; protected: void init(); void rewriteInfo(); private: column COLUMN; void rewriteFileInfo(); }; /*--------------------------------------------------------------------------*/ class TrafficView : public View { public: TrafficView(TrafficPacketInfoPresenter::infoType type); void setOutputDevice(std::function<void(int, long int)> device) {trafficPacketInfo.evaluatePacketsOfSecond = device;} void update(const serverState &state); void rewriteInfo(); void setSliceNames(const QStringList &names) {sliceNames = names;} TrafficPacketInfoPresenter::infoType getType() {return trafficPacketInfo.getType();} private: TrafficPacketInfoPresenter trafficPacketInfo; void rewriteFileInfo(); }; #endif // VIEW_H
/** * Glista - A simple task list management utility * Copyright (C) 2008 Shahar Evron, shahar@prematureoptimization.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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define _XOPEN_SOURCE /* glibc2 needs this */ #include <time.h> #include <glib/gi18n.h> #include <gmodule.h> #include <gtk/gtk.h> #include "../glista.h" #include "../glista-plugin.h" #include "../glista-reminder.h" /** * Glista reminder messaging module: dummy * * This module is here as an example. As a real reminder module it's pretty * poor - it just prints out a messages to STDOUT. */ GLISTA_DECLARE_PLUGIN( GLISTA_PLUGIN_REMINDER, "reminder-dummy", "Dummy - print to stdout" ); /** * glista_remindhandler_init: * @error A pointer to fill with an error, if any * * Initialize the remind handler module. * In the case of the dummy handler, this does nothing important. * * Returns: TRUE on success, FALSE otherwise */ G_MODULE_EXPORT gboolean glista_remindhandler_init(GError **error) { g_printerr("Module initialized\n"); return TRUE; } /** * glista_remindhandler_shutdown: * @error A pointer to fill with an error, if any * * Shut down the remind handler module. * In the case of the dummy handler, this does nothing important. * * Returns: TRUE on success, FALSE otherwise */ G_MODULE_EXPORT gboolean glista_remindhandler_shutdown(GError **error) { g_printerr("Module shut down\n"); return TRUE; } /** * glista_remindhandler_remind: * @reminder The reminder to handle * @error A pointer to fill with an error, if any * * Remind the user about a task. The dummy reminder simply prints out a * message to STDOUT. * * Returns: TRUE on success, FALSE otherwise */ G_MODULE_EXPORT gboolean glista_remindhandler_remind(GlistaReminder *reminder, GError **error) { GtkTreePath *path; GtkTreeIter iter; gchar *item_text, *time_str; struct tm *ltime; // Get reminder time into a string ltime = localtime(&(reminder->remind_at)); time_str = g_malloc0(sizeof(gchar[72])); strftime(time_str, 70, "%x %H:%M", ltime); // Get the item name path = gtk_tree_row_reference_get_path(reminder->item_ref); gtk_tree_model_get_iter(GL_ITEMSTM, &iter, path); gtk_tree_model_get(GL_ITEMSTM, &iter, GL_COLUMN_TEXT, &item_text, -1); // Remind! g_print("It's %s - don't forget: %s\n", time_str, item_text); // Free used memory g_free(time_str); return TRUE; }
#ifndef _STRINGUTILS_H #define _STRINGUTILS_H #include <string> #include <vector> typedef std::string String; typedef std::wstring WString; typedef std::vector<String> StringList; typedef std::vector<WString> WStringList; class StringUtils { public: static StringList Split(const String & s, char delim, std::vector<String> & elems); static StringList Split(const String & s, char delim); static String Escape(const String & s); static String Trim(const String & s); static String TrimLeft(const String & s); static String TrimRight(const String & s); static String Utf16ToUtf8(const WString & wstr); static String Utf16ToUtf8(const wchar_t* wstr); static WString Utf8ToUtf16(const String & str); static WString Utf8ToUtf16(const char* str); static void ReplaceAll(String & s, const String & from, const String & to); static void ReplaceAll(WString & s, const WString & from, const WString & to); static String sprintf(const char* format, ...); static WString sprintf(const wchar_t* format, ...); private: static const String WHITESPACE; }; #endif //_STRINGUTILS_H
#pragma once #include <map> #include <string> #include <vector> #include <cinttypes> #include "pvector.h" #include "range.h" namespace DynoGraph { class AlgDataManager { private: std::map<std::string, pvector<int64_t>> last_epoch_data; std::map<std::string, pvector<int64_t>> current_epoch_data; std::string path; public: AlgDataManager(int64_t nv, std::vector<std::string> alg_names); void next_epoch(); void rollback(); void dump(int64_t epoch) const; DynoGraph::Range<int64_t> get_data_for_alg(std::string alg_name); }; } // end namespace DynoGraph
/* * misc.h * * Created on: 2. veebr 2018 * Author: raigo */ #ifndef LEGAL_ACT_H_ #define LEGAL_ACT_H_ #include <stdbool.h> #include "sections.h" #include "error.h" struct legal_act_id { char* type; char* year; char* number; const char* version_date; }; struct legal_act_id leg_init_c(char* type, char* year, char* number); void leg_free(struct legal_act_id* legislation_p); bool get_sections_from_legislation( struct section_vec* result, struct legal_act_id, struct error*); char* fit_text(const char* text, int32_t prefix_length); #endif /* LEGAL_ACT_H_ */
// // AboutPanelController.h // This file is part of ShairPortMenu. // // A Simple OS X GUI wrapper for ShairPort / HairTunes // // Copyright 2011 Robert Carlsen. // // ShairPortMenu is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ShairPortMenu 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 ShairPortMenu. If not, see <http://www.gnu.org/licenses/>. // #import <Cocoa/Cocoa.h> @interface AboutPanelController : NSWindowController { @private IBOutlet NSTextView *aboutTextView; IBOutlet NSTextField *versionLabel; } @property(nonatomic,retain)IBOutlet NSTextField *versionLabel; @end
#ifndef Music_h #define Music_h #include "Arduino.h" #include "Melodies.h" class Music { public: Music(int speakerPin); void cycle(unsigned long currentTime); void setMelody(const int (*melody)[2]); private: int _speakerPin; unsigned long _toneTimer; unsigned int _notePosition; boolean _firstNotePlayed; const int (*_melody)[2]; int _currentNote; int _currentDuration; bool _isPlaying; bool isEmptyMelody(); bool isEndNote(int notePosition); void setCurrentNoteAndDuration(int notePosition); int getNoteAt(int notePosition); int getDurationAt(int notePosition); }; #endif
#ifndef POINT_H_INCLUDED #define POINT_H_INCLUDED /*#include <iostream> #include <sstream>*/ #include <cmath> class Point { public: Point(int X , int Y = 0 ); Point(); //Point(double X , double Y = 0.0); /*void afficher(bool passer_a_la_ligne = true) const; std::string text() const;*/ int x; int y; }; Point operator+(Point A, Point B); Point operator-(Point A, Point B); Point operator-(Point A); bool operator==(Point A, Point B); float distance(Point A, Point B); #endif // POINT_H_INCLUDED
// // MasterViewController.h // ScrollView+PaperFold+PageControl // // Created by Jun Seki on 13/06/2014. // Copyright (c) 2014 Poq Studio. All rights reserved. // #import <UIKit/UIKit.h> @class DetailViewController; @interface MasterViewController : UITableViewController @property (strong, nonatomic) DetailViewController *detailViewController; @end
#include "window.h" #include <stdlib.h> #include <stdio.h> ODIN_Window* Window_new(const char* title, const int width, const int height) { ODIN_Window* odin_window = (ODIN_Window*)malloc(sizeof(ODIN_Window)); //TODO: Configure for mobile // Configure the OpenGL Version DESKTOP SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); // Temp set pointer to 0 (NULL) - to point at nothing odin_window->window = 0; odin_window->window = SDL_CreateWindow( title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_OPENGL); // Check if window is created if (odin_window->window == 0) return 0; // Create the actual OpenGL Context SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1); odin_window->context = SDL_GL_CreateContext(odin_window->window); if (odin_window->context == 0) { printf("Error creating OpenGL Context!\n"); return 0; } glewExperimental = GL_TRUE; GLenum err = glewInit(); if (err != GLEW_OK) { printf("Error initializing GLEW!\n"); return 0; } if (!GLEW_VERSION_3_3) { printf("OpenGL 3.3 not available\n"); } // Make GL Context Current SDL_GL_MakeCurrent(odin_window->window, odin_window->context); // Enable hardware depth testing and model vertex draw ordering glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); // Set VSync if (SDL_GL_SetSwapInterval(1) < 0) { printf("Warning: Unable to set VSync! Error: %s\n", SDL_GetError()); } printf("OpenGL %s\n", glGetString(GL_VERSION)); glViewport(0, 0, width, height); return odin_window; } void Window_delete(ODIN_Window* odin_window) { SDL_GL_DeleteContext(odin_window->context); SDL_DestroyWindow(odin_window->window); free(odin_window); } void Window_clearColor(const float r, const float g, const float b, const float a) { // OpenGL Rendering loop glClearColor(r, g, b, a); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } void Window_swapBuffer(ODIN_Window* window) { SDL_GL_SwapWindow(window->window); }
/* This file is part of the Neper software package. */ /* Copyright (C) 2003-2022, Romain Quey. */ /* See the COPYING file in the top-level directory. */ #include<stdio.h> #include<stdlib.h> #include<math.h> #include"../../../structIn_t.h" #include"ut.h" #include"neut_t.h" #include"../../../net_utils/net_utils.h" #include"net_reg_merge_del_ff/net_reg_merge_del_ff.h" #include"net_reg_merge_del.h" extern void net_reg_merge_del_buffer (struct TESS Tess, int edge, int **buf, struct TESS *pTessBuf); extern void UpdateEdgeState (struct TESS *, int); extern void SearchDelNNewVer (struct TESS *, int, int *, int *); extern void UpdateEdgeVerNb (struct TESS *, int, int, int); extern void UpdateEdgeLength (struct TESS *, int); extern int UpdateFaceVerNEdge (struct TESS *, int, int, int, int); extern void UpdateFaceState (struct TESS *, int, int); extern void UpdateFaceVer (struct TESS *, int, int, int); extern int UpdateFaceEdge (struct TESS *, int, int); extern void net_reg_merge_delFromFace (struct TESS *, int, int, int); extern void DeleteVerFromFace (struct TESS *, int, int, int); extern void ReplaceVerInFace (struct TESS *, int, int, int); extern int DeleteFace (struct TESS *, int, int, int); extern void DeleteFaceFromItsPoly (struct TESS *, int); extern void SearchNewNOldEdges (struct TESS *, int, int, int *, int *); extern void net_edgedel_edgedom_fromverdom (struct TESS *, int); extern void net_tess_reg_ver_facedom (struct TESS *, int); extern int UpdateVer (struct TESS *, int, int, int, int); extern void UpdateVerState (struct TESS *, int, int, int); extern void UpdateVerEdge (struct TESS *, int, int, int, int); extern int UpdateVerBound (struct TESS *, int, int); extern int UpdateVerCoo (struct TESS *, int, int, int); extern int UpdateVerCooBary (struct TESS *, int, int); extern int UpdateVerCooMiniFF (struct TESS *, int, int);
#pragma once #include <afxcmn.h> class CMPCThemeLinkCtrl : public CLinkCtrl { public: CMPCThemeLinkCtrl(); virtual ~CMPCThemeLinkCtrl(); DECLARE_MESSAGE_MAP() afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); virtual void PreSubclassWindow(); };
/* atPeek - iPhone app browsing tool Copyright (C) 2008 atPurpose This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/> */ #import <Cocoa/Cocoa.h> @interface ToggleableSplitView : NSSplitView <NSSplitViewDelegate> { IBOutlet NSView *topView; IBOutlet NSView *bottomView; NSUInteger toggleMode; } @property(assign) NSUInteger toggleMode; @end
#include "header.h" void foo_1() { printf("Doing something %d\n", 1); }
#ifndef __VERSION_H__ #define __VERSION_H__ #define KERNEL_ARCH "x86_64" #define KERNEL_NAME "Riku" #define KERNEL_VERSION "0.1" #define KERNEL_CODENAME "Michiru" #endif
/** * @file * @copyright 1998-2004 Jonathan Brown <jbrown@bluedroplet.com> * @license https://www.gnu.org/licenses/gpl-3.0.html * @homepage https://github.com/bluedroplet/emergence */ struct polygon_t { int numverts; struct vertex_t vertex[8]; }; void poly_line_clip(struct polygon_t *pin, struct vertex_t *v1, struct vertex_t *v2); // must be in c/w order void poly_clip(struct polygon_t *pin, const struct polygon_t *pclip); // must be in c/w order double poly_area(const struct polygon_t *poly); // must be in c/w order double poly_clip_area(struct polygon_t *pin, const struct polygon_t *pclip); // must be in c/w order void poly_arb_line_clip(struct vertex_ll_t **pin, struct vertex_t *v1, struct vertex_t *v2); // must be in c/w order void poly_arb_clip(struct vertex_ll_t *pin, const struct vertex_ll_t *pclip); // must be in c/w order double poly_arb_area(const struct vertex_ll_t *poly); // must be in c/w order double poly_arb_clip_area(struct vertex_ll_t **pin, struct vertex_ll_t *pclip); // must be in c/w order
#include "dtree.h" #include "test.h" void test_list_all(void) { test_start(); struct dtree_dev_t *dev = NULL; while((dev = dtree_next()) != NULL) { const char *name = dtree_dev_name(dev); dtree_addr_t base = dtree_dev_base(dev); printf("DEV '%s' at 0x%08X\n", name, base); print_compat(dev); dtree_dev_free(dev); } test_end(); } void test_find_existent(void) { test_start(); struct dtree_dev_t *dev = NULL; dev = dtree_byname("ethernet@81000000"); fail_on_true(dev == NULL, "Could not find the device 'ethernet@81000000'"); const char *name = dtree_dev_name(dev); dtree_addr_t base = dtree_dev_base(dev); printf("DEV '%s' at 0x%08X\n", name, base); dtree_dev_free(dev); test_end(); } void test_find_non_existent(void) { test_start(); struct dtree_dev_t *dev = NULL; dev = dtree_byname("@not-implemented-device"); fail_on_true(dev != NULL, "Device '@not-implemented-device' was found!"); test_end(); } void test_find_null(void) { test_start(); struct dtree_dev_t *dev = NULL; dev = dtree_byname(NULL); fail_on_false(dev == NULL, "Device NULL was found!"); test_end(); } void test_find_empty(void) { test_start(); struct dtree_dev_t *dev = NULL; dev = dtree_byname(""); fail_on_false(dev == NULL, "Device '' was found!"); test_end(); } void test_find_with_discriminator(void) { test_start(); struct dtree_dev_t *dev = NULL; dev = dtree_byname("serial@84000000"); fail_on_true(dev == NULL, "Could not find the device 'serial@84000000'"); const char *name = dtree_dev_name(dev); dtree_addr_t base = dtree_dev_base(dev); dtree_addr_t high = dtree_dev_high(dev); fail_on_false(high - base == 0xFFFF, "Invalid high detected for serial@84000000)"); printf("DEV '%s' at 0x%08X\n", name, base); dtree_dev_free(dev); test_end(); } void test_find_debug(void) { test_start(); struct dtree_dev_t *dev = NULL; dev = dtree_byname("debug@84400000"); fail_on_true(dev == NULL, "Could not find the device 'debug@84400000'"); const char *name = dtree_dev_name(dev); dtree_addr_t base = dtree_dev_base(dev); dtree_addr_t high = dtree_dev_high(dev); printf("DEV '%s' at 0x%08X .. 0x%08X\n", name, base, high); dtree_dev_free(dev); fail_on_false(high - base == 0xFFFF, "Invalid high has been read for debug@84400000"); test_end(); } int main(void) { int err = dtree_open("device-tree"); halt_on_error(err, "Can not open testing device-tree"); test_list_all(); dtree_reset(); test_find_existent(); dtree_reset(); test_find_non_existent(); dtree_reset(); test_find_null(); dtree_reset(); test_find_empty(); dtree_reset(); test_find_with_discriminator(); dtree_reset(); test_find_debug(); dtree_reset(); dtree_close(); }
/* * Copyright (C) 2010-2012 Project SkyFire <http://www.projectskyfire.org/> * Copyright (C) 2005-2012 MaNGOS <http://www.getmangos.com/> * Copyright (C) 2008-2012 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _REFMANAGER_H #define _REFMANAGER_H //===================================================== #include "Dynamic/LinkedList.h" #include "Dynamic/LinkedReference/Reference.h" template <class TO, class FROM> class RefManager : public LinkedListHead { public: typedef LinkedListHead::Iterator< Reference<TO, FROM> > iterator; RefManager() { } virtual ~RefManager() { clearReferences(); } Reference<TO, FROM>* getFirst() { return ((Reference<TO, FROM>*) LinkedListHead::getFirst()); } Reference<TO, FROM> const* getFirst() const { return ((Reference<TO, FROM> const*) LinkedListHead::getFirst()); } Reference<TO, FROM>* getLast() { return ((Reference<TO, FROM>*) LinkedListHead::getLast()); } Reference<TO, FROM> const* getLast() const { return ((Reference<TO, FROM> const*) LinkedListHead::getLast()); } iterator begin() { return iterator(getFirst()); } iterator end() { return iterator(NULL); } iterator rbegin() { return iterator(getLast()); } iterator rend() { return iterator(NULL); } void clearReferences() { LinkedListElement* ref; while((ref = getFirst()) != NULL) { ((Reference<TO, FROM>*) ref)->invalidate(); ref->delink(); // the delink might be already done by invalidate(), but doing it here again does not hurt and insures an empty list } } }; //===================================================== #endif
/* * This file is part of GodMode9 * Copyright (C) 2019 Wolfvak * * 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/>. */ #include <types.h> #include <vram.h> #include <arm.h> #include <pxi.h> #include "arm/gic.h" #include "arm/mmu.h" #include "arm/scu.h" #include "arm/xrq.h" #include "hw/codec.h" #include "hw/gpulcd.h" #include "hw/i2c.h" #include "hw/mcu.h" #include <spi.h> #include "system/sections.h" #define CFG11_MPCORE_CLKCNT ((vu16*)(0x10141300)) #define CFG11_SOCINFO ((vu16*)(0x10140FFC)) #define LEGACY_BOOT_ENTRYPOINT ((vu32*)0x1FFFFFFC) #define LEGACY_BOOT_ROUTINE_SMP (0x0001004C) static bool SYS_IsNewConsole(void) { return (*CFG11_SOCINFO & 2) != 0; } static bool SYS_ClkMultEnabled(void) { return (*CFG11_MPCORE_CLKCNT & 1) != 0; } static void SYS_EnableClkMult(void) { // magic bit twiddling to enable extra FCRAM // only done on N3DS and when it hasn't been done yet // state might get a bit messed up so it has to be done // as early as possible in the initialization chain if (SYS_IsNewConsole() && !SYS_ClkMultEnabled()) { gicSetInterruptConfig(88, BIT(0), GIC_PRIO_HIGHEST, NULL); gicEnableInterrupt(88); *CFG11_MPCORE_CLKCNT = 0x8001; do { ARM_WFI(); } while(!(*CFG11_MPCORE_CLKCNT & 0x8000)); gicDisableInterrupt(88); gicClearInterruptConfig(88); } } void SYS_CoreZeroInit(void) { gicGlobalReset(); *LEGACY_BOOT_ENTRYPOINT = 0; SYS_EnableClkMult(); SCU_Init(); // Map all sections here mmuMapArea(SECTION_TRI(text), MMU_FLAGS(MMU_CACHE_WT, MMU_READ_ONLY, 0, 1)); mmuMapArea(SECTION_TRI(data), MMU_FLAGS(MMU_CACHE_WBA, MMU_READ_WRITE, 1, 1)); mmuMapArea(SECTION_TRI(rodata), MMU_FLAGS(MMU_CACHE_WT, MMU_READ_ONLY, 1, 1)); mmuMapArea(SECTION_TRI(bss), MMU_FLAGS(MMU_CACHE_WBA, MMU_READ_WRITE, 1, 1)); mmuMapArea(SECTION_TRI(shared), MMU_FLAGS(MMU_STRONG_ORDER, MMU_READ_WRITE, 1, 1)); // High exception vectors mmuMapArea(0xFFFF0000, xrqInstallVectorTable(), 4UL << 10, MMU_FLAGS(MMU_CACHE_WT, MMU_READ_ONLY, 0, 0)); // BootROM mmuMapArea(0x00010000, 0x00010000, 32UL << 10, MMU_FLAGS(MMU_CACHE_WT, MMU_READ_ONLY, 0, 1)); // IO Registers mmuMapArea(0x10100000, 0x10100000, 4UL << 20, MMU_FLAGS(MMU_DEV_SHARED, MMU_READ_WRITE, 1, 1)); // MPCore Private Memory Region mmuMapArea(0x17E00000, 0x17E00000, 8UL << 10, MMU_FLAGS(MMU_DEV_SHARED, MMU_READ_WRITE, 1, 1)); // VRAM mmuMapArea(0x18000000, 0x18000000, 6UL << 20, MMU_FLAGS(MMU_CACHE_WT, MMU_READ_WRITE, 1, 1)); // FCRAM if (SYS_IsNewConsole()) { mmuMapArea(0x20000000, 0x20000000, 256UL << 20, MMU_FLAGS(MMU_CACHE_WB, MMU_READ_WRITE, 1, 1)); } else { mmuMapArea(0x20000000, 0x20000000, 128UL << 20, MMU_FLAGS(MMU_CACHE_WB, MMU_READ_WRITE, 1, 1)); } // screen init magicks TIMER_WaitMS(64); // Initialize peripherals PXI_Reset(); I2C_init(); mcuReset(); SPI_Init(); CODEC_Init(); } void SYS_CoreInit(void) { // Reset local GIC registers gicLocalReset(); // Set up MMU registers mmuInitRegisters(); // Enable fancy ARM11 features ARM_SetACR(ARM_GetACR() | ACR_RETSTK | ACR_DBPRED | ACR_SBPRED | ACR_FOLDING | ACR_SMP); ARM_SetCR(ARM_GetCR() | CR_MMU | CR_CACHES | CR_FLOWPRED | CR_HIGHVEC | CR_DSUBPAGE); ARM_DSB(); ARM_EnableInterrupts(); } void SYS_CoreZeroShutdown(void) { ARM_DisableInterrupts(); gicGlobalReset(); } void __attribute__((noreturn)) SYS_CoreShutdown(void) { u32 core = ARM_CoreID(); ARM_DisableInterrupts(); gicLocalReset(); ARM_WbInvDC(); ARM_InvIC(); ARM_DSB(); ARM_SetCR(ARM_GetCR() & ~(CR_MMU | CR_CACHES | CR_FLOWPRED)); ARM_SetACR(ARM_GetACR() & ~(ACR_RETSTK | ACR_DBPRED | ACR_SBPRED | ACR_FOLDING | ACR_SMP)); SPI_Deinit(); if (!core) { while(*LEGACY_BOOT_ENTRYPOINT == 0); ((void (*)(void))(*LEGACY_BOOT_ENTRYPOINT))(); } else { // Branch to bootrom function that does SMP reinit magic // (waits for IPI + branches to word @ 0x1FFFFFDC) ((void (*)(void))LEGACY_BOOT_ROUTINE_SMP)(); } __builtin_unreachable(); }
/** * Spektrum DSM2 satellite decoder * * Note: J1 must be set to 3.3V * */ #include "rc_dsm2.h" #include "stm32f4xx.h" void rc_dsm2_update(struct rc_input *rc) { } void rc_dsm2_init(void) { // Enable peripheral clocks // RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN; RCC->APB2ENR |= RCC_APB2ENR_USART1EN; USART_DeInit(USART1); // DSM2 uses 115200 Baud, 8N1 // USART_Init(USART3, &(USART_InitTypeDef) { .USART_BaudRate = 115200, .USART_WordLength = USART_WordLength_8b, .USART_StopBits = USART_StopBits_1, .USART_Parity = USART_Parity_No , .USART_HardwareFlowControl = USART_HardwareFlowControl_None, .USART_Mode = USART_Mode_Rx }); // Initialize GPIO pins // // PA10 USART1_RX PPM_IN // GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1); GPIO_Init(GPIOA, &(GPIO_InitTypeDef) { .GPIO_Pin = GPIO_Pin_10, .GPIO_Speed = GPIO_Speed_2MHz, .GPIO_Mode = GPIO_Mode_AF, .GPIO_OType = GPIO_OType_PP, .GPIO_PuPd = GPIO_PuPd_UP }); }
/* * Marlin 3D Printer Firmware * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef PRINTCOUNTER_H #define PRINTCOUNTER_H #include "macros.h" #include "language.h" #include "stopwatch.h" #include <avr/eeprom.h> // Print debug messages with M111 S2 //#define DEBUG_PRINTCOUNTER struct printStatistics { // 13 bytes //const uint8_t magic; // Magic header, it will always be 0x16 uint16_t totalPrints; // Number of prints uint16_t finishedPrints; // Number of complete prints uint32_t printTime; // Accumulated printing time uint32_t longestPrint; // Longest successfull print job double filamentUsed; // Accumulated filament consumed in mm }; class PrintCounter: public Stopwatch { private: typedef Stopwatch super; printStatistics data; /** * @brief EEPROM address * @details Defines the start offset address where the data is stored. */ const uint16_t address = 0x32; /** * @brief Interval in seconds between counter updates * @details This const value defines what will be the time between each * accumulator update. This is different from the EEPROM save interval. * * @note The max value for this option is 60(s), otherwise integer * overflow will happen. */ const uint16_t updateInterval = 10; /** * @brief Interval in seconds between EEPROM saves * @details This const value defines what will be the time between each * EEPROM save cycle, the development team recommends to set this value * no lower than 3600 secs (1 hour). */ const uint16_t saveInterval = 3600; /** * @brief Timestamp of the last call to deltaDuration() * @details Stores the timestamp of the last deltaDuration(), this is * required due to the updateInterval cycle. */ millis_t lastDuration; /** * @brief Stats were loaded from EERPROM * @details If set to true it indicates if the statistical data was already * loaded from the EEPROM. */ bool loaded = false; protected: /** * @brief dT since the last call * @details Returns the elapsed time in seconds since the last call, this is * used internally for print statistics accounting is not intended to be a * user callable function. */ millis_t deltaDuration(); public: /** * @brief Class constructor */ PrintCounter(); /** * @brief Checks if Print Statistics has been loaded * @details Returns true if the statistical data has been loaded. * @return bool */ bool isLoaded(); /** * @brief Increments the total filament used * @details The total filament used counter will be incremented by "amount". * * @param amount The amount of filament used in mm */ void incFilamentUsed(double const &amount); /** * @brief Resets the Print Statistics * @details Resets the statistics to zero and saves them to EEPROM creating * also the magic header. */ void initStats(); /** * @brief Loads the Print Statistics * @details Loads the statistics from EEPROM */ void loadStats(); /** * @brief Saves the Print Statistics * @details Saves the statistics to EEPROM */ void saveStats(); /** * @brief Serial output the Print Statistics * @details This function may change in the future, for now it directly * prints the statistical data to serial. */ void showStats(); /** * @brief Return the currently loaded statistics * @details Return the raw data, in the same structure used internally */ printStatistics getStats() { return this->data; } /** * @brief Loop function * @details This function should be called at loop, it will take care of * periodically save the statistical data to EEPROM and do time keeping. */ void tick(); /** * The following functions are being overridden */ bool start(); bool stop(); void reset(); #if ENABLED(DEBUG_PRINTCOUNTER) /** * @brief Prints a debug message * @details Prints a simple debug message "PrintCounter::function" */ static void debug(const char func[]); #endif }; #endif // PRINTCOUNTER_H
/* * 3dfrac - a 3D live-view fractal generator * * Copyright (c) 2012 Mathias Steiger <mathias.steiger@googlemail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef FRAC3D_FRACTAL_MATH #define FRAC3D_FRACTAL_MATH extern float iterations; extern float zoom2; int abs_val(int v); int calc_fractal(float *sp, Quaternion *qq); int calc_quatmandel_fractal (int sp, GLfloat iter_accur, GLfloat scale, int num); #endif
#ifndef __StapleAlgorithm_h_ #define __StapleAlgorithm_h_ #include "ConvertAdapter.h" template<class TPixel, unsigned int VDim> class StapleAlgorithm : public ConvertAdapter<TPixel, VDim> { public: // Common typedefs CONVERTER_STANDARD_TYPEDEFS StapleAlgorithm(Converter *c) : c(c) {} void operator() (double ival); private: Converter *c; }; #endif
/** ****************************************************************************** * @addtogroup PIOS PIOS Core hardware abstraction layer * @{ * @addtogroup PIOS_VIDEO Code for OSD video generator * @brief Output video (black & white pixels) over SPI * @{ * * @file pios_video.h * @author Tau Labs, http://taulabs.org, Copyright (C) 2013-2014 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010-2014. * @brief OSD gen module, handles OSD draw. Parts from CL-OSD and SUPEROSD projects * @see The GNU Public License (GPL) Version 3 * ****************************************************************************** */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef VIDEO_H #define VIDEO_H #include <stdint.h> #include <stdbool.h> #include "platform.h" // PAL/NTSC specific boundary values struct video_type_boundary { uint16_t graphics_right; uint16_t graphics_bottom; }; // 3D Mode enum video_3d_mode { VIDEO_3D_DISABLED, VIDEO_3D_SBS3D, }; // PAL/NTSC specific config values struct video_type_cfg { uint16_t graphics_hight_real; uint16_t graphics_column_start; uint8_t graphics_line_start; uint8_t dma_buffer_length; }; void Video_Init(); bool VideoIsInitialized(void); void Video_SetLevels(uint8_t, uint8_t, uint8_t, uint8_t); void Video_SetXOffset(int8_t); void Video_SetYOffset(int8_t); void Video_SetXScale(uint8_t pal_x_scale, uint8_t ntsc_x_scale); void Video_Set3DConfig(enum video_3d_mode mode, uint8_t right_eye_x_shift); uint16_t Video_GetLines(void); uint16_t Video_GetType(void); // video boundary values extern const struct video_type_boundary *video_type_boundary_act; #define GRAPHICS_LEFT 0 #define GRAPHICS_TOP 0 #define GRAPHICS_RIGHT video_type_boundary_act->graphics_right #define GRAPHICS_BOTTOM video_type_boundary_act->graphics_bottom #define GRAPHICS_X_MIDDLE ((GRAPHICS_RIGHT + 1) / 2) #define GRAPHICS_Y_MIDDLE ((GRAPHICS_BOTTOM + 1) / 2) // video type defs for autodetect #define VIDEO_TYPE_NONE 0 #define VIDEO_TYPE_NTSC 1 #define VIDEO_TYPE_PAL 2 #define VIDEO_TYPE_PAL_ROWS 300 #define VIDEO_X_SCALE_PAL 6 #define VIDEO_X_SCALE_NTSC 7 // draw area buffer values, for memory allocation, access and calculations we suppose the larger values for PAL, this also works for NTSC #define GRAPHICS_WIDTH_REAL 376 // max columns #define GRAPHICS_HEIGHT_REAL 266 // max lines #define BUFFER_WIDTH_TMP (GRAPHICS_WIDTH_REAL / (8 / VIDEO_BITS_PER_PIXEL)) #define BUFFER_WIDTH (BUFFER_WIDTH_TMP + BUFFER_WIDTH_TMP % 4) #define BUFFER_HEIGHT (GRAPHICS_HEIGHT_REAL) // Macro to swap buffers given a temporary pointer. #define SWAP_BUFFS(tmp, a, b) { tmp = a; a = b; b = tmp; } #endif /* VIDEO_H */
/* * Libcaphe * * Copyright (C) 2016-2018 Arnaud Rebillout * * SPDX-License-Identifier: GPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __LIBCAPHE_CAPHE_PORTAL_DBUS_INVOKATOR_H__ #define __LIBCAPHE_CAPHE_PORTAL_DBUS_INVOKATOR_H__ #include <glib-object.h> #include "caphe-dbus-invokator.h" /* GObject declarations */ #define CAPHE_TYPE_PORTAL_DBUS_INVOKATOR caphe_portal_dbus_invokator_get_type() G_DECLARE_FINAL_TYPE(CaphePortalDbusInvokator, caphe_portal_dbus_invokator, CAPHE, PORTAL_DBUS_INVOKATOR, CapheDbusInvokator) /* Methods */ CapheDbusInvokator *caphe_portal_dbus_invokator_new(void); #endif /* __LIBCAPHE_CAPHE_PORTAL_DBUS_INVOKATOR_H__ */
#ifndef _INTERPOLATION_H_ #define _INTERPOLATION_H_ #include "taah264stdtypes.h" #include "com_compatibility.h" #include <emmintrin.h> void taa_h264_save_best_chroma_8x8( int const xfrac, int const yfrac, int const cstride, uint8_t const * full_u, uint8_t const * full_v, uint8_t * best_uv ); void taa_h264_save_best_chroma_8x4( int const xfrac, int const yfrac, int const cstride, uint8_t const * full_u, uint8_t const * full_v, uint8_t * best_uv ); void taa_h264_save_best_chroma_4x8( int const xfrac, int const yfrac, int const cstride, uint8_t const * full_u, uint8_t const * full_v, uint8_t * best_uv ); void taa_h264_save_best_16x16( const int stride, int const zfrac, uint8_t const * fpel, uint8_t * best ); void taa_h264_save_best_16x8( const int stride, int const zfrac, uint8_t const * fpel, uint8_t * best ); void taa_h264_save_best_8x16( const int stride, int const zfrac, uint8_t const * fpel, uint8_t * best ); void taa_h264_save_best_8x8( const int stride, int const zfrac, uint8_t const * fpel, uint8_t * best ); #endif
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Enumeration_C_QuickSpin.rc // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
#ifndef POLAR_COLLECT_H #define POLAR_COLLECT_H #include "polar.h" int polar_collect(polar *p); #endif
//////////////////////////////////////////////////////////////////////////////// // // This file is part of Strata. // // Strata is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software // Foundation, either version 3 of the License, or (at your option) any later // version. // // Strata 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 // Strata. If not, see <http://www.gnu.org/licenses/>. // // Copyright 2010-2018 Albert Kottke // //////////////////////////////////////////////////////////////////////////////// // FIXME this class if very similar to the distribution class maybe these two can be combined #ifndef VELOCITY_LAYER_H_ #define VELOCITY_LAYER_H_ #include "AbstractDistribution.h" #include <QDataStream> #include <QJsonObject> #include <QStringList> //! A virtual class that describes the shear-wave velocity of a specific layer class VelocityLayer : public AbstractDistribution { Q_OBJECT friend auto operator<< (QDataStream & out, const VelocityLayer* vl) -> QDataStream &; friend auto operator>> (QDataStream & in, VelocityLayer* vl) -> QDataStream &; public: explicit VelocityLayer(QObject *parent = nullptr); virtual ~VelocityLayer() = 0; auto depth() const -> double; //! Randomized shear-wave velocity auto shearVel() const -> double; //! Randomized shear modulus auto shearMod() const -> double; virtual auto untWt() const -> double = 0; virtual auto density() const -> double = 0; auto isVaried() const -> bool; //! A description of the layer for tables virtual auto toString() const -> QString = 0; //! Vary the shear-wave velocity void vary(double randVar); void fromJson(const QJsonObject &json); auto toJson() const -> QJsonObject; signals: void depthChanged(double depth); void isVariedChanged(bool isVaried); public slots: void setDepth(double depth); void setIsVaried(bool isVaried); protected: //! If the shear-wave velocity is varied with randomization bool _isVaried; //! Depth to the top of the layer double _depth; }; #endif
/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <sys/types.h> #include <string.h> /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t a_strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0) { while (--n != 0) { if ((*d++ = *s++) == '\0') break; } } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ }
// // Copyright 2015 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // #ifndef INCLUDED_UHD_USRP_SUBDEV_SPEC_H #define INCLUDED_UHD_USRP_SUBDEV_SPEC_H #include <uhd/config.h> #include <uhd/error.h> #include <stdbool.h> //! Subdevice specification typedef struct { // Daughterboard slot name char* db_name; //! Subdevice name char* sd_name; } uhd_subdev_spec_pair_t; #ifdef __cplusplus #include <uhd/usrp/subdev_spec.hpp> #include <string> struct uhd_subdev_spec_t { uhd::usrp::subdev_spec_t subdev_spec_cpp; std::string last_error; }; extern "C" { #else struct uhd_subdev_spec_t; #endif //! A C-level interface for working with a list of subdevice specifications /*! * See uhd::usrp::subdev_spec_t for more details. * * NOTE: Using a handle before passing it into uhd_subdev_spec_make() will result in * undefined behavior. */ typedef struct uhd_subdev_spec_t* uhd_subdev_spec_handle; //! Safely destroy any memory created in the generation of a uhd_subdev_spec_pair_t UHD_API uhd_error uhd_subdev_spec_pair_free( uhd_subdev_spec_pair_t *subdev_spec_pair ); //! Check to see if two subdevice specifications are equal UHD_API uhd_error uhd_subdev_spec_pairs_equal( const uhd_subdev_spec_pair_t* first, const uhd_subdev_spec_pair_t* second, bool *result_out ); //! Create a handle for a list of subdevice specifications UHD_API uhd_error uhd_subdev_spec_make( uhd_subdev_spec_handle* h, const char* markup ); //! Safely destroy a subdevice specification handle /*! * NOTE: Using a handle after passing it into this function will result in * a segmentation fault. */ UHD_API uhd_error uhd_subdev_spec_free( uhd_subdev_spec_handle* h ); //! Check how many subdevice specifications are in this list UHD_API uhd_error uhd_subdev_spec_size( uhd_subdev_spec_handle h, size_t *size_out ); //! Add a subdevice specification to this list UHD_API uhd_error uhd_subdev_spec_push_back( uhd_subdev_spec_handle h, const char* markup ); //! Get the subdevice specification at the given index UHD_API uhd_error uhd_subdev_spec_at( uhd_subdev_spec_handle h, size_t num, uhd_subdev_spec_pair_t *subdev_spec_pair_out ); //! Get a string representation of the given list UHD_API uhd_error uhd_subdev_spec_to_pp_string( uhd_subdev_spec_handle h, char* pp_string_out, size_t strbuffer_len ); //! Get a markup string representation of the given list UHD_API uhd_error uhd_subdev_spec_to_string( uhd_subdev_spec_handle h, char* string_out, size_t strbuffer_len ); //! Get the last error recorded by the given handle UHD_API uhd_error uhd_subdev_spec_last_error( uhd_subdev_spec_handle h, char* error_out, size_t strbuffer_len ); #ifdef __cplusplus } UHD_API uhd::usrp::subdev_spec_pair_t uhd_subdev_spec_pair_c_to_cpp( const uhd_subdev_spec_pair_t* subdev_spec_pair_c ); UHD_API void uhd_subdev_spec_pair_cpp_to_c( const uhd::usrp::subdev_spec_pair_t &subdev_spec_pair_cpp, uhd_subdev_spec_pair_t *subdev_spec_pair_c ); #endif #endif /* INCLUDED_UHD_USRP_SUBDEV_SPEC_H */
#pragma once #include "sort.h" namespace BI { template<class TData> class BubbleSort : public Sort<TData> { public: BubbleSort() { } ~BubbleSort() { } virtual void sort(DNode<TData>* head, DNode<TData>* tail, const size_t size) override; }; template<class TData> void BubbleSort<TData>::sort(DNode<TData>* head, DNode<TData>* tail, const size_t size) { if (nullptr == head || nullptr == tail || size <= 1) { return; } auto swapped = false; auto last = tail; do { auto current = head; swapped = false; while (current != last) { auto next = current->getNext(); if (current->getData() > next->getData()) { swap(current, next); swapped = true; } current = next; } last = last->getPrev(); } while (swapped); } } // namespace BI
/** * Updater.h * Created at 2011.6.20 * * Updater is the base class providing interfaces for * the various algorithms to update Density, Field, and Propagator. * * HISTORY: * 2012.4.2 * 1. From now on, the history of this file is tracked by Mercurial. * 2. Package name: polyorder. * 2011.6.20 * 1. original version * * Copyright (C) 2012 Yi-Xin Liu <lyx@fudan.edu.cn> * * This file is part of Polyorder * * Polyorder is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * Polyorder 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 Polyorder. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef polyorder_updater_h #define polyorder_updater_h #include <iostream> #include <blitz/array.h> class Grid; class Propagator; class Density; class Updater{ public: Updater(){} // Why not use pure virtual? // Because for different type of Object (Propagator, Density, and Field), // only one type of solve() is necessary. // Consider to split these Updater interface into three interfaces: // PropagatorUpdater // DensityUpdater // FieldUpdater // for Propagator virtual void solve(Propagator &q, const Grid &w) {} // for Density virtual void solve(blitz::Array<double,3> data, const Propagator &q, const Propagator &qc, const double cc) const {} // for Field virtual void solve(Grid &w, const Grid &data) const {} virtual void solve(Grid &w, const Grid &data) {} //virtual void set_data(const Grid&) = 0; //virtual void set_data(const blitz::Array<double,1>) = 0; //virtual void set_data(const blitz::Array<double,2>) = 0; //virtual void set_data(const blitz::Array<double,3>) = 0; virtual Updater *clone() const = 0; virtual ~Updater(){} }; #endif
/* Copyright (C) 2008 AbiSource Corporation B.V. * * 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 __ABICOLLAB_SAVE_INTERCEPTOR__ #define __ABICOLLAB_SAVE_INTERCEPTOR__ #include "ev_EditMethod.h" #define SAVE_INTERCEPTOR_EM "com.abisource.abiword.abicollab.servicesaveinterceptor" class AV_View; class EV_EditMethodCallData; class EV_EditMethod; class PD_Document; class AbiCollabSaveInterceptor { public: AbiCollabSaveInterceptor(); bool intercept(AV_View * v, EV_EditMethodCallData * d); bool saveRemotely(PD_Document * pDoc); private: void _save_cb(UT_Error error, AbiCollab* pSession); EV_EditMethod* m_pOldSaveEM; }; #endif /* __ABICOLLAB_SAVE_INTERCEPTOR__ */
// Converted using ConvPNG #include <stdint.h> #include "sprite_gfx.h" uint8_t ring_compressed[56] = { 0x0A,0x33,0x0A,0x06,0x00,0x10,0xFF,0x00,0x58,0x06,0x07,0x11,0x10,0x0F,0x6B,0x0F,0x04,0xFF,0x09,0x7E,0x0F,0x04,0x0B,0x09,0x0F,0xB9,0x08,0x2A,0x22,0x0C,0xF8,0x00, 0x11,0xC4,0x09,0x11,0xA2,0x1D,0x10,0x06,0x11,0x5F,0x14,0x0F,0x16,0xB7,0x4E,0x11,0x4A,0x27,0x22,0x00,0x70,0x3F,0x00,0x08, };
/** * @addtogroup tracyWidom * @ingroup tracyWidom * @{ * @file tracyWidom.h * * @brief functions to perform tracy-widom test on a set of eigenvalues * such as described by Patterson et al (2006) "Eigenanalysis". * This program is very similar with the one in Eigensoft. */ #ifndef TRACYWIDOM_H #define TRACYWIDOM_H /** * run tracy widom tests of eigenvalues * * @param input_file input file name of eigenvalues * @param output_file the output file with p-values */ void tracyWidom(char *input_file, char *output_file); /** * write data into output file * * @param output_file output file name * @param M number of non-zero eigenvalues * @param values eigenvalues * @param pvalues p-values * @param twstat statitic of tw * @param effectn effective n (estimated) * @param percentage percentage of variance */ void write_data_tracyWidom(char *output_file, int M, double *values, double *pvalues, double *twstat, double *effectn, double *percentage); /** * calculate tracy widom (twtable global variable !!!) * * @param values eigenvalues * @param pvalues p-values * @param twstat statitic of tw * @param effectn effective n (estimated) * @param M number of non-zero eigenvalues */ void tw(double *values, double *pvalues, double *twstat, double *effectn, int M); /** * calculate p-value from twstat (twtable global variable !!!) * * @param lambda statitic of tw * * @return p-values */ double twtest(double lambda); /** * sort in decreasing order (rosetta stone) * * @param a vector * @param n size of a */ void insertion_sort(double *a, int n); /** * remove zeros (< 1e-10) from a vector * * @param values vector * @param M size */ void clean_zeros(double **values, int *M); /** * clean from zeros and sort (decreasing order) a vector * * @param values vector * @param M size */ void clean_sort(double **values, int *M); #endif // TRACYWIDOM_H /** @} */
/* * ADCInitialisation.c * * Created on: Jan 30, 2016 * Author: Teja Chintalapati * Contact: teja.chintalapati@gmail.com * Description: This file will configure ADC * */ /****************************************************************************** * INCLUDES */ #include "mainApp.h" /****************************************************************************** * GLOBAL VARIABLES */ uint16_t ADCValue; /****************************************************************************** * FUNCTION DEFINITIONS */ void ADCConfiguration(void) { //Initialize the ADC12B Module /* * Base address of ADC12B Module * Use internal ADC12B bit as sample/hold signal to start conversion * USE MODOSC 5MHZ Digital Oscillator as clock source * Use default clock divider/pre-divider of 1 * Not use internal channel */ ADC12_B_initParam initParam = {0}; initParam.sampleHoldSignalSourceSelect = ADC12_B_SAMPLEHOLDSOURCE_SC; initParam.clockSourceSelect = ADC12_B_CLOCKSOURCE_ADC12OSC; initParam.clockSourceDivider = ADC12_B_CLOCKDIVIDER_1; initParam.clockSourcePredivider = ADC12_B_CLOCKPREDIVIDER__1; initParam.internalChannelMap = ADC12_B_NOINTCH; ADC12_B_init( ADC12_B_BASE, &initParam ); //Enable the ADC12B module ADC12_B_enable( ADC12_B_BASE ); /* * Base address of ADC12B Module * For memory buffers 0-7 sample/hold for 64 clock cycles * For memory buffers 8-15 sample/hold for 4 clock cycles (default) * Disable Multiple Sampling */ ADC12_B_setupSamplingTimer( ADC12_B_BASE, ADC12_B_CYCLEHOLD_16_CYCLES, ADC12_B_CYCLEHOLD_4_CYCLES, ADC12_B_MULTIPLESAMPLESDISABLE ); //Configure Memory Buffer /* * Base address of the ADC12B Module * Configure memory buffer 2 * Map input A2 to memory buffer 2 * Vref+ = AVcc (3.3V) * Vref- = AVss (GND) * Memory buffer 2 is not the end of a sequence * Disable Window Comparator * ADC is operating in Single Ended Mode */ ADC12_B_configureMemoryParam configureMemoryParam = {0}; configureMemoryParam.memoryBufferControlIndex = ADCMEMORY; configureMemoryParam.inputSourceSelect = ADCINPUTSOURCESELECT; configureMemoryParam.refVoltageSourceSelect = ADC12_B_VREFPOS_AVCC_VREFNEG_VSS; configureMemoryParam.endOfSequence = ADC12_B_NOTENDOFSEQUENCE; configureMemoryParam.windowComparatorSelect = ADC12_B_WINDOW_COMPARATOR_DISABLE; configureMemoryParam.differentialModeSelect = ADC12_B_DIFFERENTIAL_MODE_DISABLE; ADC12_B_configureMemory( ADC12_B_BASE, &configureMemoryParam ); //Clearing previous ADC12MEM2 Interrupt. ADC12_B_clearInterrupt( ADC12_B_BASE, 0, ADCIFG ); //Enable memory buffer 2 interrupt ADC12_B_enableInterrupt( ADC12_B_BASE, ADCIE, 0, 0 ); } /****************************************************************************** * ADC ISR */ #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=ADC12_VECTOR __interrupt #elif defined(__GNUC__) __attribute__((interrupt(ADC12_VECTOR))) #endif void ADC12_ISR(void) { switch(__even_in_range(ADC12IV,76)) { case 0: break; // Vector 0: No interrupt case 2: break; // Vector 2: ADC12BMEMx Overflow case 4: break; // Vector 4: Conversion time overflow case 6: break; // Vector 6: ADC12BHI case 8: break; // Vector 8: ADC12BLO case 10: break; // Vector 10: ADC12BIN case 12: break; // Vector 12: ADC12BMEM0 Interrupt case 14: break; // Vector 14: ADC12BMEM1 case 16: break; // Vector 16: ADC12BMEM2 case 18: break; // Vector 18: ADC12BMEM3 case 20: break; // Vector 20: ADC12BMEM4 case 22: break; // Vector 22: ADC12BMEM5 case 24: break; // Vector 24: ADC12BMEM6 case 26: break; // Vector 26: ADC12BMEM7 case 28: break; // Vector 28: ADC12BMEM8 case 30: break; // Vector 30: ADC12BMEM9 case 32: break; // Vector 32: ADC12BMEM10 case 34: break; // Vector 34: ADC12BMEM11 case 36: break; // Vector 36: ADC12BMEM12 case 38: // Vector 38: ADC12BMEM13 ADCValue = HWREG16(ADC12_B_BASE + (OFS_ADC12MEM0 + ADCMEMORY)); __bic_SR_register_on_exit(LPM3_bits); // Exit active CPU break; case 40: break; // Vector 40: ADC12BMEM14 case 42: break; // Vector 42: ADC12BMEM15 case 44: break; // Vector 44: ADC12BMEM16 case 46: break; // Vector 46: ADC12BMEM17 case 48: break; // Vector 48: ADC12BMEM18 case 50: break; // Vector 50: ADC12BMEM19 case 52: break; // Vector 52: ADC12BMEM20 case 54: break; // Vector 54: ADC12BMEM21 case 56: break; // Vector 56: ADC12BMEM22 case 58: break; // Vector 58: ADC12BMEM23 case 60: break; // Vector 60: ADC12BMEM24 case 62: break; // Vector 62: ADC12BMEM25 case 64: break; // Vector 64: ADC12BMEM26 case 66: break; // Vector 66: ADC12BMEM27 case 68: break; // Vector 68: ADC12BMEM28 case 70: break; // Vector 70: ADC12BMEM29 case 72: break; // Vector 72: ADC12BMEM30 case 74: break; // Vector 74: ADC12BMEM31 case 76: break; // Vector 76: ADC12BRDY default: break; } }