text
stringlengths
4
6.14k
/* * steghide 0.5.1 - a steganography program * Copyright (C) 1999-2003 Stefan Hetzl <[email protected]> * * 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 SH_EDGEITERATOR_H #define SH_EDGEITERATOR_H #include <list> #include "Edge.h" class Graph ; #include "SampleOccurence.h" class SampleValue ; class Vertex ; /** * \class EdgeIterator * \brief allows an iteration trough all edges of a vertex * * The Vertex that is the source for all edges is called "source vertex". * The order of the iteration through the edges is from the shortest to the longest edge. * If two edges have the same length they are ordered the same way as the corresponding * entries in the sample value adjacency lists (for different sample values) respectivly * the destination sample occurences in the SampleOccurences data structure (for the same * sample value). * * EdgeIterator uses an SampleOccurence::const_iterator to store information * about the current edge. Graph::(un)markDeletedSampleOccurence can invalidate * such iterators. It is therefore not a good idea to use EdgeIterators at the same * time as the Graph::(un)markDeletedSampleOccurence functionality. * * <b>NOTE:</b> EdgeIterator relies on the Globals object pointed to by the Globs pointer. * This means that it must be set correctly before using any method of an EdgeIterator object. **/ class EdgeIterator { public: enum ITERATIONMODE { SAMPLEOCCURENCE, // incrementing increments to next sample occurence (possibly of the same sample value) thus using every edge of the source vertex SAMPLEVALUE // incrementing increments to the next sample value thus not using all edges in general } ; /** * the default contructor - does not create a valid object **/ EdgeIterator (void) ; /** * \param v the source vertex **/ EdgeIterator (Vertex *v, ITERATIONMODE m = SAMPLEOCCURENCE) ; /** * the copy constructor **/ EdgeIterator (const EdgeIterator& eit) ; ~EdgeIterator (void) ; /** * get the current edge * \return the edge that is described by the current status of this EdgeIterator **/ const Edge* operator* (void) const { return ((Finished) ? NULL : &CurrentEdge) ; } /** * set this iterator to next edge **/ void operator++ (void) ; /** * set this iterator to first (shortest) edge of vertex v * \param v new vertex (don't change if it is NULL) **/ void reset (Vertex* v, ITERATIONMODE m = SAMPLEOCCURENCE) ; /** * reset this iterator to first (shortest) edge **/ void reset (ITERATIONMODE m = SAMPLEOCCURENCE) ; /** * \return true iff this EdgeIterator points to the end of the list of edges of SrcVertex **/ bool isFinished (void) const { return Finished ; } ; /** * get the label of the partner vertex * \return the label of the vertex that builds the edge returned by operator* together with SrcVertex **/ VertexLabel getPartnerVertexLabel (void) const { return SampleOccurenceIt->getVertex()->getLabel() ; } ; static UWORD32 getMaxNumEdges (void) { return MaxNumEdges ; } ; static void setMaxNumEdges (UWORD32 mne) { MaxNumEdges = mne ; } ; void print (unsigned short spc = 0) const ; private: /// the current edge (is returned by operator*) Edge CurrentEdge ; /// mode of iteration ITERATIONMODE Mode ; /// contains (for every sample value) an index to the current opposite neighbour unsigned long* SVALIndices ; /// the maximum number of edges the EdgeIterator should iterate through static UWORD32 MaxNumEdges ; /// the index/number of the edge that is currently returned by operator* UWORD32 EdgeIndex ; /// is true iff there are no more edges for this source vertex bool Finished ; /** * contains the iterator pointing to the sample occurence that constitutes * the edge together with SourceVertex/SourceSamleValueIndex **/ std::list<SampleOccurence>::const_iterator SampleOccurenceIt ; /** * find the shortest edge, starting the search at SVOppNeighsIndices[0...k] * set the private variables accordingly * is only called to find a new destination sample value, i.e. if one of the * SVOppNeighsIndices[i] is changed **/ void findNextEdge (void) ; /** * \return true iff there is a sample with value sv that is part of an edge starting at SrcVertex **/ bool isDestSampleValueOK (const SampleValue *sv) ; } ; #endif // ndef SH_EDGEITERATOR_H
// qtractorClipForm.h // /**************************************************************************** Copyright (C) 2005-2021, rncbc aka Rui Nuno Capela. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ #ifndef __qtractorClipForm_h #define __qtractorClipForm_h #include "ui_qtractorClipForm.h" #include "qtractorClip.h" //---------------------------------------------------------------------------- // qtractorClipForm -- UI wrapper form. class qtractorClipForm : public QDialog { Q_OBJECT public: // Constructor. qtractorClipForm(QWidget *pParent = nullptr); // Destructor. ~qtractorClipForm(); void setClip(qtractorClip *pClip, bool bClipNew = false); qtractorClip *clip() const; protected slots: void accept(); void reject(); void changed(); void formatChanged(int); void stabilizeForm(); void browseFilename(); void filenameChanged(const QString& sFilename); void trackChannelChanged(int iTrackChannel); void clipStartChanged(unsigned long iClipStart); protected: qtractorClip::FadeType fadeTypeFromIndex(int iIndex) const; int indexFromFadeType(qtractorClip::FadeType fadeType) const; qtractorTrack::TrackType trackType() const; void fileChanged(const QString& sFilename, unsigned short iTrackChannel); static void initFadeTypes(); private: // The Qt-designer UI struct... Ui::qtractorClipForm m_ui; // Instance variables... qtractorClip *m_pClip; bool m_bClipNew; qtractorTimeScale *m_pTimeScale; int m_iDirtyCount; int m_iDirtySetup; }; #endif // __qtractorClipForm_h // end of qtractorClipForm.h
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <linux/module.h> #include <linux/spinlock.h> #include <linux/init.h> #include <mach/hardware.h> #include <asm/leds.h> #include <asm/system.h> #include <asm/mach-types.h> #include "boardEnv/mvBoardEnvLib.h" static u32 last_jiffies = 0; static u32 led_val = 0; void mv_leds_hearbeat(void) { u32 sec = jiffies_to_msecs(jiffies - last_jiffies) / 1000; if (!sec) return; led_val = (led_val % (1 << mvBoardDebugLedNumGet(mvBoardIdGet()))); mvBoardDebugLed(led_val); led_val++; last_jiffies = jiffies; } static int __init leds_init(void) { return 0; } __initcall(leds_init);
/* * (C) Copyright IBM Corp. 2004, 2005 * Copyright (c) 2005, Intel Corporation * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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. * * Author(s): * Kevin Gao <[email protected]> * Carl McAdams <[email protected]> * Xiaowei Yang <[email protected]> * * Spec: HPI-B.01.01 * Function: saHpiEventGet * Description: * Make the event queue overflow firstly, * then call the function passing NULL to EventQueueStatus * then call the function to see if overflow flag is reset * Line: P63-22:P63-25 */ #include <stdio.h> #include <stdlib.h> #include "saf_test.h" SaHpiEventT new_event_1 = { .EventType = SAHPI_ET_USER, .Severity = SAHPI_INFORMATIONAL, .Source = SAHPI_UNSPECIFIED_RESOURCE_ID, .Timestamp = SAHPI_TIME_UNSPECIFIED, .EventDataUnion = { .UserEvent = { .UserEventData = { .DataType = SAHPI_TL_TYPE_TEXT, .Language = SAHPI_LANG_ZULU, .Data = "event test1", .DataLength = 11} } } }; #define TIME_OUT_VALUE 1000000000L int main() { SaHpiSessionIdT session_id; SaHpiEventT event; SaHpiRdrT rdr; SaHpiRptEntryT rpt_entry; SaHpiEvtQueueStatusT eqs; SaErrorT val; int ret = SAF_TEST_UNKNOWN; int i; int test_len = try_get_int_val_from_env("SAF_HPI_EVT_QUEUE_LIMIT", 1000) + 1; val = saHpiSessionOpen(SAHPI_UNSPECIFIED_DOMAIN_ID, &session_id, NULL); if (val != SA_OK) { e_print(saHpiSessionOpen, SA_OK, val); ret = SAF_TEST_UNRESOLVED; goto out1; } // wrong overflow reset // val = saHpiEventLogOverflowReset(session_id, SAHPI_UNSPECIFIED_RESOURCE_ID); val = saHpiSubscribe(session_id); if (val != SA_OK) { e_print(saHpiSubscribe, SA_OK, val); ret = SAF_TEST_UNRESOLVED; goto out2; } // make sure the overflow flag is cleared val = saHpiEventGet(session_id, SAHPI_TIMEOUT_IMMEDIATE, &event, &rdr, &rpt_entry, NULL); if (val != SA_OK && val != SA_ERR_HPI_TIMEOUT) { ret = SAF_TEST_UNRESOLVED; e_print(saHpiEventGet, SA_OK, val); goto out2; } // Make the event queue overflow for (i = 0; i < test_len; i++) { val = saHpiEventAdd(session_id, &new_event_1); if (val != SA_OK) { e_print(saHpiEventAdd, SA_OK, val); ret = SAF_TEST_UNRESOLVED; goto out3; } } sleep(5); val = saHpiEventGet(session_id, TIME_OUT_VALUE, &event, &rdr, &rpt_entry, NULL); if (val != SA_OK) { e_print(saHpiEventGet, SA_OK, val); ret = SAF_TEST_UNRESOLVED; goto out3; } val = saHpiEventGet(session_id, TIME_OUT_VALUE, &event, &rdr, &rpt_entry, &eqs); if (val != SA_OK || eqs == SAHPI_EVT_QUEUE_OVERFLOW) { e_print(saHpiEventGet, val == SA_OK && eqs != SAHPI_EVT_QUEUE_OVERFLOW, val); ret = SAF_TEST_FAIL; } else ret = SAF_TEST_PASS; //user events should clear the log before exiting val = saHpiEventLogClear(session_id, SAHPI_UNSPECIFIED_RESOURCE_ID); if (val != SA_OK) e_print(saHpiEventLogClear, SA_OK, val); out3: val = saHpiEventLogClear(session_id, SAHPI_UNSPECIFIED_RESOURCE_ID); val = saHpiUnsubscribe(session_id); out2: val = saHpiSessionClose(session_id); out1: return ret; }
/*************************************************************************** qgshistogramdiagram.h --------------------- begin : August 2012 copyright : (C) 2012 by Matthias Kuhn email : matthias at opengis dot ch *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSHISTOGRAMDIAGRAM_H #define QGSHISTOGRAMDIAGRAM_H #define DIAGRAM_NAME_HISTOGRAM "Histogram" #include "qgsdiagram.h" #include "qgsfeature.h" #include <QPen> #include <QBrush> class QPainter; class QPointF; class QgsDiagramSettings; class QgsDiagramInterpolationSettings; class QgsRenderContext; class CORE_EXPORT QgsHistogramDiagram: public QgsDiagram { public: QgsHistogramDiagram(); ~QgsHistogramDiagram(); virtual QgsHistogramDiagram* clone() const override; void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, QPointF position ) override; QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ) override; QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) override; QString diagramName() const override { return DIAGRAM_NAME_HISTOGRAM; } private: QBrush mCategoryBrush; QPen mPen; double mScaleFactor; }; #endif // QGSHISTOGRAMDIAGRAM_H
/* * Copyright (C) 2012 ARM Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __CLKSOURCE_ARM_ARCH_TIMER_H #define __CLKSOURCE_ARM_ARCH_TIMER_H #include <linux/clocksource.h> #include <linux/clockchips.h> #include <linux/types.h> #define ARCH_TIMER_CTRL_ENABLE (1 << 0) #define ARCH_TIMER_CTRL_IT_MASK (1 << 1) #define ARCH_TIMER_CTRL_IT_STAT (1 << 2) #define ARCH_TIMER_REG_CTRL 0 #define ARCH_TIMER_REG_TVAL 1 #define ARCH_TIMER_PHYS_ACCESS 0 #define ARCH_TIMER_VIRT_ACCESS 1 #ifdef CONFIG_ARM_ARCH_TIMER extern u32 arch_timer_get_rate(void); extern u64 (*arch_timer_read_counter)(void); extern struct timecounter *arch_timer_get_timecounter(void); int __cpuinit arch_timer_setup(struct clock_event_device *clk); void __cpuinit arch_timer_stop(struct clock_event_device *clk); #ifdef CONFIG_USE_ARCH_TIMER_AS_LOCAL_TIMER extern void smp_get_evt_context(struct clock_event_device **p_arch_timer_evt); #endif #else static inline u32 arch_timer_get_rate(void) { return 0; } static inline u64 arch_timer_read_counter(void) { return 0; } static inline struct timecounter *arch_timer_get_timecounter(void) { return NULL; } #endif #endif
/* packet-llc.h * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __PACKET_LLC_H__ #define __PACKET_LLC_H__ void capture_llc(const guchar *, int, int, packet_counts *); extern const value_string sap_vals[]; void capture_snap(const guchar *, int, int, packet_counts *); void dissect_snap(tvbuff_t *, int, packet_info *, proto_tree *, proto_tree *, int, int, int, int, int); /* * Add an entry for a new OUI. */ void llc_add_oui(guint32, const char *, const char *, hf_register_info *); /* * SNAP information about the PID for a particular OUI: * * the dissector table to use with the PID's value; * the field to use for the PID. */ typedef struct { dissector_table_t table; hf_register_info *field_info; } oui_info_t; /* * Return the oui_info_t for the PID for a particular OUI value, or NULL * if there isn't one. */ oui_info_t *get_snap_oui_info(guint32); #endif
// Copyright 2017 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <string> #include <vector> #include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" #include "InputCommon/ControllerEmu/Setting/NumericSetting.h" #include "InputCommon/ControllerInterface/CoreDevice.h" namespace ControllerEmu { class Triggers : public ControlGroup { public: struct StateData { StateData() = default; explicit StateData(std::size_t trigger_count) : data(trigger_count) {} std::vector<ControlState> data; }; explicit Triggers(const std::string& name); StateData GetState(); private: SettingValue<double> m_deadzone_setting; }; } // namespace ControllerEmu
/* Copyright (C) 2006 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <tap.h> #include <stdlib.h> int main() { plan(4); ok1(1); ok1(1); SKIP_BLOCK_IF(1, 2, "Example of skipping a few test points in a test") { ok1(1); ok1(1); } return exit_status(); }
// // Copyright (C) 2015 Vadim Zeitlin // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #ifndef SOCI_NORETURN_H_INCLUDED #define SOCI_NORETURN_H_INCLUDED // Define a portable SOCI_NORETURN macro. // // TODO-C++11: Use [[noreturn]] attribute. #if defined(__GNUC__) # define SOCI_NORETURN __attribute__((noreturn)) void #elif defined(_MSC_VER) # define SOCI_NORETURN __declspec(noreturn) void #else # define SOCI_NORETURN void #endif #endif // SOCI_NORETURN_H_INCLUDED
/* Pseudo implementation of waitid. Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg <[email protected]>, 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <signal.h> #define __need_NULL #include <stddef.h> #include <sys/wait.h> #include <sys/types.h> #include <assert.h> int waitid (idtype, id, infop, options) idtype_t idtype; id_t id; siginfo_t *infop; int options; { pid_t pid, child; int status; switch (idtype) { case P_PID: if(id <= 0) goto invalid; pid = (pid_t) id; break; case P_PGID: if (id < 0 || id == 1) goto invalid; pid = (pid_t) -id; break; case P_ALL: pid = -1; break; default: invalid: __set_errno (EINVAL); return -1; } /* Technically we're supposed to return EFAULT if infop is bogus, but that would involve mucking with signals, which is too much hassle. User will have to deal with SIGSEGV/SIGBUS. We just check for a null pointer. */ if (infop == NULL) { __set_errno (EFAULT); return -1; } child = __waitpid (pid, &status, options); if (child == -1) /* `waitpid' set `errno' for us. */ return -1; if (child == 0) { /* The WHOHANG bit in OPTIONS is set and there are children available but none has a status for us. The XPG docs do not mention this case so we clear the `siginfo_t' struct and return successfully. */ infop->si_signo = 0; infop->si_code = 0; return 0; } /* Decode the status field and set infop members... */ infop->si_signo = SIGCHLD; infop->si_pid = child; infop->si_errno = 0; if (WIFEXITED (status)) { infop->si_code = CLD_EXITED; infop->si_status = WEXITSTATUS (status); } else if (WIFSIGNALED (status)) { infop->si_code = WCOREDUMP (status) ? CLD_DUMPED : CLD_KILLED; infop->si_status = WTERMSIG (status); } else if (WIFSTOPPED (status)) { infop->si_code = CLD_STOPPED; infop->si_status = WSTOPSIG (status); } #ifdef WIFCONTINUED else if (WIFCONTINUED (status)) { infop->si_code = CLD_CONTINUED; infop->si_status = SIGCONT; } #endif else /* Can't happen. */ assert (! "What?"); return 0; }
/* SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef DELTALAKE_VPD_H #define DELTALAKE_VPD_H /* VPD variable for enabling/disabling FRB2 timer. 1/0: Enable/disable */ #define FRB2_TIMER "frb2_timer_enable" #define FRB2_TIMER_DEFAULT 1 /* Default value when the VPD variable is not found */ /* VPD variable for setting FRB2 timer countdown value. */ #define FRB2_COUNTDOWN "frb2_countdown" /* Default countdown is 15 minutes when the VPD variable is not found */ #define FRB2_COUNTDOWN_DEFAULT 9000 /* VPD variable for setting FRB2 timer action. 0: No action, 1: hard reset, 2: power down, 3: power cycle */ #define FRB2_ACTION "frb2_action" #define FRB2_ACTION_DEFAULT 0 /* Default no action when the VPD variable is not found */ /* Define the VPD keys for UPD variables that can be overwritten */ #define FSP_LOG "fsp_log_enable" /* 1 or 0: enable or disable FSP SOL log */ #define FSP_LOG_DEFAULT 1 /* Default value when the VPD variable is not found */ /* FSP debug print level: 1:Fatal, 2:Warning, 4:Summary, 8:Detail, 0x0F:All */ #define FSP_LOG_LEVEL "fsp_log_level" #define FSP_LOG_LEVEL_DEFAULT 8 /* Default value when the VPD variable is not found */ /* DCI enable */ #define FSP_DCI "fsp_dci_enable" /* 1 or 0: enable or disable DCI */ #define FSP_DCI_DEFAULT 0 /* Default value when the VPD variable is not found */ /* coreboot log level */ #define COREBOOT_LOG_LEVEL "coreboot_log_level" #define COREBOOT_LOG_LEVEL_DEFAULT 4 /* FSPM MemRefreshWatermark: 0:Auto, 1: high(default), 2: low */ #define FSPM_MEMREFRESHWATERMARK "fspm_mem_refresh_watermark" #define FSPM_MEMREFRESHWATERMARK_DEFAULT 1 /* coreboot uart io select: 0 = 0x3f8, 1 = 0x2f8, 2 = 0x3e8, 3 = 0x2e8 */ #define COREBOOT_UART_IO "coreboot_uart_io" #define COREBOOT_UART_IO_DEFAULT 1 /* FSP dimm frequency limit, 0:Auto, 1:DDR_1333, 2:DDR_1600, 3:DDR_1866, 4:DDR_2133, * 5:DDR_2400, 6:DDR_2666, 7:DDR_2933, 8:DDR_3200 */ #define FSP_DIMM_FREQ "fsp_dimm_freq" #define FSP_DIMM_FREQ_DEFAULT 0 /* Skip TXT lockdown */ #define SKIP_INTEL_TXT_LOCKDOWN "skip_intel_txt_lockdown" #define SKIP_INTEL_TXT_LOCKDOWN_DEFAULT 0 /* Force memory training: 0 = Disable, 1 = Enable, Default setting is 0 */ #define MEM_TRAIN_FORCE "mem_train_force_enable" #endif
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #if !defined(WIN32) #include <unistd.h> #endif #include "lrdf.h" #include "lrdf_md5.h" typedef struct _lrdf_uri_list { char *uri; struct _lrdf_uri_list *next; } lrdf_uri_list; lrdf_uris *lrdf_match_multi(lrdf_statement *patterns) { lrdf_uris *ret = NULL; lrdf_uri_list *uris = NULL, *allocd = NULL; lrdf_uri_list *uit, *prev; lrdf_statement *it; lrdf_statement *matches; lrdf_statement *mit; lrdf_statement match; int count = 0, i, j, rept; for (it = patterns; it; it = it->next) { if (uris) { /* We allready have a candidate list for the return list, so * iterate over those and check to see if they are possible given * the current pattern */ for (prev = NULL, uit = uris; uit; prev = uit, uit = uit->next) { match.subject = *(it->subject) == '?' ? uit->uri : it->subject; match.predicate = *(it->predicate) == '?' ? uit->uri : it->predicate; match.object = *(it->object) == '?' ? uit->uri : it->object; /* If this pattern didn't match then remove the URI from the * list of candidates */ if (!lrdf_exists_match(&match)) { count--; if (prev) { prev->next = uit->next; } else { uris = uit->next; } } } } else { /* We dont currently have a candidate list for the returns, so * build one from the matches for this pattern */ match.subject = *(it->subject) == '?' ? NULL : it->subject; match.predicate = *(it->predicate) == '?' ? NULL : it->predicate; match.object = *(it->object) == '?' ? NULL : it->object; matches = lrdf_matches(&match); if (matches == NULL) { return NULL; } for (count = 0, mit = matches; mit; count++, mit=mit->next) { } uris = malloc(count * sizeof(lrdf_uri_list)); allocd = uris; for (i=0, mit=matches; i<count; i++, mit=mit->next) { uris[i].next = &uris[i+1]; if (*(it->subject) == '?') { uris[i].uri = mit->subject; } else if (*(it->predicate) == '?') { uris[i].uri = mit->predicate; } else if (*(it->object) == '?') { uris[i].uri = mit->object; } else { free(allocd); allocd = NULL; uris = NULL; break; } } if (uris) { uris[count - 1].next = NULL; } } } ret = malloc(sizeof(lrdf_uris)); ret->size = count; ret->items = malloc(count * sizeof(char *)); for (uit = uris, i=0; uit; uit=uit->next) { rept = 0; for (j=0; j<i; j++) { if (!strcmp(uit->uri, ret->items[j])) { rept = 1; break; } } /* If the URI has allready been added to the list. */ if (rept) { continue; } else { ret->items[i++] = uit->uri; } } ret->count = i; free(allocd); return ret; } /* vi:set ts=8 sts=4 sw=4: */
/** * author: chenxiong (R0r5ch4ch) qian * date: 2014-8-9 */ #include "ND_manager.h" #include "ND_instrument.h" #include "DECAF_shared/utils/OutputWrapper.h" gpid_t ND_GLOBAL_TRACING_PID = -1; target_ulong ND_GLOBAL_TRACING_UID = -1; /* flag indicate state of tracing * 0 -- waiting (trigger by command 'nd_wait_and_trace_uid') * 1 -- tracing by pid * 2 -- tracing by uid * -1 -- stop tracing */ int ND_TRACING_STATE = ND_STOP; //the tracing process ProcessInfo* ND_GLOBAL_TRACING_PROCESS = NULL; /** * The start point of tracing process */ void startTracing(){ nd_instrument_init(); } void nd_reset(){ ND_GLOBAL_TRACING_UID = -1; ND_GLOBAL_TRACING_PID = -1; ND_TRACING_STATE = ND_STOP; ND_GLOBAL_TRACING_PROCESS = NULL; nd_instrument_stop(); } void nd_manager_trace_pid(Monitor* mon, gpid_t pid){ if(pid <= 0 || ND_TRACING_STATE != ND_STOP){ DECAF_printf("A process with pid <%d> uid <%d> is being traced, please stop tracing it first:-)\n", ND_GLOBAL_TRACING_PID, ND_GLOBAL_TRACING_UID); return; } //try to find process with pid <pid> ProcessInfo* processInfo = findProcessByPID(pid); if(processInfo != NULL){ ND_GLOBAL_TRACING_PID = pid; ND_GLOBAL_TRACING_UID = processInfo->uid; ND_TRACING_STATE = ND_TRACING_PID; DECAF_printf("Find process with pid <%d>, start tracing!\n", pid); ND_GLOBAL_TRACING_PROCESS = processInfo; nd_instrument_init(); }else{ DECAF_printf("Canot find process with pid <%d>\n", pid); } } void nd_manager_trace_uid(Monitor* mon, target_ulong uid){ if(uid <= 0 || (ND_TRACING_STATE != ND_STOP && ND_TRACING_STATE != ND_WAITING)){ DECAF_printf("A process with pid <%d> uid <%d> is being traced, please stop tracing it first:-)\n", ND_GLOBAL_TRACING_PID, ND_GLOBAL_TRACING_UID); return; } //try to find process with uid <uid> ProcessInfo* processInfo = findProcessByUID(uid); if(processInfo != NULL){ ND_GLOBAL_TRACING_UID = uid; ND_GLOBAL_TRACING_PID = processInfo->pid; ND_TRACING_STATE = ND_TRACING_UID; DECAF_printf("Find process with uid <%d>, start tracing!\n", uid); ND_GLOBAL_TRACING_PROCESS = processInfo; nd_instrument_init(); }else{ DECAF_printf("Canot find process with uid <%d>\n", uid); } } void nd_manager_wait_and_trace_uid(Monitor* mon, target_ulong uid){ if(uid <= 0 || ND_TRACING_STATE != ND_STOP){ if(ND_GLOBAL_TRACING_PID != -1){ DECAF_printf("A process with pid <%d> is being traced, please stop tracing it first:-)\n", ND_GLOBAL_TRACING_PID); } if(ND_GLOBAL_TRACING_UID != -1){ DECAF_printf("A process with uid <%s> is being traced, please stop tracing it first:-)\n", ND_GLOBAL_TRACING_UID); } return; } ND_GLOBAL_TRACING_UID = uid; ND_TRACING_STATE = ND_WAITING; } void nd_manager_stop_trace_pid(Monitor* mon, gpid_t pid){ if(pid > 0 && pid == ND_GLOBAL_TRACING_PID){ nd_reset(); }else{ DECAF_printf("Check pid or use command 'nd_stop_trace_uid'\n"); } } void nd_manager_stop_trace_uid(Monitor* mon, target_ulong uid){ if(uid > 0 && uid == ND_GLOBAL_TRACING_UID){ nd_reset(); }else{ DECAF_printf("Check uid or use command 'nd_stop_trace_pid'\n"); } }
/* Copyright (C) 1991, 1996, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <stdio.h> #include <stdlib.h> /* Flush STREAM's buffer. If STREAM is NULL, flush the buffers of all streams that are writing. */ int fflush (stream) register FILE *stream; { if (stream == NULL) { int lossage = 0; for (stream = __stdio_head; stream != NULL; stream = stream->__next) if (__validfp (stream) && stream->__mode.__write) lossage |= fflush (stream) == EOF; return lossage ? EOF : 0; } if (!__validfp (stream) || !stream->__mode.__write) { __set_errno (EINVAL); return EOF; } return __flshfp (stream, EOF); } weak_alias(fflush, fflush_unlocked)
/****************************************************************************** * * 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. * * (c) Copyright 2011 Xilinx Inc. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * ******************************************************************************/ #include <common.h> #include <asm/io.h> #include <watchdog.h> #ifdef CONFIG_HW_WATCHDOG #define XWT_TWCSR0_OFFSET 0x0 /**< Control/Status Register 0 Offset */ #define XWT_TWCSR1_OFFSET 0x4 /**< Control/Status Register 1 Offset */ #define XWT_TBR_OFFSET 0x8 /**< Timebase Register Offset */ #define XWT_CSR0_WRS_MASK 0x00000008 /**< Reset status Mask */ #define XWT_CSR0_WDS_MASK 0x00000004 /**< Timer state Mask */ #define XWT_CSR0_EWDT1_MASK 0x00000002 /**< Enable bit 1 Mask*/ #define XWT_CSRX_EWDT2_MASK 0x00000001 /**< Enable bit 2 Mask */ void hw_watchdog_reset(void) { unsigned int CSRRegister; #ifdef XPAR_MICROBLAZE_USE_DCACHE microblaze_invalidate_dcache_range(WATCHDOG_BASEADDR, 4); #endif /* Read the current contents of TCSR0 */ CSRRegister = inl(WATCHDOG_BASEADDR + XWT_TWCSR0_OFFSET); /* Clear the watchdog WDS bit */ if (CSRRegister & (XWT_CSR0_EWDT1_MASK | XWT_CSRX_EWDT2_MASK)) { outl(CSRRegister | XWT_CSR0_WDS_MASK, WATCHDOG_BASEADDR + XWT_TWCSR0_OFFSET); #ifdef XPAR_MICROBLAZE_USE_DCACHE microblaze_flush_dcache_range(WATCHDOG_BASEADDR, 4); #endif } } void hw_watchdog_init(void) { outl((XWT_CSR0_WRS_MASK | XWT_CSR0_WDS_MASK | XWT_CSR0_EWDT1_MASK), WATCHDOG_BASEADDR + XWT_TWCSR0_OFFSET); outl(XWT_CSRX_EWDT2_MASK, WATCHDOG_BASEADDR + XWT_TWCSR1_OFFSET); #ifdef XPAR_MICROBLAZE_USE_DCACHE microblaze_flush_dcache_range(WATCHDOG_BASEADDR, 8); #endif } void hw_watchdog_disable(void) { unsigned int CSRRegister; #ifdef XPAR_MICROBLAZE_USE_DCACHE microblaze_invalidate_dcache_range(WATCHDOG_BASEADDR, 4); #endif /* Read the current contents of TCSR0 */ CSRRegister = inl(WATCHDOG_BASEADDR + XWT_TWCSR0_OFFSET); outl(CSRRegister & ~XWT_CSR0_EWDT1_MASK, WATCHDOG_BASEADDR + XWT_TWCSR0_OFFSET); outl(~XWT_CSRX_EWDT2_MASK, WATCHDOG_BASEADDR + XWT_TWCSR1_OFFSET); #ifdef XPAR_MICROBLAZE_USE_DCACHE microblaze_flush_dcache_range(WATCHDOG_BASEADDR, 8); #endif } #endif
/* * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ /********************************************************** * * TEST IDENTIFIER : sched_rr_get_interval02 * * EXECUTED BY : root / superuser * * TEST TITLE : Functionality test * * TEST CASE TOTAL : 1 * * AUTHOR : Saji Kumar.V.R <[email protected]> * * SIGNALS * Uses SIGUSR1 to pause before test if option set. * (See the parse_opts(3) man page). * * DESCRIPTION * Verify that for a process with scheduling policy SCHED_FIFO, * sched_rr_get_interval() writes zero into timespec structure * for tv_sec & tv_nsec. * * Setup: * Setup signal handling. * Pause for SIGUSR1 if option specified. * Change scheduling policy to SCHED_FIFO * * Test: * Loop if the proper options are given. * Execute system call * Check (return code == 0) & (got 0 for tv_sec & tv_nsec ) * Test passed. * Otherwise * Test failed * * Cleanup: * Print errno log and/or timing stats if options given * * USAGE: <for command-line> * sched_rr_get_interval02 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p] * where, -c n : Run n copies concurrently. * -e : Turn on errno logging. * -h : Show help screen * -f : Turn off functional testing * -i n : Execute test n times. * -I x : Execute test for x seconds. * -p : Pause for SIGUSR1 before starting * -P x : Pause for x seconds between iterations. * -t : Turn on syscall timing. * ****************************************************************/ #include <errno.h> #include <sched.h> #include "test.h" #include "usctest.h" static void setup(); static void cleanup(); char *TCID = "sched_rr_get_interval02"; int TST_TOTAL = 1; struct timespec tp; int main(int ac, char **av) { int lc; char *msg; if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; tp.tv_sec = 99; tp.tv_nsec = 99; /* * Call sched_rr_get_interval(2) with pid=0 sothat it will * write into the timespec structure pointed to by tp the * round robin time quantum for the current process. */ TEST(sched_rr_get_interval(0, &tp)); if ((TEST_RETURN == 0) && (tp.tv_sec == 0) && (tp.tv_nsec == 0)) { tst_resm(TPASS, "Test passed"); } else { tst_resm(TFAIL, "Test Failed, sched_rr_get_interval()" "returned %ld, errno = %d : %s, tp.tv_sec = %d," " tp.tv_nsec = %ld", TEST_RETURN, TEST_ERRNO, strerror(TEST_ERRNO), (int)tp.tv_sec, tp.tv_nsec); } } /* cleanup and exit */ cleanup(); tst_exit(); } /* setup() - performs all ONE TIME setup for this test */ void setup() { /* * Initialize scheduling parameter structure to use with * sched_setscheduler() */ struct sched_param p = { 1 }; tst_sig(NOFORK, DEF_HANDLER, cleanup); TEST_PAUSE; /* Change scheduling policy to SCHED_FIFO */ if ((sched_setscheduler(0, SCHED_FIFO, &p)) == -1) { tst_brkm(TBROK, cleanup, "sched_setscheduler() failed"); } } /* *cleanup() - performs all ONE TIME cleanup for this test at * completion or premature exit. */ void cleanup() { /* * print timing stats if that option was specified. * print errno log if that option was specified. */ TEST_CLEANUP; }
// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2018, Bin Meng <[email protected]> */ #include <common.h> #include <asm/arch/sysinfo.h> #include <init.h> #include <smbios.h> int board_early_init_r(void) { /* * Make sure PCI bus is enumerated so that peripherals on the PCI bus * can be discovered by their drivers */ pci_init(); return 0; } #ifdef CONFIG_SMBIOS_PARSER int show_board_info(void) { const struct smbios_entry *smbios = smbios_entry(lib_sysinfo.smbios_start, lib_sysinfo.smbios_size); if (!smbios) goto fallback; const struct smbios_header *bios = smbios_header(smbios, SMBIOS_BIOS_INFORMATION); const struct smbios_header *system = smbios_header(smbios, SMBIOS_SYSTEM_INFORMATION); const struct smbios_type0 *t0 = (struct smbios_type0 *)bios; const struct smbios_type1 *t1 = (struct smbios_type1 *)system; if (!t0 || !t1) goto fallback; const char *bios_ver = smbios_string(bios, t0->bios_ver); const char *model = smbios_string(system, t1->product_name); const char *manufacturer = smbios_string(system, t1->manufacturer); if (!model || !manufacturer || !bios_ver) goto fallback; printf("Vendor: %s\n", manufacturer); printf("Model: %s\n", model); printf("BIOS Version: %s\n", bios_ver); return 0; fallback: #ifdef CONFIG_OF_CONTROL DECLARE_GLOBAL_DATA_PTR; model = fdt_getprop(gd->fdt_blob, 0, "model", NULL); if (model) printf("Model: %s\n", model); #endif return checkboard(); } #endif
/************************************************ tcpserver.c - created at: Thu Mar 31 12:21:29 JST 1994 Copyright (C) 1993-2007 Yukihiro Matsumoto ************************************************/ #include "rubysocket.h" /* * call-seq: * TCPServer.new([hostname,] port) => tcpserver * * Creates a new server socket bound to _port_. * * If _hostname_ is given, the socket is bound to it. * * serv = TCPServer.new("127.0.0.1", 28561) * s = serv.accept * s.puts Time.now * s.close * * Internally, TCPServer.new calls getaddrinfo() function to * obtain addresses. * If getaddrinfo() returns multiple addresses, * TCPServer.new tries to create a server socket for each address * and returns first one that is successful. * */ static VALUE tcp_svr_init(int argc, VALUE *argv, VALUE sock) { VALUE hostname, port; rb_scan_args(argc, argv, "011", &hostname, &port); return rsock_init_inetsock(sock, hostname, port, Qnil, Qnil, INET_SERVER); } /* * call-seq: * tcpserver.accept => tcpsocket * * Accepts an incoming connection. It returns a new TCPSocket object. * * TCPServer.open("127.0.0.1", 14641) {|serv| * s = serv.accept * s.puts Time.now * s.close * } * */ static VALUE tcp_accept(VALUE sock) { rb_io_t *fptr; union_sockaddr from; socklen_t fromlen; GetOpenFile(sock, fptr); fromlen = (socklen_t)sizeof(from); return rsock_s_accept(rb_cTCPSocket, fptr->fd, &from.addr, &fromlen); } /* * call-seq: * tcpserver.accept_nonblock => tcpsocket * * Accepts an incoming connection using accept(2) after * O_NONBLOCK is set for the underlying file descriptor. * It returns an accepted TCPSocket for the incoming connection. * * === Example * require 'socket' * serv = TCPServer.new(2202) * begin # emulate blocking accept * sock = serv.accept_nonblock * rescue IO::WaitReadable, Errno::EINTR * IO.select([serv]) * retry * end * # sock is an accepted socket. * * Refer to Socket#accept for the exceptions that may be thrown if the call * to TCPServer#accept_nonblock fails. * * TCPServer#accept_nonblock may raise any error corresponding to accept(2) failure, * including Errno::EWOULDBLOCK. * * If the exception is Errno::EWOULDBLOCK, Errno::AGAIN, Errno::ECONNABORTED, Errno::EPROTO, * it is extended by IO::WaitReadable. * So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock. * * === See * * TCPServer#accept * * Socket#accept */ static VALUE tcp_accept_nonblock(VALUE sock) { rb_io_t *fptr; union_sockaddr from; socklen_t fromlen; GetOpenFile(sock, fptr); fromlen = (socklen_t)sizeof(from); return rsock_s_accept_nonblock(rb_cTCPSocket, fptr, &from.addr, &fromlen); } /* * call-seq: * tcpserver.sysaccept => file_descriptor * * Returns a file descriptor of a accepted connection. * * TCPServer.open("127.0.0.1", 28561) {|serv| * fd = serv.sysaccept * s = IO.for_fd(fd) * s.puts Time.now * s.close * } * */ static VALUE tcp_sysaccept(VALUE sock) { rb_io_t *fptr; union_sockaddr from; socklen_t fromlen; GetOpenFile(sock, fptr); fromlen = (socklen_t)sizeof(from); return rsock_s_accept(0, fptr->fd, &from.addr, &fromlen); } void rsock_init_tcpserver(void) { /* * Document-class: TCPServer < TCPSocket * * TCPServer represents a TCP/IP server socket. * * A simple TCP server may look like: * * require 'socket' * * server = TCPServer.new 2000 # Server bind to port 2000 * loop do * client = server.accept # Wait for a client to connect * client.puts "Hello !" * client.puts "Time is #{Time.now}" * client.close * end * * A more usable server (serving multiple clients): * * require 'socket' * * server = TCPServer.new 2000 * loop do * Thread.start(server.accept) do |client| * client.puts "Hello !" * client.puts "Time is #{Time.now}" * client.close * end * end * */ rb_cTCPServer = rb_define_class("TCPServer", rb_cTCPSocket); rb_define_method(rb_cTCPServer, "accept", tcp_accept, 0); rb_define_method(rb_cTCPServer, "accept_nonblock", tcp_accept_nonblock, 0); rb_define_method(rb_cTCPServer, "sysaccept", tcp_sysaccept, 0); rb_define_method(rb_cTCPServer, "initialize", tcp_svr_init, -1); rb_define_method(rb_cTCPServer, "listen", rsock_sock_listen, 1); /* in socket.c */ }
#include <stdio.h> #include <errno.h> #include <netinet/in_systm.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <stdbool.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <sys/ioctl.h> #include <net/if.h> #include <sys/select.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/select.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <syslog.h> #include <sys/time.h> #include <net/if.h> #include <ifaddrs.h> #include <netdb.h> #define PKT_BUFSIZ 1500 #define BUFFERSIZE 1500 #define WIFI 2 /* network type values giving by SeaMo may vary from differnet OS */ #define GSM 3 #define MSG_NOBLOCK 0x01 #define PKT_BUFSIZ 1500 #define INVALID_SOCK 0 #define INVALID_SELECT 0 #define INVALID_LEN 0 #define LISTEN_QUEUE 5 #define SBIN_DIR "/usr/local/seamo/sbin/" #define TEARDOWN 1 #define ACTIVE 2 #define BLOCK 3 #define MAX_SIZE 1016 #define MAX_PPP 3 char *replace(const char *s, const char *old, const char *new); void removeSubstr(const char *src, const char *substr, char *target); void *network_change_detection(); void *network_monitor_task(); void ConnectToVideoServer(); void *client_pkts_discard(); void get_current_ipaddr(char *ip_interface); void command_seq_change(); void networkchangedip(); int fire_voip_server(); int vncServer_conn(); void *seamless_video(); void seamless_conn(); void *fire_voip_rs(); void vnc_start(); void *vncserver(); void *localvnc(); void *voip_sip(); void check_add_ip_rule(char *ip_interface); /*Functions for RTSP-UDP*/ void * rtsp_vlc(); int vlc_server_conn(); void *vlcserver(); void *localvlc(); void *rtcp_ltor_conn(); void *rtcp_rtol_conn(); void *rtp_rtol_conn (); void *rtp_ltor_conn (); void *rtsp_ltor(); void *rtsp_rtol(); void stop_streaming(); void store_handshake(char packet[], int len); void reconnect(); void construct_teardown( char session_id[]); void save_first_session_id(char reply[]); void save_new_session_id(char reply[]); void replace_first_session_id(char change_pkt[]); void replace_new_session_id(char change_pkt[]); void save_replace_local_ports (char buf[]); void save_replace_remote_ports (char buf[]); void udp_sockets_init(); void construct_teardown(char session_id[]); void send_teardown(); /*Functions for RTSP-TCP*/ void construct_teardown( char session_id[]); void seamless_switch(); void save_rtp_header(unsigned char rtp_packet[], int pkt_len); void capture_ssrc(unsigned char recv_rpt[]); void save_old_session_id(char reply[]); void save_new_session_id(char reply[]); void replace_old_session_id(char change_pkt[]); void replace_new_session_id(char change_pkt[]); /*Functions for ambulet_demo.c*/ void* ambulet_demo_thread(); int get_available_ifs(char *ip_addrs[]); /* Structures */ typedef struct ntwSock { int sfd; int flag; }nts; typedef struct iface_ip{ char ppp0[128]; char ppp1[128]; char ppp2[128]; char wlan0[128]; } iface_ip; typedef struct rtp_header{ unsigned char rtp_ver; unsigned char payload_type; unsigned short seq_no; int time_stamp; int ssrc; }__attribute_packed; struct packet{ int interface; int packet_number; char data [MAX_SIZE]; };
#include <complex.h> #include <pfft.h> int main(int argc, char **argv) { int np[2]; ptrdiff_t n[3]; ptrdiff_t alloc_local; ptrdiff_t local_ni[3], local_i_start[3]; ptrdiff_t local_no[3], local_o_start[3]; double err; double *planned_in, *executed_in; pfft_complex *planned_out, *executed_out; pfft_plan plan_forw=NULL, plan_back=NULL; MPI_Comm comm_cart_2d; /* Set size of FFT and process mesh */ n[0] = 29; n[1] = 27; n[2] = 31; np[0] = 2; np[1] = 2; /* Initialize MPI and PFFT */ MPI_Init(&argc, &argv); pfft_init(); /* Create two-dimensional process grid of size np[0] x np[1], if possible */ if( pfft_create_procmesh_2d(MPI_COMM_WORLD, np[0], np[1], &comm_cart_2d) ){ pfft_fprintf(MPI_COMM_WORLD, stderr, "Error: This test file only works with %d processes.\n", np[0]*np[1]); MPI_Finalize(); return 1; } /* Get parameters of data distribution */ alloc_local = pfft_local_size_dft_r2c_3d(n, comm_cart_2d, PFFT_TRANSPOSED_NONE, local_ni, local_i_start, local_no, local_o_start); /* Allocate memory for planning */ planned_in = pfft_alloc_real (2 * alloc_local); planned_out = pfft_alloc_complex(alloc_local); /* Plan parallel forward FFT */ plan_forw = pfft_plan_dft_r2c_3d( n, planned_in, planned_out, comm_cart_2d, PFFT_FORWARD, PFFT_TRANSPOSED_NONE| PFFT_MEASURE| PFFT_DESTROY_INPUT); /* Plan parallel backward FFT */ plan_back = pfft_plan_dft_c2r_3d( n, planned_out, planned_in, comm_cart_2d, PFFT_BACKWARD, PFFT_TRANSPOSED_NONE| PFFT_MEASURE| PFFT_DESTROY_INPUT); /* Free planning arrays since we use other arrays for execution */ pfft_free(planned_in); pfft_free(planned_out); /* Allocate memory for execution */ executed_in = pfft_alloc_real(2 * alloc_local); executed_out = pfft_alloc_complex(alloc_local); /* Initialize input with random numbers */ pfft_init_input_real(3, n, local_ni, local_i_start, executed_in); /* execute parallel forward FFT */ pfft_execute_dft_r2c(plan_forw, executed_in, executed_out); /* clear the old input */ pfft_clear_input_real(3, n, local_ni, local_i_start, executed_in); /* execute parallel backward FFT */ pfft_execute_dft_c2r(plan_back, executed_out, executed_in); /* Scale data */ for(ptrdiff_t l=0; l < local_ni[0] * local_ni[1] * local_ni[2]; l++) executed_in[l] /= (n[0]*n[1]*n[2]); /* Print error of back transformed data */ err = pfft_check_output_real(3, n, local_ni, local_i_start, executed_in, comm_cart_2d); pfft_printf(comm_cart_2d, "Error after one forward and backward trafo of size n=(%td, %td, %td):\n", n[0], n[1], n[2]); pfft_printf(comm_cart_2d, "maxerror = %6.2e;\n", err); /* free mem and finalize */ pfft_destroy_plan(plan_forw); pfft_destroy_plan(plan_back); MPI_Comm_free(&comm_cart_2d); pfft_free(executed_in); pfft_free(executed_out); MPI_Finalize(); return 0; }
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM nsISafeOutputStream.idl */ #ifndef __gen_nsISafeOutputStream_h__ #define __gen_nsISafeOutputStream_h__ #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsISafeOutputStream */ #define NS_ISAFEOUTPUTSTREAM_IID_STR "5f914307-5c34-4e1f-8e32-ec749d25b27a" #define NS_ISAFEOUTPUTSTREAM_IID \ {0x5f914307, 0x5c34, 0x4e1f, \ { 0x8e, 0x32, 0xec, 0x74, 0x9d, 0x25, 0xb2, 0x7a }} /** * This interface provides a mechanism to control an output stream * that takes care not to overwrite an existing target until it is known * that all writes to the destination succeeded. * * An object that supports this interface is intended to also support * nsIOutputStream. * * For example, a file output stream that supports this interface writes to * a temporary file, and moves it over the original file when |finish| is * called only if the stream can be successfully closed and all writes * succeeded. If |finish| is called but something went wrong during * writing, it will delete the temporary file and not touch the original. * If the stream is closed by calling |close| directly, or the stream * goes away, the original file will not be overwritten, and the temporary * file will be deleted. * * Currently, this interface is implemented only for file output streams. */ class NS_NO_VTABLE NS_SCRIPTABLE nsISafeOutputStream : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISAFEOUTPUTSTREAM_IID) /** * Call this method to close the stream and cause the original target * to be overwritten. Note: if any call to |write| failed to write out * all of the data given to it, then calling this method will |close| the * stream and return failure. Further, if closing the stream fails, this * method will return failure. The original target will be overwritten only * if all calls to |write| succeeded and the stream was successfully closed. */ /* void finish (); */ NS_SCRIPTABLE NS_IMETHOD Finish(void) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsISafeOutputStream, NS_ISAFEOUTPUTSTREAM_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSISAFEOUTPUTSTREAM \ NS_SCRIPTABLE NS_IMETHOD Finish(void); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSISAFEOUTPUTSTREAM(_to) \ NS_SCRIPTABLE NS_IMETHOD Finish(void) { return _to Finish(); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSISAFEOUTPUTSTREAM(_to) \ NS_SCRIPTABLE NS_IMETHOD Finish(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Finish(); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsSafeOutputStream : public nsISafeOutputStream { public: NS_DECL_ISUPPORTS NS_DECL_NSISAFEOUTPUTSTREAM nsSafeOutputStream(); private: ~nsSafeOutputStream(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsSafeOutputStream, nsISafeOutputStream) nsSafeOutputStream::nsSafeOutputStream() { /* member initializers and constructor code */ } nsSafeOutputStream::~nsSafeOutputStream() { /* destructor code */ } /* void finish (); */ NS_IMETHODIMP nsSafeOutputStream::Finish() { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsISafeOutputStream_h__ */
#pragma once #include "nn/ipc/nn_ipc_command.h" #include "nn/ipc/nn_ipc_service.h" #include <cstdint> namespace nn::spm::services { // Served from /dev/acp_main struct ExtendedStorageService : ipc::Service<303> { using SetAutoFatal = ipc::Command<ExtendedStorageService, 6> ::Parameters<uint8_t> ::Response<>; }; } // namespace nn::spm::services
/* $KAME: if_nameindex.c,v 1.8 2000/11/24 08:20:01 itojun Exp $ */ /*- * Copyright (c) 1997, 2000 * Berkeley Software Design, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``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 Berkeley Software Design, Inc. 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. * * BSDI Id: if_nameindex.c,v 2.3 2000/04/17 22:38:05 dab Exp */ #include <sys/types.h> #include <sys/socket.h> #include <net/if_dl.h> #include <net/if.h> #include <ifaddrs.h> #include <stdlib.h> #include <string.h> /* * From RFC 2553: * * 4.3 Return All Interface Names and Indexes * * The if_nameindex structure holds the information about a single * interface and is defined as a result of including the <net/if.h> * header. * * struct if_nameindex { * unsigned int if_index; * char *if_name; * }; * * The final function returns an array of if_nameindex structures, one * structure per interface. * * struct if_nameindex *if_nameindex(void); * * The end of the array of structures is indicated by a structure with * an if_index of 0 and an if_name of NULL. The function returns a NULL * pointer upon an error, and would set errno to the appropriate value. * * The memory used for this array of structures along with the interface * names pointed to by the if_name members is obtained dynamically. * This memory is freed by the next function. * * 4.4. Free Memory * * The following function frees the dynamic memory that was allocated by * if_nameindex(). * * #include <net/if.h> * * void if_freenameindex(struct if_nameindex *ptr); * * The argument to this function must be a pointer that was returned by * if_nameindex(). */ struct if_nameindex * if_nameindex(void) { struct ifaddrs *ifaddrs, *ifa; unsigned int ni; int nbytes; struct if_nameindex *ifni, *ifni2; char *cp; if (getifaddrs(&ifaddrs) < 0) return(NULL); /* * First, find out how many interfaces there are, and how * much space we need for the string names. */ ni = 0; nbytes = 0; for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_LINK) { nbytes += strlen(ifa->ifa_name) + 1; ni++; } } /* * Next, allocate a chunk of memory, use the first part * for the array of structures, and the last part for * the strings. */ cp = malloc((ni + 1) * sizeof(struct if_nameindex) + nbytes); ifni = (struct if_nameindex *)cp; if (ifni == NULL) goto out; cp += (ni + 1) * sizeof(struct if_nameindex); /* * Now just loop through the list of interfaces again, * filling in the if_nameindex array and making copies * of all the strings. */ ifni2 = ifni; for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_LINK) { ifni2->if_index = ((struct sockaddr_dl*)ifa->ifa_addr)->sdl_index; ifni2->if_name = cp; strcpy(cp, ifa->ifa_name); ifni2++; cp += strlen(cp) + 1; } } /* * Finally, don't forget to terminate the array. */ ifni2->if_index = 0; ifni2->if_name = NULL; out: freeifaddrs(ifaddrs); return(ifni); } #ifndef __OpenBSD__ void if_freenameindex(struct if_nameindex *ptr) { free(ptr); } #endif
/* Definitions for AMD x86-64 running Linux-based GNU systems with ELF format. Copyright (C) 2001-2014 Free Software Foundation, Inc. Contributed by Jan Hubicka <[email protected]>, based on linux.h. This file is part of GCC. GCC 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. GCC 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #define GNU_USER_LINK_EMULATION32 "elf_i386" #define GNU_USER_LINK_EMULATION64 "elf_x86_64" #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" #define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/tools/lib64/ld-linux-x86-64.so.2" #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" #define STANDARD_STARTFILE_PREFIX_2 ""
/** * This version is stamped on Apr. 14, 2015 * * Contact: * Louis-Noel Pouchet <pouchet.ohio-state.edu> * Tomofumi Yuki <tomofumi.yuki.fr> * * Web address: http://polybench.sourceforge.net */ #ifndef _SYMM_H # define _SYMM_H /* Default to LARGE_DATASET. */ # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(MEDIUM_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) # define LARGE_DATASET # endif # if !defined(M) && !defined(N) /* Define sample dataset sizes. */ # ifdef MINI_DATASET # define M 20 # define N 30 # endif # ifdef SMALL_DATASET # define M 60 # define N 80 # endif # ifdef MEDIUM_DATASET # define M 200 # define N 240 # endif # ifdef LARGE_DATASET # define M 1000 # define N 1200 # endif # ifdef EXTRALARGE_DATASET # define M 2000 # define N 2600 # endif #endif /* !(M N) */ # define _PB_M POLYBENCH_LOOP_BOUND(M,m) # define _PB_N POLYBENCH_LOOP_BOUND(N,n) /* Default data type */ # if !defined(DATA_TYPE_IS_INT) && !defined(DATA_TYPE_IS_FLOAT) && !defined(DATA_TYPE_IS_DOUBLE) # define DATA_TYPE_IS_DOUBLE # endif #ifdef DATA_TYPE_IS_INT # define DATA_TYPE int # define DATA_PRINTF_MODIFIER "%d " #endif #ifdef DATA_TYPE_IS_FLOAT # define DATA_TYPE float # define DATA_PRINTF_MODIFIER "%0.2f " # define SCALAR_VAL(x) x##f # define SQRT_FUN(x) sqrtf(x) # define EXP_FUN(x) expf(x) # define POW_FUN(x,y) powf(x,y) # endif #ifdef DATA_TYPE_IS_DOUBLE # define DATA_TYPE double # define DATA_PRINTF_MODIFIER "%0.2lf " # define SCALAR_VAL(x) x # define SQRT_FUN(x) sqrt(x) # define EXP_FUN(x) exp(x) # define POW_FUN(x,y) pow(x,y) # endif #endif /* !_SYMM_H */
/* * Copyright (c) 2018 Thomas Pornin <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "t_inner.h" /* * Get the appropriate Base64 character for a numeric value in the * 0..63 range. This is constant-time. */ static char b64char(uint32_t x) { /* * Values 0 to 25 map to 0x41..0x5A ('A' to 'Z') * Values 26 to 51 map to 0x61..0x7A ('a' to 'z') * Values 52 to 61 map to 0x30..0x39 ('0' to '9') * Value 62 maps to 0x2B ('+') * Value 63 maps to 0x2F ('/') */ uint32_t a, b, c; a = x - 26; b = x - 52; c = x - 62; /* * Looking at bits 8..15 of values a, b and c: * * x a b c * --------------------- * 0..25 FF FF FF * 26..51 00 FF FF * 52..61 00 00 FF * 62..63 00 00 00 */ return (char)(((x + 0x41) & ((a & b & c) >> 8)) | ((x + (0x61 - 26)) & ((~a & b & c) >> 8)) | ((x - (52 - 0x30)) & ((~a & ~b & c) >> 8)) | ((0x2B + ((x & 1) << 2)) & (~(a | b | c) >> 8))); } /* see bearssl_pem.h */ size_t br_pem_encode(void *dest, const void *data, size_t len, const char *banner, unsigned flags) { size_t dlen, banner_len, lines; char *d; unsigned char *buf; size_t u; int off, lim; banner_len = strlen(banner); /* FIXME: try to avoid divisions here, as they may pull an extra libc function. */ if ((flags & BR_PEM_LINE64) != 0) { lines = (len + 47) / 48; } else { lines = (len + 56) / 57; } dlen = (banner_len << 1) + 30 + (((len + 2) / 3) << 2) + lines + 2; if ((flags & BR_PEM_CRLF) != 0) { dlen += lines + 2; } if (dest == NULL) { return dlen; } d = dest; /* * We always move the source data to the end of output buffer; * the encoding process never "catches up" except at the very * end. This also handles all conditions of partial or total * overlap. */ buf = (unsigned char *)d + dlen - len; memmove(buf, data, len); memcpy(d, "-----BEGIN ", 11); d += 11; memcpy(d, banner, banner_len); d += banner_len; memcpy(d, "-----", 5); d += 5; if ((flags & BR_PEM_CRLF) != 0) { *d ++ = 0x0D; } *d ++ = 0x0A; off = 0; lim = (flags & BR_PEM_LINE64) != 0 ? 16 : 19; for (u = 0; (u + 2) < len; u += 3) { uint32_t w; w = ((uint32_t)buf[u] << 16) | ((uint32_t)buf[u + 1] << 8) | (uint32_t)buf[u + 2]; *d ++ = b64char(w >> 18); *d ++ = b64char((w >> 12) & 0x3F); *d ++ = b64char((w >> 6) & 0x3F); *d ++ = b64char(w & 0x3F); if (++ off == lim) { off = 0; if ((flags & BR_PEM_CRLF) != 0) { *d ++ = 0x0D; } *d ++ = 0x0A; } } if (u < len) { uint32_t w; w = (uint32_t)buf[u] << 16; if (u + 1 < len) { w |= (uint32_t)buf[u + 1] << 8; } *d ++ = b64char(w >> 18); *d ++ = b64char((w >> 12) & 0x3F); if (u + 1 < len) { *d ++ = b64char((w >> 6) & 0x3F); } else { *d ++ = 0x3D; } *d ++ = 0x3D; off ++; } if (off != 0) { if ((flags & BR_PEM_CRLF) != 0) { *d ++ = 0x0D; } *d ++ = 0x0A; } memcpy(d, "-----END ", 9); d += 9; memcpy(d, banner, banner_len); d += banner_len; memcpy(d, "-----", 5); d += 5; if ((flags & BR_PEM_CRLF) != 0) { *d ++ = 0x0D; } *d ++ = 0x0A; /* Final zero, not counted in returned length. */ *d ++ = 0x00; return dlen; }
/******************************************************************************* Copyright (C) The University of Auckland OpenCOR 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. OpenCOR 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 <https://gnu.org/licenses>. *******************************************************************************/ //============================================================================== // CellML API tests //============================================================================== #pragma once //============================================================================== #include <QObject> //============================================================================== class Tests : public QObject { Q_OBJECT private slots: void basicTests(); }; //============================================================================== // End of file //==============================================================================
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #ifndef _N_AP_RetransMax_H_ #define _N_AP_RetransMax_H_ #include <asn_application.h> /* Including external dependencies */ #include <NativeInteger.h> #ifdef __cplusplus extern "C" { #endif /* N-AP-RetransMax */ typedef long N_AP_RetransMax_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_N_AP_RetransMax; asn_struct_free_f N_AP_RetransMax_free; asn_struct_print_f N_AP_RetransMax_print; asn_constr_check_f N_AP_RetransMax_constraint; ber_type_decoder_f N_AP_RetransMax_decode_ber; der_type_encoder_f N_AP_RetransMax_encode_der; xer_type_decoder_f N_AP_RetransMax_decode_xer; xer_type_encoder_f N_AP_RetransMax_encode_xer; per_type_decoder_f N_AP_RetransMax_decode_uper; per_type_encoder_f N_AP_RetransMax_encode_uper; #ifdef __cplusplus } #endif #endif /* _N_AP_RetransMax_H_ */ #include <asn_internal.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. By using JUCE, you agree to the terms of both the JUCE 5 End-User License Agreement and JUCE 5 Privacy Policy (both updated and effective as of the 27th April 2017). End User License Agreement: www.juce.com/juce-5-licence Privacy Policy: www.juce.com/juce-5-privacy-policy Or: You may also use this code under the terms of the GPL v3 (see www.gnu.org/licenses). JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE DISCLAIMED. ============================================================================== */ namespace juce { //============================================================================== /** Specifies a set of gaps to be left around the sides of a rectangle. This is basically the size of the spaces at the top, bottom, left and right of a rectangle. It's used by various component classes to specify borders. @see Rectangle */ template <typename ValueType> class BorderSize { public: //============================================================================== /** Creates a null border. All sizes are left as 0. */ BorderSize() noexcept : top(), left(), bottom(), right() { } /** Creates a copy of another border. */ BorderSize (const BorderSize& other) noexcept : top (other.top), left (other.left), bottom (other.bottom), right (other.right) { } /** Creates a border with the given gaps. */ BorderSize (ValueType topGap, ValueType leftGap, ValueType bottomGap, ValueType rightGap) noexcept : top (topGap), left (leftGap), bottom (bottomGap), right (rightGap) { } /** Creates a border with the given gap on all sides. */ explicit BorderSize (ValueType allGaps) noexcept : top (allGaps), left (allGaps), bottom (allGaps), right (allGaps) { } //============================================================================== /** Returns the gap that should be left at the top of the region. */ ValueType getTop() const noexcept { return top; } /** Returns the gap that should be left at the top of the region. */ ValueType getLeft() const noexcept { return left; } /** Returns the gap that should be left at the top of the region. */ ValueType getBottom() const noexcept { return bottom; } /** Returns the gap that should be left at the top of the region. */ ValueType getRight() const noexcept { return right; } /** Returns the sum of the top and bottom gaps. */ ValueType getTopAndBottom() const noexcept { return top + bottom; } /** Returns the sum of the left and right gaps. */ ValueType getLeftAndRight() const noexcept { return left + right; } /** Returns true if this border has no thickness along any edge. */ bool isEmpty() const noexcept { return left + right + top + bottom == ValueType(); } //============================================================================== /** Changes the top gap. */ void setTop (ValueType newTopGap) noexcept { top = newTopGap; } /** Changes the left gap. */ void setLeft (ValueType newLeftGap) noexcept { left = newLeftGap; } /** Changes the bottom gap. */ void setBottom (ValueType newBottomGap) noexcept { bottom = newBottomGap; } /** Changes the right gap. */ void setRight (ValueType newRightGap) noexcept { right = newRightGap; } //============================================================================== /** Returns a rectangle with these borders removed from it. */ Rectangle<ValueType> subtractedFrom (const Rectangle<ValueType>& original) const noexcept { return Rectangle<ValueType> (original.getX() + left, original.getY() + top, original.getWidth() - (left + right), original.getHeight() - (top + bottom)); } /** Removes this border from a given rectangle. */ void subtractFrom (Rectangle<ValueType>& rectangle) const noexcept { rectangle = subtractedFrom (rectangle); } /** Returns a rectangle with these borders added around it. */ Rectangle<ValueType> addedTo (const Rectangle<ValueType>& original) const noexcept { return Rectangle<ValueType> (original.getX() - left, original.getY() - top, original.getWidth() + (left + right), original.getHeight() + (top + bottom)); } /** Adds this border around a given rectangle. */ void addTo (Rectangle<ValueType>& rectangle) const noexcept { rectangle = addedTo (rectangle); } //============================================================================== bool operator== (const BorderSize& other) const noexcept { return top == other.top && left == other.left && bottom == other.bottom && right == other.right; } bool operator!= (const BorderSize& other) const noexcept { return ! operator== (other); } private: //============================================================================== ValueType top, left, bottom, right; }; } // namespace juce
/** * \file * * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries. * * \asf_license_start * * \page License * * Subject to your compliance with these terms, you may use Microchip * software and any derivatives exclusively with Microchip products. * It is your responsibility to comply with third party license terms applicable * to your use of third party software (including open source software) that * may accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. * * \asf_license_stop * */ /* * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a> */ #ifndef _SAME70_AES_INSTANCE_ #define _SAME70_AES_INSTANCE_ /* ========== Register definition for AES peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) #define REG_AES_CR (0x4006C000U) /**< \brief (AES) Control Register */ #define REG_AES_MR (0x4006C004U) /**< \brief (AES) Mode Register */ #define REG_AES_IER (0x4006C010U) /**< \brief (AES) Interrupt Enable Register */ #define REG_AES_IDR (0x4006C014U) /**< \brief (AES) Interrupt Disable Register */ #define REG_AES_IMR (0x4006C018U) /**< \brief (AES) Interrupt Mask Register */ #define REG_AES_ISR (0x4006C01CU) /**< \brief (AES) Interrupt Status Register */ #define REG_AES_KEYWR (0x4006C020U) /**< \brief (AES) Key Word Register */ #define REG_AES_IDATAR (0x4006C040U) /**< \brief (AES) Input Data Register */ #define REG_AES_ODATAR (0x4006C050U) /**< \brief (AES) Output Data Register */ #define REG_AES_IVR (0x4006C060U) /**< \brief (AES) Initialization Vector Register */ #define REG_AES_AADLENR (0x4006C070U) /**< \brief (AES) Additional Authenticated Data Length Register */ #define REG_AES_CLENR (0x4006C074U) /**< \brief (AES) Plaintext/Ciphertext Length Register */ #define REG_AES_GHASHR (0x4006C078U) /**< \brief (AES) GCM Intermediate Hash Word Register */ #define REG_AES_TAGR (0x4006C088U) /**< \brief (AES) GCM Authentication Tag Word Register */ #define REG_AES_CTRR (0x4006C098U) /**< \brief (AES) GCM Encryption Counter Value Register */ #define REG_AES_GCMHR (0x4006C09CU) /**< \brief (AES) GCM H Word Register */ #define REG_AES_VERSION (0x4006C0FCU) /**< \brief (AES) Version Register */ #else #define REG_AES_CR (*(__O uint32_t*)0x4006C000U) /**< \brief (AES) Control Register */ #define REG_AES_MR (*(__IO uint32_t*)0x4006C004U) /**< \brief (AES) Mode Register */ #define REG_AES_IER (*(__O uint32_t*)0x4006C010U) /**< \brief (AES) Interrupt Enable Register */ #define REG_AES_IDR (*(__O uint32_t*)0x4006C014U) /**< \brief (AES) Interrupt Disable Register */ #define REG_AES_IMR (*(__I uint32_t*)0x4006C018U) /**< \brief (AES) Interrupt Mask Register */ #define REG_AES_ISR (*(__I uint32_t*)0x4006C01CU) /**< \brief (AES) Interrupt Status Register */ #define REG_AES_KEYWR (*(__O uint32_t*)0x4006C020U) /**< \brief (AES) Key Word Register */ #define REG_AES_IDATAR (*(__O uint32_t*)0x4006C040U) /**< \brief (AES) Input Data Register */ #define REG_AES_ODATAR (*(__I uint32_t*)0x4006C050U) /**< \brief (AES) Output Data Register */ #define REG_AES_IVR (*(__O uint32_t*)0x4006C060U) /**< \brief (AES) Initialization Vector Register */ #define REG_AES_AADLENR (*(__IO uint32_t*)0x4006C070U) /**< \brief (AES) Additional Authenticated Data Length Register */ #define REG_AES_CLENR (*(__IO uint32_t*)0x4006C074U) /**< \brief (AES) Plaintext/Ciphertext Length Register */ #define REG_AES_GHASHR (*(__IO uint32_t*)0x4006C078U) /**< \brief (AES) GCM Intermediate Hash Word Register */ #define REG_AES_TAGR (*(__I uint32_t*)0x4006C088U) /**< \brief (AES) GCM Authentication Tag Word Register */ #define REG_AES_CTRR (*(__I uint32_t*)0x4006C098U) /**< \brief (AES) GCM Encryption Counter Value Register */ #define REG_AES_GCMHR (*(__IO uint32_t*)0x4006C09CU) /**< \brief (AES) GCM H Word Register */ #define REG_AES_VERSION (*(__I uint32_t*)0x4006C0FCU) /**< \brief (AES) Version Register */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #endif /* _SAME70_AES_INSTANCE_ */
/*********************************************************************************** Filename: usb_interrupt.c Description: USB library interrupt initialisation and ISR. ***********************************************************************************/ /// \addtogroup module_usb_interrupt /// @{ #define USBINTERRUPT_C ///< Modifies the behavior of "EXTERN" in usb_interrupt.h #include "usb_firmware_library_headers.h" #include "clock.h" #include "hal_board.h" #include "hal_led.h" /** \brief Initializes the \ref module_usb_interrupt module * * This function should be called after the \ref module_usb_framework module has been initialized. * Use interrupt group priority control (refer to the CC2531 datasheet) to adjust the priority of the * USB interrupt relative to other interrupts. * * \param[in] irqMask * A bit mask containing USBIRQ_EVENT bits for all events that shall be reported */ void usbirqInit(uint16 irqMask) { // Initialize variables usbirqData.eventMask = 0x0000; usbirqData.inSuspend = FALSE; usbirqData.irqMask = irqMask; // Select which IRQ flags to handle USBCIE = irqMask; USBIIE = irqMask >> 4; USBOIE = (irqMask >> 9) & 0x3E; HAL_USB_INT_CLEAR(); HAL_USB_INT_ENABLE(); } // usbirqInit /** \brief USB interrupt handler * * Clears the P2 interrupt flag and converts all USB interrupt flags into events. * The interrupt also lets \ref usbsuspEnter() break from the suspend loop. */ void usbirqHandler(void) { uint8 usbcif; // First make sure that the crystal oscillator is stable while (!CC2530_IS_XOSC_STABLE()); // Special handling for reset interrupts usbcif = USBCIF; if (usbcif & USBCIF_RSTIF) { // All interrupts (except suspend) are by default enabled by hardware, so // re-initialize the enable bits to avoid unwanted interrupts USBCIE = usbirqData.irqMask; USBIIE = usbirqData.irqMask >> 4; USBOIE = (usbirqData.irqMask >> 9) & 0x3E; // Enable suspend mode when suspend signaling is detected on the bus USBPOW |= USBPOW_SUSPEND_EN; } // Record events (keeping existing) usbirqData.eventMask |= (uint16) usbcif; usbirqData.eventMask |= (uint16) USBIIF << 4; usbirqData.eventMask |= (uint16) USBOIF << 9; // If we get a suspend event, we should always enter suspend mode. We must, // however be sure that we exit the suspend loop upon resume or reset // signaling. if (usbcif & USBCIF_SUSPENDIF) { usbirqData.inSuspend = TRUE; } if (usbcif & (USBCIF_RSTIF | USBCIF_RESUMEIF)) { usbirqData.inSuspend = FALSE; } if (P2IFG & P2IFG_DPIF) { // Resume interrupt detected on D+ line while in suspend P2IFG = (unsigned char)~P2IFG_DPIF; usbirqData.inSuspend = FALSE; } // Handle event which need immediate processing usbirqHookProcessEvents(); // Clear the interrupt HAL_USB_INT_CLEAR(); } // usbirqHandler //@} /* +------------------------------------------------------------------------------ | Copyright 2008-2009 Texas Instruments Incorporated. All rights reserved. | | IMPORTANT: Your use of this Software is limited to those specific rights | granted under the terms of a software license agreement between the user who | downloaded the software, his/her employer (which must be your employer) and | Texas Instruments Incorporated (the "License"). You may not use this Software | unless you agree to abide by the terms of the License. The License limits | your use, and you acknowledge, that the Software may not be modified, copied | or distributed unless embedded on a Texas Instruments microcontroller or used | solely and exclusively in conjunction with a Texas Instruments radio | frequency transceiver, which is integrated into your product. Other than for | the foregoing purpose, you may not use, reproduce, copy, prepare derivative | works of, modify, distribute, perform, display or sell this Software and/or | its documentation for any purpose. | | YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE | PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, | INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, | NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL | TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, | NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER | LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING | BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR | CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF | SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES | (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. | | Should you have any questions regarding your right to use this Software, | contact Texas Instruments Incorporated at www.TI.com. | +------------------------------------------------------------------------------ */
/* * gedit-plugin-loader.h * This file is part of gedit * * Copyright (C) 2008 - Jesse van den Kieboom * * 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 __GEDIT_PLUGIN_LOADER_H__ #define __GEDIT_PLUGIN_LOADER_H__ #include <glib-object.h> #include <gedit/gedit-plugin.h> #include <gedit/gedit-plugin-info.h> G_BEGIN_DECLS #define GEDIT_TYPE_PLUGIN_LOADER (gedit_plugin_loader_get_type ()) #define GEDIT_PLUGIN_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_PLUGIN_LOADER, GeditPluginLoader)) #define GEDIT_IS_PLUGIN_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_PLUGIN_LOADER)) #define GEDIT_PLUGIN_LOADER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GEDIT_TYPE_PLUGIN_LOADER, GeditPluginLoaderInterface)) typedef struct _GeditPluginLoader GeditPluginLoader; /* dummy object */ typedef struct _GeditPluginLoaderInterface GeditPluginLoaderInterface; struct _GeditPluginLoaderInterface { GTypeInterface parent; const gchar *(*get_id) (void); GeditPlugin *(*load) (GeditPluginLoader *loader, GeditPluginInfo *info, const gchar *path); void (*unload) (GeditPluginLoader *loader, GeditPluginInfo *info); void (*garbage_collect) (GeditPluginLoader *loader); }; GType gedit_plugin_loader_get_type (void); const gchar *gedit_plugin_loader_type_get_id (GType type); GeditPlugin *gedit_plugin_loader_load (GeditPluginLoader *loader, GeditPluginInfo *info, const gchar *path); void gedit_plugin_loader_unload (GeditPluginLoader *loader, GeditPluginInfo *info); void gedit_plugin_loader_garbage_collect (GeditPluginLoader *loader); /** * GEDIT_PLUGIN_LOADER_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init): * * Utility macro used to register interfaces for gobject types in plugin loaders. */ #define GEDIT_PLUGIN_LOADER_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \ const GInterfaceInfo g_implement_interface_info = \ { \ (GInterfaceInitFunc) iface_init, \ NULL, \ NULL \ }; \ \ g_type_module_add_interface (type_module, \ g_define_type_id, \ TYPE_IFACE, \ &g_implement_interface_info); /** * GEDIT_PLUGIN_LOADER_REGISTER_TYPE(PluginLoaderName, plugin_loader_name, PARENT_TYPE, loader_interface_init): * * Utility macro used to register plugin loaders. */ #define GEDIT_PLUGIN_LOADER_REGISTER_TYPE(PluginLoaderName, plugin_loader_name, PARENT_TYPE, loader_iface_init) \ G_DEFINE_DYNAMIC_TYPE_EXTENDED (PluginLoaderName, \ plugin_loader_name, \ PARENT_TYPE, \ 0, \ GEDIT_PLUGIN_LOADER_IMPLEMENT_INTERFACE(GEDIT_TYPE_PLUGIN_LOADER, loader_iface_init)); \ \ \ G_MODULE_EXPORT GType \ register_gedit_plugin_loader (GTypeModule *type_module) \ { \ plugin_loader_name##_register_type (type_module); \ \ return plugin_loader_name##_get_type(); \ } G_END_DECLS #endif /* __GEDIT_PLUGIN_LOADER_H__ */
//_____________________________________________________________________________ /*! \class genie::nuvld::GuiXmlFileHandler \brief Responds to GUI events associated with parsing, opening (through a TGFileDialog), closing, and uploading to an RDBMS of the NuValidator XML data files. \author Costas Andreopoulos (Rutherford Lab.) <costas.andreopoulos \at stfc.ac.uk> \created January 12, 2004 */ //_____________________________________________________________________________ #ifndef _GUI_XML_FILE_HANDLER_H_ #define _GUI_XML_FILE_HANDLER_H_ class TGWindow; class TGMenu; class TGPopupMenu; namespace genie { namespace nuvld { class GuiXmlFileHandler { public: GuiXmlFileHandler(); GuiXmlFileHandler(const TGWindow * main, DBConnection * connection); ~GuiXmlFileHandler(); void OpenFile (void); void CloseFile (void); void ParseFile (void); void SendToDBase (void); void AttachFileMenu(TGPopupMenu * file_menu) { _file_menu = file_menu; } private: bool IsConnected (void); string _current_file; TGPopupMenu * _file_menu; const TGWindow * _main; DBConnection * _dbc; }; } // nuvld namespace } // genie namespace #endif
/** -*- C++ -*- * Copyright (C) 2007-2012 Hypertable, Inc. * * This file is part of Hypertable. * * Hypertable 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 any later version. * * Hypertable 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 Hypertable. If not, see <http://www.gnu.org/licenses/> */ #ifndef HYPERTABLE_CELLCACHE_ALLOCATOR_H #define HYPERTABLE_CELLCACHE_ALLOCATOR_H #include "Common/PageArenaAllocator.h" namespace Hypertable { struct CellCachePageAllocator : DefaultPageAllocator { void *allocate(size_t sz); void freed(size_t sz); }; typedef PageArena<uint8_t, CellCachePageAllocator> CellCacheArena; template <typename T, class Impl = PageArenaAllocator<T, CellCacheArena> > struct CellCacheAllocator : Impl { template <typename U> CellCacheAllocator(const PageArenaAllocator<U, CellCacheArena> &other) : Impl(other) {} template <typename U> struct rebind { typedef PageArenaAllocator<U, CellCacheArena> other; }; CellCacheAllocator() {} CellCacheAllocator(CellCacheArena &arena) : Impl(arena) {} }; } // namespace Hypertable #endif /* HYPERTABLE_CELLCACHE_ALLOCATOR_H */
/* This file is part of Telegram Desktop, the official desktop version of Telegram messaging app, see https://telegram.org Telegram Desktop 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. It 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. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once #include "pspecific_mac_p.h" inline QString psServerPrefix() { return qsl("/tmp/"); } inline void psCheckLocalSocket(const QString &serverName) { QFile address(serverName); if (address.exists()) { address.remove(); } } class MacPrivate : public PsMacWindowPrivate { public: void activeSpaceChanged(); void darkModeChanged(); void notifyClicked(unsigned long long peer, int msgid); void notifyReplied(unsigned long long peer, int msgid, const char *str); }; class NotifyWindow; class PsMainWindow : public QMainWindow { Q_OBJECT public: PsMainWindow(QWidget *parent = 0); int32 psResizeRowWidth() const { return 0;//st::wndResizeAreaWidth; } void psInitFrameless(); void psInitSize(); void psFirstShow(); void psInitSysMenu(); void psUpdateSysMenu(Qt::WindowState state); void psUpdateMargins(); void psUpdatedPosition(); bool psHandleTitle(); void psFlash(); void psUpdateWorkmode(); void psRefreshTaskbarIcon(); bool psPosInited() const { return posInited; } void psActivateNotify(NotifyWindow *w); void psClearNotifies(PeerId peerId = 0); void psNotifyShown(NotifyWindow *w); void psPlatformNotify(HistoryItem *item); bool eventFilter(QObject *obj, QEvent *evt); void psUpdateCounter(); virtual QImage iconWithCounter(int size, int count, style::color bg, bool smallIcon) = 0; ~PsMainWindow(); public slots: void psUpdateDelegate(); void psSavePosition(Qt::WindowState state = Qt::WindowActive); void psShowTrayMenu(); void psMacUndo(); void psMacRedo(); void psMacCut(); void psMacCopy(); void psMacPaste(); void psMacDelete(); void psMacSelectAll(); protected: void psNotIdle() const; QImage psTrayIcon(bool selected = false) const; bool psHasTrayIcon() const { return trayIcon; } void psMacUpdateMenu(); bool posInited; QSystemTrayIcon *trayIcon; QMenu *trayIconMenu; QImage icon256, iconbig256; QIcon wndIcon; QImage trayImg, trayImgSel; void psTrayMenuUpdated(); void psSetupTrayIcon(); virtual void placeSmallCounter(QImage &img, int size, int count, style::color bg, const QPoint &shift, style::color color) = 0; QTimer psUpdatedPositionTimer; private: MacPrivate _private; mutable bool psIdle; mutable QTimer psIdleTimer; QMenuBar psMainMenu; QAction *psLogout, *psUndo, *psRedo, *psCut, *psCopy, *psPaste, *psDelete, *psSelectAll, *psContacts, *psAddContact, *psNewGroup, *psShowTelegram; }; class PsApplication : public QApplication { Q_OBJECT public: PsApplication(int &argc, char **argv); void psInstallEventFilter(); ~PsApplication(); signals: void updateChecking(); void updateLatest(); void updateDownloading(qint64 ready, qint64 total); void updateReady(); void updateFailed(); }; class PsUpdateDownloader : public QObject { Q_OBJECT public: PsUpdateDownloader(QThread *thread, const MTPDhelp_appUpdate &update); PsUpdateDownloader(QThread *thread, const QString &url); void unpackUpdate(); int32 ready(); int32 size(); static void deleteDir(const QString &dir); static void clearAll(); ~PsUpdateDownloader(); public slots: void start(); void partMetaGot(); void partFinished(qint64 got, qint64 total); void partFailed(QNetworkReply::NetworkError e); void sendRequest(); private: void initOutput(); void fatalFail(); QString updateUrl; QNetworkAccessManager manager; QNetworkReply *reply; int32 already, full; QFile outputFile; QMutex mutex; }; void psUserActionDone(); bool psIdleSupported(); uint64 psIdleTime(); bool psSkipAudioNotify(); bool psSkipDesktopNotify(); QStringList psInitLogs(); void psClearInitLogs(); void psActivateProcess(uint64 pid = 0); QString psLocalServerPrefix(); QString psCurrentCountry(); QString psCurrentLanguage(); QString psAppDataPath(); QString psDownloadPath(); QString psCurrentExeDirectory(int argc, char *argv[]); QString psCurrentExeName(int argc, char *argv[]); void psAutoStart(bool start, bool silent = false); void psSendToMenu(bool send, bool silent = false); QRect psDesktopRect(); void psShowOverAll(QWidget *w, bool canFocus = true); void psBringToBack(QWidget *w); int psCleanup(); int psFixPrevious(); bool psCheckReadyUpdate(); void psExecUpdater(); void psExecTelegram(); bool psShowOpenWithMenu(int x, int y, const QString &file); void psPostprocessFile(const QString &name); void psOpenFile(const QString &name, bool openWith = false); void psShowInFolder(const QString &name); void psStart(); void psFinish(); void psRegisterCustomScheme(); void psUpdateOverlayed(QWidget *widget); QString psConvertFileUrl(const QString &url); QString strNotificationAboutThemeChange(); QString strStyleOfInterface(); QString strNeedToReload(); QString strNeedToRefresh1(); QString strNeedToRefresh2();
// $Id: sig.c 1 2005-6-13 3:17:17 PM Celestia $ #include <stdio.h> #include <stdlib.h> #include <signal.h> #define __USE_GNU // required to enable strsignal on some platforms #include <string.h> #include <time.h> #include "../common/plugin.h" PLUGIN_INFO = { "Signals", PLUGIN_CORE, "1.1", PLUGIN_VERSION, "Handles program signals" }; PLUGIN_EVENTS_TABLE = { { "sig_init", "Plugin_Init" }, { "sig_final", "Plugin_Final" }, { NULL, NULL } }; ////////////////////////////////////// #if defined(_WIN32) || defined(MINGW) int sig_init() { printf("sig: This plugin is not supported - Enable 'exchndl' instead!\n"); return 0; } int sig_final() { return 0; } #elif defined (__NETBSD__) || defined (__FREEBSD__) int sig_init() { printf("sig: This plugin is not supported!\n"); return 0; } int sig_final() { return 0; } #else ////////////////////////////////////// #ifdef HAVE_EXECINFO_H #include <execinfo.h> #endif const char* (*getrevision)(); unsigned long (*getuptime)(); char *server_name; int crash_flag = 0; int sig_final (); // by Gabuzomeu // This is an implementation of signal() using sigaction() for portability. // (sigaction() is POSIX; signal() is not.) Taken from Stevens' _Advanced // Programming in the UNIX Environment_. // #ifndef POSIX #define compat_signal(signo, func) signal(signo, func) #else sigfunc *compat_signal(int signo, sigfunc *func) { struct sigaction sact, oact; sact.sa_handler = func; sigemptyset(&sact.sa_mask); sact.sa_flags = 0; #ifdef SA_INTERRUPT sact.sa_flags |= SA_INTERRUPT; /* SunOS */ #endif if (sigaction(signo, &sact, &oact) < 0) return (SIG_ERR); return (oact.sa_handler); } #endif /*========================================= * Dumps the stack using glibc's backtrace *----------------------------------------- */ #ifdef CYGWIN #define FOPEN_ freopen #ifdef __cplusplus extern "C" void cygwin_stackdump(); #else extern void cygwin_stackdump(); #endif #else #define FOPEN_(fn,m,s) fopen(fn,m) #endif void sig_dump(int sn) { FILE *fp; char file[256]; int no = 0; crash_flag = 1; // search for a usable filename do { sprintf (file, "log/%s%04d.stackdump", server_name, ++no); } while((fp = fopen(file,"r")) && (fclose(fp), no < 9999)); // dump the trace into the file if ((fp = FOPEN_(file, "w", stderr)) != NULL) { const char *revision; #ifndef CYGWIN void* array[20]; char **stack; size_t size; #endif printf("sig: Dumping stack to '%s'...\n", file); fprintf(fp, "Version: SVN %s \n", getrevision()); fprintf(fp, "Exception: %s \n", strsignal(sn)); fflush (fp); #ifdef CYGWIN cygwin_stackdump (); #else fprintf(fp, "Stack trace:\n"); size = backtrace (array, 20); stack = backtrace_symbols (array, size); for (no = 0; no < size; no++) { fprintf(fp, "%s\n", stack[no]); } fprintf(fp,"End of stack trace\n"); free(stack); #endif printf("sig: %s Saved.\n", file); fflush(stdout); fclose(fp); } sig_final(); // Log our uptime // Pass the signal to the system's default handler compat_signal(sn, SIG_DFL); raise(sn); } /*========================================= * Shutting down (Program did not crash ^^) * - Log our current up time *----------------------------------------- */ int sig_final () { time_t curtime; char curtime2[24]; FILE *fp; long seconds = 0, day = 24*60*60, hour = 60*60, minute = 60, days = 0, hours = 0, minutes = 0; fp = fopen("log/uptime.log","a"); if (fp) { time(&curtime); strftime(curtime2, 24, "%m/%d/%Y %H:%M:%S", localtime(&curtime)); seconds = getuptime(); days = seconds/day; seconds -= (seconds/day>0)?(seconds/day)*day:0; hours = seconds/hour; seconds -= (seconds/hour>0)?(seconds/hour)*hour:0; minutes = seconds/minute; seconds -= (seconds/minute>0)?(seconds/minute)*minute:0; fprintf(fp, "%s: %s %s - %ld days, %ld hours, %ld minutes, %ld seconds.\n", curtime2, server_name, (crash_flag ? "crashed" : "uptime"), days, hours, minutes, seconds); fclose(fp); } return 1; } /*========================================= * Register the signal handlers *----------------------------------------- */ int sig_init () { void (*func)(int) = sig_dump; #ifdef CYGWIN // test if dumper is enabled char *buf = getenv ("CYGWIN"); if (buf && strstr(buf, "error_start") != NULL) func = SIG_DFL; #endif IMPORT_SYMBOL(server_name, 1); IMPORT_SYMBOL(getrevision, 6); IMPORT_SYMBOL(getuptime, 11); compat_signal(SIGSEGV, func); compat_signal(SIGFPE, func); compat_signal(SIGILL, func); compat_signal(SIGBUS, func); return 1; } #endif
#ifndef _HW_ #define _HW_ #include "string.h" #include "global.h" #include "memory.h" #include "ipc.h" #include "alloc.h" #include "dip.h" #include "GCPad.h" #define P2C(x) ((x)&0x7FFFFFFF) #define HW_BASE 0x0d800000 #define HW_MEMIRR (HW_BASE+0x60) #define HW_AHBPROT (HW_BASE+0x64) #define HW_DDRCTRL_ADDR (HW_BASE+0x74) #define HW_DDRCTRL_VAL (HW_BASE+0x76) #define HW_GPIO_ENABLE (HW_BASE+0xDC) #define HW_GPIO_OUT (HW_BASE+0xE0) #define HW_GPIO_DIR (HW_BASE+0xE4) #define HW_GPIO_IN (HW_BASE+0xE8) #define HW_GPIO_INTLVL (HW_BASE+0xEC) #define HW_GPIO_INTFLAG (HW_BASE+0xF0) #define HW_GPIO_INTMASK (HW_BASE+0xF4) #define HW_GPIO_INMIR (HW_BASE+0xF8) #define HW_GPIO_OWNER (HW_BASE+0xFC) #define HW_ACRPLLSYS (HW_BASE+0x1B0) #define HW_ACRPLLSYSEXT (HW_BASE+0x1B4) #define DIFLAGS_PPCBOOT (1<<20) #define IRQ_TIMER (1<<0) #define IRQ_NAND (1<<1) #define IRQ_AES (1<<2) #define IRQ_SHA1 (1<<3) #define IRQ_EHCI (1<<4) #define IRQ_OHCI0 (1<<5) #define IRQ_OHCI1 (1<<6) #define IRQ_SDHC (1<<7) #define IRQ_WIFI (1<<8) #define IRQ_GPIO1B (1<<10) #define IRQ_GPIO1 (1<<11) #define IRQ_RESET (1<<17) #define IRQ_PPCIPC (1<<30) #define IRQ_IPC (1<<31) #define GPIO_POWER (1<<1) extern void DRAMCTRLWrite( u32 Register, u32 Value ); extern u32 DRAMCTRLRead( u32 Register ); void EHCIInit( void ); void EXIControl( u32 value ); void MIOSHWInit( u32 A, u32 B ); void MIOSInit( void ); void MEMInitLow( void ); void BootPPC( void ); void UNKInit( u32 A, u32 B ); void DRAMInit( u32 A, u32 B ); void ChangeClock( void ); void PPCReset( void ); void HWResetDisable( void ); void HWResetEnable( void ); void HW_184( void ); void HW_184_2( void ); void GetRevision( u32 *Version, u32 *Revision ); void HWMAgic( u32 R0, u32 R1, u32 R2, u32 R3 ); u32 DRAMRead( u32 ValueA ); void DRAMWrite( u32 ValueA, u32 ValueB ); u32 RegRead( u32 Register ); void RegWrite( u32 Register, u32 Value ); void HWRegWriteBatch( u32 A, u32 B, u32 C, u32 D, u32 delay ); void Shutdown( void ); #endif
/* This file is part of darktable, copyright (c) 2010 henrik andersson. copyright (c) 2010--2017 tobias ellinghaus. darktable 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. darktable 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 darktable. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <glib.h> #include <stdint.h> typedef struct dt_variables_params_t { /** used for expanding variables that uses filename $(FILE_FOLDER) $(FILE_NAME) and $(FILE_EXTENSION). */ const gchar *filename; /** used for expanding variable $(JOBCODE) */ const gchar *jobcode; /** used for expanding variables such as $(IMAGE_WIDTH) $(IMAGE_HEIGHT). */ uint32_t imgid; /** used as thread-safe sequence number. only used if >= 0. */ int sequence; /** internal variables data */ struct dt_variables_data_t *data; } dt_variables_params_t; /** allocate and initializes a dt_variables_params_t. */ void dt_variables_params_init(dt_variables_params_t **params); /** destroys an initialized dt_variables_params_t, pointer is garbage after this call. */ void dt_variables_params_destroy(dt_variables_params_t *params); /** set the time in a dt_variables_params_t. */ void dt_variables_set_time(dt_variables_params_t *params, time_t time); /** set the time to use for EXIF variables */ void dt_variables_set_exif_time(dt_variables_params_t *params, time_t time); /** expands variables in string. the result should be freed with g_free(). */ char *dt_variables_expand(dt_variables_params_t *params, gchar *source, gboolean iterate); /** reset sequence number */ void dt_variables_reset_sequence(dt_variables_params_t *params); // modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh // vim: shiftwidth=2 expandtab tabstop=2 cindent // kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
/* How much read-only Lisp storage a dumped Emacs needs. Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs 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. GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define PURESIZE, the number of bytes of pure Lisp code to leave space for. At one point, this was defined in config.h, meaning that changing PURESIZE would make Make recompile all of Emacs. But only a few files actually use PURESIZE, so we split it out to its own .h file. Make sure to include this file after config.h, since that tells us whether we are running X windows, which tells us how much pure storage to allocate. */ /* First define a measure of the amount of data we have. */ /* A system configuration file may set this to request a certain extra amount of storage. This is a lot more update-robust that defining BASE_PURESIZE or even PURESIZE directly. */ #ifndef SYSTEM_PURESIZE_EXTRA #define SYSTEM_PURESIZE_EXTRA 0 #endif #ifndef SITELOAD_PURESIZE_EXTRA #define SITELOAD_PURESIZE_EXTRA 0 #endif #ifndef BASE_PURESIZE #define BASE_PURESIZE (1700000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ #ifndef PURESIZE_RATIO #if EMACS_INT_MAX >> 31 != 0 #if PTRDIFF_MAX >> 31 != 0 #define PURESIZE_RATIO 10 / 6 /* Don't surround with `()'. */ #else #define PURESIZE_RATIO 8 / 6 /* Don't surround with `()'. */ #endif #else #define PURESIZE_RATIO 1 #endif #endif #ifdef ENABLE_CHECKING /* ENABLE_CHECKING somehow increases the purespace used, probably because it tends to cause some macro arguments to be evaluated twice. This is a bug, but it's difficult to track it down. */ #define PURESIZE_CHECKING_RATIO 12 / 10 /* Don't surround with `()'. */ #else #define PURESIZE_CHECKING_RATIO 1 #endif /* This is the actual size in bytes to allocate. */ #ifndef PURESIZE #define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO * PURESIZE_CHECKING_RATIO) #endif /* Signal an error if OBJ is pure. */ #define CHECK_IMPURE(obj) \ { if (PURE_P (obj)) \ pure_write_error (); } extern _Noreturn void pure_write_error (void); /* Define PURE_P. */ extern EMACS_INT pure[]; #define PURE_P(obj) \ ((uintptr_t) XPNTR (obj) - (uintptr_t) pure <= PURESIZE)
/* * $Id: buttonbox.h,v 1.27 2012/03/21 21:15:30 tom Exp $ */ #ifndef CDKINCLUDES #ifndef CDKBUTTONBOX_H #define CDKBUTTONBOX_H 1 #ifdef __cplusplus extern "C" { #endif #ifndef CDK_H #define CDKINCLUDES #include <cdk.h> #undef CDKINCLUDES #include <binding.h> #include <cdkscreen.h> #include <cdk_objs.h> #endif /* * Changes 1999-2005,2012 copyright Thomas E. Dickey * * Copyright 1999, Mike Glover * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgment: * This product includes software developed by Mike Glover * and contributors. * 4. Neither the name of Mike Glover, nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY MIKE GLOVER 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 MIKE GLOVER 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 the CDK buttonbox structure. */ struct SButtonBox { CDKOBJS obj; WINDOW * parent; WINDOW * win; WINDOW * shadowWin; int titleAdj; chtype ** button; int * buttonLen; int * buttonPos; int * columnWidths; int buttonCount; int buttonWidth; int currentButton; int rows; int cols; int colAdjust; int rowAdjust; int boxWidth; int boxHeight; chtype ButtonAttrib; EExitType exitType; boolean shadow; chtype highlight; }; typedef struct SButtonBox CDKBUTTONBOX; /* * This returns a CDK buttonbox widget pointer. */ CDKBUTTONBOX *newCDKButtonbox ( CDKSCREEN * /* cdkscreen */, int /* xPos */, int /* yPos */, int /* height */, int /* width */, const char * /* title */, int /* rows */, int /* cols */, CDK_CSTRING2 /* buttons */, int /* buttonCount */, chtype /* highlight */, boolean /* Box */, boolean /* shadow */); /* * This activates the widget. */ int activateCDKButtonbox ( CDKBUTTONBOX * /* buttonbox */, chtype * /* actions */); /* * This injects a single character into the widget. */ #define injectCDKButtonbox(obj,input) injectCDKObject(obj,input,Int) /* * This sets multiple attributes of the widget. */ void setCDKButtonbox ( CDKBUTTONBOX * /* buttonbox */, chtype /* highlight */, boolean /* Box */); void setCDKButtonboxCurrentButton ( CDKBUTTONBOX * /* buttonbox */, int /* button */); int getCDKButtonboxCurrentButton ( CDKBUTTONBOX * /* buttonbox */); int getCDKButtonboxButtonCount ( CDKBUTTONBOX * /* buttonbox */); /* * This sets the highlight attribute for the buttonbox. */ void setCDKButtonboxHighlight ( CDKBUTTONBOX * /* buttonbox */, chtype /* highlight */); chtype getCDKButtonboxHighlight ( CDKBUTTONBOX * /* buttonbox */); /* * This sets the box attribute of the widget. */ void setCDKButtonboxBox ( CDKBUTTONBOX * /* buttonbox */, boolean /* Box */); boolean getCDKButtonboxBox ( CDKBUTTONBOX * /* buttonbox */); /* * These set the drawing characters of the widget. */ #define setCDKButtonboxULChar(w,c) setULCharOf(w,c) #define setCDKButtonboxURChar(w,c) setURCharOf(w,c) #define setCDKButtonboxLLChar(w,c) setLLCharOf(w,c) #define setCDKButtonboxLRChar(w,c) setLRCharOf(w,c) #define setCDKButtonboxVerticalChar(w,c) setVTCharOf(w,c) #define setCDKButtonboxHorizontalChar(w,c) setHZCharOf(w,c) #define setCDKButtonboxBoxAttribute(w,c) setBXAttrOf(w,c) /* * This sets the background color of the widget. */ #define setCDKButtonboxBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c) /* * This sets the background attribute of the widget. */ #define setCDKButtonboxBackgroundAttrib(w,c) setBKAttrOf(w,c) /* * This draws the buttonbox box widget. */ #define drawCDKButtonbox(obj,box) drawCDKObject(obj,box) void drawCDKButtonboxButtons ( CDKBUTTONBOX * /* buttonbox */); /* * This erases the buttonbox box from the screen. */ #define eraseCDKButtonbox(obj) eraseCDKObject(obj) /* * This moves the buttonbox box to a new screen location. */ #define moveCDKButtonbox(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh) /* * This allows the user to position the widget on the screen interactively. */ #define positionCDKButtonbox(widget) positionCDKObject(ObjOf(widget),widget->win) /* * This destroys the widget and all the memory associated with it. */ #define destroyCDKButtonbox(obj) destroyCDKObject(obj) /* * This redraws the buttonbox box buttonboxs. */ void redrawCDKButtonboxButtonboxs ( CDKBUTTONBOX * /* buttonbox */); /* * These set the pre/post process functions of the buttonbox widget. */ #define setCDKButtonboxPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d) #define setCDKButtonboxPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d) #ifdef __cplusplus } #endif #endif /* CDKBUTTONBOX_H */ #endif /* CDKINCLUDES */
/* Copyright (C) 2012 Fredrik Johansson This file is part of Arb. Arb is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include "bernoulli.h" static __inline__ void mag_ui_div(mag_t z, ulong c, const mag_t x) { mag_t t; mag_init(t); mag_set_ui(t, c); mag_div(z, t, x); mag_clear(t); } void bernoulli_rev_next(fmpz_t numer, fmpz_t denom, bernoulli_rev_t iter) { ulong n; slong j, wp; fmpz_t sum; mag_t err; arb_t z, h; n = iter->n; wp = iter->prec; if (n < BERNOULLI_REV_MIN) { _arith_bernoulli_number(numer, denom, n); if (n != 0) iter->n -= 2; return; } fmpz_init(sum); mag_init(err); arb_init(z); arb_init(h); /* add all odd powers */ fmpz_zero(sum); for (j = iter->max_power; j >= 3; j -= 2) fmpz_add(sum, sum, iter->powers + j); arb_set_fmpz(z, sum); /* bound numerical error from the powers */ fmpz_mul_ui(sum, iter->pow_error, iter->max_power / 2); mag_set_fmpz(err, sum); mag_add(arb_radref(z), arb_radref(z), err); arb_mul_2exp_si(z, z, -wp); arb_add_ui(z, z, 1, wp); /* add truncation error: sum_{k > N} 1/k^n <= 1/N^(i-1) */ mag_set_ui_lower(err, iter->max_power); mag_pow_ui_lower(err, err, n - 1); mag_ui_div(err, 1, err); mag_add(arb_radref(z), arb_radref(z), err); /* convert zeta to Bernoulli number */ arb_div_2expm1_ui(h, z, n, wp); arb_add(z, z, h, wp); arb_mul(z, z, iter->prefactor, wp); arith_bernoulli_number_denom(denom, n); arb_mul_fmpz(z, z, denom, wp); if (n % 4 == 0) arb_neg(z, z); /* flint_printf("%wd: ", n); arb_printd(z, 5); flint_printf("\n"); */ if (!arb_get_unique_fmpz(numer, z)) { flint_printf("warning: insufficient precision for B_%wd\n", n); _bernoulli_fmpq_ui(numer, denom, n); } /* update prefactor */ if (n > 0) { arb_mul(iter->prefactor, iter->prefactor, iter->two_pi_squared, wp); arb_div_ui(iter->prefactor, iter->prefactor, n, wp); arb_div_ui(iter->prefactor, iter->prefactor, n - 1, wp); } /* update powers */ for (j = 3; j <= iter->max_power; j += 2) fmpz_mul2_uiui(iter->powers + j, iter->powers + j, j, j); /* bound error after update */ fmpz_mul2_uiui(iter->pow_error, iter->pow_error, iter->max_power, iter->max_power); /* readjust precision */ if (n % 64 == 0 && n > BERNOULLI_REV_MIN) { slong new_prec, new_max; new_prec = bernoulli_global_prec(n); new_max = bernoulli_zeta_terms(n, new_prec); if (new_prec < iter->prec && new_max <= iter->max_power) { /* change precision of the powers */ for (j = 3; j <= new_max; j += 2) fmpz_tdiv_q_2exp(iter->powers + j, iter->powers + j, iter->prec - new_prec); /* the error also changes precision */ fmpz_cdiv_q_2exp(iter->pow_error, iter->pow_error, iter->prec - new_prec); /* contribution of rounding error when changing the precision of the powers */ fmpz_add_ui(iter->pow_error, iter->pow_error, 1); /* speed improvement (could be skipped with better multiplication) */ arb_set_round(iter->two_pi_squared, iter->two_pi_squared, new_prec); iter->max_power = new_max; iter->prec = new_prec; } } iter->n -= 2; fmpz_clear(sum); mag_clear(err); arb_clear(z); arb_clear(h); }
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2020 Paul Ramsey <[email protected]> * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * **********************************************************************/ #pragma once #include <geos/geom/Dimension.h> #include <geos/export.h> namespace geos { // geos. namespace operation { // geos.operation namespace overlayng { // geos.operation.overlayng /** * Records topological information about an * edge representing a piece of linework (lineString or polygon ring) * from a single source geometry. * This information is carried through the noding process * (which may result in many noded edges sharing the same information object). * It is then used to populate the topology info fields * in {@link Edge}s (possibly via merging). * That information is used to construct the topology graph {@link OverlayLabel}s. * * @author mdavis * */ class GEOS_DLL EdgeSourceInfo { private: // Members uint8_t index; int8_t dim; bool edgeIsHole; int depthDelta; public: EdgeSourceInfo(uint8_t p_index, int p_depthDelta, bool p_isHole); EdgeSourceInfo(uint8_t p_index); uint8_t getIndex() const { return index; } int getDimension() const { return dim; } int getDepthDelta() const { return depthDelta; } bool isHole() const { return edgeIsHole; } }; } // namespace geos.operation.overlayng } // namespace geos.operation } // namespace geos
void requestor1(); void requestor2(); int main(void) { requestor1(); requestor2(); return 0; }
/* Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <[email protected]> 2004, 2005 Rob Buis <[email protected]> 2005 Eric Seidel <[email protected]> 2006 Apple Computer, Inc This file is part of the KDE project This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef RenderPath_h #define RenderPath_h #if ENABLE(SVG) #include "TransformationMatrix.h" #include "FloatRect.h" #include "RenderObject.h" namespace WebCore { class FloatPoint; class Path; class RenderSVGContainer; class SVGStyledTransformableElement; class RenderPath : public RenderObject { public: RenderPath(RenderStyle*, SVGStyledTransformableElement*); virtual ~RenderPath(); // Hit-detection seperated for the fill and the stroke bool fillContains(const FloatPoint&, bool requiresFill = true) const; bool strokeContains(const FloatPoint&, bool requiresStroke = true) const; // Returns an unscaled bounding box (not even including localTransform()) for this vector path virtual FloatRect relativeBBox(bool includeStroke = true) const; const Path& path() const; void setPath(const Path& newPath); virtual bool isRenderPath() const { return true; } virtual const char* renderName() const { return "RenderPath"; } bool calculateLocalTransform(); virtual TransformationMatrix localTransform() const; virtual void layout(); virtual IntRect absoluteClippedOverflowRect(); virtual bool requiresLayer(); virtual int lineHeight(bool b, bool isRootLineBox = false) const; virtual int baselinePosition(bool b, bool isRootLineBox = false) const; virtual void paint(PaintInfo&, int parentX, int parentY); virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true); virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true); virtual void addFocusRingRects(GraphicsContext*, int tx, int ty); virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); FloatRect drawMarkersIfNeeded(GraphicsContext*, const FloatRect&, const Path&) const; private: FloatPoint mapAbsolutePointToLocal(const FloatPoint&) const; mutable Path m_path; mutable FloatRect m_fillBBox; mutable FloatRect m_strokeBbox; FloatRect m_markerBounds; TransformationMatrix m_localTransform; IntRect m_absoluteBounds; }; } #endif // ENABLE(SVG) #endif // vim:ts=4:noet
/* This file is part of KOrganizer Copyright (c) 2004 Bo Thorsen <[email protected]> Copyright (c) 2005 Rafal Rzepecki <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef KORGANIZERIFACEIMPL_H #define KORGANIZERIFACEIMPL_H #include "korganizer_export.h" #include <QObject> class ActionManager; class KORGANIZERPRIVATE_EXPORT KOrganizerIfaceImpl : public QObject { Q_OBJECT public: explicit KOrganizerIfaceImpl( ActionManager *mActionManager, QObject *parent = 0, const char *name = 0 ); ~KOrganizerIfaceImpl(); public slots: bool openURL( const QString &url ); bool mergeURL( const QString &url ); void closeUrl(); bool saveURL(); bool saveAsURL( const QString &url ); QString getCurrentURLasString() const; bool editIncidence( const QString &uid ); /** @reimp from KOrganizerIface::deleteIncidence() @param uid the UID of the item to delete. if no such item exists, nothing happens @return true if the item could be deleted, false otherwise */ bool deleteIncidence( const QString &uid ) { return deleteIncidence( uid, false ); } /** Delete the incidence with the given unique ID from the active calendar. @param uid The incidence's unique ID. @param force If true, all recurrences and sub-todos (if applicable) will be deleted without prompting for confirmation. */ bool deleteIncidence( const QString &uid, bool force ); /** Add an incidence to the active calendar. @param iCal A calendar in iCalendar format containing the incidence. The calendar must consist of a VCALENDAR component which contains the incidence (VEVENT, VTODO, VJOURNAL or VFREEBUSY) and optionally a VTIMEZONE component. If there is more than one incidence, only the first is added to KOrganizer's calendar. */ bool addIncidence( const QString &iCal ); /** Show a HTML representation of the incidence (the "View.." dialog). If no incidence with the given uid exists, nothing happens. @param uid The UID of the incidence to be shown. */ bool showIncidence( const QString &uid ); /** Show an incidence in context. This means showing the todo, agenda or journal view (as appropriate) and scrolling it to show the incidence. @param uid Unique ID of the incidence to show. */ bool showIncidenceContext( const QString &uid ); private: ActionManager *mActionManager; }; #endif // KORGANIZER_SHARED_H
/*! \file gk_arch.h \brief This file contains various architecture-specific declerations \date Started 3/27/2007 \author George \version\verbatim $Id: gk_arch.h 10711 2011-08-31 22:23:04Z karypis $ \endverbatim */ #ifndef _GK_ARCH_H_ #define _GK_ARCH_H_ /************************************************************************* * Architecture-specific differences in header files **************************************************************************/ #ifdef __linux__ #if !defined(__USE_XOPEN) #define __USE_XOPEN #endif #if !defined(_XOPEN_SOURCE) #define _XOPEN_SOURCE 600 #endif #if !defined(__USE_XOPEN2K) #define __USE_XOPEN2K #endif #endif #ifdef HAVE_EXECINFO_H #include <execinfo.h> #endif #ifdef __MSC__ #include "ms_stdint.h" #include "ms_inttypes.h" #include "ms_stat.h" #else #ifndef SUNOS #include <stdint.h> #endif #include <inttypes.h> #include <sys/types.h> #ifndef __MINGW32__ #include <sys/resource.h> #endif #include <sys/time.h> #endif /************************************************************************* * Architecture-specific modifications **************************************************************************/ #ifdef WIN32 typedef ptrdiff_t ssize_t; #endif #ifdef SUNOS #define PTRDIFF_MAX INT64_MAX #endif #ifdef __MSC__ /* MSC does not have rint() function */ #define rint(x) ((int)((x)+0.5)) /* MSC does not have INFINITY defined */ #ifndef INFINITY #define INFINITY FLT_MAX #endif #endif #endif
extern int a1(void); int b(void) { return a1(); }
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** 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 Digia. For licensing terms and ** conditions see http://www.qt.io/licensing. For further information ** use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef PROJECTWIZARDPAGE_H #define PROJECTWIZARDPAGE_H #include "projectnodes.h" #include <coreplugin/generatedfile.h> #include <coreplugin/iwizardfactory.h> #include <utils/wizardpage.h> QT_BEGIN_NAMESPACE class QTreeView; class QModelIndex; QT_END_NAMESPACE namespace Core { class IVersionControl; } namespace Utils { class TreeModel; } namespace ProjectExplorer { namespace Internal { class AddNewTree; namespace Ui { class WizardPage; } // Documentation inside. class ProjectWizardPage : public Utils::WizardPage { Q_OBJECT public: explicit ProjectWizardPage(QWidget *parent = 0); virtual ~ProjectWizardPage(); FolderNode *currentNode() const; void setNoneLabel(const QString &label); int versionControlIndex() const; void setVersionControlIndex(int); Core::IVersionControl *currentVersionControl(); // Returns the common path void setFiles(const QStringList &files); bool runVersionControl(const QList<Core::GeneratedFile> &files, QString *errorMessage); void initializeProjectTree(Node *context, const QStringList &paths, Core::IWizardFactory::WizardKind kind, ProjectAction action); signals: void projectNodeChanged(); void versionControlChanged(int); public slots: void initializeVersionControls(); private slots: void projectChanged(int); void manageVcs(); private: void setAdditionalInfo(const QString &text); void setAddingSubProject(bool addingSubProject); void setModel(Utils::TreeModel *model); void setBestNode(ProjectExplorer::Internal::AddNewTree *tree); void setVersionControls(const QStringList &); void setProjectToolTip(const QString &); bool expandTree(const QModelIndex &root); Ui::WizardPage *m_ui; QStringList m_projectToolTips; Utils::TreeModel *m_model; QList<Core::IVersionControl*> m_activeVersionControls; QString m_commonDirectory; bool m_repositoryExists; }; } // namespace Internal } // namespace ProjectExplorer #endif // PROJECTWIZARDPAGE_H
//Compile with: //gcc -o efl_thread_5 efl_thread_5.c -g `pkg-config --cflags --libs elementary` #include <Elementary.h> static Ecore_Thread *thr = NULL; static Evas_Object *win = NULL; static Evas_Object *rect = NULL; struct info { double x, y; }; // BEGIN - code running in my custom thread instance // static void th_do(void *data, Ecore_Thread *th) { double t = 0.0; // inside our "do" function for the ecore thread, lets do the real work for (;;) { struct info *inf = malloc(sizeof(struct info)); if (inf) { inf->x = 200 + (200 * sin(t)); inf->y = 200 + (200 * cos(t)); // now we have recorded the timepoint we pass it as feedback // back to the mainloop. it will free it when done ecore_thread_feedback(th, inf); } // and sleep and loop usleep(1000); t += 0.02; // in case someone has asked us to cancel - then cancel this loop // co-operatively (cancelling is co-operative) if (ecore_thread_check(th)) break; } } // // END - code running in my custom thread instance static void // when mainloop gets feedback from worker th_feedback(void *data, Ecore_Thread *th, void *msg) { struct info *inf = msg; evas_object_move(rect, inf->x - 50, inf->y - 50); free(inf); } // BONUS (optional): called after th_do returns and has NOT been cancelled static void th_end(void *data, Ecore_Thread *th) { printf("thread ended\n"); } // BONUS (optional): called in mainloop AFTER thread has finished cancelling static void th_cancel(void *data, Ecore_Thread *th) { printf("thread cancelled\n"); } // just test cancelling the thread worker static void down(void *data, Evas *e, Evas_Object *obj, void *event_info) { if (thr) ecore_thread_cancel(thr); thr = NULL; } // on window delete - cancel thread then delete window and exit mainloop static void del(void *data, Evas_Object *obj, void *event_info) { if (thr) ecore_thread_cancel(thr); thr = NULL; evas_object_del(obj); elm_exit(); } EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *o; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("efl-thread-5", "EFL Thread 5"); evas_object_smart_callback_add(win, "delete,request", del, NULL); o = evas_object_rectangle_add(evas_object_evas_get(win)); evas_object_color_set(o, 50, 80, 180, 255); evas_object_resize(o, 100, 100); evas_object_show(o); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, down, NULL); rect = o; // explicitly create ecore thread to do some "work on the side" and pass // in NULL as data ptr to callbacks and true at the end means to actually // make a new thread and not use the thread pool (there is a thread pool // with as many thread workers as there are cpu's so this means you do not // overload the cpu's with more work than you actually have processing // units *IF* your threads do actually spend their time doing actual // heavy computation) thr = ecore_thread_feedback_run(th_do, th_feedback, th_end, th_cancel, NULL, EINA_TRUE); evas_object_resize(win, 400, 400); evas_object_show(win); elm_run(); if (thr) ecore_thread_cancel(thr); return 0; } ELM_MAIN()
/* * HQDefenseStatusCallback.h * * Created on: Oct 27, 2012 * Author: root */ #ifndef HQDEFENSESTATUSSUICALLBACK_H_ #define HQDEFENSESTATUSSUICALLBACK_H_ #include "server/zone/objects/player/sui/SuiCallback.h" #include "server/zone/objects/scene/SceneObjectType.h" #include "server/zone/objects/player/PlayerObject.h" #include "server/zone/managers/gcw/GCWManager.h" class HQDefenseStatusSuiCallback : public SuiCallback { public: HQDefenseStatusSuiCallback(ZoneServer* server) : SuiCallback(server) { } void run(CreatureObject* player, SuiBox* suiBox, bool cancelPressed, Vector<UnicodeString>* args) { if (cancelPressed || !suiBox->isListBox() || player == NULL) return; ManagedReference<SceneObject*> obj = suiBox->getUsingObject(); if(obj == NULL || !obj->isBuildingObject()) return; ManagedReference<BuildingObject*> building = cast<BuildingObject*>(obj.get()); GCWManager* gcwMan = player->getZone()->getGCWManager(); if(gcwMan==NULL) return; bool otherPressed = Bool::valueOf(args->get(0).toString()); int indx = Integer::valueOf(args->get(1).toString()); if(indx == -1) return; SuiListBox* listBox = cast<SuiListBox*>(suiBox); uint64 turretOID = listBox->getMenuObjectID(indx); if(otherPressed) gcwMan->sendRemoveDefenseConfirmation(building, player, turretOID); else gcwMan->sendBaseDefenseStatus(player, building); } }; #endif /* HQDEFENSESTATUSCALLBACK_H_ */
/** * @copyright 2015 Chris Stylianou * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once // Qt includes. #include <QtCore/QtGlobal> #ifdef QWIDGETMAP_LIBRARY /// Defines that the specified function, variable or class should be exported. #define QWIDGETMAP_EXPORT Q_DECL_EXPORT #else /// Defines that the specified function, variable or class should be imported. #define QWIDGETMAP_EXPORT Q_DECL_IMPORT #endif
/* * $Id: rmpbc.c,v 1.18 2002/02/28 10:49:29 spoel Exp $ * * This source code is part of * * G R O M A C S * * GROningen MAchine for Chemical Simulations * * VERSION 3.1 * Copyright (c) 1991-2001, University of Groningen, The Netherlands * 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. * * If you want to redistribute modifications, please consider that * scientific software is very special. Version control is crucial - * bugs must be traceable. We will be happy to consider code for * inclusion in the official distribution, but derived work must not * be called official GROMACS. Details are found in the README & COPYING * files - if they are missing, get the official version at www.gromacs.org. * * To help us fund GROMACS development, we humbly ask that you cite * the papers on the package - you can find them in the top README file. * * For more info, check our website at http://www.gromacs.org * * And Hey: * Gnomes, ROck Monsters And Chili Sauce */ static char *SRCID_rmpbc_c = "$Id: rmpbc.c,v 1.18 2002/02/28 10:49:29 spoel Exp $"; #include "sysstuff.h" #include "typedefs.h" #include "smalloc.h" #include "mshift.h" #include "pbc.h" #include "gstat.h" #include "futil.h" #include "vec.h" void rm_pbc(t_idef *idef,int natoms,matrix box,rvec x[],rvec x_s[]) { typedef struct { int natoms; t_graph *gr; } multi_graph; static int ngraph=0; static multi_graph *mgraph=NULL; static bool bFirst=TRUE; rvec sv[SHIFTS],box_size; int n,i; bool bNeedToCopy; bNeedToCopy = (x != x_s); if (fabs(box[0][0])>GMX_REAL_MIN) { if (idef->ntypes!=-1) { n=-1; for(i=0; i<ngraph; i++) if (mgraph[i].natoms==natoms) n=i; if (n==-1) { /* make a new graph if there isn't one with this number of atoms */ n=ngraph; ngraph++; srenew(mgraph,ngraph); mgraph[n].natoms=natoms; mgraph[n].gr=mk_graph(idef,natoms,FALSE,FALSE); } mk_mshift(stdout,mgraph[n].gr,box,x); calc_shifts(box,box_size,sv); shift_x(mgraph[n].gr,box,x,x_s); bNeedToCopy=FALSE; } else if (bFirst) { fprintf(stderr, "\nWarning: can not make broken molecules whole without a run input file,\n don't worry, mdrun doesn't write broken molecules\n\n"); bFirst=FALSE; } } if (bNeedToCopy) for (i=0; i<natoms; i++) copy_rvec(x[i],x_s[i]); }
#include <sched.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main (void) { fprintf (stdout, "Ordonnancement FIFO :\n %d <= priorité <= %d\n", sched_get_priority_min (SCHED_FIFO), sched_get_priority_max (SCHED_FIFO)); fprintf (stdout, "Ordonnancement RR :\n %d <= priorité <= %d\n", sched_get_priority_min (SCHED_RR), sched_get_priority_max (SCHED_RR)); fprintf (stdout, "Ordonnancement OTHER :\n %d <= priorité <= %d\n", sched_get_priority_min (SCHED_OTHER), sched_get_priority_max (SCHED_OTHER)); return (0); }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _ATIVEMQ_UTIL_IDGENERATOR_H_ #define _ATIVEMQ_UTIL_IDGENERATOR_H_ #include <activemq/util/Config.h> #include <string> namespace activemq { namespace library { class ActiveMQCPP; } namespace util { class IdGeneratorKernel; class AMQCPP_API IdGenerator { private: std::string prefix; mutable std::string seed; mutable long long sequence; static IdGeneratorKernel* kernel; private: IdGenerator(const IdGenerator&); IdGenerator& operator=(const IdGenerator&); public: IdGenerator(); IdGenerator(const std::string& prefix); virtual ~IdGenerator(); public: /** * @return a newly generated unique id. */ std::string generateId() const; public: /** * Since the initialization of this object results in the retrieval of the * machine's host name we can quickly return it here. * * @return the previously retrieved host name. */ static std::string getHostname(); /** * Gets the seed value from a Generated Id, the count portion is removed. * * @return the seed portion of the Id, minus the count value. */ static std::string getSeedFromId(const std::string& id); /** * Gets the count value from a Generated Id, the seed portion is removed. * * @return the sequence count portion of the id, minus the seed value. */ static long long getSequenceFromId(const std::string& id); /** * Compares two generated id values. * * @param id1 * The first id to compare, or left hand side. * @param id2 * The second id to compare, or right hand side. * * @return zero if ids are equal or positove if id1 > id2... */ static int compare(const std::string& id1, const std::string& id2); private: static void initialize(); static void shutdown(); friend class activemq::library::ActiveMQCPP; }; }} #endif /* _ATIVEMQ_UTIL_IDGENERATOR_H_ */
//////////////////////////////////////////////////////////////////////////////// // // JASPER BLUES // Copyright 2012 Jasper Blues // All Rights Reserved. // // NOTICE: Jasper Blues permits you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> typedef NS_OPTIONS(NSInteger, XcodeSourceFileType) { FileTypeNil = 0, // Unknown filetype Framework = 1, // .framework PropertyList = 2, // .plist SourceCodeHeader = 3, // .h SourceCodeObjC = 4, // .m SourceCodeObjCPlusPlus = 5, // .mm SourceCodeCPlusPlus = 6, // .cpp XibFile = 7, // .xib ImageResourcePNG = 8, // .png Bundle = 9, // .bundle .octet Archive = 10, // .a files HTML = 11, // HTML file TEXT = 12, // Some text file XcodeProject = 13, // .xcodeproj Folder = 14, // a Folder reference AssetCatalog = 15, // Assets SourceCodeSwift = 16, // .swift Application = 17, // .app (wrapper.application) Playground = 18, // .playground (file.playground) ShellScript = 19, // no suffix Xcode seems to detect (text.script.sh) Markdown = 20, // .md (net.daringfileball.markdown) XMLPropertyList = 21, // .plist (text.plist.xml) Storyboard = 22, // .storyboard (file.storyboard) XCConfig = 23, // .xcconfig XCDataModel = 24, // .xcdatamodel LocalizableStrings = 25 // .strings }; NSString* NSStringFromXCSourceFileType(XcodeSourceFileType type); XcodeSourceFileType XCSourceFileTypeFromStringRepresentation(NSString* string); XcodeSourceFileType XCSourceFileTypeFromFileName(NSString* fileName);
/* * Copyright 2018 Google * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" // This file contains declarations that should go into FirebaseCore when // Firebase InAppMessagingDisplay is merged into master. Keep them separate now to help // with build from development folder and avoid merge conflicts. extern FIRLoggerService kFIRLoggerInAppMessagingDisplay; // this should eventually be in FIRError.h extern NSString *const kFirebaseInAppMessagingDisplayErrorDomain;
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/ssm/SSM_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace SSM { namespace Model { class AWS_SSM_API DeregisterTaskFromMaintenanceWindowResult { public: DeregisterTaskFromMaintenanceWindowResult(); DeregisterTaskFromMaintenanceWindowResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DeregisterTaskFromMaintenanceWindowResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The ID of the maintenance window the task was removed from.</p> */ inline const Aws::String& GetWindowId() const{ return m_windowId; } /** * <p>The ID of the maintenance window the task was removed from.</p> */ inline void SetWindowId(const Aws::String& value) { m_windowId = value; } /** * <p>The ID of the maintenance window the task was removed from.</p> */ inline void SetWindowId(Aws::String&& value) { m_windowId = std::move(value); } /** * <p>The ID of the maintenance window the task was removed from.</p> */ inline void SetWindowId(const char* value) { m_windowId.assign(value); } /** * <p>The ID of the maintenance window the task was removed from.</p> */ inline DeregisterTaskFromMaintenanceWindowResult& WithWindowId(const Aws::String& value) { SetWindowId(value); return *this;} /** * <p>The ID of the maintenance window the task was removed from.</p> */ inline DeregisterTaskFromMaintenanceWindowResult& WithWindowId(Aws::String&& value) { SetWindowId(std::move(value)); return *this;} /** * <p>The ID of the maintenance window the task was removed from.</p> */ inline DeregisterTaskFromMaintenanceWindowResult& WithWindowId(const char* value) { SetWindowId(value); return *this;} /** * <p>The ID of the task removed from the maintenance window.</p> */ inline const Aws::String& GetWindowTaskId() const{ return m_windowTaskId; } /** * <p>The ID of the task removed from the maintenance window.</p> */ inline void SetWindowTaskId(const Aws::String& value) { m_windowTaskId = value; } /** * <p>The ID of the task removed from the maintenance window.</p> */ inline void SetWindowTaskId(Aws::String&& value) { m_windowTaskId = std::move(value); } /** * <p>The ID of the task removed from the maintenance window.</p> */ inline void SetWindowTaskId(const char* value) { m_windowTaskId.assign(value); } /** * <p>The ID of the task removed from the maintenance window.</p> */ inline DeregisterTaskFromMaintenanceWindowResult& WithWindowTaskId(const Aws::String& value) { SetWindowTaskId(value); return *this;} /** * <p>The ID of the task removed from the maintenance window.</p> */ inline DeregisterTaskFromMaintenanceWindowResult& WithWindowTaskId(Aws::String&& value) { SetWindowTaskId(std::move(value)); return *this;} /** * <p>The ID of the task removed from the maintenance window.</p> */ inline DeregisterTaskFromMaintenanceWindowResult& WithWindowTaskId(const char* value) { SetWindowTaskId(value); return *this;} private: Aws::String m_windowId; Aws::String m_windowTaskId; }; } // namespace Model } // namespace SSM } // namespace Aws
/// /// @file RTypeStringPropTableBuilder.h /// @brief interface to create RTypeStringPropertyTable instance /// @author Kevin Lin <[email protected]> /// @date Created 2013-04-27 /// #ifndef SF1R_RTYPE_STRING_PROP_TABLE_BUILDER_H #define SF1R_RTYPE_STRING_PROP_TABLE_BUILDER_H #include <string> #include <boost/shared_ptr.hpp> namespace sf1r { class DocumentManager; class RTypeStringPropTable; class RTypeStringPropTableBuilder { public: RTypeStringPropTableBuilder(DocumentManager& documentManagerPtr); ~RTypeStringPropTableBuilder() {} boost::shared_ptr<RTypeStringPropTable>& createPropertyTable( const std::string& propertyName); private: DocumentManager& documentManagerPtr_; }; } #endif
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/resource-groups/ResourceGroups_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSMap.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace ResourceGroups { namespace Model { class AWS_RESOURCEGROUPS_API TagResult { public: TagResult(); TagResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); TagResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The ARN of the tagged resource.</p> */ inline const Aws::String& GetArn() const{ return m_arn; } /** * <p>The ARN of the tagged resource.</p> */ inline void SetArn(const Aws::String& value) { m_arn = value; } /** * <p>The ARN of the tagged resource.</p> */ inline void SetArn(Aws::String&& value) { m_arn = std::move(value); } /** * <p>The ARN of the tagged resource.</p> */ inline void SetArn(const char* value) { m_arn.assign(value); } /** * <p>The ARN of the tagged resource.</p> */ inline TagResult& WithArn(const Aws::String& value) { SetArn(value); return *this;} /** * <p>The ARN of the tagged resource.</p> */ inline TagResult& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;} /** * <p>The ARN of the tagged resource.</p> */ inline TagResult& WithArn(const char* value) { SetArn(value); return *this;} /** * <p>The tags that have been added to the specified resource group.</p> */ inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tags = value; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tags = std::move(value); } /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;} /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;} /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& AddTags(const Aws::String& key, const Aws::String& value) { m_tags.emplace(key, value); return *this; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& AddTags(Aws::String&& key, const Aws::String& value) { m_tags.emplace(std::move(key), value); return *this; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& AddTags(const Aws::String& key, Aws::String&& value) { m_tags.emplace(key, std::move(value)); return *this; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& AddTags(Aws::String&& key, Aws::String&& value) { m_tags.emplace(std::move(key), std::move(value)); return *this; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& AddTags(const char* key, Aws::String&& value) { m_tags.emplace(key, std::move(value)); return *this; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& AddTags(Aws::String&& key, const char* value) { m_tags.emplace(std::move(key), value); return *this; } /** * <p>The tags that have been added to the specified resource group.</p> */ inline TagResult& AddTags(const char* key, const char* value) { m_tags.emplace(key, value); return *this; } private: Aws::String m_arn; Aws::Map<Aws::String, Aws::String> m_tags; }; } // namespace Model } // namespace ResourceGroups } // namespace Aws
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/autoscaling/AutoScaling_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/autoscaling/model/ResponseMetadata.h> #include <aws/autoscaling/model/FailedScheduledUpdateGroupActionRequest.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Xml { class XmlDocument; } // namespace Xml } // namespace Utils namespace AutoScaling { namespace Model { class AWS_AUTOSCALING_API BatchDeleteScheduledActionResult { public: BatchDeleteScheduledActionResult(); BatchDeleteScheduledActionResult(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); BatchDeleteScheduledActionResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); /** * <p>The names of the scheduled actions that could not be deleted, including an * error message.</p> */ inline const Aws::Vector<FailedScheduledUpdateGroupActionRequest>& GetFailedScheduledActions() const{ return m_failedScheduledActions; } /** * <p>The names of the scheduled actions that could not be deleted, including an * error message.</p> */ inline void SetFailedScheduledActions(const Aws::Vector<FailedScheduledUpdateGroupActionRequest>& value) { m_failedScheduledActions = value; } /** * <p>The names of the scheduled actions that could not be deleted, including an * error message.</p> */ inline void SetFailedScheduledActions(Aws::Vector<FailedScheduledUpdateGroupActionRequest>&& value) { m_failedScheduledActions = std::move(value); } /** * <p>The names of the scheduled actions that could not be deleted, including an * error message.</p> */ inline BatchDeleteScheduledActionResult& WithFailedScheduledActions(const Aws::Vector<FailedScheduledUpdateGroupActionRequest>& value) { SetFailedScheduledActions(value); return *this;} /** * <p>The names of the scheduled actions that could not be deleted, including an * error message.</p> */ inline BatchDeleteScheduledActionResult& WithFailedScheduledActions(Aws::Vector<FailedScheduledUpdateGroupActionRequest>&& value) { SetFailedScheduledActions(std::move(value)); return *this;} /** * <p>The names of the scheduled actions that could not be deleted, including an * error message.</p> */ inline BatchDeleteScheduledActionResult& AddFailedScheduledActions(const FailedScheduledUpdateGroupActionRequest& value) { m_failedScheduledActions.push_back(value); return *this; } /** * <p>The names of the scheduled actions that could not be deleted, including an * error message.</p> */ inline BatchDeleteScheduledActionResult& AddFailedScheduledActions(FailedScheduledUpdateGroupActionRequest&& value) { m_failedScheduledActions.push_back(std::move(value)); return *this; } inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; } inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; } inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = std::move(value); } inline BatchDeleteScheduledActionResult& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;} inline BatchDeleteScheduledActionResult& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(std::move(value)); return *this;} private: Aws::Vector<FailedScheduledUpdateGroupActionRequest> m_failedScheduledActions; ResponseMetadata m_responseMetadata; }; } // namespace Model } // namespace AutoScaling } // namespace Aws
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/logs/CloudWatchLogs_EXPORTS.h> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CloudWatchLogs { namespace Model { /** * <p>Contains the number of log events scanned by the query, the number of log * events that matched the query criteria, and the total number of bytes in the log * events that were scanned.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/QueryStatistics">AWS * API Reference</a></p> */ class AWS_CLOUDWATCHLOGS_API QueryStatistics { public: QueryStatistics(); QueryStatistics(Aws::Utils::Json::JsonView jsonValue); QueryStatistics& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The number of log events that matched the query string.</p> */ inline double GetRecordsMatched() const{ return m_recordsMatched; } /** * <p>The number of log events that matched the query string.</p> */ inline bool RecordsMatchedHasBeenSet() const { return m_recordsMatchedHasBeenSet; } /** * <p>The number of log events that matched the query string.</p> */ inline void SetRecordsMatched(double value) { m_recordsMatchedHasBeenSet = true; m_recordsMatched = value; } /** * <p>The number of log events that matched the query string.</p> */ inline QueryStatistics& WithRecordsMatched(double value) { SetRecordsMatched(value); return *this;} /** * <p>The total number of log events scanned during the query.</p> */ inline double GetRecordsScanned() const{ return m_recordsScanned; } /** * <p>The total number of log events scanned during the query.</p> */ inline bool RecordsScannedHasBeenSet() const { return m_recordsScannedHasBeenSet; } /** * <p>The total number of log events scanned during the query.</p> */ inline void SetRecordsScanned(double value) { m_recordsScannedHasBeenSet = true; m_recordsScanned = value; } /** * <p>The total number of log events scanned during the query.</p> */ inline QueryStatistics& WithRecordsScanned(double value) { SetRecordsScanned(value); return *this;} /** * <p>The total number of bytes in the log events scanned during the query.</p> */ inline double GetBytesScanned() const{ return m_bytesScanned; } /** * <p>The total number of bytes in the log events scanned during the query.</p> */ inline bool BytesScannedHasBeenSet() const { return m_bytesScannedHasBeenSet; } /** * <p>The total number of bytes in the log events scanned during the query.</p> */ inline void SetBytesScanned(double value) { m_bytesScannedHasBeenSet = true; m_bytesScanned = value; } /** * <p>The total number of bytes in the log events scanned during the query.</p> */ inline QueryStatistics& WithBytesScanned(double value) { SetBytesScanned(value); return *this;} private: double m_recordsMatched; bool m_recordsMatchedHasBeenSet; double m_recordsScanned; bool m_recordsScannedHasBeenSet; double m_bytesScanned; bool m_bytesScannedHasBeenSet; }; } // namespace Model } // namespace CloudWatchLogs } // namespace Aws
/* * Copyright (c) 2019 Google LLC. * Copyright (c) 2016-2018 Nest Labs, Inc. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * THIS FILE IS GENERATED. DO NOT MODIFY. * * SOURCE TEMPLATE: struct.cpp.h * SOURCE PROTO: weave/common/identifiers.proto * */ #ifndef _WEAVE_COMMON__INTERFACE_NAME_STRUCT_SCHEMA_H_ #define _WEAVE_COMMON__INTERFACE_NAME_STRUCT_SCHEMA_H_ #include <Weave/Support/SerializationUtils.h> #include <Weave/Profiles/data-management/DataManagement.h> namespace Schema { namespace Weave { namespace Common { struct InterfaceName { const char * interfaceName; static const nl::SchemaFieldDescriptor FieldSchema; }; struct InterfaceName_array { uint32_t num; InterfaceName *buf; }; } // namespace Common } // namespace Weave } // namespace Schema #endif // _WEAVE_COMMON__INTERFACE_NAME_STRUCT_SCHEMA_H_
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/codepipeline/CodePipeline_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/codepipeline/model/ArtifactLocation.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CodePipeline { namespace Model { /** * <p>Represents information about an artifact that is worked on by actions in the * pipeline.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/Artifact">AWS * API Reference</a></p> */ class AWS_CODEPIPELINE_API Artifact { public: Artifact(); Artifact(Aws::Utils::Json::JsonView jsonValue); Artifact& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The artifact's name.</p> */ inline const Aws::String& GetName() const{ return m_name; } /** * <p>The artifact's name.</p> */ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** * <p>The artifact's name.</p> */ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** * <p>The artifact's name.</p> */ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** * <p>The artifact's name.</p> */ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** * <p>The artifact's name.</p> */ inline Artifact& WithName(const Aws::String& value) { SetName(value); return *this;} /** * <p>The artifact's name.</p> */ inline Artifact& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** * <p>The artifact's name.</p> */ inline Artifact& WithName(const char* value) { SetName(value); return *this;} /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline const Aws::String& GetRevision() const{ return m_revision; } /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline bool RevisionHasBeenSet() const { return m_revisionHasBeenSet; } /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline void SetRevision(const Aws::String& value) { m_revisionHasBeenSet = true; m_revision = value; } /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline void SetRevision(Aws::String&& value) { m_revisionHasBeenSet = true; m_revision = std::move(value); } /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline void SetRevision(const char* value) { m_revisionHasBeenSet = true; m_revision.assign(value); } /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline Artifact& WithRevision(const Aws::String& value) { SetRevision(value); return *this;} /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline Artifact& WithRevision(Aws::String&& value) { SetRevision(std::move(value)); return *this;} /** * <p>The artifact's revision ID. Depending on the type of object, this could be a * commit ID (GitHub) or a revision ID (Amazon S3).</p> */ inline Artifact& WithRevision(const char* value) { SetRevision(value); return *this;} /** * <p>The location of an artifact.</p> */ inline const ArtifactLocation& GetLocation() const{ return m_location; } /** * <p>The location of an artifact.</p> */ inline bool LocationHasBeenSet() const { return m_locationHasBeenSet; } /** * <p>The location of an artifact.</p> */ inline void SetLocation(const ArtifactLocation& value) { m_locationHasBeenSet = true; m_location = value; } /** * <p>The location of an artifact.</p> */ inline void SetLocation(ArtifactLocation&& value) { m_locationHasBeenSet = true; m_location = std::move(value); } /** * <p>The location of an artifact.</p> */ inline Artifact& WithLocation(const ArtifactLocation& value) { SetLocation(value); return *this;} /** * <p>The location of an artifact.</p> */ inline Artifact& WithLocation(ArtifactLocation&& value) { SetLocation(std::move(value)); return *this;} private: Aws::String m_name; bool m_nameHasBeenSet; Aws::String m_revision; bool m_revisionHasBeenSet; ArtifactLocation m_location; bool m_locationHasBeenSet; }; } // namespace Model } // namespace CodePipeline } // namespace Aws
/* cairo - a vector graphics library with display and print output * * Copyright © 2002 University of Southern California * Copyright © 2005 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it either under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * (the "LGPL") or, at your option, under the terms of the Mozilla * Public License Version 1.1 (the "MPL"). If you do not alter this * notice, a recipient may use your version of this file under either * the MPL or the LGPL. * * You should have received a copy of the LGPL along with this library * in the file COPYING-LGPL-2.1; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * You should have received a copy of the MPL along with this library * in the file COPYING-MPL-1.1 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY * OF ANY KIND, either express or implied. See the LGPL or the MPL for * the specific language governing rights and limitations. * * The Original Code is the cairo graphics library. * * The Initial Developer of the Original Code is University of Southern * California. * * Contributor(s): * Carl D. Worth <[email protected]> */ #include "cairoint.h" static cairo_color_t const cairo_color_white = { 1.0, 1.0, 1.0, 1.0, 0xffff, 0xffff, 0xffff, 0xffff }; static cairo_color_t const cairo_color_black = { 0.0, 0.0, 0.0, 1.0, 0x0, 0x0, 0x0, 0xffff }; static cairo_color_t const cairo_color_transparent = { 0.0, 0.0, 0.0, 0.0, 0x0, 0x0, 0x0, 0x0 }; static cairo_color_t const cairo_color_magenta = { 1.0, 0.0, 1.0, 1.0, 0xffff, 0x0, 0xffff, 0xffff }; const cairo_color_t * _cairo_stock_color (cairo_stock_t stock) { switch (stock) { case CAIRO_STOCK_WHITE: return &cairo_color_white; case CAIRO_STOCK_BLACK: return &cairo_color_black; case CAIRO_STOCK_TRANSPARENT: return &cairo_color_transparent; } ASSERT_NOT_REACHED; /* If the user can get here somehow, give a color that indicates a * problem. */ return &cairo_color_magenta; } void _cairo_color_init (cairo_color_t *color) { *color = cairo_color_white; } void _cairo_color_init_rgb (cairo_color_t *color, double red, double green, double blue) { _cairo_color_init_rgba (color, red, green, blue, 1.0); } /* Convert a double in [0.0, 1.0] to an integer in [0, 65535] * The conversion is designed to divide the input range into 65536 * equally-sized regions. This is achieved by multiplying by 65536 and * then special-casing the result of an input value of 1.0 so that it * maps to 65535 instead of 65536. */ uint16_t _cairo_color_double_to_short (double d) { uint32_t i; i = (uint32_t) (d * 65536); i -= (i >> 16); return i; } static void _cairo_color_compute_shorts (cairo_color_t *color) { color->red_short = _cairo_color_double_to_short (color->red * color->alpha); color->green_short = _cairo_color_double_to_short (color->green * color->alpha); color->blue_short = _cairo_color_double_to_short (color->blue * color->alpha); color->alpha_short = _cairo_color_double_to_short (color->alpha); } void _cairo_color_init_rgba (cairo_color_t *color, double red, double green, double blue, double alpha) { color->red = red; color->green = green; color->blue = blue; color->alpha = alpha; _cairo_color_compute_shorts (color); } void _cairo_color_multiply_alpha (cairo_color_t *color, double alpha) { color->alpha *= alpha; _cairo_color_compute_shorts (color); } void _cairo_color_get_rgba (cairo_color_t *color, double *red, double *green, double *blue, double *alpha) { *red = color->red; *green = color->green; *blue = color->blue; *alpha = color->alpha; } void _cairo_color_get_rgba_premultiplied (cairo_color_t *color, double *red, double *green, double *blue, double *alpha) { *red = color->red * color->alpha; *green = color->green * color->alpha; *blue = color->blue * color->alpha; *alpha = color->alpha; } cairo_bool_t _cairo_color_equal (const cairo_color_t *color_a, const cairo_color_t *color_b) { if (color_a == color_b) return TRUE; return color_a->red_short == color_b->red_short && color_a->green_short == color_b->green_short && color_a->blue_short == color_b->blue_short && color_a->alpha_short == color_b->alpha_short; }
#ifndef E_MOD_MAIN_H #define E_MOD_MAIN_H int e_syscon_init(void); int e_syscon_shutdown(void); int e_syscon_show(E_Zone *zone, const char *defact); void e_syscon_hide(void); E_Config_Dialog *e_int_config_syscon(Evas_Object *parent, const char *params EINA_UNUSED); void e_syscon_gadget_init(E_Module *m); void e_syscon_gadget_shutdown(void); void e_syscon_menu_fill(E_Menu *m); /** * @addtogroup Optional_Control * @{ * * @defgroup Module_Syscon SysCon (System Control) * * Controls your system actions such as shutdown, reboot, hibernate or * suspend. * * @} */ #endif
/* SPDX-License-Identifier: BSD-2-Clause */ /***********************************************************************; * Copyright (c) 2015 - 2017, Intel Corporation * All rights reserved. ***********************************************************************/ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "tss2_tpm2_types.h" #include "tss2_mu.h" #include "sysapi_util.h" TSS2_RC Tss2_Sys_VerifySignature_Prepare( TSS2_SYS_CONTEXT *sysContext, TPMI_DH_OBJECT keyHandle, const TPM2B_DIGEST *digest, const TPMT_SIGNATURE *signature) { _TSS2_SYS_CONTEXT_BLOB *ctx = syscontext_cast(sysContext); TSS2_RC rval; if (!ctx || !signature) return TSS2_SYS_RC_BAD_REFERENCE; rval = CommonPreparePrologue(ctx, TPM2_CC_VerifySignature); if (rval) return rval; rval = Tss2_MU_UINT32_Marshal(keyHandle, ctx->cmdBuffer, ctx->maxCmdSize, &ctx->nextData); if (rval) return rval; if (!digest) { ctx->decryptNull = 1; rval = Tss2_MU_UINT16_Marshal(0, ctx->cmdBuffer, ctx->maxCmdSize, &ctx->nextData); } else { rval = Tss2_MU_TPM2B_DIGEST_Marshal(digest, ctx->cmdBuffer, ctx->maxCmdSize, &ctx->nextData); } if (rval) return rval; rval = Tss2_MU_TPMT_SIGNATURE_Marshal(signature, ctx->cmdBuffer, ctx->maxCmdSize, &ctx->nextData); if (rval) return rval; ctx->decryptAllowed = 1; ctx->encryptAllowed = 0; ctx->authAllowed = 1; return CommonPrepareEpilogue(ctx); } TSS2_RC Tss2_Sys_VerifySignature_Complete( TSS2_SYS_CONTEXT *sysContext, TPMT_TK_VERIFIED *validation) { _TSS2_SYS_CONTEXT_BLOB *ctx = syscontext_cast(sysContext); TSS2_RC rval; if (!ctx) return TSS2_SYS_RC_BAD_REFERENCE; rval = CommonComplete(ctx); if (rval) return rval; return Tss2_MU_TPMT_TK_VERIFIED_Unmarshal(ctx->cmdBuffer, ctx->maxCmdSize, &ctx->nextData, validation); } TSS2_RC Tss2_Sys_VerifySignature( TSS2_SYS_CONTEXT *sysContext, TPMI_DH_OBJECT keyHandle, TSS2L_SYS_AUTH_COMMAND const *cmdAuthsArray, const TPM2B_DIGEST *digest, const TPMT_SIGNATURE *signature, TPMT_TK_VERIFIED *validation, TSS2L_SYS_AUTH_RESPONSE *rspAuthsArray) { _TSS2_SYS_CONTEXT_BLOB *ctx = syscontext_cast(sysContext); TSS2_RC rval; if (!signature) return TSS2_SYS_RC_BAD_REFERENCE; rval = Tss2_Sys_VerifySignature_Prepare(sysContext, keyHandle, digest, signature); if (rval) return rval; rval = CommonOneCall(ctx, cmdAuthsArray, rspAuthsArray); if (rval) return rval; return Tss2_Sys_VerifySignature_Complete(sysContext, validation); }
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_MOJO_BLUETOOTH_MOJOM_TRAITS_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_MOJO_BLUETOOTH_MOJOM_TRAITS_H_ #include "device/bluetooth/public/mojom/uuid.mojom-blink-forward.h" #include "third_party/blink/public/mojom/bluetooth/web_bluetooth.mojom-blink.h" #include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace mojo { template <> struct PLATFORM_EXPORT StructTraits<::blink::mojom::WebBluetoothDeviceIdDataView, WTF::String> { static const WTF::String& device_id(const WTF::String& input) { return input; } static bool Read(::blink::mojom::WebBluetoothDeviceIdDataView, WTF::String* output); }; template <> struct PLATFORM_EXPORT StructTraits<bluetooth::mojom::UUIDDataView, WTF::String> { static const WTF::String& uuid(const WTF::String& input) { return input; } static bool Read(bluetooth::mojom::UUIDDataView, WTF::String* output); static bool IsNull(const WTF::String& input) { return input.IsNull(); } static void SetToNull(WTF::String* output); }; } // namespace mojo #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_MOJO_BLUETOOTH_MOJOM_TRAITS_H_
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "runtime.h" #include "type.h" #include "../../cmd/ld/textflag.h" //static Lock debuglock; static void vprintf(int8*, byte*); // write to goroutine-local buffer if diverting output, // or else standard error. static void gwrite(void *v, intgo n) { if(g == nil || g->writebuf == nil) { runtime·write(2, v, n); return; } if(g->writenbuf == 0) return; if(n > g->writenbuf) n = g->writenbuf; runtime·memmove(g->writebuf, v, n); g->writebuf += n; g->writenbuf -= n; } void runtime·dump(byte *p, int32 n) { int32 i; for(i=0; i<n; i++) { runtime·printpointer((byte*)(p[i]>>4)); runtime·printpointer((byte*)(p[i]&0xf)); if((i&15) == 15) runtime·prints("\n"); else runtime·prints(" "); } if(n & 15) runtime·prints("\n"); } void runtime·prints(int8 *s) { gwrite(s, runtime·findnull((byte*)s)); } #pragma textflag NOSPLIT void runtime·printf(int8 *s, ...) { byte *arg; arg = (byte*)(&s+1); vprintf(s, arg); } // Very simple printf. Only for debugging prints. // Do not add to this without checking with Rob. static void vprintf(int8 *s, byte *base) { int8 *p, *lp; uintptr arg, siz; byte *v; //runtime·lock(&debuglock); lp = p = s; arg = (uintptr)base; for(; *p; p++) { if(*p != '%') continue; if(p > lp) gwrite(lp, p-lp); p++; siz = 0; switch(*p) { case 't': case 'c': siz = 1; break; case 'd': // 32-bit case 'x': arg = ROUND(arg, 4); siz = 4; break; case 'D': // 64-bit case 'U': case 'X': case 'f': arg = ROUND(arg, sizeof(uintptr)); siz = 8; break; case 'C': arg = ROUND(arg, sizeof(uintptr)); siz = 16; break; case 'p': // pointer-sized case 's': arg = ROUND(arg, sizeof(uintptr)); siz = sizeof(uintptr); break; case 'S': // pointer-aligned but bigger arg = ROUND(arg, sizeof(uintptr)); siz = sizeof(String); break; case 'a': // pointer-aligned but bigger arg = ROUND(arg, sizeof(uintptr)); siz = sizeof(Slice); break; case 'i': // pointer-aligned but bigger case 'e': arg = ROUND(arg, sizeof(uintptr)); siz = sizeof(Eface); break; } v = (byte*)arg; switch(*p) { case 'a': runtime·printslice(*(Slice*)v); break; case 'c': runtime·printbyte(*(int8*)v); break; case 'd': runtime·printint(*(int32*)v); break; case 'D': runtime·printint(*(int64*)v); break; case 'e': runtime·printeface(*(Eface*)v); break; case 'f': runtime·printfloat(*(float64*)v); break; case 'C': runtime·printcomplex(*(Complex128*)v); break; case 'i': runtime·printiface(*(Iface*)v); break; case 'p': runtime·printpointer(*(void**)v); break; case 's': runtime·prints(*(int8**)v); break; case 'S': runtime·printstring(*(String*)v); break; case 't': runtime·printbool(*(bool*)v); break; case 'U': runtime·printuint(*(uint64*)v); break; case 'x': runtime·printhex(*(uint32*)v); break; case 'X': runtime·printhex(*(uint64*)v); break; } arg += siz; lp = p+1; } if(p > lp) gwrite(lp, p-lp); //runtime·unlock(&debuglock); } #pragma textflag NOSPLIT void runtime·goprintf(String s, ...) { // Can assume s has terminating NUL because only // the Go compiler generates calls to runtime·goprintf, using // string constants, and all the string constants have NULs. vprintf((int8*)s.str, (byte*)(&s+1)); } void runtime·printpc(void *p) { runtime·prints("PC="); runtime·printhex((uint64)runtime·getcallerpc(p)); } void runtime·printbool(bool v) { if(v) { gwrite((byte*)"true", 4); return; } gwrite((byte*)"false", 5); } void runtime·printbyte(int8 c) { gwrite(&c, 1); } void runtime·printfloat(float64 v) { byte buf[20]; int32 e, s, i, n; float64 h; if(ISNAN(v)) { gwrite("NaN", 3); return; } if(v == runtime·posinf) { gwrite("+Inf", 4); return; } if(v == runtime·neginf) { gwrite("-Inf", 4); return; } n = 7; // digits printed e = 0; // exp s = 0; // sign if(v == 0) { if(1/v == runtime·neginf) s = 1; } else { // sign if(v < 0) { v = -v; s = 1; } // normalize while(v >= 10) { e++; v /= 10; } while(v < 1) { e--; v *= 10; } // round h = 5; for(i=0; i<n; i++) h /= 10; v += h; if(v >= 10) { e++; v /= 10; } } // format +d.dddd+edd buf[0] = '+'; if(s) buf[0] = '-'; for(i=0; i<n; i++) { s = v; buf[i+2] = s+'0'; v -= s; v *= 10.; } buf[1] = buf[2]; buf[2] = '.'; buf[n+2] = 'e'; buf[n+3] = '+'; if(e < 0) { e = -e; buf[n+3] = '-'; } buf[n+4] = (e/100) + '0'; buf[n+5] = (e/10)%10 + '0'; buf[n+6] = (e%10) + '0'; gwrite(buf, n+7); } void runtime·printcomplex(Complex128 v) { gwrite("(", 1); runtime·printfloat(v.real); runtime·printfloat(v.imag); gwrite("i)", 2); } void runtime·printuint(uint64 v) { byte buf[100]; int32 i; for(i=nelem(buf)-1; i>0; i--) { buf[i] = v%10 + '0'; if(v < 10) break; v = v/10; } gwrite(buf+i, nelem(buf)-i); } void runtime·printint(int64 v) { if(v < 0) { gwrite("-", 1); v = -v; } runtime·printuint(v); } void runtime·printhex(uint64 v) { static int8 *dig = "0123456789abcdef"; byte buf[100]; int32 i; i=nelem(buf); for(; v>0; v/=16) buf[--i] = dig[v%16]; if(i == nelem(buf)) buf[--i] = '0'; buf[--i] = 'x'; buf[--i] = '0'; gwrite(buf+i, nelem(buf)-i); } void runtime·printpointer(void *p) { runtime·printhex((uintptr)p); } void runtime·printstring(String v) { if(v.len > runtime·maxstring) { gwrite("[string too long]", 17); return; } if(v.len > 0) gwrite(v.str, v.len); } void runtime·printsp(void) { gwrite(" ", 1); } void runtime·printnl(void) { gwrite("\n", 1); }
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_ #define STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_ #include <stdint.h> #include <map> #include <memory> #include <set> #include <string> #include <vector> #include "base/callback.h" #include "base/component_export.h" #include "base/containers/flat_map.h" #include "base/memory/scoped_refptr.h" #include "base/sequence_checker.h" #include "components/services/storage/public/mojom/quota_client.mojom.h" #include "storage/browser/quota/quota_callbacks.h" #include "storage/browser/quota/quota_client_type.h" #include "storage/browser/quota/quota_task.h" #include "storage/browser/quota/special_storage_policy.h" #include "third_party/blink/public/mojom/quota/quota_types.mojom.h" namespace blink { class StorageKey; } // namespace blink namespace storage { class ClientUsageTracker; // A helper class that gathers and tracks the amount of data stored in // all quota clients. // // Ownership: Each QuotaManagerImpl instance owns 3 instances of this class (one // per storage type: Persistent, Temporary, Syncable). Thread-safety: All // methods except the constructor must be called on the same sequence. class COMPONENT_EXPORT(STORAGE_BROWSER) UsageTracker : public QuotaTaskObserver { public: // The caller must ensure that all mojo::QuotaClient instances outlive this // instance. UsageTracker( const base::flat_map<mojom::QuotaClient*, QuotaClientType>& client_types, blink::mojom::StorageType type, scoped_refptr<SpecialStoragePolicy> special_storage_policy); UsageTracker(const UsageTracker&) = delete; UsageTracker& operator=(const UsageTracker&) = delete; ~UsageTracker() override; blink::mojom::StorageType type() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return type_; } void GetGlobalUsage(GlobalUsageCallback callback); void GetHostUsageWithBreakdown(const std::string& host, UsageWithBreakdownCallback callback); void UpdateUsageCache(QuotaClientType client_type, const blink::StorageKey& storage_key, int64_t delta); int64_t GetCachedUsage() const; std::map<std::string, int64_t> GetCachedHostsUsage() const; std::map<blink::StorageKey, int64_t> GetCachedStorageKeysUsage() const; std::set<blink::StorageKey> GetCachedStorageKeys() const; bool IsWorking() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return !global_usage_callbacks_.empty() || !host_usage_callbacks_.empty(); } void SetUsageCacheEnabled(QuotaClientType client_type, const blink::StorageKey& storage_key, bool enabled); private: struct AccumulateInfo; friend class ClientUsageTracker; void AccumulateClientGlobalUsage(AccumulateInfo* info, int64_t usage, int64_t unlimited_usage); void AccumulateClientHostUsage(base::OnceClosure callback, AccumulateInfo* info, const std::string& host, QuotaClientType client, int64_t usage); void FinallySendHostUsageWithBreakdown(AccumulateInfo* info, const std::string& host); const blink::mojom::StorageType type_; base::flat_map<QuotaClientType, std::vector<std::unique_ptr<ClientUsageTracker>>> client_tracker_map_; size_t client_count_; std::vector<GlobalUsageCallback> global_usage_callbacks_; std::map<std::string, std::vector<UsageWithBreakdownCallback>> host_usage_callbacks_; SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<UsageTracker> weak_factory_{this}; }; } // namespace storage #endif // STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef XWALK_TEST_XWALKDRIVER_XWALK_FRAME_TRACKER_H_ #define XWALK_TEST_XWALKDRIVER_XWALK_FRAME_TRACKER_H_ #include <map> #include <string> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "xwalk/test/xwalkdriver/xwalk/devtools_event_listener.h" namespace base { class DictionaryValue; class Value; } class DevToolsClient; class Status; // Tracks execution context creation. class FrameTracker : public DevToolsEventListener { public: explicit FrameTracker(DevToolsClient* client); virtual ~FrameTracker(); Status GetFrameForContextId(int context_id, std::string* frame_id); Status GetContextIdForFrame(const std::string& frame_id, int* context_id); // Overridden from DevToolsEventListener: virtual Status OnConnected(DevToolsClient* client) override; virtual Status OnEvent(DevToolsClient* client, const std::string& method, const base::DictionaryValue& params) override; private: std::map<std::string, int> frame_to_context_map_; DISALLOW_COPY_AND_ASSIGN(FrameTracker); }; #endif // XWALK_TEST_XWALKDRIVER_XWALK_FRAME_TRACKER_H_
// Copyright (c) 2014 The Native Client Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NACL_SPAWN_PATH_UTIL_H_ #define NACL_SPAWN_PATH_UTIL_H_ #include <string> #include <vector> // Parses path environment variables such as PATH or LD_LIBRARY_PATH. void GetPaths(const char* env, std::vector<std::string>* paths); // Gets a file for the specified basename in paths. Returns true on // success and out_path will be updated. On failure, this function // returns false and out_path will not be updated. bool GetFileInPaths(const std::string& basename, const std::vector<std::string>& paths, std::string* out_path); #endif // NACL_SPAWN_PATH_UTIL_H_
// // ViewController.h // MPPlotExample // // Created by Alex Manzella on 23/10/14. // Copyright (c) 2014 mpow. All rights reserved. // #import <UIKit/UIKit.h> #import "MPGraphView.h" #import "MPPlot.h" #import "MPBarsGraphView.h" @interface ViewController : UIViewController{ MPGraphView *graph,*graph2,*graph3,*graph4; MPBarsGraphView *graph5; } @end
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_TEST_TEST_DISCARDABLE_MEMORY_ALLOCATOR_H_ #define BASE_TEST_TEST_DISCARDABLE_MEMORY_ALLOCATOR_H_ #include <stddef.h> #include "base/macros.h" #include "base/memory/discardable_memory_allocator.h" namespace base { // TestDiscardableMemoryAllocator is a simple DiscardableMemoryAllocator // implementation that can be used for testing. It allocates one-shot // DiscardableMemory instances backed by heap memory. class TestDiscardableMemoryAllocator : public DiscardableMemoryAllocator { public: TestDiscardableMemoryAllocator() = default; TestDiscardableMemoryAllocator(const TestDiscardableMemoryAllocator&) = delete; TestDiscardableMemoryAllocator& operator=( const TestDiscardableMemoryAllocator&) = delete; // Overridden from DiscardableMemoryAllocator: std::unique_ptr<DiscardableMemory> AllocateLockedDiscardableMemory( size_t size) override; size_t GetBytesAllocated() const override; void ReleaseFreeMemory() override { // Do nothing since it is backed by heap memory. } }; } // namespace base #endif // BASE_TEST_TEST_DISCARDABLE_MEMORY_ALLOCATOR_H_
/* * Copyright (c) 2015 Dmitry V. Levin <[email protected]> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <sys/syscall.h> #ifdef __NR_getdents64 #include <assert.h> #include <dirent.h> #include <fcntl.h> #include <inttypes.h> #include <stddef.h> #include <stdio.h> #include <sys/stat.h> #include <unistd.h> static const char fname[] = "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nZ"; static const char qname[] = "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\n" "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; typedef struct { uint64_t d_ino; uint64_t d_off; unsigned short d_reclen; unsigned char d_type; char d_name[256]; } kernel_dirent64; static char buf[8192]; static const char * str_d_type(const unsigned char d_type) { switch (d_type) { case DT_DIR: return "DT_DIR"; case DT_REG: return "DT_REG"; default: return "DT_UNKNOWN"; } } static void print_dirent(const kernel_dirent64 *d) { const unsigned int d_name_offset = offsetof(kernel_dirent64, d_name); int d_name_len = d->d_reclen - d_name_offset; assert(d_name_len > 0); printf("{d_ino=%" PRIu64 ", d_off=%" PRId64 ", d_reclen=%u, d_type=%s, d_name=", d->d_ino, d->d_off, d->d_reclen, str_d_type(d->d_type)); if (d->d_name[0] == '.') printf("\"%.*s\"}", d_name_len, d->d_name); else printf("\"%s\"}", qname); } int main(int ac, const char **av) { char *dname; int rc; assert(ac == 1); assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); assert(!creat(fname, 0600)); assert(!close(0)); assert(!open(".", O_RDONLY | O_DIRECTORY)); while ((rc = syscall(__NR_getdents64, 0, buf, sizeof(buf)))) { kernel_dirent64 *d; int i; if (rc < 0) return 77; printf("getdents64(0, ["); for (i = 0; i < rc; i += d->d_reclen) { d = (kernel_dirent64 *) &buf[i]; if (i) printf(", "); print_dirent(d); } printf("], %zu) = %d\n", sizeof(buf), rc); } printf("getdents64(0, [], %zu) = 0\n", sizeof(buf)); puts("+++ exited with 0 +++"); assert(!unlink(fname)); assert(!chdir("..")); assert(!rmdir(dname)); return 0; } #else int main(void) { return 77; } #endif
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file contains a set of histogram support functions for logging behavior // seen while loading NaCl plugins. #include <string> #include "base/time/time.h" #include "components/nacl/renderer/ppb_nacl_private.h" namespace nacl { void HistogramCustomCounts(const std::string& name, int32_t sample, int32_t min, int32_t max, uint32_t bucket_count); void HistogramEnumerate(const std::string& name, int32_t sample, int32_t boundary_value); void HistogramEnumerateLoadStatus(PP_NaClError error_code, bool is_installed); void HistogramEnumerateOsArch(const std::string& sandbox_isa); // Records values up to 20 seconds. void HistogramTimeSmall(const std::string& name, int64_t sample); // Records values up to 3 minutes, 20 seconds. void HistogramTimeMedium(const std::string& name, int64_t sample); // Records values up to 33 minutes. void HistogramTimeLarge(const std::string& name, int64_t sample); // Records values up to 12 minutes. void HistogramTimeTranslation(const std::string& name, int64_t sample_ms); void HistogramStartupTimeSmall(const std::string& name, base::TimeDelta td, int64_t nexe_size); void HistogramStartupTimeMedium(const std::string& name, base::TimeDelta td, int64_t nexe_size); void HistogramSizeKB(const std::string& name, int32_t sample); void HistogramHTTPStatusCode(const std::string& name, int32_t status); void HistogramEnumerateManifestIsDataURI(bool is_data_uri); void HistogramKBPerSec(const std::string& name, int64_t kb, int64_t us); } // namespace nacl
//================================================================================================= /*! // \file blaze/math/typetraits/IsUniTriangular.h // \brief Header file for the IsUniTriangular type trait // // Copyright (C) 2013 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. 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 names of the Blaze development group 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 _BLAZE_MATH_TYPETRAITS_ISUNITRIANGULAR_H_ #define _BLAZE_MATH_TYPETRAITS_ISUNITRIANGULAR_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/math/typetraits/IsUniLower.h> #include <blaze/math/typetraits/IsUniUpper.h> #include <blaze/util/FalseType.h> #include <blaze/util/SelectType.h> #include <blaze/util/TrueType.h> namespace blaze { //================================================================================================= // // CLASS DEFINITION // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Auxiliary helper struct for the IsUniTriangular type trait. // \ingroup math_type_traits */ template< typename T > struct IsUniTriangularHelper { //********************************************************************************************** enum { value = IsUniLower<T>::value || IsUniUpper<T>::value }; typedef typename SelectType<value,TrueType,FalseType>::Type Type; //********************************************************************************************** }; /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*!\brief Compile time check for unitriangular matrix types. // \ingroup math_type_traits // // This type trait tests whether or not the given template parameter is a lower or upper // unitriangular matrix type. In case the type is an unitriangular matrix type, the \a value // member enumeration is set to 1, the nested type definition \a Type is \a TrueType, and // the class derives from \a TrueType. Otherwise \a yes is set to 0, \a Type is \a FalseType, // and the class derives from \a FalseType. \code using blaze::rowMajor; typedef blaze::StaticMatrix<double,3UL,3UL,rowMajor> StaticMatrixType; typedef blaze::DynamicMatrix<float,rowMajor> DynamicMatrixType; typedef blaze::CompressedMatrix<int,rowMajor> CompressedMatrixType; typedef blaze::UniLowerMatrix<StaticMatrixType> UniLowerStaticType; typedef blaze::UniUpperMatrix<DynamicMatrixType> UniUpperDynamicType; typedef blaze::UniLowerMatrix<CompressedMatrixType> UniLowerCompressedType; blaze::IsLower< UniLowerStaticType >::value // Evaluates to 1 blaze::IsLower< const UniUpperDynamicType >::Type // Results in TrueType blaze::IsLower< volatile UniLowerCompressedType > // Is derived from TrueType blaze::IsLower< StaticMatrixType >::value // Evaluates to 0 blaze::IsLower< const DynamicMatrixType >::Type // Results in FalseType blaze::IsLower< volatile CompressedMatrixType > // Is derived from FalseType \endcode */ template< typename T > struct IsUniTriangular : public IsUniTriangularHelper<T>::Type { public: //********************************************************************************************** /*! \cond BLAZE_INTERNAL */ enum { value = IsUniTriangularHelper<T>::value }; typedef typename IsUniTriangularHelper<T>::Type Type; /*! \endcond */ //********************************************************************************************** }; //************************************************************************************************* } // namespace blaze #endif
#include "lookup.h" #include "stdio_impl.h" #include <ctype.h> #include <errno.h> #include <string.h> #include <netinet/in.h> int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) { char line[256]; unsigned char _buf[256]; FILE *f, _f; int nns = 0; conf->ndots = 1; conf->timeout = 5; conf->attempts = 2; if (search) *search = 0; f = __fopen_rb_ca("/etc/resolv.conf", &_f, _buf, sizeof _buf); if (!f) switch (errno) { case ENOENT: case ENOTDIR: case EACCES: goto no_resolv_conf; default: return -1; } while (fgets(line, sizeof line, f)) { char *p, *z; if (!strchr(line, '\n') && !feof(f)) { /* Ignore lines that get truncated rather than * potentially misinterpreting them. */ int c; do c = getc(f); while (c != '\n' && c != EOF); continue; } if (!strncmp(line, "options", 7) && isspace(line[7])) { p = strstr(line, "ndots:"); if (p && isdigit(p[6])) { p += 6; unsigned long x = strtoul(p, &z, 10); if (z != p) conf->ndots = x > 15 ? 15 : x; } p = strstr(line, "attempts:"); if (p && isdigit(p[9])) { p += 9; unsigned long x = strtoul(p, &z, 10); if (z != p) conf->attempts = x > 10 ? 10 : x; } p = strstr(line, "timeout:"); if (p && (isdigit(p[8]) || p[8]=='.')) { p += 8; unsigned long x = strtoul(p, &z, 10); if (z != p) conf->timeout = x > 60 ? 60 : x; } continue; } if (!strncmp(line, "nameserver", 10) && isspace(line[10])) { if (nns >= MAXNS) continue; for (p=line+11; isspace(*p); p++); for (z=p; *z && !isspace(*z); z++); *z=0; if (__lookup_ipliteral(conf->ns+nns, p, AF_UNSPEC) > 0) nns++; continue; } if (!search) continue; if ((strncmp(line, "domain", 6) && strncmp(line, "search", 6)) || !isspace(line[6])) continue; for (p=line+7; isspace(*p); p++); size_t l = strlen(p); /* This can never happen anyway with chosen buffer sizes. */ if (l >= search_sz) continue; memcpy(search, p, l+1); } __fclose_ca(f); no_resolv_conf: if (!nns) { __lookup_ipliteral(conf->ns, "127.0.0.1", AF_UNSPEC); nns = 1; } conf->nns = nns; return 0; }
/* config.h. Generated by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the 'getopt_long' function */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if the system has the type `ssize_t'. */ #define HAVE_SSIZE_T 1 /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H /* Define to build experimental code */ /* #undef OGGZ_CONFIG_EXPERIMENTAL */ /* Do not build reading support */ #define OGGZ_CONFIG_READ 1 /* Do not build writing support */ #define OGGZ_CONFIG_WRITE 1 /* Set to maximum allowed value of sf_count_t type. */ #define OGGZ_OFF_MAX 0x7FFFFFFFFFFFFFFFLL /* Name of package */ #define PACKAGE "liboggz" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* The size of a `loff_t', as computed by sizeof. */ /* #undef SIZEOF_LOFF_T */ /* The size of a `off64_t', as computed by sizeof. */ /* #undef SIZEOF_OFF64_T */ /* The size of a `off_t', as computed by sizeof. */ /* #define SIZEOF_OFF_T 8 */ /* Set to sizeof (long) if unknown. */ /* #define SIZEOF_OGGZ_OFF_T 8 */ /* The size of a `ssize_t', as computed by sizeof. */ /* #define SIZEOF_SSIZE_T 4 */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Set to long if unknown. */ #define TYPEOF_OGGZ_OFF_T off_t /* Version number of package */ #define VERSION "0.9.8" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define to make fseeko etc. visible, on some hosts. */ /* #undef _LARGEFILE_SOURCE */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `long' if <sys/types.h> does not define. */ /* #undef off_t */ /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned' if <sys/types.h> does not define. */ #undef size_t /* Define for MSVC as <stdint.h> is unavailable there */ typedef unsigned char uint8_t; #define inline __inline // MSVC
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once #include <string> #include "db/merge_context.h" #include "db/range_del_aggregator.h" #include "db/read_callback.h" #include "rocksdb/env.h" #include "rocksdb/statistics.h" #include "rocksdb/types.h" #include "table/block.h" namespace rocksdb { class MergeContext; class PinnedIteratorsManager; class GetContext { public: enum GetState { kNotFound, kFound, kDeleted, kCorrupt, kMerge, // saver contains the current merge result (the operands) kBlobIndex, }; uint64_t tickers_value[Tickers::TICKER_ENUM_MAX] = {0}; GetContext(const Comparator* ucmp, const MergeOperator* merge_operator, Logger* logger, Statistics* statistics, GetState init_state, const Slice& user_key, PinnableSlice* value, bool* value_found, MergeContext* merge_context, RangeDelAggregator* range_del_agg, Env* env, SequenceNumber* seq = nullptr, PinnedIteratorsManager* _pinned_iters_mgr = nullptr, ReadCallback* callback = nullptr, bool* is_blob_index = nullptr); void MarkKeyMayExist(); // Records this key, value, and any meta-data (such as sequence number and // state) into this GetContext. // // Returns True if more keys need to be read (due to merges) or // False if the complete value has been found. bool SaveValue(const ParsedInternalKey& parsed_key, const Slice& value, Cleanable* value_pinner = nullptr); // Simplified version of the previous function. Should only be used when we // know that the operation is a Put. void SaveValue(const Slice& value, SequenceNumber seq); GetState State() const { return state_; } RangeDelAggregator* range_del_agg() { return range_del_agg_; } PinnedIteratorsManager* pinned_iters_mgr() { return pinned_iters_mgr_; } // If a non-null string is passed, all the SaveValue calls will be // logged into the string. The operations can then be replayed on // another GetContext with replayGetContextLog. void SetReplayLog(std::string* replay_log) { replay_log_ = replay_log; } // Do we need to fetch the SequenceNumber for this key? bool NeedToReadSequence() const { return (seq_ != nullptr); } bool sample() const { return sample_; } bool CheckCallback(SequenceNumber seq) { if (callback_) { return callback_->IsCommitted(seq); } return true; } void RecordCounters(Tickers ticker, size_t val); private: const Comparator* ucmp_; const MergeOperator* merge_operator_; // the merge operations encountered; Logger* logger_; Statistics* statistics_; GetState state_; Slice user_key_; PinnableSlice* pinnable_val_; bool* value_found_; // Is value set correctly? Used by KeyMayExist MergeContext* merge_context_; RangeDelAggregator* range_del_agg_; Env* env_; // If a key is found, seq_ will be set to the SequenceNumber of most recent // write to the key or kMaxSequenceNumber if unknown SequenceNumber* seq_; std::string* replay_log_; // Used to temporarily pin blocks when state_ == GetContext::kMerge PinnedIteratorsManager* pinned_iters_mgr_; ReadCallback* callback_; bool sample_; bool* is_blob_index_; }; void replayGetContextLog(const Slice& replay_log, const Slice& user_key, GetContext* get_context, Cleanable* value_pinner = nullptr); } // namespace rocksdb
/**************************************************************************** * * Copyright (c) 2014 Wi-Fi Alliance * * 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. * * 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. * *****************************************************************************/ #ifndef _WFA_VER_H #define _WFA_VER_H #define WFA_SYSTEM_VER "WIN7_WIN8_DUT-v9.0.0" #endif
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #include "testrunnerswitcher.h" int main(void) { size_t failedTestCount = 0; RUN_TEST_SUITE(connection_ut, failedTestCount); return failedTestCount; }
#ifndef LIME_UI_GAMEPAD_EVENT_H #define LIME_UI_GAMEPAD_EVENT_H #include <system/CFFI.h> #include <system/ValuePointer.h> namespace lime { enum GamepadEventType { GAMEPAD_AXIS_MOVE, GAMEPAD_BUTTON_DOWN, GAMEPAD_BUTTON_UP, GAMEPAD_CONNECT, GAMEPAD_DISCONNECT }; struct GamepadEvent { hl_type* t; int axis; int button; int id; GamepadEventType type; double axisValue; static ValuePointer* callback; static ValuePointer* eventObject; GamepadEvent (); static void Dispatch (GamepadEvent* event); }; } #endif
#ifndef _USER_CONFIG_H_ #define _USER_CONFIG_H_ #define CFG_HOLDER 0x00FF55A4 /* Change this value to load default configurations */ #define CFG_LOCATION 0x3C /* Please don't change or if you know what you doing */ #define CLIENT_SSL_ENABLE /*DEFAULT CONFIGURATIONS*/ #define MQTT_HOST "192.168.11.122" //or "mqtt.yourdomain.com" #define MQTT_PORT 1880 #define MQTT_BUF_SIZE 1024 #define MQTT_KEEPALIVE 120 /*second*/ #define MQTT_CLIENT_ID "DVES_%08X" #define MQTT_USER "DVES_USER" #define MQTT_PASS "DVES_PASS" #define STA_SSID "DVES_HOME" #define STA_PASS "yourpassword" #define STA_TYPE AUTH_WPA2_PSK #define MQTT_RECONNECT_TIMEOUT 5 /*second*/ #define DEFAULT_SECURITY 0 #define QUEUE_BUFFER_SIZE 2048 #define PROTOCOL_NAMEv31 /*MQTT version 3.1 compatible with Mosquitto v0.15*/ //PROTOCOL_NAMEv311 /*MQTT version 3.11 compatible with https://eclipse.org/paho/clients/testing/*/ //#define INFO #endif
/* Copyright (c) 2002-2014 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "buffer.h" #include "unichar.h" #include "charset-utf8.h" #ifdef HAVE_ICONV #include <iconv.h> #include <ctype.h> struct charset_translation { iconv_t cd; normalizer_func_t *normalizer; }; int charset_to_utf8_begin(const char *charset, normalizer_func_t *normalizer, struct charset_translation **t_r) { struct charset_translation *t; iconv_t cd; if (charset_is_utf8(charset)) cd = (iconv_t)-1; else { cd = iconv_open("UTF-8", charset); if (cd == (iconv_t)-1) return -1; } t = i_new(struct charset_translation, 1); t->cd = cd; t->normalizer = normalizer; *t_r = t; return 0; } void charset_to_utf8_end(struct charset_translation **_t) { struct charset_translation *t = *_t; *_t = NULL; if (t->cd != (iconv_t)-1) iconv_close(t->cd); i_free(t); } void charset_to_utf8_reset(struct charset_translation *t) { if (t->cd != (iconv_t)-1) (void)iconv(t->cd, NULL, NULL, NULL, NULL); } static int charset_append_utf8(struct charset_translation *t, const void *src, size_t src_size, buffer_t *dest) { if (t->normalizer != NULL) return t->normalizer(src, src_size, dest); else if (!uni_utf8_get_valid_data(src, src_size, dest)) return -1; else { buffer_append(dest, src, src_size); return 0; } } static bool charset_to_utf8_try(struct charset_translation *t, const unsigned char *src, size_t *src_size, buffer_t *dest, enum charset_result *result) { ICONV_CONST char *ic_srcbuf; char tmpbuf[8192], *ic_destbuf; size_t srcleft, destleft; bool ret = TRUE; if (t->cd == (iconv_t)-1) { /* input is already supposed to be UTF-8 */ if (charset_append_utf8(t, src, *src_size, dest) < 0) *result = CHARSET_RET_INVALID_INPUT; else *result = CHARSET_RET_OK; return TRUE; } destleft = sizeof(tmpbuf); ic_destbuf = tmpbuf; srcleft = *src_size; ic_srcbuf = (ICONV_CONST char *) src; if (iconv(t->cd, &ic_srcbuf, &srcleft, &ic_destbuf, &destleft) != (size_t)-1) *result = CHARSET_RET_OK; else if (errno == E2BIG) { /* set result just to avoid compiler warning */ *result = CHARSET_RET_INCOMPLETE_INPUT; ret = FALSE; } else if (errno == EINVAL) *result = CHARSET_RET_INCOMPLETE_INPUT; else { /* should be EILSEQ */ *result = CHARSET_RET_INVALID_INPUT; ret = FALSE; } *src_size -= srcleft; /* we just converted data to UTF-8. it shouldn't be invalid, but Solaris iconv appears to pass invalid data through sometimes (e.g. 8 bit characters with UTF-7) */ if (charset_append_utf8(t, tmpbuf, sizeof(tmpbuf) - destleft, dest) < 0) *result = CHARSET_RET_INVALID_INPUT; return ret; } enum charset_result charset_to_utf8(struct charset_translation *t, const unsigned char *src, size_t *src_size, buffer_t *dest) { enum charset_result result; size_t pos, size; size_t prev_invalid_pos = (size_t)-1; bool ret; for (pos = 0;;) { size = *src_size - pos; ret = charset_to_utf8_try(t, src + pos, &size, dest, &result); pos += size; if (ret) break; if (result == CHARSET_RET_INVALID_INPUT) { if (prev_invalid_pos != dest->used) { uni_ucs4_to_utf8_c(UNICODE_REPLACEMENT_CHAR, dest); prev_invalid_pos = dest->used; } pos++; } } if (prev_invalid_pos != (size_t)-1) result = CHARSET_RET_INVALID_INPUT; *src_size = pos; return result; } #endif
/* * File: exception3.c * * * -------------------------------------------------------------------------- * * Pthreads-win32 - POSIX Threads Library for Win32 * Copyright(C) 1998 John E. Bossom * Copyright(C) 1999,2005 Pthreads-win32 contributors * * Contact Email: [email protected] * * The current list of contributors is contained * in the file CONTRIBUTORS included with the source * code distribution. The list can also be seen at the * following World Wide Web location: * http://sources.redhat.com/pthreads-win32/contributors.html * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library in the file COPYING.LIB; * if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * -------------------------------------------------------------------------- * * Test Synopsis: Test running of user supplied terminate() function. * * Test Method (Validation or Falsification): * - * * Requirements Tested: * - * * Features Tested: * - * * Cases Tested: * - * * Description: * - * * Environment: * - * * Input: * - None. * * Output: * - File name, Line number, and failed expression on failure. * - No output on success. * * Assumptions: * - have working pthread_create, pthread_self, pthread_mutex_lock/unlock * pthread_testcancel, pthread_cancel, pthread_join * * Pass Criteria: * - Process returns zero exit status. * * Fail Criteria: * - Process returns non-zero exit status. */ #include "test.h" #if defined(__cplusplus) # if defined(__GNUC__) && __GNUC__ < 3 # include <new.h> # else # include <new> using std::set_terminate; # endif /* * Create NUMTHREADS threads in addition to the Main thread. */ enum { NUMTHREADS = 1 }; int caught = 0; pthread_mutex_t caughtLock; static void terminateFunction () { assert(pthread_mutex_lock(&caughtLock) == 0); caught++; assert(pthread_mutex_unlock(&caughtLock) == 0); pthread_exit((void *) 0); } static void * exceptionedThread(void * arg) { int dummy = 0x1; (void) set_terminate(&terminateFunction); throw dummy; return (void *) 0; } int pthread_test_exception3() { int i; pthread_t mt; pthread_t et[NUMTHREADS]; pthread_mutexattr_t ma; assert((mt = pthread_self()).p != NULL); assert(pthread_mutexattr_init(&ma) == 0); assert(pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_ERRORCHECK) == 0); assert(pthread_mutex_init(&caughtLock, &ma) == 0); assert(pthread_mutexattr_destroy(&ma) == 0); for (i = 0; i < NUMTHREADS; i++) { assert(pthread_create(&et[i], NULL, exceptionedThread, NULL) == 0); } pte_osThreadSleep(1000); assert(caught == NUMTHREADS); /* * Success. */ return 0; } #else /* defined(__cplusplus) */ #include <stdio.h> int pthread_test_exception3() { printf("Test N/A for this compiler environment.\n"); return 0; } #endif /* defined(__cplusplus) */
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.20.1\Source\Uno\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Delegate.h> namespace g{ namespace Uno{ // public delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3) :17 uDelegateType* Action3_typeof(); }} // ::g::Uno
/*********************************************************************** created: Sun, 6th April 2014 author: Lukas E Meindl *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2014 Paul D Turner & The CEGUI Development Team * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. ***************************************************************************/ #ifndef _CEGUIDirect3D11Shader_h_ #define _CEGUIDirect3D11Shader_h_ #include "CEGUI/RendererModules/Direct3D11/Renderer.h" #include "CEGUI/Exceptions.h" #include "D3Dcompiler.h" #include <string> #if defined(_MSC_VER) # pragma warning(push) # pragma warning(disable : 4251) #endif // Start of CEGUI namespace section namespace CEGUI { //----------------------------------------------------------------------------// /*! \brief Enumerated type used when specifying the type of a shader (e.g. vertex shader, or pixel shader) */ enum ShaderType { /** * The ShaderType represents a vertex shader */ ST_VERTEX, /** * The ShaderType represents a pixel shader */ ST_PIXEL }; //----------------------------------------------------------------------------// class D3D11_GUIRENDERER_API Direct3D11Shader { public: /*! \brief Creates and loads shader programs from the two strings supplied to it */ Direct3D11Shader(Direct3D11Renderer& owner, const std::string& vertexShaderSource, const std::string& pixelShaderSource); ~Direct3D11Shader(); /*! \brief Binds the shader - prepares it to be used for follow-up rendering */ void bind() const; //! Returns the binding location of a texture resource variable in the shader D3D11_SHADER_INPUT_BIND_DESC getTextureBindingDesc(const std::string& variableName, ShaderType shaderType); //! Returns the binding location of a uniform (constant) variable in the shader D3D11_SHADER_VARIABLE_DESC getUniformVariableDescription(const std::string& variableName, ShaderType shaderType); //! Returns the ID3D10Blob pointer to the buffer of the vertex shader ID3D10Blob* getVertexShaderBuffer() const; //! Returns the ID3D11ShaderReflectionConstantBuffer pointer of the specified shader type ID3D11ShaderReflectionConstantBuffer* getShaderReflectionConstBuffer(ShaderType shaderType); private: //! Creates the vertex shader from a shader source code string void createVertexShader(const std::string& vertexShaderSource); //! Creates the pixel shader from a shader source code string void createPixelShader(const std::string& pixelShaderSource); //! Returns the highest pixel shader version available that CEGUI supports std::string getVertexShaderVersion() const; //! Returns the highest pixel shader version available that CEGUI supports std::string getPixelShaderVersion() const; //! The D3D Device ID3D11Device* d_device; //! The D3D DeviceContext ID3D11DeviceContext* d_deviceContext; //! The D3D VertexShader of this shader program ID3D11VertexShader* d_vertShader; //! The D3D Vertex Shader Buffer mutable ID3D10Blob* d_vertexShaderBuffer; //! The D3D VertexShader ShaderReflection of this shader program ID3D11ShaderReflection* d_vertexShaderReflection; //! The D3D PixelShader of this shader program ID3D11PixelShader* d_pixelShader; //! The D3D Vertex Shader Buffer mutable ID3D10Blob* d_pixelShaderBuffer; //! The D3D PixelShader ShaderReflection of this shader program ID3D11ShaderReflection* d_pixelShaderReflection; }; } #endif
// // PhotoTableViewCell.h // IQMediaPickerController // // Copyright (c) 2013-14 Iftekhar Qurashi. // #import <UIKit/UIKit.h> @interface PhotoTableViewCell : UITableViewCell @property (strong, nonatomic) IBOutlet UIImageView *imageViewPhoto; @end
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Controls\0.19.3\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Fuse.Animations.IResize.h> #include <Fuse.Controls.Panel.h> #include <Fuse.IActualPlacement.h> #include <Fuse.Navigation.INavigationPanel.h> #include <Fuse.Node.h> #include <Fuse.Scripting.INameScope.h> #include <Fuse.Triggers.Actions.ICollapse.h> #include <Fuse.Triggers.Actions.IHide.h> #include <Fuse.Triggers.Actions.IShow.h> #include <Fuse.Triggers.IAddRemove-1.h> namespace g{namespace Fuse{namespace Controls{struct MultiLayout;}}} namespace g{namespace Fuse{namespace Controls{struct MultiLayoutPanel;}}} namespace g{namespace Fuse{namespace Elements{struct Element;}}} namespace g{ namespace Fuse{ namespace Controls{ // public sealed class MultiLayoutPanel :1357 // { ::g::Fuse::Controls::Panel_type* MultiLayoutPanel_typeof(); void MultiLayoutPanel__ctor_4_fn(MultiLayoutPanel* __this); void MultiLayoutPanel__get_LayoutElement_fn(MultiLayoutPanel* __this, ::g::Fuse::Elements::Element** __retval); void MultiLayoutPanel__set_LayoutElement_fn(MultiLayoutPanel* __this, ::g::Fuse::Elements::Element* value); void MultiLayoutPanel__New2_fn(MultiLayoutPanel** __retval); struct MultiLayoutPanel : ::g::Fuse::Controls::Panel { uStrong< ::g::Fuse::Controls::MultiLayout*> _multiLayout; void ctor_4(); ::g::Fuse::Elements::Element* LayoutElement(); void LayoutElement(::g::Fuse::Elements::Element* value); static MultiLayoutPanel* New2(); }; // } }}} // ::g::Fuse::Controls
/* * This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information * * 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 MANGOS_DBCSFRM_H #define MANGOS_DBCSFRM_H const char AreaTableEntryfmt[] = "niiiixxxxxissssssssxixxxi"; const char AreaTriggerEntryfmt[] = "niffffffff"; const char AuctionHouseEntryfmt[] = "niiixxxxxxxxx"; const char BankBagSlotPricesEntryfmt[] = "ni"; const char ChrClassesEntryfmt[] = "nxxixssssssssxxix"; const char ChrRacesEntryfmt[] = "nxixiixxixxxxxixissssssssxxxx"; const char CharStartOutfitEntryfmt[] = "diiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char ChatChannelsEntryfmt[] = "iixssssssssxxxxxxxxxx";// ChatChannelsEntryfmt, index not used (more compact store) const char CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; const char CreatureDisplayInfofmt[] = "nxxifxxxxxxx"; const char CreatureDisplayInfoExtrafmt[] = "nixxxxxxxxxxxxxxxxx"; const char CreatureFamilyfmt[] = "nfifiiiissssssssxx"; const char CreatureSpellDatafmt[] = "niiiixxxx"; const char CreatureTypefmt[] = "nxxxxxxxxxx"; const char DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; const char DurabilityQualityfmt[] = "nf"; const char EmotesEntryfmt[] = "nxxiiix"; const char EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; const char FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiissssssssxxxxxxxxxx"; const char FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; const char GameObjectDisplayInfofmt[] = "nsxxxxxxxxxx"; const char ItemBagFamilyfmt[] = "nxxxxxxxxx"; const char ItemClassfmt[]="nxxssssssssx"; // const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; const char ItemRandomPropertiesfmt[] = "nxiiixxxxxxxxxxx"; const char ItemSetEntryfmt[] = "dssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii"; const char LiquidTypefmt[] = "niii"; const char LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char MailTemplateEntryfmt[] = "nxxxxxxxxx"; const char MapEntryfmt[] = "nxixssssssssxxxxxxxixxxxxxxxxxxxxxxxxxixxx"; const char QuestSortEntryfmt[] = "nxxxxxxxxx"; const char SkillLinefmt[] = "nixssssssssxxxxxxxxxxi"; const char SkillLineAbilityfmt[] = "niiiixxiiiiixxi"; const char SkillRaceClassInfofmt[] = "diiiiixx"; const char SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SpellCastTimefmt[] = "nixx"; const char SpellDurationfmt[] = "niii"; const char SpellEntryfmt[] = "niixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiifffixiixssssssssxssssssssxxxxxxxxxxxxxxxxxxxiiiiiiiiiixfffxxx"; const char SpellFocusObjectfmt[] = "nxxxxxxxxx"; const char SpellItemEnchantmentfmt[] = "niiiiiixxxiiissssssssxii"; const char SpellRadiusfmt[] = "nfxx"; const char SpellRangefmt[] = "nffxxxxxxxxxxxxxxxxxxx"; const char SpellShapeshiftfmt[] = "nxxxxxxxxxxiix"; const char StableSlotPricesfmt[] = "ni"; const char TalentEntryfmt[] = "niiiiiiiixxxxixxixxxi"; const char TalentTabEntryfmt[] = "nxxxxxxxxxxxiix"; const char TaxiNodesEntryfmt[] = "nifffssssssssxii"; const char TaxiPathEntryfmt[] = "niii"; const char TaxiPathNodeEntryfmt[] = "diiifffii"; const char WMOAreaTableEntryfmt[] = "niiixxxxxiixxxxxxxxx"; const char WorldMapAreaEntryfmt[] = "xinxffff"; // const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx"; const char WorldSafeLocsEntryfmt[] = "nifffxxxxxxxxx"; #endif
/* * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 SQLDatabase_h #define SQLDatabase_h #include "PlatformString.h" #include <wtf/Noncopyable.h> #include <wtf/Vector.h> #ifndef NDEBUG #include <pthread.h> #endif #if COMPILER(MSVC) #pragma warning(disable: 4800) #endif typedef struct sqlite3 sqlite3; namespace WebCore { class SQLStatement; class SQLTransaction; extern const int SQLResultError; extern const int SQLResultDone; extern const int SQLResultOk; extern const int SQLResultRow; class SQLDatabase : public Noncopyable { friend class SQLTransaction; public: SQLDatabase(); ~SQLDatabase() { close(); } bool open(const String& filename); bool isOpen() const { return m_db; } String path() const { return m_path; } void close(); bool executeCommand(const String&); bool returnsAtLeastOneResult(const String&); bool tableExists(const String&); void clearAllTables(); void runVacuumCommand(); bool transactionInProgress() const { return m_transactionInProgress; } int64_t lastInsertRowID(); int lastChanges(); void setBusyTimeout(int ms); void setBusyHandler(int(*)(void*, int)); // TODO - add pragma and sqlite_master accessors here void setFullsync(bool); // The SQLite SYNCHRONOUS pragma can be either FULL, NORMAL, or OFF // FULL - Any writing calls to the DB block until the data is actually on the disk surface // NORMAL - SQLite pauses at some critical moments when writing, but much less than FULL // OFF - Calls return immediately after the data has been passed to disk enum SynchronousPragma { SyncOff = 0, SyncNormal = 1, SyncFull = 2 }; void setSynchronous(SynchronousPragma); int lastError(); const char* lastErrorMsg(); sqlite3* sqlite3Handle() const { ASSERT(pthread_equal(m_openingThread, pthread_self())); return m_db; } private: String m_path; sqlite3* m_db; int m_lastError; bool m_transactionInProgress; #ifndef NDEBUG pthread_t m_openingThread; #endif }; // class SQLDatabase inline String escapeSQLString(const String& s) { String es = s; es.replace('\'', "''"); return es; } } // namespace WebCore #endif
/** @file * Inline routines for Watcom C. */ /* * Copyright (C) 2010-2015 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ extern unsigned inp(unsigned port); extern unsigned outp(unsigned port, unsigned value); extern unsigned inpw(unsigned port); extern unsigned outpw(unsigned port, unsigned value); #pragma intrinsic(inp,outp,inpw,outpw) #define inb(p) inp(p) #define outb(p, v) outp(p, v) #define inw(p) inpw(p) #define outw(p, v) outpw(p, v) extern uint8_t read_byte(uint16_t seg, uint16_t offset); extern uint16_t read_word(uint16_t seg, uint16_t offset); extern uint32_t read_dword(uint16_t seg, uint16_t offset); extern void write_byte(uint16_t seg, uint16_t offset, uint8_t data); extern void write_word(uint16_t seg, uint16_t offset, uint16_t data); extern void write_dword(uint16_t seg, uint16_t offset, uint32_t data); void int_enable(void); #pragma aux int_enable = "sti" modify exact [] nomemory; void int_disable(void); #pragma aux int_disable = "cli" modify exact [] nomemory; void int_enable_hlt_disable(void); #pragma aux int_enable_hlt_disable = \ "sti" \ "hlt" \ "cli" \ modify exact [] nomemory; uint16_t int_query(void); #pragma aux int_query = \ "pushf" \ "pop ax" \ value [ax] modify exact [ax] nomemory; void int_restore(uint16_t old_flags); #pragma aux int_restore = \ "push ax" \ "popf" \ parm [ax] modify exact [] nomemory; void halt(void); #pragma aux halt = "hlt" modify exact [] nomemory; void halt_forever(void); #pragma aux halt_forever = \ "forever:" \ "hlt" \ "jmp forever" \ modify exact [] nomemory aborts; #ifdef __386__ void rep_movsb(void __far *d, void __far *s, int nbytes); #pragma aux rep_movsb = \ "push ds" \ "mov ds, dx" \ "rep movsb" \ "pop ds" \ parm [es edi] [dx esi] [ecx]; #else void rep_movsb(void __far *d, void __far *s, int nbytes); #pragma aux rep_movsb = \ "push ds" \ "mov ds, dx" \ "rep movsb" \ "pop ds" \ parm [es di] [dx si] [cx]; #endif void rep_movsw(void __far *d, void __far *s, int nwords); #pragma aux rep_movsw = \ "push ds" \ "mov ds, dx" \ "rep movsw" \ "pop ds" \ parm [es di] [dx si] [cx]; #ifndef __386__ char __far *rep_insb(char __far *buffer, unsigned nbytes, unsigned port); #pragma aux rep_insb = ".286" "rep insb" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; char __far *rep_insw(char __far *buffer, unsigned nwords, unsigned port); #pragma aux rep_insw = ".286" "rep insw" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; char __far *rep_insd(char __far *buffer, unsigned ndwords, unsigned port); #pragma aux rep_insd = ".386" "rep insd" parm [es di] [cx] [dx] value [es di] modify exact [cx di]; char __far *rep_outsb(char __far *buffer, unsigned nbytes, unsigned port); #pragma aux rep_outsb = ".286" "rep outs dx,byte ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; char __far *rep_outsw(char __far *buffer, unsigned nwords, unsigned port); #pragma aux rep_outsw = ".286" "rep outs dx,word ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; char __far *rep_outsd(char __far *buffer, unsigned ndwords, unsigned port); #pragma aux rep_outsd = ".386" "rep outs dx,dword ptr es:[si]" parm [es si] [cx] [dx] value [es si] modify exact [cx si]; uint16_t __far swap_16(uint16_t val); #pragma aux swap_16 = "xchg ah,al" parm [ax] value [ax] modify exact [ax] nomemory; uint32_t __far swap_32(uint32_t val); #pragma aux swap_32 = \ "xchg ah, al" \ "xchg dh, dl" \ "xchg ax, dx" \ parm [dx ax] value [dx ax] modify exact [dx ax] nomemory; #endif
/* * This is the source code of Telegram for iOS v. 1.1 * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Peter Iakovlev, 2013. */ #import "ASQueue.h" @class TGWorkerTask; @interface TGWorkerPool : NSObject - (void)addTask:(TGWorkerTask *)task; - (void)removeTask:(TGWorkerTask *)task; @end
/* Copyright (C) 1995-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <[email protected]>, August 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> int __jrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, long int *result) { /* Compute next state. */ if (__drand48_iterate (xsubi, buffer) < 0) return -1; /* Store the result. */ *result = (int32_t) ((xsubi[2] << 16) | xsubi[1]); return 0; } weak_alias (__jrand48_r, jrand48_r)
#ifndef __lib_gui_ewidgetdesktop_h #define __lib_gui_ewidgetdesktop_h #include <lib/gdi/grc.h> #include <lib/base/eptrlist.h> class eWidget; class eMainloop; class eTimer; /* an eWidgetDesktopCompBuffer is a composition buffer. in immediate composition mode, we only have one composition buffer - the screen. in buffered mode, we have one buffer for each widget, plus the screen. even in buffered mode, we have a background region, because a window can be arbitrary shaped. the screen size acts as a bounding box in these cases. */ struct eWidgetDesktopCompBuffer { ePoint m_position; eSize m_screen_size; gRegion m_dirty_region; gRegion m_background_region; ePtr<gDC> m_dc; gRGB m_background_color; }; class eWidgetDesktop: public Object { public: eWidgetDesktop(eSize screen); ~eWidgetDesktop(); void addRootWidget(eWidget *root); void removeRootWidget(eWidget *root); /* try to move widget content. */ /* returns -1 if there's no move support. */ /* call this after recalcClipRegions for that widget. */ /* you probably want to invalidate if -1 was returned. */ int movedWidget(eWidget *root); void recalcClipRegions(eWidget *root); void invalidateWidgetLayer(const gRegion &region, const eWidget *widget, int layer); void invalidateWidget(const gRegion &region, const eWidget *widget, int layer = -1); void invalidate(const gRegion &region, const eWidget *widget = 0, int layer = -1); void paintLayer(eWidget *widget, int layer); void paint(); void setDC(gDC *dc); void setBackgroundColor(gRGB col); void setBackgroundColor(eWidgetDesktopCompBuffer *comp, gRGB col); void setPalette(gPixmap &pm); void setRedrawTask(eMainloop &ml); void makeCompatiblePixmap(ePtr<gPixmap> &pm); void makeCompatiblePixmap(gPixmap &pm); enum { cmImmediate, cmBuffered }; void setCompositionMode(int mode); int getStyleID() { return m_style_id; } void setStyleID(int id) { m_style_id = id; } void resize(eSize size); eSize size() const { return m_screen.m_screen_size; } void sendShow(ePoint point, eSize size); void sendHide(ePoint point, eSize size); eRect bounds() const; // returns area inside margins eRect margins() const { return m_margins; } void setMargins(const eRect& value) { m_margins = value; } private: ePtrList<eWidget> m_root; void calcWidgetClipRegion(eWidget *widget, gRegion &parent_visible); void paintBackground(eWidgetDesktopCompBuffer *comp); eMainloop *m_mainloop; ePtr<eTimer> m_timer; int m_comp_mode; int m_require_redraw; eWidgetDesktopCompBuffer m_screen; void createBufferForWidget(eWidget *widget, int layer); void removeBufferForWidget(eWidget *widget, int layer); void redrawComposition(int notifed); void notify(); void clearVisibility(eWidget *widget); int m_style_id; eRect m_margins; }; #endif
/* cprojl.c Contributed by Danny Smith 2005-01-04 */ #include <math.h> #include <complex.h> /* Return the value of the projection onto the Riemann sphere.*/ long double complex cprojl (long double complex Z) { complex long double Res = Z; if (isinf (__real__ Z) || isinf (__imag__ Z)) { __real__ Res = HUGE_VALL; __imag__ Res = copysignl (0.0L, __imag__ Z); } return Res; }
/* PCI: Interrupt Routing Table found at 0x40163ed0 size = 272 */ #include <arch/pirq_routing.h> const struct irq_routing_table intel_irq_routing_table = { 0x52495024, /* u32 signature */ 0x0100, /* u16 version */ 32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* u16 Table size 32+(16*devices) */ 0x00, /* u8 Bus 0 */ 0xf8, /* u8 Device 1, Function 0 */ 0x0000, /* u16 reserve IRQ for PCI */ 0x8086, /* u16 Vendor */ 0x122e, /* Device ID */ 0x00000000, /* u32 miniport_data */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* u8 rfu[11] */ 0x78, /* u8 checksum - mod 256 checksum must give zero */ { /* bus, devfn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */ {0x00, 0x00, {{0x00, 0xdef8}, {0x00, 0xdef8}, {0x00, 0xdef8}, {0x00, 0xdef8}}, 0x00, 0x00}, {0x00, 0x10, {{0x60, 0xdef8}, {0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0xdef8}}, 0x00, 0x00}, {0x01, 0x00, {{0x60, 0x1ef8}, {0x61, 0x1ef8}, {0x62, 0x1ef8}, {0x63, 0x1ef8}}, 0x04, 0x00}, {0x00, 0x20, {{0x60, 0xdef8}, {0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0xdef8}}, 0x00, 0x00}, {0x02, 0x00, {{0x60, 0x1ef8}, {0x61, 0x1ef8}, {0x62, 0x1ef8}, {0x63, 0x1ef8}}, 0x06, 0x00}, {0x00, 0xe0, {{0x60, 0xdef8}, {0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0xdef8}}, 0x00, 0x00}, {0x04, 0x08, {{0x6a, 0x1ef8}, {0x6a, 0x1ef8}, {0x6a, 0x1ef8}, {0x6a, 0x1ef8}}, 0x01, 0x00}, {0x04, 0x10, {{0x6a, 0x1ef8}, {0x00, 0xdef8}, {0x00, 0xdef8}, {0x00, 0xdef8}}, 0x07, 0x00}, {0x04, 0x18, {{0x6a, 0x1ef8}, {0x6a, 0x1ef8}, {0x6a, 0x1ef8}, {0x6a, 0x1ef8}}, 0x02, 0x00}, {0x00, 0xf0, {{0x60, 0xdef8}, {0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0xdef8}}, 0x00, 0x00}, {0x05, 0x40, {{0x68, 0x1ef8}, {0x69, 0x1ef8}, {0x6a, 0x1ef8}, {0x6b, 0x1ef8}}, 0x03, 0x00}, {0x05, 0x18, {{0x6a, 0x1ef8}, {0x00, 0xdef8}, {0x00, 0xdef8}, {0x00, 0xdef8}}, 0x08, 0x00}, {0x05, 0x10, {{0x69, 0x1ef8}, {0x6a, 0x1ef8}, {0x6b, 0x1ef8}, {0x68, 0x1ef8}}, 0x05, 0x00}, {0x00, 0xf8, {{0x62, 0x1ef8}, {0x61, 0x1ef8}, {0x00, 0xdef8}, {0x00, 0xdef8}}, 0x00, 0x00}, {0x00, 0xe8, {{0x60, 0x1ef8}, {0x63, 0x1ef8}, {0x00, 0xdef8}, {0x6b, 0x1ef8}}, 0x00, 0x00} } }; unsigned long write_pirq_routing_table(unsigned long addr) { return copy_pirq_routing_table(addr); }
/* Header file for memory address lowering and mode selection. Copyright (C) 2013-2021 Free Software Foundation, Inc. This file is part of GCC. GCC 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. GCC 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 GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #ifndef GCC_TREE_SSA_ADDRESS_H #define GCC_TREE_SSA_ADDRESS_H /* Description of a memory address. */ struct mem_address { tree symbol, base, index, step, offset; }; extern rtx addr_for_mem_ref (struct mem_address *, addr_space_t, bool); extern rtx addr_for_mem_ref (tree exp, addr_space_t as, bool really_expand); extern void get_address_description (tree, struct mem_address *); extern tree tree_mem_ref_addr (tree, tree); extern bool valid_mem_ref_p (machine_mode, addr_space_t, struct mem_address *); extern void move_fixed_address_to_symbol (struct mem_address *, class aff_tree *); tree create_mem_ref (gimple_stmt_iterator *, tree, class aff_tree *, tree, tree, tree, bool); extern void copy_ref_info (tree, tree); tree maybe_fold_tmr (tree); extern unsigned int preferred_mem_scale_factor (tree base, machine_mode mem_mode, bool speed); #endif /* GCC_TREE_SSA_ADDRESS_H */
/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2015 RehiveTech. All rights reserved. */ #ifndef _RTE_SPINLOCK_ARM_H_ #define _RTE_SPINLOCK_ARM_H_ #ifndef RTE_FORCE_INTRINSICS # error Platform must be built with CONFIG_RTE_FORCE_INTRINSICS #endif #ifdef __cplusplus extern "C" { #endif #include <rte_common.h> #include "generic/rte_spinlock.h" static inline int rte_tm_supported(void) { return 0; } static inline void rte_spinlock_lock_tm(rte_spinlock_t *sl) { rte_spinlock_lock(sl); /* fall-back */ } static inline int rte_spinlock_trylock_tm(rte_spinlock_t *sl) { return rte_spinlock_trylock(sl); } static inline void rte_spinlock_unlock_tm(rte_spinlock_t *sl) { rte_spinlock_unlock(sl); } static inline void rte_spinlock_recursive_lock_tm(rte_spinlock_recursive_t *slr) { rte_spinlock_recursive_lock(slr); /* fall-back */ } static inline void rte_spinlock_recursive_unlock_tm(rte_spinlock_recursive_t *slr) { rte_spinlock_recursive_unlock(slr); } static inline int rte_spinlock_recursive_trylock_tm(rte_spinlock_recursive_t *slr) { return rte_spinlock_recursive_trylock(slr); } #ifdef __cplusplus } #endif #endif /* _RTE_SPINLOCK_ARM_H_ */