text
stringlengths
4
6.14k
/* * Copyright (c) 2016 The AnyRTC project authors. All Rights Reserved. * * Please visit https://www.anyrtc.io for detail. * * The GNU General Public License is a free, copyleft license for * software and other kinds of works. * * The licenses for most software and other practical works are designed * to take away your freedom to share and change the works. By contrast, * the GNU General Public License is intended to guarantee your freedom to * share and change all versions of a program--to make sure it remains free * software for all its users. We, the Free Software Foundation, use the * GNU General Public License for most of our software; it applies also to * any other work released this way by its authors. You can apply it to * your programs, too. * See the GNU LICENSE file for more info. */ #ifndef __PLAYER_BUFER_H__ #define __PLAYER_BUFER_H__ #include <list> #include <stdint.h> #include "webrtc/base/criticalsection.h" #include "webrtc/base/messagehandler.h" #include "webrtc/base/thread.h" typedef struct PlyPacket { PlyPacket(bool isvideo) :_data(NULL), _data_len(0), _b_video(isvideo), _dts(0) {} virtual ~PlyPacket(void){ if (_data) delete[] _data; } void SetData(const uint8_t*pdata, int len, uint32_t ts) { _dts = ts; if (len > 0 && pdata != NULL) { if (_data) delete[] _data; if (_b_video) _data = new uint8_t[len + 8]; else _data = new uint8_t[len]; memcpy(_data, pdata, len); _data_len = len; } } uint8_t*_data; int _data_len; bool _b_video; uint32_t _dts; }PlyPacket; enum PlyStuts { PS_Fast = 0, // Fast video decode PS_Normal, PS_Cache, }; class PlyBufferCallback { public: PlyBufferCallback(void){}; virtual ~PlyBufferCallback(void){}; virtual void OnPlay() = 0; virtual void OnPause() = 0; virtual bool OnNeedDecodeData(PlyPacket* pkt) = 0; }; class PlyBuffer : public rtc::MessageHandler { public: PlyBuffer(PlyBufferCallback&callback, rtc::Thread*worker); virtual ~PlyBuffer(); void SetCacheSize(int miliseconds/*ms*/); int GetPlayAudio(void* audioSamples); PlyStuts PlayerStatus(){return ply_status_;}; int GetPlayCacheTime(){return buf_cache_time_;}; void CacheH264Data(const uint8_t*pdata, int len, uint32_t ts); void CachePcmData(const uint8_t*pdata, int len, uint32_t ts); protected: //* For MessageHandler virtual void OnMessage(rtc::Message* msg); int GetCacheTime(); void DoDecode(); private: PlyBufferCallback &callback_; bool got_audio_; int cache_time_; int cache_delta_; int buf_cache_time_; PlyStuts ply_status_; rtc::Thread *worker_thread_; uint32_t sys_fast_video_time_; // Ã뿪ʱ¼äÖá uint32_t rtmp_fast_video_time_; uint32_t rtmp_cache_time_; uint32_t play_cur_time_; rtc::CriticalSection cs_list_audio_; std::list<PlyPacket*> lst_audio_buffer_; rtc::CriticalSection cs_list_video_; std::list<PlyPacket*> lst_video_buffer_; }; #endif // __PLAYER_BUFER_H__
// driver/atkbd.c #include <arch/x86/io.h> #include <driver/i8259.h> #include <driver/atkbd.h> #include <kernel/process/lock.h> #define I8042_DATA_IO 0x60 #define I8042_STAT_IO 0x64 #define I8042_CTL_IO 0x64 #define SET_LED 0xed static _key_handler_t atkbd_handler; static _lock_t ilock; static void irq1_handler(_intr_regs_t *regs) { _u8_t scan_code = inb(I8042_DATA_IO); intr_unlock(&ilock); if (atkbd_handler != NULL) { atkbd_handler(scan_code); } } void set_kbd_led(_u8_t c) { while (inb(I8042_STAT_IO) & 0x2) {} led_1: init_intr_lock(&ilock); outb(SET_LED, I8042_DATA_IO); intr_lock(&ilock); if (inb(I8042_DATA_IO) == 0xfe) goto led_1; led_2: init_intr_lock(&ilock); outb(c, I8042_DATA_IO); intr_lock(&ilock); if (inb(I8042_DATA_IO) == 0xfe) goto led_2; } void reg_atkbd_handler(_key_handler_t handler) { atkbd_handler = handler; } void init_atkbd(void) { atkbd_handler = NULL; reg_irq_handler(1, irq1_handler); }
#define __GM4_INDEX_C__ #include <malloc.h> #include <string.h> #include "index.h" #include "version.h" unsigned long long gt4_index_get_kmer_info (GT4Index *index, unsigned int kmer, unsigned int *num_reads) { if ((index->version_major == 0) && (index->version_minor < 4)) { *num_reads = index->read_blocks[kmer] & 0xffffff; return index->read_blocks[kmer] >> 24; } else { if (kmer >= (index->n_kmers - 1)) { *num_reads = index->n_reads - index->read_blocks[kmer]; /* fprintf (stderr, "%u %llu %llu %u\n", kmer, index->n_kmers, index->read_blocks[kmer], *num_reads); */ } else { *num_reads = index->read_blocks[kmer + 1] - index->read_blocks[kmer]; /* fprintf (stderr, "%u %llu %llu %u\n", kmer, index->n_kmers, index->read_blocks[kmer], *num_reads); */ } return index->read_blocks[kmer]; } } unsigned long long gt4_index_get_read_info (GT4Index *index, unsigned long long read, unsigned int *file_idx, unsigned long long *name_pos, unsigned int *dir) { unsigned long long code; code = read = index->reads[read]; *name_pos = (code >> index->nbits_kmer) & ((1ULL << index->nbits_npos) - 1); *file_idx = (code >> (index->nbits_npos + index->nbits_kmer)) & ((1ULL << index->nbits_file) - 1); *dir = (code >> (index->nbits_npos + index->nbits_kmer + index->nbits_file)) & 1; return code & ((1ULL << index->nbits_kmer) - 1); } unsigned int GT4_INDEX_CODE = 'G' << 24 | 'T' << 16 | '4' << 8 | 'I'; unsigned int gt4_index_init_from_data (GT4Index *index, const unsigned char *cdata, unsigned long long csize, unsigned long long n_kmers, unsigned int compatibility_mode) { unsigned long long cpos = 0, files_start, blocks_start, reads_start; unsigned int i; memset (index, 0, sizeof (GT4Index)); if (compatibility_mode) { index->code = GT4_INDEX_CODE; index->version_major = 0; index->version_minor = 3; } else { memcpy (index, cdata + cpos, 16); cpos += 16; } /* Bitsizes */ memcpy (&index->nbits_file, cdata + cpos, 4); memcpy (&index->nbits_npos, cdata + cpos + 4, 4); memcpy (&index->nbits_kmer, cdata + cpos + 8, 4); cpos += 12; /* Sizes */ memcpy (&index->n_files, cdata + cpos, 4); memcpy (&index->n_kmers, cdata + cpos + 4, 8); memcpy (&index->n_reads, cdata + cpos + 12, 8); cpos += 20; /* Starts */ memcpy (&files_start, cdata + cpos, 8); memcpy (&blocks_start, cdata + cpos + 8, 8); memcpy (&reads_start, cdata + cpos + 16, 8); cpos += 24; /* Files */ cpos = files_start; index->files = (char **) malloc (index->n_files * sizeof (char *)); for (i = 0; i < index->n_files; i++) { index->files[i] = (char *) cdata + cpos; cpos += strlen ((const char *) cdata + cpos); cpos += 1; } /* Blocks */ cpos = blocks_start; index->read_blocks = (unsigned long long *) (cdata + cpos); /* Reads */ cpos = reads_start; index->reads = (unsigned long long *) (cdata + cpos); return 1; } unsigned long long default_write_reads (GT4Index *index, FILE *ofs, void *data) { unsigned long long written = 0; if (index->reads) { fwrite (index->reads, 8, index->n_reads, ofs); written += index->n_reads * 8; } written = (written + 15) & 0xfffffffffffffff0; return written; } unsigned long long gt4_index_write_with_reads_callback (GT4Index *index, FILE *ofs, unsigned long long n_kmers, unsigned long long (*write_reads) (GT4Index *index, FILE *ofs, void *data), void *data) { unsigned long long fpos; unsigned long long written = 0, files_start, blocks_start, reads_start; unsigned int zero_4 = 0; unsigned int i; unsigned int major, minor; if (write_reads == NULL) { write_reads = default_write_reads; } fpos = ftello (ofs); /* Version */ fwrite (&GT4_INDEX_CODE, 4, 1, ofs); major = 0; fwrite (&major, 4, 1, ofs); minor = 4; fwrite (&minor, 4, 1, ofs); fwrite (&zero_4, 4, 1, ofs); written += 16; /* Bitsizes */ fwrite (&index->nbits_file, 4, 1, ofs); fwrite (&index->nbits_npos, 4, 1, ofs); fwrite (&index->nbits_kmer, 4, 1, ofs); written += 12; /* Sizes */ fwrite (&index->n_files, 4, 1, ofs); fwrite (&index->n_kmers, 8, 1, ofs); fwrite (&index->n_reads, 8, 1, ofs); written += 20; /* Starts */ fseek (ofs, fpos + written + 24, SEEK_SET); written += 24; /* Files */ files_start = written; fseek (ofs, fpos + files_start, SEEK_SET); for (i = 0; i < index->n_files; i++) { unsigned int len = (unsigned int) strlen (index->files[i]) + 1; fwrite (index->files[i], len, 1, ofs); written += len; } written = (written + 15) & 0xfffffffffffffff0; /* Blocks */ blocks_start = written; fseek (ofs, fpos + blocks_start, SEEK_SET); if (index->read_blocks) { fwrite (index->read_blocks, 8, n_kmers, ofs); written += n_kmers * 8; } written = (written + 15) & 0xfffffffffffffff0; /* Reads */ reads_start = written; fseek (ofs, fpos + reads_start, SEEK_SET); written += write_reads (index, ofs, data); /* Starts */ fseek (ofs, fpos + 48, SEEK_SET); fwrite (&files_start, 8, 1, ofs); fwrite (&blocks_start, 8, 1, ofs); fwrite (&reads_start, 8, 1, ofs); fseek (ofs, fpos + written, SEEK_SET); return written; } unsigned long long gt4_index_write (GT4Index *index, FILE *ofs, unsigned long long n_kmers) { return gt4_index_write_with_reads_callback (index, ofs, n_kmers, default_write_reads, NULL); }
/* File: leaidrawable.h Project: leafhopper Author: Douwe Vos Date: Nov 18, 2014 e-mail: dmvos2000(at)yahoo.com Copyright (C) 2014 Douwe Vos. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LEAIDRAWABLE_H_ #define LEAIDRAWABLE_H_ #include <gtk/gtk.h> #include <caterpillar.h> G_BEGIN_DECLS #define LEA_TYPE_IDRAWABLE (lea_idrawable_get_type()) #define LEA_IDRAWABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LEA_TYPE_IDRAWABLE, LeaIDrawable)) #define LEA_IS_IDRAWABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LEA_TYPE_IDRAWABLE)) #define LEA_IDRAWABLE_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), LEA_TYPE_IDRAWABLE, LeaIDrawableInterface)) typedef struct _LeaIDrawable LeaIDrawable; /* dummy object */ typedef struct _LeaIDrawableInterface LeaIDrawableInterface; struct _MooNodeWo; struct _LeaIDrawableInterface { GTypeInterface parent_iface; void (*draw)(LeaIDrawable *self, cairo_t *cairo); cairo_region_t *(*createRegion)(LeaIDrawable *self); }; GType lea_idrawable_get_type(void); void lea_idrawable_draw(LeaIDrawable *self, cairo_t *cairo); cairo_region_t *lea_idrawable_create_region(LeaIDrawable *self); G_END_DECLS #endif /* LEAIDRAWABLE_H_ */
/* This file is part of Chirp. Chirp 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. Chirp 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 Chirp. If not, see <http://www.gnu.org/licenses/>. Copyright 2016 Mike Lemberger */ #ifndef OutputChannel_h #define OutputChannel_h #include "Arduino.h" typedef enum { OFF = 0, ON = 1 } OUTPUT_STATUS_T; typedef enum { SUCCESS=0, ERROR_MESSAGE_UNKNOWN, ERROR_MESSAGE_VALUE_TOO_SMALL, ERROR_MESSAGE_VALUE_TOO_LARGE, ERROR_MESSAGE_OTHER } ERROR_MESSAGE_T; typedef enum { WAVEFORM_SINE=0, WAVEFORM_TRIANGLE, WAVEFORM_SQUARE, WAVEFORM_SQUARE_DIV_2 } WAVEFORM_T; /// @brief Class for storing information about an output channel class OutputChannelClass { public: OutputChannelClass(uint8_t cNumber); ~OutputChannelClass(); void init(void); uint8_t getChannelNumber(void); uint32_t getFrequencyHz(void); uint16_t getAmplitudeMV(void); uint16_t getPhaseDegrees(void); const char* getWaveform(void); OUTPUT_STATUS_T getOutputStatus(void); ERROR_MESSAGE_T setFrequencyHz(uint32_t); ERROR_MESSAGE_T setAmplitudeMV(); ERROR_MESSAGE_T setAmplitudeMV(uint16_t); ERROR_MESSAGE_T setPhaseDegrees(uint16_t); ERROR_MESSAGE_T setWaveform(WAVEFORM_T); ERROR_MESSAGE_T setOutputStatus(OUTPUT_STATUS_T); ERROR_MESSAGE_T reset(); private: uint8_t channelNumber; //!< channel number {1..5} uint32_t frequencyHz; //!< frequency in hz {0..8MHz} uint16_t amplitudeMV; //!< magnitude of output in mV {100..4000mV} uint16_t phaseDegrees; //!< phase angle {0..359degrees} WAVEFORM_T waveform; OUTPUT_STATUS_T outputStatus; //!< off or on }; #endif
#ifndef PROTY_TOKEN_H #define PROTY_TOKEN_H typedef enum TokenType { // operators Token_binaryop, Token_unaryop, Token_assign, // primitive data types Token_integer, Token_decimal, Token_string, Token_name, // keywords Token_doKw, Token_ifKw, Token_elseKw, Token_whileKw, Token_endKw, Token_tryKw, Token_catchKw, // braces Token_lpar, Token_rpar, Token_lsqb, Token_rsqb, Token_lbrace, Token_rbrace, // other symbols Token_comma, Token_dot, Token_colon, Token_semicolon, Token_hash, Token_excl, Token_arrow, Token_newline, Token_eof, Token_unknown, } TokenType; typedef struct Token { TokenType type; const char* value; int lineno; int precedence; } Token; #endif
// Copyright 2017 Philip Zwanenburg // MIT License (https://github.com/PhilipZwanenburg/DPGSolver/blob/master/LICENSE) #ifndef DPG__solver_Advection_functions_h__INCLUDED #define DPG__solver_Advection_functions_h__INCLUDED double *compute_b_Advection (unsigned int const Nn, double const *const XYZ); #endif // DPG__solver_Advection_functions_h__INCLUDED
/****************************************************************************/ /// @file Bresenham.h /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 /// @version $Id: Bresenham.h 13811 2013-05-01 20:31:43Z behrisch $ /// // A class to realise a uniform n:m - relationship using the /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. // SUMO 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. // /****************************************************************************/ #ifndef Bresenham_h #define Bresenham_h // =========================================================================== // included modules // =========================================================================== #ifdef _MSC_VER #include <windows_config.h> #else #include <config.h> #endif // =========================================================================== // class definitions // =========================================================================== /** * The class' only static method "execute" obtains a callback object and * performs the computation of the n:m - relationship */ class Bresenham { public: /** * BresenhamCallBack * This class is the base interface-describing class for a callback class * for the bresenham-function. * Derived classes must implement the execute-method which is called * on every bresenham-step */ class BresenhamCallBack { public: /** constuctor */ BresenhamCallBack() { } /** destructor */ virtual ~BresenhamCallBack() { } /** called when a bresenham step has been computed */ virtual void execute(const unsigned int val1, const unsigned int val2) = 0; }; public: /** compute the bresenham - interpolation between both values the higher number is increased by one for each step while the smaller is increased by smaller/higher. In each step, the callback is executed. */ static void compute(BresenhamCallBack* callBack, const unsigned int val1, const unsigned int val2); }; #endif /****************************************************************************/
/****************************************************************************** * main.h * * pdfresurrect - PDF history extraction tool * * Copyright (C) 2008, 2009, 2010, 2012, 2019, 2020, 2021 Matt Davis (enferex). * * Special thanks to all of the contributors: See AUTHORS. * * Special thanks to 757labs (757 crew), they are a great group * of people to hack on projects and brainstorm with. * * main.h is part of pdfresurrect. * pdfresurrect 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. * * pdfresurrect 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 pdfresurrect. If not, see <http://www.gnu.org/licenses/>. *****************************************************************************/ #ifndef MAIN_H_INCLUDE #define MAIN_H_INCLUDE #include <stdio.h> #define EXEC_NAME "pdfresurrect" #define VER_MAJOR "0" #define VER_MINOR "23b" #define VER VER_MAJOR"."VER_MINOR #define TAG "[pdfresurrect]" #define ERR(...) {fprintf(stderr, TAG" -- Error -- " __VA_ARGS__);} /* Returns a zero'd buffer of 'size' bytes or exits in failure. */ extern void *safe_calloc(size_t bytes); #endif /* MAIN_H_INCLUDE */
/* AGS - Advanced GTK Sequencer * Copyright (C) 2005-2011 Joël Krähemann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __AGS_TABLE_H__ #define __AGS_TABLE_H__ #include <glib.h> #include <glib-object.h> #include <gtk/gtk.h> #define AGS_TYPE_TABLE (ags_table_get_type()) #define AGS_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_TABLE, AgsTable)) #define AGS_TABLE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_TABLE, AgsTableClass)) #define AGS_IS_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_TABLE)) #define AGS_IS_TABLE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE((class), AGS_TYPE_TABLE)) #define AGS_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_TABLE, AgsTableClass)) typedef struct _AgsTable AgsTable; typedef struct _AgsTableClass AgsTableClass; struct _AgsTable { GtkTable table; }; struct _AgsTableClass { GtkTableClass table; }; GType ags_table_get_type(void); AgsTable* ags_table_new(guint row, guint columns, gboolean homogeneous); #endif /*__AGS_TABLE_H__*/
// // Created by bernardoct on 8/25/17. // #ifndef TRIANGLEMODEL_OBJECTIVESCALCULATOR_H #define TRIANGLEMODEL_OBJECTIVESCALCULATOR_H #include "../DataCollector/UtilitiesDataCollector.h" #include "../DataCollector/RestrictionsDataCollector.h" class ObjectivesCalculator { public: static double calculateReliabilityObjective( const vector<UtilitiesDataCollector *>& utility_collector, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculateRestrictionFrequencyObjective( const vector<RestrictionsDataCollector>& restriction_data, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculateNetPresentCostInfrastructureObjective( const vector<UtilitiesDataCollector *>& utility_data, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculatePeakFinancialCostsObjective( const vector<UtilitiesDataCollector *>& utility_data, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculateWorseCaseCostsObjective( const vector<UtilitiesDataCollector *>& utility_data, vector<unsigned long> realizations = vector<unsigned long>(0)); }; #endif //TRIANGLEMODEL_OBJECTIVESCALCULATOR_H
/* * Generated by class-dump 3.1.2. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard. */ #import "_ABCreateStringWithAddressDictionary.h" @interface _TNDRUser : _ABCreateStringWithAddressDictionary { } + (id)keyPathsForValuesAffectingValueForKey:(id)fp8; + (id)entityInManagedObjectContext:(id)fp8; + (id)entityName; + (id)insertInManagedObjectContext:(id)fp8; - (id)photosSet; - (id)momentsSet; - (id)memberMatchesSet; - (id)groupSet; - (id)commonLikesSet; - (id)commonFriendsSet; - (void)setPrimitiveVerifiedValue:(BOOL)fp8; - (BOOL)primitiveVerifiedValue; - (void)setVerifiedValue:(BOOL)fp8; - (BOOL)verifiedValue; - (void)setPrimitiveTravelDistanceMilesValue:(float)fp8; - (float)primitiveTravelDistanceMilesValue; - (void)setTravelDistanceMilesValue:(float)fp8; - (float)travelDistanceMilesValue; - (void)setPrimitiveSuperLikedValue:(BOOL)fp8; - (BOOL)primitiveSuperLikedValue; - (void)setSuperLikedValue:(BOOL)fp8; - (BOOL)superLikedValue; - (void)setPrimitiveStaleValue:(BOOL)fp8; - (BOOL)primitiveStaleValue; - (void)setStaleValue:(BOOL)fp8; - (BOOL)staleValue; - (void)setPrimitiveShouldHideLastActiveValue:(BOOL)fp8; - (BOOL)primitiveShouldHideLastActiveValue; - (void)setShouldHideLastActiveValue:(BOOL)fp8; - (BOOL)shouldHideLastActiveValue; - (void)setPrimitiveShouldHideDistanceAwayValue:(BOOL)fp8; - (BOOL)primitiveShouldHideDistanceAwayValue; - (void)setShouldHideDistanceAwayValue:(BOOL)fp8; - (BOOL)shouldHideDistanceAwayValue; - (void)setPrimitiveSequenceNumberValue:(long long)fp8; - (long long)primitiveSequenceNumberValue; - (void)setSequenceNumberValue:(long long)fp8; - (long long)sequenceNumberValue; - (void)setPrimitiveLikedValue:(BOOL)fp8; - (BOOL)primitiveLikedValue; - (void)setLikedValue:(BOOL)fp8; - (BOOL)likedValue; - (void)setPrimitiveIsTravelingValue:(BOOL)fp8; - (BOOL)primitiveIsTravelingValue; - (void)setIsTravelingValue:(BOOL)fp8; - (BOOL)isTravelingValue; - (void)setPrimitiveIsSuperLikeUserValue:(BOOL)fp8; - (BOOL)primitiveIsSuperLikeUserValue; - (void)setIsSuperLikeUserValue:(BOOL)fp8; - (BOOL)isSuperLikeUserValue; - (void)setPrimitiveIsPlaceholderValue:(BOOL)fp8; - (BOOL)primitiveIsPlaceholderValue; - (void)setIsPlaceholderValue:(BOOL)fp8; - (BOOL)isPlaceholderValue; - (void)setPrimitiveIsCurrentUserValue:(BOOL)fp8; - (BOOL)primitiveIsCurrentUserValue; - (void)setIsCurrentUserValue:(BOOL)fp8; - (BOOL)isCurrentUserValue; - (void)setPrimitiveIsBrandValue:(BOOL)fp8; - (BOOL)primitiveIsBrandValue; - (void)setIsBrandValue:(BOOL)fp8; - (BOOL)isBrandValue; - (void)setPrimitiveInstagramMediaCountValue:(short)fp8; - (short)primitiveInstagramMediaCountValue; - (void)setInstagramMediaCountValue:(short)fp8; - (short)instagramMediaCountValue; - (void)setPrimitiveInstagramCompletedInitialFetchValue:(BOOL)fp8; - (BOOL)primitiveInstagramCompletedInitialFetchValue; - (void)setInstagramCompletedInitialFetchValue:(BOOL)fp8; - (BOOL)instagramCompletedInitialFetchValue; - (void)setPrimitiveGroupOnlyValue:(BOOL)fp8; - (BOOL)primitiveGroupOnlyValue; - (void)setGroupOnlyValue:(BOOL)fp8; - (BOOL)groupOnlyValue; - (void)setPrimitiveGenderValue:(BOOL)fp8; - (BOOL)primitiveGenderValue; - (void)setGenderValue:(BOOL)fp8; - (BOOL)genderValue; - (void)setPrimitiveFailedChoiceValue:(BOOL)fp8; - (BOOL)primitiveFailedChoiceValue; - (void)setFailedChoiceValue:(BOOL)fp8; - (BOOL)failedChoiceValue; - (void)setPrimitiveDistanceMilesValue:(float)fp8; - (float)primitiveDistanceMilesValue; - (void)setDistanceMilesValue:(float)fp8; - (float)distanceMilesValue; - (void)setPrimitiveDisplaySchoolYearValue:(BOOL)fp8; - (BOOL)primitiveDisplaySchoolYearValue; - (void)setDisplaySchoolYearValue:(BOOL)fp8; - (BOOL)displaySchoolYearValue; - (void)setPrimitiveCommonLikeCountValue:(short)fp8; - (short)primitiveCommonLikeCountValue; - (void)setCommonLikeCountValue:(short)fp8; - (short)commonLikeCountValue; - (void)setPrimitiveCommonFriendCountValue:(short)fp8; - (short)primitiveCommonFriendCountValue; - (void)setCommonFriendCountValue:(short)fp8; - (short)commonFriendCountValue; - (void)setPrimitiveCommonConnectionCountValue:(short)fp8; - (short)primitiveCommonConnectionCountValue; - (void)setCommonConnectionCountValue:(short)fp8; - (short)commonConnectionCountValue; - (void)setPrimitiveAlreadyMatchedValue:(BOOL)fp8; - (BOOL)primitiveAlreadyMatchedValue; - (void)setAlreadyMatchedValue:(BOOL)fp8; - (BOOL)alreadyMatchedValue; - (id)objectID; - (void)replacePhotosAtIndexes:(id)fp8 withPhotos:(id)fp12; - (void)replaceObjectInPhotosAtIndex:(unsigned int)fp8 withObject:(id)fp12; - (void)removePhotosAtIndexes:(id)fp8; - (void)insertPhotos:(id)fp8 atIndexes:(id)fp12; - (void)removeObjectFromPhotosAtIndex:(unsigned int)fp8; - (void)insertObject:(id)fp8 inPhotosAtIndex:(unsigned int)fp12; - (void)removePhotosObject:(id)fp8; - (void)addPhotosObject:(id)fp8; - (void)removePhotos:(id)fp8; - (void)addPhotos:(id)fp8; @end
#include "gui.h" int gui(){ return 0; }
/* atmega88_example.c */ #ifndef F_CPU #define F_CPU 8000000 #endif #include <avr/io.h> #include <stdio.h> #include <avr/interrupt.h> #include <avr/eeprom.h> #include <avr/sleep.h> /* * This demonstrate how to use the avr_mcu_section.h file The macro adds a section to the ELF file * with useful information for the simulator */ #include "avr_mcu_section.h" AVR_MCU(F_CPU, "atmega88"); /* * This small section tells simavr to generate a VCD trace dump with changes to these registers. * Opening it with gtkwave will show you the data being pumped out into the data register UDR0, and * the UDRE0 bit being set, then cleared */ const struct avr_mmcu_vcd_trace_t _mytrace[] _MMCU_ = { { AVR_MCU_VCD_SYMBOL("UDR0"), .what = (void*)&UDR0, }, { AVR_MCU_VCD_SYMBOL("UDRE0"), .mask = (1 << UDRE0), .what = (void*)&UCSR0A, }, }; /* declare this in a .eeprom ELF section */ uint32_t value EEMEM = 0xdeadbeef; static int uart_putchar(char c, FILE *stream) { if (c == '\n') uart_putchar('\r', stream); loop_until_bit_is_set(UCSR0A, UDRE0); UDR0 = c; return 0; } static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE); int main() { stdout = &mystdout; // read the eeprom value uint32_t c = eeprom_read_dword((void*)&value); printf("Read from eeprom 0x%08lx -- should be 0xdeadbeef\n", c); // change the eeprom eeprom_write_dword((void*)&value, 0xcafef00d); // re-read it c = eeprom_read_dword((void*)&value); printf("Read from eeprom 0x%08lx -- should be 0xcafef00d\n", c); // this quits the simulator, since interupts are off // this is a "feature" that allows running tests cases and exit sleep_cpu(); }
#ifndef SENSORMODULE_H #define SENSORMODULE_H // wrappes sensor access, eventual data polling and the publishing class SensorModule { public: SensorModule( shared_ptr<AbstractActiveSensor> sensor, shared_ptr<AbstractPublisher> publisher) : sensor(sensor), publisher(publisher) { sensor.setCallback(this->dataCallback); } virtual ~SensorModule(){;} // don't know if that will be needed in the end, rather // start/stop the active sensor from outside(if thats possible) //void start(); //void stop(); private: shared_ptr<ActiveSensor> sensor; shared_ptr<AbstractPublisher> publisher) void dataCallback(data) { publisher->publish(data); } }; #endif // #ifndef SENSORMODULE_H
#include <linux/kernel.h> #include <linux/sched.h> #include <linux/delay.h> #include <linux/grsecurity.h> #include <linux/grinternal.h> char *signames[] = { [SIGSEGV] = "Segmentation fault", [SIGILL] = "Illegal instruction", [SIGABRT] = "Abort", [SIGBUS] = "Invalid alignment/Bus error" }; void gr_log_signal(const int sig, const void *addr, const struct task_struct *t) { #ifdef CONFIG_GRKERNSEC_SIGNAL if (grsec_enable_signal && ((sig == SIGSEGV) || (sig == SIGILL) || (sig == SIGABRT) || (sig == SIGBUS))) { if (t->pid == current->pid) { gr_log_sig_addr(GR_DONT_AUDIT_GOOD, GR_UNISIGLOG_MSG, signames[sig], addr); } else { gr_log_sig_task(GR_DONT_AUDIT_GOOD, GR_DUALSIGLOG_MSG, t, sig); } } #endif return; } int gr_handle_signal(const struct task_struct *p, const int sig) { #ifdef CONFIG_GRKERNSEC if (current->pid > 1 && gr_check_protected_task(p)) { gr_log_sig_task(GR_DONT_AUDIT, GR_SIG_ACL_MSG, p, sig); return -EPERM; } else if (gr_pid_is_chrooted((struct task_struct *)p)) { return -EPERM; } #endif return 0; } void gr_handle_brute_attach(struct task_struct *p) { #ifdef CONFIG_GRKERNSEC_BRUTE read_lock(&tasklist_lock); read_lock(&grsec_exec_file_lock); if (p->real_parent && p->real_parent->exec_file == p->exec_file) p->real_parent->brute = 1; read_unlock(&grsec_exec_file_lock); read_unlock(&tasklist_lock); #endif return; } void gr_handle_brute_check(void) { #ifdef CONFIG_GRKERNSEC_BRUTE if (current->brute) msleep(30 * 1000); #endif return; }
// tf8036_bl.c : tex font drawing, 80 cols, 36 rows - baseline implementation #include <sys/time.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "GL/glfw.h" #include "util/sys.h" #include "util/fps.h" #include "util/win.h" #include "font/tfont.h" #include "tf8036_common.h" static const char* APP_TITLE = "tex font drawing, 80 cols, 36 rows - baseline implementation"; void draw_text() { int ch_rows = 36; int ch_h = 16; float x = 0; float y = win_height(); int i; for(i = 0; i < ch_rows; ++i) { x = 0; y -= ch_h; glPushMatrix(); glTranslatef(x, y, 0); const char* ln = test_line(i); tfont_draw_string(ln); glPopMatrix(); } } int main(int argc, char* argv[]) { init(APP_TITLE); // main loop int run = 1; while(run) { glClear(GL_COLOR_BUFFER_BIT); draw_text(); report_fps(); glfwSwapBuffers(); // error check error_check(); // exit check exit_check(&run); fps_inc_frames_drawn(); } glfwTerminate(); return 0; }
#ifndef MUSICQQQUERYALBUMREQUEST_H #define MUSICQQQUERYALBUMREQUEST_H /*************************************************************************** * This file is part of the TTK Music Player project * Copyright (C) 2015 - 2022 Greedysky Studio * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License along * with this program; If not, see <http://www.gnu.org/licenses/>. ***************************************************************************/ #include "musicqqqueryinterface.h" #include "musicqueryalbumrequest.h" /*! @brief The class of qq query album download data from net. * @author Greedysky <greedysky@163.com> */ class TTK_MODULE_EXPORT MusicQQQueryAlbumRequest : public MusicQueryAlbumRequest, private MusicQQQueryInterface { Q_OBJECT TTK_DECLARE_MODULE(MusicQQQueryAlbumRequest) public: /*! * Object contsructor. */ explicit MusicQQQueryAlbumRequest(QObject *parent = nullptr); /*! * Start to Search data from name and type. */ virtual void startToSearch(const QString &album) override final; /*! * Start to search data by given id. */ virtual void startToSingleSearch(const QString &artist) override final; public Q_SLOTS: /*! * Download data from net finished. */ virtual void downLoadFinished() override final; /*! * Download single data from net finished. */ void singleDownLoadFinished(); }; #endif // MUSICQQQUERYALBUMREQUEST_H
/****************************************************************************/ /// @file NIVissimSingleTypeParser_Signalgeberdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 /// @version $Id: NIVissimSingleTypeParser_Signalgeberdefinition.h 22608 2017-01-17 06:28:54Z behrisch $ /// // /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. // SUMO 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. // /****************************************************************************/ #ifndef NIVissimSingleTypeParser_Signalgeberdefinition_h #define NIVissimSingleTypeParser_Signalgeberdefinition_h // =========================================================================== // included modules // =========================================================================== #ifdef _MSC_VER #include <windows_config.h> #else #include <config.h> #endif #include <iostream> #include "../NIImporter_Vissim.h" // =========================================================================== // class definitions // =========================================================================== /** * @class NIVissimSingleTypeParser_Signalgeberdefinition * */ class NIVissimSingleTypeParser_Signalgeberdefinition : public NIImporter_Vissim::VissimSingleTypeParser { public: /// Constructor NIVissimSingleTypeParser_Signalgeberdefinition(NIImporter_Vissim& parent); /// Destructor ~NIVissimSingleTypeParser_Signalgeberdefinition(); /// Parses the data type from the given stream bool parse(std::istream& from); }; #endif /****************************************************************************/
/* * Copyright 1997, Regents of the University of Minnesota * * cmpfillin.c * * This file takes a graph and a fill-reducing ordering and computes * the fillin. * * Started 9/1/2004 * George * * $Id: cmpfillin.c 9982 2011-05-25 17:18:00Z karypis $ * */ #include "metisbin.h" /************************************************************************* * Let the game begin **************************************************************************/ int main(int argc, char *argv[]) { idx_t i; idx_t * perm, *iperm; graph_t *graph; params_t params; size_t maxlnz, opc; if (argc != 3) { printf("Usage: %s <GraphFile> <PermFile\n", argv[0]); exit(0); } params.filename = gk_strdup(argv[1]); graph = ReadGraph(&params); if (graph->nvtxs <= 0) { printf("Empty graph. Nothing to do.\n"); exit(0); } if (graph->ncon != 1) { printf("Ordering can only be applied to graphs with one constraint.\n"); exit(0); } /* Read the external iperm vector */ perm = imalloc(graph->nvtxs, "main: perm"); iperm = imalloc(graph->nvtxs, "main: iperm"); ReadPOVector(graph, argv[2], iperm); for (i = 0; i < graph->nvtxs; i++) { perm[iperm[i]] = i; } printf("**********************************************************************\n"); printf("%s", METISTITLE); printf("Graph Information ---------------------------------------------------\n"); printf(" Name: %s, #Vertices: %"PRIDX", #Edges: %"PRIDX"\n\n", argv[1], graph->nvtxs, graph->nedges / 2); printf("Fillin... -----------------------------------------------------------\n"); ComputeFillIn(graph, perm, iperm, &maxlnz, &opc); printf(" Nonzeros: %6.3le \tOperation Count: %6.3le\n", (double) maxlnz, (double) opc); printf("**********************************************************************\n"); FreeGraph(&graph); }
/* * Copyright (C) 2021 Yee Young Han <websearch@naver.com> (http://blog.naver.com/websearch) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _HTTP2_CLIENT_H_ #define _HTTP2_CLIENT_H_ #include "HttpMessage.h" #include "SipTcp.h" #include "TlsFunction.h" #include "Http2Conversion.h" #include "Http2FrameList.h" #include "Http2Packet.h" #ifdef WIN32 #if _MSC_VER == VC2008_VERSION #include "PcapSave.h" #endif #endif /** * @ingroup HttpStack * @brief HTTP/2 Ŭ¶óÀÌ¾ðÆ® */ class CHttp2Client { public: CHttp2Client(); ~CHttp2Client(); bool Connect( const char * pszIp, int iPort, const char * pszClientPemFileName = NULL, const char * pszPcapFileName = NULL ); bool Close(); bool DoGet( const char * pszPath, std::string & strOutputContentType, std::string & strOutputBody ); bool DoPost( const char * pszPath, HTTP_HEADER_LIST * pclsHeaderList, const char * pszInputContentType, const char * pszInputBody, int iInputBodyLen, std::string & strOutputContentType, std::string & strOutputBody ); int GetStatusCode(); private: bool Execute( CHttpMessage * pclsRequest, CHttpMessage * pclsResponse ); int Send( char * pszPacket, int iPacketLen ); int Recv( char * pszPacket, int iPacketSize ); bool RecvNonBlocking(); bool SendSettingsAck(); bool SendPingAck(); Socket m_hSocket; SSL * m_psttSsl; SSL_CTX * m_psttCtx; uint32_t m_iStreamIdentifier; CHttp2Conversion m_clsSendConversion; CHttp2Conversion m_clsRecvConversion; CHttp2FrameList m_clsFrameList; CHttp2Frame m_clsFrame; CHttp2Packet m_clsPacket; std::string m_strHost; pollfd m_sttPoll[1]; uint8_t m_szPacket[TCP_INIT_BUF_SIZE]; std::string m_strServerIp; int m_iServerPort; std::string m_strClientIp; int m_iClientPort; int m_iStatusCode; bool m_bHttpHeaderLog; #ifdef WIN32 #if _MSC_VER == VC2008_VERSION CPcapSave m_clsPcap; #endif #endif }; #endif
#include "../../../../../src/purchasing/inapppurchase/winrt/qwinrtinappproduct_p.h"
/* * Copyright (C) 2015 NIPE-SYSTEMS * Copyright (C) 2015 Jonas Krug * Copyright (C) 2015 Tim Gevers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __CORE_H__ #define __CORE_H__ #include <stdarg.h> #include <stdio.h> // #define CORE_FRAME_TIME 100000 // -> 10 fps, specified in microseconds (usleep) #define CORE_FRAME_TIME 75000 // -> 10 fps, specified in microseconds (usleep) typedef enum core_state_e { CORE_START_SCREEN, CORE_MENU, CORE_RUNNING, CORE_PAUSED, CORE_QR_CODE, CORE_WIN, CORE_GAME_OVER, CORE_SHUTDOWN } core_state_t; void core_init(void); void core_main(void); void core_cleanup(void); #ifdef DEBUG void core_debug(char *fmt, ...); void core_error(char *fmt, ...); #else #define core_debug(...) ((void)0) #define core_error(...) ((void)0) #endif /* DEBUG */ #endif /* __CORE_H__ */
/* PubSubClient.h - A simple client for MQTT. Nick O'Leary http://knolleary.net */ #ifndef PubSubClient_h #define PubSubClient_h #include <Arduino.h> #include "IPAddress.h" #include "Client.h" #include "Stream.h" #define MQTT_VERSION_3_1 3 #define MQTT_VERSION_3_1_1 4 // MQTT_VERSION : Pick the version //#define MQTT_VERSION MQTT_VERSION_3_1 #ifndef MQTT_VERSION #define MQTT_VERSION MQTT_VERSION_3_1_1 #endif // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE //#define MQTT_MAX_PACKET_SIZE 128 //#define MQTT_MAX_PACKET_SIZE 512 // Tasmota #define MQTT_MAX_PACKET_SIZE 1000 // Tasmota v5.11.1c #endif // MQTT_KEEPALIVE : keepAlive interval in Seconds #ifndef MQTT_KEEPALIVE #define MQTT_KEEPALIVE 15 #endif // MQTT_SOCKET_TIMEOUT: socket timeout interval in Seconds #ifndef MQTT_SOCKET_TIMEOUT #define MQTT_SOCKET_TIMEOUT 15 #endif // MQTT_MAX_TRANSFER_SIZE : limit how much data is passed to the network client // in each write call. Needed for the Arduino Wifi Shield. Leave undefined to // pass the entire MQTT packet in each write call. //#define MQTT_MAX_TRANSFER_SIZE 80 // Possible values for client.state() #define MQTT_CONNECTION_TIMEOUT -4 #define MQTT_CONNECTION_LOST -3 #define MQTT_CONNECT_FAILED -2 #define MQTT_DISCONNECTED -1 #define MQTT_CONNECTED 0 #define MQTT_CONNECT_BAD_PROTOCOL 1 #define MQTT_CONNECT_BAD_CLIENT_ID 2 #define MQTT_CONNECT_UNAVAILABLE 3 #define MQTT_CONNECT_BAD_CREDENTIALS 4 #define MQTT_CONNECT_UNAUTHORIZED 5 #define MQTTCONNECT 1 << 4 // Client request to connect to Server #define MQTTCONNACK 2 << 4 // Connect Acknowledgment #define MQTTPUBLISH 3 << 4 // Publish message #define MQTTPUBACK 4 << 4 // Publish Acknowledgment #define MQTTPUBREC 5 << 4 // Publish Received (assured delivery part 1) #define MQTTPUBREL 6 << 4 // Publish Release (assured delivery part 2) #define MQTTPUBCOMP 7 << 4 // Publish Complete (assured delivery part 3) #define MQTTSUBSCRIBE 8 << 4 // Client Subscribe request #define MQTTSUBACK 9 << 4 // Subscribe Acknowledgment #define MQTTUNSUBSCRIBE 10 << 4 // Client Unsubscribe request #define MQTTUNSUBACK 11 << 4 // Unsubscribe Acknowledgment #define MQTTPINGREQ 12 << 4 // PING Request #define MQTTPINGRESP 13 << 4 // PING Response #define MQTTDISCONNECT 14 << 4 // Client is Disconnecting #define MQTTReserved 15 << 4 // Reserved #define MQTTQOS0 (0 << 1) #define MQTTQOS1 (1 << 1) #define MQTTQOS2 (2 << 1) #ifdef ESP8266 #include <functional> #define MQTT_CALLBACK_SIGNATURE std::function<void(char*, uint8_t*, unsigned int)> callback #else #define MQTT_CALLBACK_SIGNATURE void (*callback)(char*, uint8_t*, unsigned int) #endif class PubSubClient { private: Client* _client; uint8_t buffer[MQTT_MAX_PACKET_SIZE]; uint16_t nextMsgId; unsigned long lastOutActivity; unsigned long lastInActivity; bool pingOutstanding; MQTT_CALLBACK_SIGNATURE; uint16_t readPacket(uint8_t*); boolean readByte(uint8_t * result); boolean readByte(uint8_t * result, uint16_t * index); boolean write(uint8_t header, uint8_t* buf, uint16_t length); uint16_t writeString(const char* string, uint8_t* buf, uint16_t pos); IPAddress ip; const char* domain; uint16_t port; Stream* stream; int _state; public: PubSubClient(); PubSubClient(Client& client); PubSubClient(IPAddress, uint16_t, Client& client); PubSubClient(IPAddress, uint16_t, Client& client, Stream&); PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client); PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&); PubSubClient(uint8_t *, uint16_t, Client& client); PubSubClient(uint8_t *, uint16_t, Client& client, Stream&); PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client); PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&); PubSubClient(const char*, uint16_t, Client& client); PubSubClient(const char*, uint16_t, Client& client, Stream&); PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client); PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&); PubSubClient& setServer(IPAddress ip, uint16_t port); PubSubClient& setServer(uint8_t * ip, uint16_t port); PubSubClient& setServer(const char * domain, uint16_t port); PubSubClient& setCallback(MQTT_CALLBACK_SIGNATURE); PubSubClient& setClient(Client& client); PubSubClient& setStream(Stream& stream); boolean connect(const char* id); boolean connect(const char* id, const char* user, const char* pass); boolean connect(const char* id, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage); boolean connect(const char* id, const char* user, const char* pass, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage); void disconnect(); boolean publish(const char* topic, const char* payload); boolean publish(const char* topic, const char* payload, boolean retained); boolean publish(const char* topic, const uint8_t * payload, unsigned int plength); boolean publish(const char* topic, const uint8_t * payload, unsigned int plength, boolean retained); boolean publish_P(const char* topic, const uint8_t * payload, unsigned int plength, boolean retained); boolean subscribe(const char* topic); boolean subscribe(const char* topic, uint8_t qos); boolean unsubscribe(const char* topic); boolean loop(); boolean connected(); int state(); }; #endif
/** **************************************************************************************** * * @file user_profiles_config.h * * @brief Configuration file for the profiles used in the application. * * Copyright (C) 2015. Dialog Semiconductor Ltd, unpublished work. This computer * program includes Confidential, Proprietary Information and is a Trade Secret of * Dialog Semiconductor Ltd. All use, disclosure, and/or reproduction is prohibited * unless authorized in writing. All Rights Reserved. * * <bluetooth.support@diasemi.com> and contributors. * **************************************************************************************** */ #ifndef _USER_PROFILES_CONFIG_H_ #define _USER_PROFILES_CONFIG_H_ /** **************************************************************************************** * @defgroup APP_CONFIG * @ingroup APP * @brief Application configuration file * * This file contains the configuaration of the profiles used by the application. * * @{ **************************************************************************************** */ /* * INCLUDE FILES **************************************************************************************** */ /// Add below the profiles that the application wishes to use by including the <profile_name>.h file. /* * PROFILE CONFIGUARTION **************************************************************************************** */ /// Add profile specific configurations /* SPOTAR configurations * ----------------------------------------------------------------------------------------- */ #define SPOTAR_PATCH_AREA 1 // Placed in the RetRAM when SPOTAR_PATCH_AREA is 0 and in SYSRAM when 1 /* DISS profile configurations * ----------------------------------------------------------------------------------------- */ /// Manufacturer Name (up to 18 chars) #define APP_DIS_MANUFACTURER_NAME ("Dialog Semi") #define APP_DIS_MANUFACTURER_NAME_LEN (11) /// Model Number String (up to 18 chars) #define APP_DIS_MODEL_NB_STR ("DA1458x") #define APP_DIS_MODEL_NB_STR_LEN (7) /// System ID - LSB -> MSB (FIXME) #define APP_DIS_SYSTEM_ID ("\x12\x34\x56\xFF\xFE\x9A\xBC\xDE") #define APP_DIS_SYSTEM_ID_LEN (8) #define APP_DIS_SW_REV DA14580_REFDES_SW_VERSION #define APP_DIS_FIRM_REV DA14580_SW_VERSION #define APP_DIS_FEATURES (DIS_MANUFACTURER_NAME_CHAR_SUP | DIS_MODEL_NB_STR_CHAR_SUP | DIS_SYSTEM_ID_CHAR_SUP | DIS_SW_REV_STR_CHAR_SUP | DIS_FIRM_REV_STR_CHAR_SUP | DIS_PNP_ID_CHAR_SUP) /// PNP ID #define APP_DISS_PNP_COMPANY_ID_TYPE (0x01) #define APP_DISS_PNP_VENDOR_ID (0x00D2) #define APP_DISS_PNP_PRODUCT_ID (0x0580) #define APP_DISS_PNP_PRODUCT_VERSION (0x0100) /* BASS profile configurations * ----------------------------------------------------------------------------------------- */ //Measured in timer units (10ms) #define APP_BASS_POLL_INTERVAL (6000) // (6000*10ms)/60sec = Every 1 minutes /// @} APP_CONFIG #endif // _USER_PROFILES_CONFIG_H_
//===----------------------- config_elast.h -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_CONFIG_ELAST #define _LIBCPP_CONFIG_ELAST #include <__config> #if defined(_LIBCPP_MSVCRT) #include <stdlib.h> #else #include <errno.h> #endif #if defined(ELAST) #define _LIBCPP_ELAST ELAST #elif defined(_NEWLIB_VERSION) #define _LIBCPP_ELAST __ELASTERROR #elif defined(__Fuchsia__) // No _LIBCPP_ELAST needed on Fuchsia #elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_ELAST 4095 #elif defined(__APPLE__) // No _LIBCPP_ELAST needed on Apple #elif defined(__sun__) #define _LIBCPP_ELAST ESTALE #elif defined(_LIBCPP_MSVCRT) #define _LIBCPP_ELAST (_sys_nerr - 1) #else // Warn here so that the person doing the libcxx port has an easier time: #warning ELAST for this platform not yet implemented #endif #endif // _LIBCPP_CONFIG_ELAST
/* This file is part of Darling. Copyright (C) 2020 Lubos Dolezel Darling 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. Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _AUDIO_FILE_FORMAT_MANAGER_H #define _AUDIO_FILE_FORMAT_MANAGER_H #include <AudioToolbox/AudioComponent.h> #include <AudioToolbox/AudioFileComponent.h> #include <vector> #include <string> #include <set> #include <list> #include <unordered_map> class __attribute__((visibility("hidden"))) AudioFileFormatManager { public: static AudioFileFormatManager* instance(); std::set<UInt32> availableFormatIDs(UInt32 fileType) const; struct ComponentInfo { AudioComponentDescription acd; UInt32 fileType; // container type std::string name; std::vector<std::string> utis, extensions, mimeTypes; // codec type std::unordered_map<UInt32, std::vector<AudioStreamBasicDescription>> formatDescriptions; bool canRead, canWrite; }; const ComponentInfo* fileType(UInt32 type) const; std::set<UInt32> types(bool writableTypes) const; std::set<UInt32> typesForMIME(const char* mime) const; std::set<UInt32> typesForUTI(const char* uti) const; std::set<UInt32> typesForExtension(const char* ext) const; std::set<std::string> allMIMEs() const; std::set<std::string> allUTIs() const; std::set<std::string> allExtensions() const; private: AudioFileFormatManager(); void buildDatabase(); void analyzeAudioFileComponent(AudioFileComponent component); void registerComponent(const ComponentInfo& ci); static void addToMap(std::unordered_map<std::string, std::vector<ComponentInfo*>>& map, const std::string& key, ComponentInfo* ci); static std::set<UInt32> findTypes(const std::unordered_map<std::string, std::vector<ComponentInfo*>>& map, const char* key); template <typename K, typename V> std::set<K> allKeys(const std::unordered_map<K,V>& map) const { std::set<K> rv; for (auto const& [k, v] : map) rv.insert(k); return rv; } private: std::list<ComponentInfo> m_components; std::unordered_map<UInt32, ComponentInfo*> m_fileTypeMap; std::unordered_map<std::string, std::vector<ComponentInfo*>> m_mimeMap, m_utiMap, m_extensionMap; }; #endif
/* SSSD Utilities to for tha pam_data structure Authors: Sumit Bose <sbose@redhat.com> Copyright (C) 2009 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "providers/data_provider.h" #define PAM_SAFE_ITEM(item) item ? item : "not set" static const char *pamcmd2str(int cmd) { switch (cmd) { case SSS_PAM_AUTHENTICATE: return "PAM_AUTHENTICATE"; case SSS_PAM_SETCRED: return "PAM_SETCRED"; case SSS_PAM_ACCT_MGMT: return "PAM_ACCT_MGMT"; case SSS_PAM_OPEN_SESSION: return "PAM_OPEN_SESSION"; case SSS_PAM_CLOSE_SESSION: return "PAM_CLOSE_SESSION"; case SSS_PAM_CHAUTHTOK: return "PAM_CHAUTHTOK"; case SSS_PAM_CHAUTHTOK_PRELIM: return "PAM_CHAUTHTOK_PRELIM"; case SSS_PAM_PREAUTH: return "SSS_PAM_PREAUTH"; default: return "UNKNOWN"; } } int pam_data_destructor(void *ptr) { struct pam_data *pd = talloc_get_type(ptr, struct pam_data); /* make sure to wipe any password from memory before freeing */ sss_authtok_wipe_password(pd->authtok); sss_authtok_wipe_password(pd->newauthtok); return 0; } struct pam_data *create_pam_data(TALLOC_CTX *mem_ctx) { struct pam_data *pd; pd = talloc_zero(mem_ctx, struct pam_data); if (pd == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; } pd->authtok = sss_authtok_new(pd); if (pd->authtok == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; } pd->newauthtok = sss_authtok_new(pd); if (pd->newauthtok == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; } talloc_set_destructor((TALLOC_CTX *) pd, pam_data_destructor); return pd; failed: talloc_free(pd); return NULL; } errno_t copy_pam_data(TALLOC_CTX *mem_ctx, struct pam_data *src, struct pam_data **dst) { struct pam_data *pd = NULL; errno_t ret; pd = create_pam_data(mem_ctx); if (pd == NULL) { ret = ENOMEM; goto failed; } pd->cmd = src->cmd; pd->priv = src->priv; pd->domain = talloc_strdup(pd, src->domain); if (pd->domain == NULL && src->domain != NULL) { ret = ENOMEM; goto failed; } pd->user = talloc_strdup(pd, src->user); if (pd->user == NULL && src->user != NULL) { ret = ENOMEM; goto failed; } pd->service = talloc_strdup(pd, src->service); if (pd->service == NULL && src->service != NULL) { ret = ENOMEM; goto failed; } pd->tty = talloc_strdup(pd, src->tty); if (pd->tty == NULL && src->tty != NULL) { ret = ENOMEM; goto failed; } pd->ruser = talloc_strdup(pd, src->ruser); if (pd->ruser == NULL && src->ruser != NULL) { ret = ENOMEM; goto failed; } pd->rhost = talloc_strdup(pd, src->rhost); if (pd->rhost == NULL && src->rhost != NULL) { ret = ENOMEM; goto failed; } pd->cli_pid = src->cli_pid; /* if structure pam_data was allocated on stack and zero initialized, * than src->authtok and src->newauthtok are NULL, therefore * instead of copying, new empty authtok will be created. */ if (src->authtok) { ret = sss_authtok_copy(src->authtok, pd->authtok); if (ret) { goto failed; } } else { pd->authtok = sss_authtok_new(pd); if (pd->authtok == NULL) { ret = ENOMEM; goto failed; } } if (src->newauthtok) { ret = sss_authtok_copy(src->newauthtok, pd->newauthtok); if (ret) { goto failed; } } else { pd->newauthtok = sss_authtok_new(pd); if (pd->newauthtok == NULL) { ret = ENOMEM; goto failed; } } *dst = pd; return EOK; failed: talloc_free(pd); DEBUG(SSSDBG_CRIT_FAILURE, "copy_pam_data failed: (%d) %s.\n", ret, strerror(ret)); return ret; } void pam_print_data(int l, struct pam_data *pd) { DEBUG(l, "command: %s\n", pamcmd2str(pd->cmd)); DEBUG(l, "domain: %s\n", PAM_SAFE_ITEM(pd->domain)); DEBUG(l, "user: %s\n", PAM_SAFE_ITEM(pd->user)); DEBUG(l, "service: %s\n", PAM_SAFE_ITEM(pd->service)); DEBUG(l, "tty: %s\n", PAM_SAFE_ITEM(pd->tty)); DEBUG(l, "ruser: %s\n", PAM_SAFE_ITEM(pd->ruser)); DEBUG(l, "rhost: %s\n", PAM_SAFE_ITEM(pd->rhost)); DEBUG(l, "authtok type: %d\n", sss_authtok_get_type(pd->authtok)); DEBUG(l, "newauthtok type: %d\n", sss_authtok_get_type(pd->newauthtok)); DEBUG(l, "priv: %d\n", pd->priv); DEBUG(l, "cli_pid: %d\n", pd->cli_pid); DEBUG(l, "logon name: %s\n", PAM_SAFE_ITEM(pd->logon_name)); } int pam_add_response(struct pam_data *pd, enum response_type type, int len, const uint8_t *data) { struct response_data *new; new = talloc(pd, struct response_data); if (new == NULL) return ENOMEM; new->type = type; new->len = len; new->data = talloc_memdup(pd, data, len); if (new->data == NULL) return ENOMEM; new->do_not_send_to_client = false; new->next = pd->resp_list; pd->resp_list = new; return EOK; }
/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ #ifndef AOM_AV1_DECODER_DECODEFRAME_H_ #define AOM_AV1_DECODER_DECODEFRAME_H_ #ifdef __cplusplus extern "C" { #endif struct AV1Decoder; struct aom_read_bit_buffer; struct ThreadData; // Reads the middle part of the sequence header OBU (from // frame_width_bits_minus_1 to enable_restoration) into seq_params. // Reports errors by calling rb->error_handler() or aom_internal_error(). void av1_read_sequence_header(AV1_COMMON *cm, struct aom_read_bit_buffer *rb, SequenceHeader *seq_params); void av1_read_frame_size(struct aom_read_bit_buffer *rb, int num_bits_width, int num_bits_height, int *width, int *height); BITSTREAM_PROFILE av1_read_profile(struct aom_read_bit_buffer *rb); // Returns 0 on success. Sets pbi->common.error.error_code and returns -1 on // failure. int av1_check_trailing_bits(struct AV1Decoder *pbi, struct aom_read_bit_buffer *rb); // On success, returns the frame header size. On failure, calls // aom_internal_error and does not return. uint32_t av1_decode_frame_headers_and_setup(struct AV1Decoder *pbi, struct aom_read_bit_buffer *rb, int trailing_bits_present); void av1_decode_tg_tiles_and_wrapup(struct AV1Decoder *pbi, const uint8_t *data, const uint8_t *data_end, const uint8_t **p_data_end, int start_tile, int end_tile, int initialize_flag); // Implements the color_config() function in the spec. Reports errors by // calling rb->error_handler() or aom_internal_error(). void av1_read_color_config(struct aom_read_bit_buffer *rb, int allow_lowbitdepth, SequenceHeader *seq_params, struct aom_internal_error_info *error_info); // Implements the timing_info() function in the spec. Reports errors by calling // rb->error_handler() or aom_internal_error(). void av1_read_timing_info_header(aom_timing_info_t *timing_info, struct aom_internal_error_info *error, struct aom_read_bit_buffer *rb); // Implements the decoder_model_info() function in the spec. Reports errors by // calling rb->error_handler(). void av1_read_decoder_model_info(aom_dec_model_info_t *decoder_model_info, struct aom_read_bit_buffer *rb); // Implements the operating_parameters_info() function in the spec. Reports // errors by calling rb->error_handler(). void av1_read_op_parameters_info(aom_dec_model_op_parameters_t *op_params, int buffer_delay_length, struct aom_read_bit_buffer *rb); struct aom_read_bit_buffer *av1_init_read_bit_buffer( struct AV1Decoder *pbi, struct aom_read_bit_buffer *rb, const uint8_t *data, const uint8_t *data_end); void av1_free_mc_tmp_buf(struct ThreadData *thread_data); void av1_set_single_tile_decoding_mode(AV1_COMMON *const cm); #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AV1_DECODER_DECODEFRAME_H_
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo * This benchmark is part of SWSC */ #include <assert.h> #include <stdint.h> #include <stdatomic.h> #include <pthread.h> atomic_int vars[3]; atomic_int atom_0_r3_0; atomic_int atom_1_r6_0; void *t0(void *arg){ label_1:; atomic_store_explicit(&vars[0], 1, memory_order_seq_cst); int v2_r3 = atomic_load_explicit(&vars[1], memory_order_seq_cst); int v13 = (v2_r3 == 0); atomic_store_explicit(&atom_0_r3_0, v13, memory_order_seq_cst); return NULL; } void *t1(void *arg){ label_2:; atomic_store_explicit(&vars[1], 1, memory_order_seq_cst); int v4_r3 = atomic_load_explicit(&vars[2], memory_order_seq_cst); int v6_r5 = atomic_load_explicit(&vars[2], memory_order_seq_cst); int v7_cmpeq = (v6_r5 == v6_r5); if (v7_cmpeq) goto lbl_LC00; else goto lbl_LC00; lbl_LC00:; int v9_r6 = atomic_load_explicit(&vars[0], memory_order_seq_cst); int v14 = (v9_r6 == 0); atomic_store_explicit(&atom_1_r6_0, v14, memory_order_seq_cst); return NULL; } int main(int argc, char *argv[]){ pthread_t thr0; pthread_t thr1; atomic_init(&vars[2], 0); atomic_init(&vars[1], 0); atomic_init(&vars[0], 0); atomic_init(&atom_0_r3_0, 0); atomic_init(&atom_1_r6_0, 0); pthread_create(&thr0, NULL, t0, NULL); pthread_create(&thr1, NULL, t1, NULL); pthread_join(thr0, NULL); pthread_join(thr1, NULL); int v10 = atomic_load_explicit(&atom_0_r3_0, memory_order_seq_cst); int v11 = atomic_load_explicit(&atom_1_r6_0, memory_order_seq_cst); int v12_conj = v10 & v11; if (v12_conj == 1) assert(0); return 0; }
/* RetroArch - A frontend for libretro. * Copyright (c) 2011-2016 - Daniel De Matteis * * RetroArch 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 Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch 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 RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #ifndef __DRM_COMMON_H #define __DRM_COMMON_H #include <stdint.h> #include <stddef.h> #include <xf86drm.h> #include <xf86drmMode.h> #include <poll.h> #include <boolean.h> #include <retro_inline.h> #ifdef __cplusplus extern "C" { #endif extern uint32_t g_connector_id; extern int g_drm_fd; extern uint32_t g_crtc_id; extern struct pollfd g_drm_fds; extern drmModeConnector *g_drm_connector; extern drmModeModeInfo *g_drm_mode; extern drmEventContext g_drm_evctx; bool drm_get_encoder(int fd); /* Restore the original CRTC. */ void drm_restore_crtc(void); bool drm_get_resources(int fd); bool drm_get_connector(int id); void drm_setup(int fd); void drm_free(void); static INLINE bool drm_wait_flip(int timeout) { g_drm_fds.revents = 0; if (poll(&g_drm_fds, 1, timeout) < 0) return false; if (g_drm_fds.revents & (POLLHUP | POLLERR)) return false; if (g_drm_fds.revents & POLLIN) { drmHandleEvent(g_drm_fd, &g_drm_evctx); return true; } return false; } #ifdef __cplusplus } #endif #endif
/* * HackRFFrontend.h * * Created on: 26/02/2017 * Author: Lucas Teske */ #if 0 #ifndef SRC_HACKRFFRONTEND_H_ #define SRC_HACKRFFRONTEND_H_ #include "FrontendDevice.h" #include <libhackrf/hackrf.h> class HackRFFrontend: public FrontendDevice { private: std::function<void(void*data, int length, int type)> cb; hackrf_device *device; int deviceNumber; static const std::string FrontendName; static const std::vector<uint32_t> supportedSampleRates; static int callback(hackrf_transfer* transfer); uint8_t lnaGain; uint8_t vgaGain; uint8_t mixerGain; uint32_t centerFrequency; uint32_t sampleRate; float *buffer; float lut[256]; int bufferLength; float alpha; float iavg; float qavg; public: static void Initialize(); static void DeInitialize(); HackRFFrontend(int deviceNum); virtual ~HackRFFrontend(); uint32_t SetSampleRate(uint32_t sampleRate) override; uint32_t SetCenterFrequency(uint32_t centerFrequency) override; const std::vector<uint32_t>& GetAvailableSampleRates() override; void Start() override; void Stop() override; void SetAGC(bool agc) override; void SetLNAGain(uint8_t value) override; void SetVGAGain(uint8_t value) override; void SetMixerGain(uint8_t value) override; uint32_t GetCenterFrequency() override; const std::string &GetName() override; uint32_t GetSampleRate() override; void SetSamplesAvailableCallback(std::function<void(void*data, int length, int type)> cb) override; }; #endif /* SRC_HACKRFFRONTEND_H_ */ #endif
// Generated by gencpp from file rosserial_msgs/RequestParamRequest.msg // DO NOT EDIT! #ifndef ROSSERIAL_MSGS_MESSAGE_REQUESTPARAMREQUEST_H #define ROSSERIAL_MSGS_MESSAGE_REQUESTPARAMREQUEST_H #include <string> #include <vector> #include <map> #include <ros/types.h> #include <ros/serialization.h> #include <ros/builtin_message_traits.h> #include <ros/message_operations.h> namespace rosserial_msgs { template <class ContainerAllocator> struct RequestParamRequest_ { typedef RequestParamRequest_<ContainerAllocator> Type; RequestParamRequest_() : name() { } RequestParamRequest_(const ContainerAllocator& _alloc) : name(_alloc) { (void)_alloc; } typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _name_type; _name_type name; typedef boost::shared_ptr< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > Ptr; typedef boost::shared_ptr< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> const> ConstPtr; }; // struct RequestParamRequest_ typedef ::rosserial_msgs::RequestParamRequest_<std::allocator<void> > RequestParamRequest; typedef boost::shared_ptr< ::rosserial_msgs::RequestParamRequest > RequestParamRequestPtr; typedef boost::shared_ptr< ::rosserial_msgs::RequestParamRequest const> RequestParamRequestConstPtr; // constants requiring out of line definition template<typename ContainerAllocator> std::ostream& operator<<(std::ostream& s, const ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> & v) { ros::message_operations::Printer< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> >::stream(s, "", v); return s; } } // namespace rosserial_msgs namespace ros { namespace message_traits { // BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': False} // {'rosserial_msgs': ['/home/pi/Documents/desenvolvimentoRos/src/rosserial/rosserial_msgs/msg']} // !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types'] template <class ContainerAllocator> struct IsFixedSize< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > : FalseType { }; template <class ContainerAllocator> struct IsFixedSize< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> const> : FalseType { }; template <class ContainerAllocator> struct IsMessage< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > : TrueType { }; template <class ContainerAllocator> struct IsMessage< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> const> : TrueType { }; template <class ContainerAllocator> struct HasHeader< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > : FalseType { }; template <class ContainerAllocator> struct HasHeader< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> const> : FalseType { }; template<class ContainerAllocator> struct MD5Sum< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > { static const char* value() { return "c1f3d28f1b044c871e6eff2e9fc3c667"; } static const char* value(const ::rosserial_msgs::RequestParamRequest_<ContainerAllocator>&) { return value(); } static const uint64_t static_value1 = 0xc1f3d28f1b044c87ULL; static const uint64_t static_value2 = 0x1e6eff2e9fc3c667ULL; }; template<class ContainerAllocator> struct DataType< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > { static const char* value() { return "rosserial_msgs/RequestParamRequest"; } static const char* value(const ::rosserial_msgs::RequestParamRequest_<ContainerAllocator>&) { return value(); } }; template<class ContainerAllocator> struct Definition< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > { static const char* value() { return "string name\n\ \n\ "; } static const char* value(const ::rosserial_msgs::RequestParamRequest_<ContainerAllocator>&) { return value(); } }; } // namespace message_traits } // namespace ros namespace ros { namespace serialization { template<class ContainerAllocator> struct Serializer< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > { template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m) { stream.next(m.name); } ROS_DECLARE_ALLINONE_SERIALIZER }; // struct RequestParamRequest_ } // namespace serialization } // namespace ros namespace ros { namespace message_operations { template<class ContainerAllocator> struct Printer< ::rosserial_msgs::RequestParamRequest_<ContainerAllocator> > { template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::rosserial_msgs::RequestParamRequest_<ContainerAllocator>& v) { s << indent << "name: "; Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.name); } }; } // namespace message_operations } // namespace ros #endif // ROSSERIAL_MSGS_MESSAGE_REQUESTPARAMREQUEST_H
#include "pyc_code.h" #include "pyc_module.h" #include "data.h" namespace Pyc { enum Opcode { /* No parameter word */ STOP_CODE, POP_TOP, ROT_TWO, ROT_THREE, DUP_TOP, DUP_TOP_TWO, UNARY_POSITIVE, UNARY_NEGATIVE, UNARY_NOT, UNARY_CONVERT, UNARY_CALL, UNARY_INVERT, BINARY_POWER, BINARY_MULTIPLY, BINARY_DIVIDE, BINARY_MODULO, BINARY_ADD, BINARY_SUBTRACT, BINARY_SUBSCR, BINARY_CALL, SLICE_0, SLICE_1, SLICE_2, SLICE_3, STORE_SLICE_0, STORE_SLICE_1, STORE_SLICE_2, STORE_SLICE_3, DELETE_SLICE_0, DELETE_SLICE_1, DELETE_SLICE_2, DELETE_SLICE_3, STORE_SUBSCR, DELETE_SUBSCR, BINARY_LSHIFT, BINARY_RSHIFT, BINARY_AND, BINARY_XOR, BINARY_OR, PRINT_EXPR, PRINT_ITEM, PRINT_NEWLINE, BREAK_LOOP, RAISE_EXCEPTION, LOAD_LOCALS, RETURN_VALUE, LOAD_GLOBALS, EXEC_STMT, BUILD_FUNCTION, POP_BLOCK, END_FINALLY, BUILD_CLASS, ROT_FOUR, NOP, LIST_APPEND, BINARY_FLOOR_DIVIDE, BINARY_TRUE_DIVIDE, INPLACE_FLOOR_DIVIDE, INPLACE_TRUE_DIVIDE, STORE_MAP, INPLACE_ADD, INPLACE_SUBTRACT, INPLACE_MULTIPLY, INPLACE_DIVIDE, INPLACE_MODULO, INPLACE_POWER, GET_ITER, PRINT_ITEM_TO, PRINT_NEWLINE_TO, INPLACE_LSHIFT, INPLACE_RSHIFT, INPLACE_AND, INPLACE_XOR, INPLACE_OR, WITH_CLEANUP, IMPORT_STAR, YIELD_VALUE, LOAD_BUILD_CLASS, STORE_LOCALS, POP_EXCEPT, SET_ADD, YIELD_FROM, /* Has parameter word */ PYC_HAVE_ARG, STORE_NAME_A = PYC_HAVE_ARG, DELETE_NAME_A, UNPACK_TUPLE_A, UNPACK_LIST_A, UNPACK_ARG_A, STORE_ATTR_A, DELETE_ATTR_A, STORE_GLOBAL_A, DELETE_GLOBAL_A, UNPACK_VARARG_A, LOAD_CONST_A, LOAD_NAME_A, BUILD_TUPLE_A, BUILD_LIST_A, BUILD_MAP_A, LOAD_ATTR_A, COMPARE_OP_A, IMPORT_NAME_A, IMPORT_FROM_A, JUMP_FORWARD_A, JUMP_IF_FALSE_A, JUMP_IF_TRUE_A, JUMP_ABSOLUTE_A, FOR_LOOP_A, LOAD_LOCAL_A, LOAD_GLOBAL_A, SET_FUNC_ARGS_A, SETUP_LOOP_A, SETUP_EXCEPT_A, SETUP_FINALLY_A, RESERVE_FAST_A, LOAD_FAST_A, STORE_FAST_A, DELETE_FAST_A, SET_LINENO_A, RAISE_VARARGS_A, CALL_FUNCTION_A, MAKE_FUNCTION_A, BUILD_SLICE_A, CALL_FUNCTION_VAR_A, CALL_FUNCTION_KW_A, CALL_FUNCTION_VAR_KW_A, UNPACK_SEQUENCE_A, FOR_ITER_A, DUP_TOPX_A, BUILD_SET_A, JUMP_IF_FALSE_OR_POP_A, JUMP_IF_TRUE_OR_POP_A, POP_JUMP_IF_FALSE_A, POP_JUMP_IF_TRUE_A, CONTINUE_LOOP_A, MAKE_CLOSURE_A, LOAD_CLOSURE_A, LOAD_DEREF_A, STORE_DEREF_A, DELETE_DEREF_A, EXTENDED_ARG_A, SETUP_WITH_A, SET_ADD_A, MAP_ADD_A, UNPACK_EX_A, LIST_APPEND_A, PYC_LAST_OPCODE, PYC_INVALID_OPCODE = -1, }; const char* OpcodeName(int opcode); int ByteToOpcode(int maj, int min, int opcode); bool IsConstArg(int opcode); bool IsNameArg(int opcode); bool IsVarNameArg(int opcode); bool IsCellArg(int opcode); bool IsJumpOffsetArg(int opcode); } void print_const(PycRef<PycObject> obj, PycModule* mod); void bc_next(PycBuffer& source, PycRef<PycCode> code, PycModule* mod, int& opcode, int& operand, int& pos, bool is_disasm); void bc_disasm(PycRef<PycCode> code, PycModule* mod, int indent);
#ifndef __lockpick__ #define __lockpick__ // Libraries #include <unistd.h> #ifdef __graphics__ #include <passe_par_tout.h> #endif namespace lockpick { struct vector { // Members double x; double y; // Constructors vector(); vector(double x, double y); }; struct color { // Members unsigned int red, green, blue; // Constructors color(); color(unsigned int red, unsigned int green, unsigned int blue); }; class window { // Members int _id; protected: // Static members static bool __started; static char * __default_title; static int __default_width; static int __default_height; static int __window_count; public: // Constructors window(const char * title = nullptr, int width = __default_width, int height = __default_height, int position_x = 0, int position_y = 0, color background = color(255, 255, 255), int frame_width_percentage = 95, int frame_height_percentage = 95); // Destructor ~window(); // Methods void ellipse(vector center, vector axes, bool fill = false); void arc(vector center, vector axes, double initial_ang, double amp, double incl = 360, bool fill = false); void circle(vector center, double radius, bool fill = false, int c = 0); void line(vector from, vector to); void text(char * c, vector x); void colors(int n); // Static methods static void set_default_title(const char * title); static void set_default_size(int width, int height); static void wait_enter(); static void wait_click(); void flush(); void clear(); private: // Static private methods static void start(); }; }; #endif
/* * Copyright(C) 2016 Davidson Francis <davidsondfgl@gmail.com> * * This file is part of Nanvix. * * Nanvix 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. * * Nanvix 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 Nanvix. If not, see <http://www.gnu.org/licenses/>. */ /* $NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ /*- * Copyright (c)1999 Citrus Project, * 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 THE AUTHOR 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 AUTHOR 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. * * citrus Id: wcscpy.c,v 1.2 2000/12/21 04:51:09 itojun Exp */ #include <_ansi.h> #include <wchar.h> /** * @brief Copies a wide-character string, returning a pointer to its end. * * @details Copies the wide-character string pointed to by @p s2 (including * the terminating null wide-character code) into the array pointed to by @p s1. * * @return Returns a pointer to the terminating null wide-character code copied * into the @p s1 buffer. */ wchar_t * wcscpy(wchar_t *restrict s1, const wchar_t *restrict s2) { wchar_t *p; _CONST wchar_t *q; *s1 = '\0'; p = s1; q = s2; while (*q) *p++ = *q++; *p = '\0'; return s1; }
/* * Copyright (C) 2006-2016 Christopho, Solarus - http://www.solarus-games.org * * Solarus 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. * * Solarus 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 SOLARUS_HERO_VICTORY_STATE_H #define SOLARUS_HERO_VICTORY_STATE_H #include "solarus/hero/BaseState.h" #include <cstdint> namespace Solarus { /** * \brief The victory state of the hero. */ class Hero::VictoryState: public Hero::BaseState { public: VictoryState(Hero& hero, const ScopedLuaRef& callback_ref); virtual void start(const State* previous_state) override; virtual void stop(const State* next_state) override; virtual void update() override; virtual void set_suspended(bool suspended) override; private: uint32_t end_victory_date; /**< Date when the victory animation stops. */ bool finished; /**< Indicates that the victory sequence is finished. */ ScopedLuaRef callback_ref; /**< Lua ref of a function to call when the sequence finishes. */ }; } #endif
#include <cassert> #include "UnitTest/UnitTest.h" #include "../src/CacheManager.h" using namespace std; class TestCacheManager : public TestClass<TestCacheManager> { public: TestCacheManager(); ~TestCacheManager(); bool ModuleCache(); bool ConfigCache(); bool ParamCache(); bool DeviceCache(); bool AdvanceFormatCache(); bool AdvanceConfigCache(); bool QueueCache(); CacheManager m_CacheManager; };
/* ------------------------------------------------------------------------- // File Name : InternalStruct.h // Author : Zhang Fan // Create Time : 2013-3-18 18:22:47 // Description : // // -----------------------------------------------------------------------*/ #ifndef __INTERNALSTRUCT_H__ #define __INTERNALSTRUCT_H__ #include "../LibKss/CrossPlatformConfig.h" //------------------------------------------------------------------------- namespace KSS { struct BlockMeta { std::string blockMeta; bool existed; std::string commitMeta; }; typedef std::vector<BlockMeta> BlockMetaList; struct BlockDownloadInfo { std::string SHA1; UInt32 size; std::vector<std::string> urls; }; typedef std::vector<BlockDownloadInfo> BlockDownloadInfoList; } //-------------------------------------------------------------------------- #endif /* __INTERNALSTRUCT_H__ */
/*** * This file is part of rtorrent-cli * Copyright (C) 2013 Damir Jelić * * 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 scgi_proxy #define scgi_proxy int scgi_create_transport(int *sockfd, const char *host, const char *port); /* This function should work over a UNIX socket int scgi_create_transportu(int *sockfd, const char *file); */ int scgi_make_call(int *sockfd, char *msg, int msg_length, char **body); #endif
/* Graffik Motion Control Application Copyright (c) 2011-2013 Dynamic Perception This file is part of Graffik. Graffik 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. Graffik 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 Graffik. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MOTIONAREA_H #define MOTIONAREA_H #include <QWidget> #include <QFrame> #include <QPainter> #include <QPaintEvent> #include <QRect> #include <QList> #include <QTimer> #include <QToolTip> #include <QPoint> #include <QPen> #include <QString> #include <QLinearGradient> #include "MoCoBus/omnetwork.h" #include "core/Options/axisoptions.h" #include "core/Options/globaloptions.h" #include "core/Utilities/timeconverter.h" #include "core/Themer/singlethemer.h" #include "film/FilmParameters/filmparameters.h" #include "motionpathpainter.h" const QString MA_BG_COLOR = "#5999BC"; const QString MA_CL_COLOR = "#FFFFFF"; const QString MA_ER_COLOR = "#FF3333"; const QString MA_MT_COLOR = "#CDC5BF"; const QString MA_STR_STEP = " Steps"; const QString MA_STR_IMP = " In."; const QString MA_STR_MET = " cm."; const QString MA_STR_DEG = " Deg."; const QString MA_STR_POS = "Postion: "; const QString MA_STR_SPD = "Speed: "; const QString MA_STR_MOD = "/sec"; const QString MA_STR_TIM = "Time: "; const int MA_PT_NONE = 0; const int MA_PT_START = 1; const int MA_PT_END = 2; const int MA_PT_ACE = 3; const int MA_PT_DCS = 4; const int MA_TT_TIMER = 500; const int MA_MUTE_NA = 0; const int MA_MUTE_MT = 1; const int MA_MUTE_ER = 2; // grab handle size, in px const unsigned int MA_GRAB_SIZE = 10; // region growth around grab circle for registering a hit const unsigned int MA_HIT_AREA = 40; namespace Ui { class MotionArea; } /** Motion Area Widget The Motion Area Widget is a widget which draws the motion path for a particular axis. @author C. A. Church */ class MotionArea : public QFrame { Q_OBJECT Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth DESIGNABLE true) Q_PROPERTY(QColor lineColor READ lineColor WRITE setLineColor DESIGNABLE true) Q_PROPERTY(QColor fillColorStart READ fillColorStart WRITE setFillColorStart DESIGNABLE true) Q_PROPERTY(QColor fillColorEnd READ fillColorEnd WRITE setFillColorEnd DESIGNABLE true) Q_PROPERTY(QColor grabLineColor READ grabLineColor WRITE setGrabLineColor DESIGNABLE true) Q_PROPERTY(QColor grabFillColor READ grabFillColor WRITE setGrabFillColor DESIGNABLE true) Q_PROPERTY(int muted READ muted DESIGNABLE true) public: MotionArea(FilmParameters* c_film, OMdeviceInfo* c_dev, AxisOptions* c_aopt, GlobalOptions* c_gopt, QWidget *parent); ~MotionArea(); void paintEvent(QPaintEvent* e); void mousePressEvent(QMouseEvent* p_event); void mouseMoveEvent(QMouseEvent* p_event); void mouseReleaseEvent(QMouseEvent* p_event); MotionPathPainter* getPathPainter(); QList<QString> convertValue(float p_val); int lineWidth(); void setLineWidth(int p_width); QColor lineColor(); void setLineColor(QColor p_color); QColor fillColorStart(); void setFillColorStart(QColor p_color); QColor fillColorEnd(); void setFillColorEnd(QColor p_grad); QColor grabLineColor(); void setGrabLineColor(QColor p_grad); QColor grabFillColor(); void setGrabFillColor(QColor p_grad); int muted(); public slots: void filmUpdated(); void scaleChange(); void axisOptionsUpdated(OMaxisOptions* p_opts,unsigned short p_addr); void moveSane(bool p_sane); void mute(); void playStatus(bool p_stat); signals: /** Signal indicates when the display scale (relative or proportional) has been changed */ void scaleChanged(bool p_scale); /** Signal indicates when the track has been muted */ void muted(int p_muted); /** Signal indicates the global far-left and far-right x-pixel of the area (for aligning other elements) */ void globalPosition(int p_left, int p_right); private slots: void _tooltipTimer(); private: Ui::MotionArea *ui; OMdeviceInfo* m_dev; FilmParameters* m_film; MotionPathPainter* m_path; AxisOptions* m_aopt; GlobalOptions* m_gopt; QTimer* m_timer; QRect m_mvStart; QRect m_mvEnd; QRect m_acEnd; QRect m_dcStart; QColor m_lineColor; QColor m_fillStartColor; QColor m_fillEndColor; QColor m_grabLineColor; QColor m_grabFillColor; int m_lineWidth; int m_moveItem; int m_curPx; int m_curPy; int m_mute; bool m_sane; bool m_pstat; void _refreshStylesheet(); bool _inHitRegion(QPoint* p_point, QRect p_rect); }; #endif // MOTIONAREA_H
/* Copyright (C) 2020 Anssi Kulju This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CMDLIB_H #define CMDLIB_H #include "editor.h" CmdHook_t *cmdlib_get_lib(); CmdLib_t *cmdlib_get_rlib(); int cmdlib_file_load_cb(void *uptr, char *args); int cmdlib_file_save_cb(void *uptr, char *args); int cmdlib_cursor_up_cb(void *uptr, char *args); int cmdlib_cursor_down_cb(void *uptr, char *args); int cmdlib_cursor_left_cb(void *uptr, char *args); int cmdlib_cursor_right_cb(void *uptr, char *args); int cmdlib_cmd_line_cb(void *uptr, char *args); int cmdlib_main_quit_cb(void *uptr, char *args); #endif
#ifndef NETWORK_H #define NETWORK_H #include <QObject> #include <QUdpSocket> //枚举:发送数据的类型 typedef enum MessageType { NewParticipant, //新用户上线 Message, //消息 FileName, //传送文件名 Refuse, //拒绝接收文件 ParticipantLeft //用户下线 }MessageType; class Network : public QObject { Q_OBJECT public: explicit Network(QObject *parent = 0); ~Network(); private: QUdpSocket *udpManager; QString myUserName; int udpPort; QString myIp; signals: void receivedMessage(QStringList message); public slots: void setUserName(QString userName); void sendUdp(int messageType, QString chatContent = "", QString destinationIp = ""); void receiveUdp(); void sendTcp(); void receiveTcp(); void receiveUdpDatagram(); }; #endif // NETWORK_H
#pragma once #include "Shared.h" #include "CasparDevice.h" class CORE_EXPORT DeviceManager { public: explicit DeviceManager(); ~DeviceManager(); static DeviceManager& getInstance(); CasparDevice& getDevice(); private: CasparDevice* device; };
// PD is a free, modular C++ library for biomolecular simulation with a // flexible and scriptable Python interface. // Copyright (C) 2003-2013 Mike Tyka and Jon Rea // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef __GENPOLYMER_H #define __GENPOLYMER_H namespace Sequence { class BioSequence; class ResidueInfo; } class Molecule; class MoleculeBase; class FFParamSet; #ifndef SWIG /// For internal use only, but must be in the header as it is a friend of MoleculeBase int GeneratorCore( const Sequence::BioSequence &bioSeq, Molecule &newmol, const FFParamSet &ffps, bool _Polymerise, Verbosity::Type OutputLevel); int GeneratePolymer( const std::string &aseq, ///< Polymer Sequence Molecule &newmol, ///< Returns new molecule const FFParamSet &ffps, ///< Forcefield Parameters Verbosity::Type OutputLevel); ///< make gurgling noises? int GeneratePolymer( const Sequence::BioSequence &bioSeq, ///< Polymer Sequence Molecule &newmol, ///< Returns new molecule const FFParamSet &ffps, ///< Forcefield Parameters Verbosity::Type OutputLevel); ///< make gurgling noises? int GenerateMoleculeSet( const std::string &aseq, ///< Molecule-set Sequence Molecule &newmol, ///< Returns new molecule const FFParamSet &ffps, ///< Forcefield Parameters Verbosity::Type OutputLevel); ///< make gurgling noises? int GenerateMoleculeSet( const Sequence::BioSequence &bioSeq, ///< Molecule-set Sequence Molecule &newmol, ///< Returns new molecule const FFParamSet &ffps, ///< Forcefield Parameters Verbosity::Type OutputLevel); ///< make gurgling noises? int loadMolecule( const Sequence::ResidueInfo& _Res, Molecule &newmol, const FFParamSet &ffps); /// Possibly DEPRECATED - this version does not assign the underlyings sequence == badness. /// However there IS no sequence with a single molecule ... int loadMolecule( const std::string &MolName, Molecule &newmol, const FFParamSet &ffps); #endif Molecule PD_API NewProtein( FFParamSet &ffps, const std::string &aseq); Molecule PD_API NewProteinHelix( FFParamSet &ffps, const std::string &aseq); Molecule PD_API NewMolecule( FFParamSet &ffps, const std::string &MolName); #endif
# if !defined(LINK_H) # define LINK_H # include <sys/link.h> //# include "/usr/include/link.h" # endif
/** * \file * * \author Georg Hopp * * \copyright * Copyright © 2014 Georg Hopp * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __TR_PROTOCOL_HTTP_H__ #define __TR_PROTOCOL_HTTP_H__ #include <sys/types.h> #include "trbase.h" #include "trio.h" #include "tr/protocol.h" TR_CLASS(TR_ProtocolHttp) { TR_EXTENDS(TR_Protocol); }; TR_INSTANCE_INIT(TR_ProtocolHttp); TR_CLASSVARS_DECL(TR_ProtocolHttp) {}; #endif // __TR_PROTOCOL_HTTP_H__ // vim: set ts=4 sw=4:
/****************************************************************************** CCAV: Media play library based on Qt(UI),c/c++11 and FFmpeg Copyright (C) 2015-2016 Juno <junowendy@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ #ifndef CCAV_WIDGETRENDERER_P_H #define CCAV_WIDGETRENDERER_P_H #include <private/image_renderer_private.h> #include <CCAV/widget_renderer.h> namespace CCAV { class Q_EXPORT CCWidgetRendererPrivate : public CCImageRendererPrivate { public: CCWidgetRendererPrivate():action(CCWidgetRenderer::GestureMove) {} virtual ~CCWidgetRendererPrivate(){} QPoint iMousePos, gMousePos; CCWidgetRenderer::GestureAction action; }; } //namespace CCAV #endif // CCAV_WIDGETRENDERER_P_H
#pragma once #include "DNode.h" namespace BI { template<class TData> class Sort { public: Sort() { } ~Sort() { } virtual void sort(DNode<TData>* head, DNode<TData>* tail, const size_t size) = 0; protected: bool swap(DNode<TData>* n1, DNode<TData>* n2); }; template<class TData> bool Sort<TData>::swap(DNode<TData>* n1, DNode<TData>* n2) { if (n1 && n2) { auto data = n1->getData(); n1->setData(n2->getData()); n2->setData(data); return true; } return false; } } // namespace BI
void base() { }
/* Lips of Suna * Copyright© 2007-2012 Lips of Suna development team. * * Lips of Suna 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. * * Lips of Suna 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 Lips of Suna. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __RENDER_H__ #define __RENDER_H__ #include "lipsofsuna/paths.h" #include "lipsofsuna/system.h" #include "render-types.h" LIAPICALL (LIRenRender*, liren_render_new, ( LIPthPaths* paths, LIRenVideomode* mode)); LIAPICALL (void, liren_render_free, ( LIRenRender* self)); LIAPICALL (void, liren_render_add_compositor, ( LIRenRender* self, const char* name)); LIAPICALL (void, liren_render_remove_compositor, ( LIRenRender* self, const char* name)); LIAPICALL (int, liren_render_load_font, ( LIRenRender* self, const char* name, const char* file, int size)); LIAPICALL (void, liren_render_load_resources, ( LIRenRender* self)); LIAPICALL (int, liren_render_measure_text, ( LIRenRender* self, const char* font, const char* text, int width_limit, int* result_width, int* result_height)); LIAPICALL (void, liren_render_project, ( LIRenRender* self, const LIMatVector* world, LIMatVector* screen)); LIAPICALL (void, liren_render_render, ( LIRenRender* self)); LIAPICALL (int, liren_render_screenshot, ( LIRenRender* self, const char* path)); LIAPICALL (int, liren_render_update, ( LIRenRender* self, float secs)); LIAPICALL (void, liren_render_update_animations, ( LIRenRender* self, float secs)); LIAPICALL (int, liren_render_layout_text, ( LIRenRender* self, const char* font, const char* text, int width_limit, int** result_glyphs, int* result_glyphs_num)); LIAPICALL (int, liren_render_get_anisotropy, ( const LIRenRender* self)); LIAPICALL (void, liren_render_set_anisotropy, ( LIRenRender* self, int value)); LIAPICALL (void, liren_render_set_camera_far, ( LIRenRender* self, float value)); LIAPICALL (void, liren_render_set_camera_near, ( LIRenRender* self, float value)); LIAPICALL (void, liren_render_set_camera_transform, ( LIRenRender* self, const LIMatTransform* value)); LIAPICALL (void, liren_render_set_material_scheme, ( LIRenRender* self, const char* value)); LIAPICALL (float, liren_render_get_opengl_version, ( LIRenRender* self)); LIAPICALL (void, liren_render_set_scene_ambient, ( LIRenRender* self, const float* value)); LIAPICALL (void, liren_render_set_skybox, ( LIRenRender* self, const char* value)); LIAPICALL (void, liren_render_get_stats, ( LIRenRender* self, LIRenStats* result)); LIAPICALL (void, liren_render_set_title, ( LIRenRender* self, const char* value)); LIAPICALL (void, liren_render_get_videomode, ( LIRenRender* self, LIRenVideomode* mode)); LIAPICALL (int, liren_render_set_videomode, ( LIRenRender* self, LIRenVideomode* mode)); LIAPICALL (int, liren_render_get_videomodes, ( LIRenRender* self, LIRenVideomode** modes, int* modes_num)); #endif
/* DO NOT EDIT THIS FILE - it is machine generated */ /* Generated for class beast.evomodel.treelikelihood.NativeNucleotideLikelihoodCore */ /* Generated from NativeNucleotideLik%231272A6.java*/ #ifndef _Included_beast_evomodel_treelikelihood_NativeNucleotideLikelihoodCore #define _Included_beast_evomodel_treelikelihood_NativeNucleotideLikelihoodCore #include <jni.h> #ifdef __cplusplus extern "C" { #endif /** NativeNucleotideLikelihoodCore - An implementation of LikelihoodCore for nucleotides that calls native methods for maximum speed. The native methods should be in a shared library called "NucleotideLikelihoodCore" but the exact name will be system dependent (i.e. "libNucleotideLikelihoodCore.so" or "NucleotideLikelihoodCore.dll"). @version $Id: NucleotideLikelihoodCore.h,v 1.2 2003/10/28 16:26:31 rambaut Exp $ @author Andrew Rambaut */ /* * Class: dr_evomodel_treelikelihood_NativeNucleotideLikelihoodCore * Method: nativeStatesStatesPruning * Signature: ([I[D[I[DII[D)V */ /** Calculates partial likelihoods at a node when both children have states. */ JNIEXPORT void JNICALL Java_beast_evomodel_treelikelihood_NativeNucleotideLikelihoodCore_nativeStatesStatesPruning (JNIEnv *, jobject, jintArray, jdoubleArray, jintArray, jdoubleArray, jint, jint, jdoubleArray); /* * Class: dr_evomodel_treelikelihood_NativeNucleotideLikelihoodCore * Method: nativeStatesPartialsPruning * Signature: ([I[D[D[DII[D)V */ JNIEXPORT void JNICALL Java_beast_evomodel_treelikelihood_NativeNucleotideLikelihoodCore_nativeStatesPartialsPruning (JNIEnv *, jobject, jintArray, jdoubleArray, jdoubleArray, jdoubleArray, jint, jint, jdoubleArray); /* * Class: dr_evomodel_treelikelihood_NativeNucleotideLikelihoodCore * Method: nativePartialsPartialsPruning * Signature: ([D[D[D[DII[D)V */ JNIEXPORT void JNICALL Java_beast_evomodel_treelikelihood_NativeNucleotideLikelihoodCore_nativePartialsPartialsPruning (JNIEnv *, jobject, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jint, jint, jdoubleArray); /* * Class: dr_evomodel_treelikelihood_NativeNucleotideLikelihoodCore * Method: nativeIntegratePartials * Signature: ([D[DII[D)V */ JNIEXPORT void JNICALL Java_beast_evomodel_treelikelihood_NativeNucleotideLikelihoodCore_nativeIntegratePartials (JNIEnv *, jobject, jdoubleArray, jdoubleArray, jint, jint, jdoubleArray); #ifdef __cplusplus } #endif #endif
/****************************************************************************************//** Author of this file is __________ _______ __ _____ __ __________ _____ __ __ _____ ______ __ ____ / _ _ // ___ /__/ /_ / ___ / // _ _ // ___ / // //____// ____ \ / //___ \ / / / / / // /__/_//_ __// / / // / / / / // / / // / / /___/_// /__/_/ / / / / / // /_____ / /_ / /__/ // / / / / // /__/ // /\ \__ / /_____ / /\ \__ /_/ /_/ /_/ \______/ \__/ \____/_//_/ /_/ /_/ \____/_//_/ \___/\______//_/ \___/ webpage: http://www.goblinov.net email: guru@goblinov.net This file is provided under certain circumstances. For more details see LICENSE file in the project's root folder. \author metamaker \brief Non-terminal position for CYK algorithm for syntax parsing. ********************************************************************************************/ #ifndef C_SHARP_NON_TERMINAL_POSITION_TYPE_H #define C_SHARP_NON_TERMINAL_POSITION_TYPE_H #include <string> using std::string; struct NonTerminalPositionType { int i; int j; string name; NonTerminalPositionType(int _i, int _j, const string& _name); bool operator<(const NonTerminalPositionType& rhs) const; bool operator==(const NonTerminalPositionType& rhs) const; bool operator!=(const NonTerminalPositionType& rhs) const; bool operator>(const NonTerminalPositionType& rhs) const; friend std::ostream& operator<<(std::ostream& stream, const NonTerminalPositionType& nonTerminalPosition); }; extern NonTerminalPositionType NullPosition; #endif // C_SHARP_NON_TERMINAL_POSITION_TYPE_H
/* * Copyright (C) 2003-2020 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * * WeeChat 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. * * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>. */ #ifndef WEECHAT_HOOK_COMMAND_RUN_H #define WEECHAT_HOOK_COMMAND_RUN_H struct t_weechat_plugin; struct t_infolist_item; struct t_gui_buffer; #define HOOK_COMMAND_RUN(hook, var) (((struct t_hook_command_run *)hook->hook_data)->var) typedef int (t_hook_callback_command_run)(const void *pointer, void *data, struct t_gui_buffer *buffer, const char *command); struct t_hook_command_run { t_hook_callback_command_run *callback; /* command_run callback */ char *command; /* name of command (without '/') */ }; extern struct t_hook *hook_command_run (struct t_weechat_plugin *plugin, const char *command, t_hook_callback_command_run *callback, const void *callback_pointer, void *callback_data); extern int hook_command_run_exec (struct t_gui_buffer *buffer, const char *command); extern void hook_command_run_free_data (struct t_hook *hook); extern int hook_command_run_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_command_run_print_log (struct t_hook *hook); #endif /* WEECHAT_HOOK_COMMAND_RUN_H */
/* AGS - Advanced GTK Sequencer * Copyright (C) 2014 Joël Krähemann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __AGS_PEAK_CHANNEL_H__ #define __AGS_PEAK_CHANNEL_H__ #include <glib.h> #include <glib-object.h> #include <ags/audio/ags_recall_channel.h> #include <ags/audio/ags_channel.h> #define AGS_TYPE_PEAK_CHANNEL (ags_peak_channel_get_type()) #define AGS_PEAK_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_PEAK_CHANNEL, AgsPeakChannel)) #define AGS_PEAK_CHANNEL_CLASS(class) (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_PEAK_CHANNEL, AgsPeakChannel)) #define AGS_IS_PEAK_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_PEAK_CHANNEL)) #define AGS_IS_PEAK_CHANNEL_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), AGS_TYPE_PEAK_CHANNEL)) #define AGS_PEAK_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AGS_TYPE_PEAK_CHANNEL, AgsPeakChannelClass)) typedef struct _AgsPeakChannel AgsPeakChannel; typedef struct _AgsPeakChannelClass AgsPeakChannelClass; struct _AgsPeakChannel { AgsRecallChannel recall_channel; AgsPort *peak; }; struct _AgsPeakChannelClass { AgsRecallChannelClass recall_channel; }; GType ags_peak_channel_get_type(); void ags_peak_channel_retrieve_peak(AgsPeakChannel *peak_channel, gboolean is_play); AgsPeakChannel* ags_peak_channel_new(AgsChannel *source); #endif /*__AGS_PEAK_CHANNEL_H__*/
// This file is part of tralloc. Copyright (C) 2013 Andrew Aladjev aladjev.andrew@gmail.com // tralloc 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. // tralloc 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 tralloc. If not, see <http://www.gnu.org/licenses/>. #include "common.h" tralloc_bool test_pool_resize ( tralloc_context * ctx ) { if ( ! test_pool_resize_overflow ( ctx ) || ! test_pool_resize_left ( ctx ) || ! test_pool_resize_right ( ctx ) || ! test_pool_resize_order ( ctx ) ) { return TRALLOC_FALSE; } return TRALLOC_TRUE; }
#ifndef _BSIM3v0INIT_H #define _BSIM3v0INIT_H extern IFparm BSIM3v0pTable[ ]; extern IFparm BSIM3v0mPTable[ ]; extern char *BSIM3v0names[ ]; extern int BSIM3v0pTSize; extern int BSIM3v0mPTSize; extern int BSIM3v0nSize; extern int BSIM3v0iSize; extern int BSIM3v0mSize; #endif
#ifndef MANAGECHUCVU_H #define MANAGECHUCVU_H #include <QKeyEvent> #include <QWidget> #include <QtSql> #include "manageindex.h" #include <QDebug> namespace Ui { class ManageChucVu; } class ManageChucVu : public QWidget { Q_OBJECT public: explicit ManageChucVu(QWidget *parent = 0); ~ManageChucVu(); private slots: void on_pushButton_clicked(); void on_tableView_customContextMenuRequested(const QPoint &pos); private: manageIndex id; QString ma_cv; QSqlQuery query; QSqlTableModel *tablemodel; QSqlRelationalTableModel *chuc_vu; Ui::ManageChucVu *ui; void keyPressEvent(QKeyEvent *e); void update_phanquyen(); }; #endif // MANAGECHUCVU_H
#include <stdio.h> #include <stdlib.h> #include <wchar.h> #include "rh4n.h" #include "rh4n_nat_varhandling.h" int rh4nnatputBool(RH4nNatVarHandleParms *args, char *groupname, char *varname) { int rc = 0; char val = 0; if(args->desc->dimensions > 0) return(rh4nnatputBoolArray(args, groupname, varname)); if((rc = rh4nvarGetBool(args->varlist, groupname, varname, &val)) != RH4N_RET_OK) { sprintf(args->errorstr, "Could not get bool %s.%s. Varlib return: %d", groupname, varname, rc); return(rc); } rh4n_log_debug(args->props->logging, "Boolval: %#2x\n", val); rh4n_log_debug(args->props->logging, "Bool length: [%d]\n", args->desc->length); if((rc = args->nnifuncs->pf_nni_put_parm(args->nnifuncs, args->parmindex, args->parmhandle, LSIZE, &val)) != NNI_RC_OK) { return(RH4N_RET_NNI_ERR); } return(RH4N_RET_OK); } int rh4nnatputBoolArray(RH4nNatVarHandleParms *args, char* groupname, char* varname) { int rc = 0, x = 0, y = 0, z = 0, arrlength[3] = { 0, 0, 0}, arrindex[3] = { -1, -1, -1 }; RH4nVarRef _refvar = RH4NVAR_REF_INIT; if((rc = rh4nvarGetRef(args->varlist, groupname, varname, &_refvar)) != RH4N_RET_OK) { sprintf(args->errorstr, "Could not get variable %s.%s. Varlib return: %d", groupname, varname, rc); return(rc); } if((rc = rh4nvarGetArrayLength(&_refvar.var->var, arrlength)) != RH4N_RET_OK) { sprintf(args->errorstr, "Could not get array length for %s.%s. Varlib return: %d", groupname, varname, rc); return(rc); } if(!(args->desc->flags & NNI_FLG_UBVAR_0) && args->desc->occurrences[0] < arrlength[0]) { return(RH4N_RET_DIM1_TOO_SMALL); } else if(args->desc->dimensions > 1 && !(args->desc->flags & NNI_FLG_UBVAR_1) && args->desc->occurrences[1] < arrlength[1]) { return(RH4N_RET_DIM2_TOO_SMALL); } else if(args->desc->dimensions > 2 && !(args->desc->flags & NNI_FLG_UBVAR_2) && args->desc->occurrences[2] < arrlength[2]) { return(RH4N_RET_DIM3_TOO_SMALL); } if(args->desc->flags & NNI_FLG_XARRAY) { rh4n_log_debug(args->props->logging, "Resize array to [%d,%d,%d]", arrlength[0], arrlength[1], arrlength[2]); if((rc = args->nnifuncs->pf_nni_resize_parm_array(args->nnifuncs, args->parmindex, args->parmhandle, arrlength)) != NNI_RC_OK) { return(RH4N_RET_NNI_ERR); } } for(; x < arrlength[0]; x++) { arrindex[0] = x; if(args->desc->dimensions == 1) { if((rc = rh4nnatputBoolArrayEntry(args, groupname, varname, arrindex)) != RH4N_RET_OK) { return(rc); } } else { for(y=0; y < arrlength[1]; y++) { arrindex[1] = y; if(args->desc->dimensions == 2) { if((rc = rh4nnatputBoolArrayEntry(args, groupname, varname, arrindex)) != RH4N_RET_OK) { return(rc); } } else { for(z=0; z < arrlength[2]; z++) { arrindex[2] = z; if((rc = rh4nnatputBoolArrayEntry(args, groupname, varname, arrindex)) != RH4N_RET_OK) { return(rc); } } } } } } return(RH4N_RET_OK); } int rh4nnatputBoolArrayEntry(RH4nNatVarHandleParms *args, char* groupname, char* varname, int index[3]) { int rc = 0; char val = 0; if((rc = rh4nvarGetBoolArrayEntry(args->varlist, groupname, varname, index, &val)) != RH4N_RET_OK) { sprintf(args->errorstr, "Could not get integer from %s.%s x: %d y: %d z: %d. Varlib return: %d", groupname, varname, index[0], index[1], index[2], rc); return(rc); } if((rc = args->nnifuncs->pf_nni_put_parm_array(args->nnifuncs, args->parmindex, args->parmhandle, LSIZE, &val, index)) != NNI_RC_OK) { if(rc < 0) { return(RH4N_RET_NNI_ERR); } } return(RH4N_RET_OK); }
// Copyright 2017 Philip Zwanenburg // MIT License (https://github.com/PhilipZwanenburg/DPGSolver/blob/master/LICENSE) #ifndef DPG__const_cast_h__INCLUDED #define DPG__const_cast_h__INCLUDED /** \file * \brief Provides functions for casting to const lvalues for standard datatypes. * * Variables with standard datatypes with higher levels of dereferencing than 0 should be placed in Multiarray * containers. Const cast functions are thus not provided for higher levels of dereferencing. * * The function naming convention is: const_cast_{0} * - {0} : Datatype. * - Options: i, ptrdiff, bool, const_Element. */ #include <stddef.h> #include <stdbool.h> // Standard data types ********************************************************************************************** // /// \brief Cast from `int` to `const int`. void const_cast_i (const int* dest, ///< Destination. const int src ///< Source. ); /// \brief Cast from `ptrdiff_t` to `const ptrdiff_t`. void const_cast_ptrdiff (const ptrdiff_t* dest, ///< Destination. const ptrdiff_t src ///< Source. ); /// \brief Cast from `bool` to `const bool`. void const_cast_bool (const bool* dest, ///< Destination. const bool src ///< Source. ); // Custom data types ************************************************************************************************ // #endif // DPG__const_cast_h__INCLUDED
/* * See Licensing and Copyright notice in naev.h */ #ifndef AI_EXTRA_H # define AI_EXTRA_H #include "ai.h" #include "pilot.h" /* * Init, destruction. */ int ai_pinit( Pilot *p, const char *ai ); void ai_destroy( Pilot* p ); /* * Task related. */ Task *ai_newtask( Pilot *p, const char *func, int subtask, int pos ); void ai_freetask( Task* t ); void ai_cleartasks( Pilot* p ); /* * Misc functions. */ void ai_attacked( Pilot* attacked, const unsigned int attacker ); void ai_refuel( Pilot* refueler, unsigned int target ); void ai_getDistress( Pilot* p, const Pilot* distressed ); void ai_think( Pilot* pilot, const double dt ); void ai_setPilot( Pilot *p ); #endif /* AI_EXTRA_H */
/* * Interface to SPI flash * * Copyright (C) 2008 Atmel Corporation * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. */ #ifndef _SPI_FLASH_H_ #define _SPI_FLASH_H_ #include <spi.h> #include <linux/types.h> #include <linux/compiler.h> struct spi_flash { struct spi_slave *spi; const char *name; /* Total flash size */ u32 size; /* Write (page) size */ u32 page_size; /* Erase (sector) size */ u32 sector_size; #ifdef CONFIG_SPI_FLASH_BAR /* Bank read cmd */ u8 bank_read_cmd; /* Bank write cmd */ u8 bank_write_cmd; /* Current flash bank */ u8 bank_curr; #endif /* Poll cmd - for flash erase/program */ u8 poll_cmd; void *memory_map; /* Address of read-only SPI flash access */ int (*read)(struct spi_flash *flash, u32 offset, size_t len, void *buf); int (*write)(struct spi_flash *flash, u32 offset, size_t len, const void *buf); int (*erase)(struct spi_flash *flash, u32 offset, size_t len); }; /** * spi_flash_do_alloc - Allocate a new spi flash structure * * The structure is allocated and cleared with default values for * read, write and erase, which the caller can modify. The caller must set * up size, page_size and sector_size. * * Use the helper macro spi_flash_alloc() to call this. * * @offset: Offset of struct spi_slave within slave structure * @size: Size of slave structure * @spi: SPI slave * @name: Name of SPI flash device */ void *spi_flash_do_alloc(int offset, int size, struct spi_slave *spi, const char *name); /** * spi_flash_alloc - Allocate a new SPI flash structure * * @_struct: Name of structure to allocate (e.g. struct ramtron_spi_fram). This * structure must contain a member 'struct spi_flash *flash'. * @spi: SPI slave * @name: Name of SPI flash device */ #define spi_flash_alloc(_struct, spi, name) \ spi_flash_do_alloc(offsetof(_struct, flash), sizeof(_struct), \ spi, name) /** * spi_flash_alloc_base - Allocate a new SPI flash structure with no private data * * @spi: SPI slave * @name: Name of SPI flash device */ #define spi_flash_alloc_base(spi, name) \ spi_flash_do_alloc(0, sizeof(struct spi_flash), spi, name) struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, unsigned int max_hz, unsigned int spi_mode); void spi_flash_free(struct spi_flash *flash); static inline int spi_flash_read(struct spi_flash *flash, u32 offset, size_t len, void *buf) { return flash->read(flash, offset, len, buf); } static inline int spi_flash_write(struct spi_flash *flash, u32 offset, size_t len, const void *buf) { return flash->write(flash, offset, len, buf); } static inline int spi_flash_erase(struct spi_flash *flash, u32 offset, size_t len) { return flash->erase(flash, offset, len); } void spi_boot(void) __noreturn; #endif /* _SPI_FLASH_H_ */
#ifndef REQUESTHANDLER_H #define REQUESTHANDLER_H #include <QNetworkAccessManager> #include <QNetworkReply> namespace GrooveShark { class RequestHandler { public: /** * @param username The username that should be used for authentication if required. * @param password The password that should be used for authentication if required */ RequestHandler( QNetworkAccessManager* nam ); virtual ~RequestHandler(); /** * Sends a GET request with the given url and receives the servers response. * @param response The servers response will be written into this QByteArray * @param url The request url (without http://) as QString * @return 0 if the request was successful, corresponding ErrorCode if unsuccessful */ QNetworkReply* getRequest( const QString& url ); /** * Sends a POST request with the given url and data, adds auth Data and receives the servers response * @param data The data to send to the url * @param url The request url (without http://) as QString * @return 0 if the request was successful, corresponding ErrorCode if unsuccessful */ QNetworkReply* postRequest( const QString& url, const QByteArray data ); QNetworkReply* postFileRequest( const QString& url, const QString& referer, const QByteArray data ); private: QNetworkAccessManager* m_nam; void addUserAgent( QNetworkRequest& request ); void addContentType( QNetworkRequest& request ); void addReferer( QNetworkRequest& request, const QString& referer ); }; } #endif // REQUESTHANDLER_H
// // JYTrendTypeView.h // 各种报表 // // Created by niko on 17/4/28. // Copyright © 2017年 YMS. All rights reserved. // #import <UIKit/UIKit.h> #import "JYDashboardModel.h" @interface JYTrendTypeView : UIView @property (nonatomic, assign) TrendTypeArrow arrow; @end
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ #include "smsdk_ext.h" class PluginStatusForward : public SDKExtension, public IPluginsListener { public: // SDKExtension virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late); virtual void SDK_OnUnload(); public: // IPluginListener void OnPluginCreated(IPlugin *plugin); void OnPluginLoaded(IPlugin *plugin); void OnPluginUnloaded(IPlugin *plugin); void OnPluginPauseChange(IPlugin *plugin, bool paused); void OnPluginDestroyed(IPlugin *plugin); public: // Forward_INIT bool ForwardInit(char* error, size_t maxlength); void ForwardShutdown(); }; enum PSFHookType { PSF_OnPluginCreated, PSF_OnPluginLoaded, PSF_OnPluginPauseChange, PSF_OnPluginUnloaded, PSF_OnPluginDestroyed, /********************/ PSF_TOTALNUM }; extern IChangeableForward* g_PSFpForwards[PSF_TOTALNUM]; extern PluginStatusForward g_PluginStatusForward; #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
/* Aventurine Alpha Copyright (C) 2014 Jie Kang 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 METHODDATA_H #define METHODDATA_H #include <string> class MethodData { public: MethodData(const bool enter, const std::string threadName, const std::string className, const std::string methodName); const bool enter; const std::string threadName; const std::string className; const std::string methodName; }; #endif // METHODDATA_H
/* * Copyright (c) 2017 Cisco and/or its affiliates. * 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. */ // Include the file(s) containing the functions to be tested. // This permits internal static functions to be visible to this Test Framework. #include "../metis_MissiveDeque.c" #include <LongBow/unit-test.h> LONGBOW_TEST_RUNNER(metis_MissiveDeque) { // The following Test Fixtures will run their corresponding Test Cases. // Test Fixtures are run in the order specified, but all tests should be idempotent. // Never rely on the execution order of tests or share state between them. LONGBOW_RUN_TEST_FIXTURE(Global); LONGBOW_RUN_TEST_FIXTURE(Local); } // The Test Runner calls this function once before any Test Fixtures are run. LONGBOW_TEST_RUNNER_SETUP(metis_MissiveDeque) { return LONGBOW_STATUS_SUCCEEDED; } // The Test Runner calls this function once after all the Test Fixtures are run. LONGBOW_TEST_RUNNER_TEARDOWN(metis_MissiveDeque) { return LONGBOW_STATUS_SUCCEEDED; } LONGBOW_TEST_FIXTURE(Global) { LONGBOW_RUN_TEST_CASE(Global, metisMissiveDeque_Append); LONGBOW_RUN_TEST_CASE(Global, metisMissiveDeque_Create); LONGBOW_RUN_TEST_CASE(Global, metisMissiveDeque_Release); LONGBOW_RUN_TEST_CASE(Global, metisMissiveDeque_RemoveFirst); LONGBOW_RUN_TEST_CASE(Global, metisMissiveDeque_Size); } LONGBOW_TEST_FIXTURE_SETUP(Global) { return LONGBOW_STATUS_SUCCEEDED; } LONGBOW_TEST_FIXTURE_TEARDOWN(Global) { return LONGBOW_STATUS_SUCCEEDED; } LONGBOW_TEST_CASE(Global, metisMissiveDeque_Append) { testUnimplemented(""); } LONGBOW_TEST_CASE(Global, metisMissiveDeque_Create) { testUnimplemented(""); } LONGBOW_TEST_CASE(Global, metisMissiveDeque_Release) { testUnimplemented(""); } LONGBOW_TEST_CASE(Global, metisMissiveDeque_RemoveFirst) { testUnimplemented(""); } LONGBOW_TEST_CASE(Global, metisMissiveDeque_Size) { testUnimplemented(""); } LONGBOW_TEST_FIXTURE(Local) { } LONGBOW_TEST_FIXTURE_SETUP(Local) { return LONGBOW_STATUS_SUCCEEDED; } LONGBOW_TEST_FIXTURE_TEARDOWN(Local) { return LONGBOW_STATUS_SUCCEEDED; } int main(int argc, char *argv[]) { LongBowRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(metis_MissiveDeque); int exitStatus = longBowMain(argc, argv, testRunner, NULL); longBowTestRunner_Destroy(&testRunner); exit(exitStatus); }
#ifndef __SOCK_IO_H__ #define __SOCK_IO_H__ #define GRD_DATA_TYPE_TEXT 1 #define GRD_DATA_TYPE_FILE 2 #define GRD_RECV_ERROR 1 #define GRD_RECV_SUCESS 0 #define GRD_SEND_ERROR 1 #define GRD_SEND_SUCESS 0 #include <web-header.h> #include <unistd.h> int grd_recv(int fd_sock, char **recvd); int grd_recv_len(int fd_sock, char **recvd, size_t len); int grd_send(int fd_sock, void *data, int data_type); int grd_callback_send(const http_header *hh, const char *content); #endif /*SOCK-IO_H*/
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace Hermes::Hermes2D::WeakFormsH1; using namespace Hermes::Hermes2D::Views; /* Weak forms */ class CustomWeakFormPoisson : public WeakForm<double> { public: CustomWeakFormPoisson(std::string mat_al, Hermes1DFunction<double>* lambda_al, std::string mat_cu, Hermes1DFunction<double>* lambda_cu, Hermes2DFunction<double>* src_term); };
/* * Copyright 2004-2009 Analog Devices Inc. * * Licensed under the GPL-2 or later. */ #define BITS_PER_UNIT 8 #define SI_TYPE_SIZE (sizeof (SItype) * BITS_PER_UNIT) typedef unsigned int UQItype __attribute__ ((mode(QI))); typedef int SItype __attribute__ ((mode(SI))); typedef unsigned int USItype __attribute__ ((mode(SI))); typedef int DItype __attribute__ ((mode(DI))); typedef int word_type __attribute__ ((mode(__word__))); typedef unsigned int UDItype __attribute__ ((mode(DI))); struct DIstruct { SItype low, high; }; typedef union { struct DIstruct s; DItype ll; } DIunion;
/* * Code for class TYPE [NATURAL_64] */ #include "eif_eiffel.h" #include "../E1/estructure.h" #include "../E1/eoffsets.h" #include "ty416.h" #include "eif_built_in.h" #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #ifdef __cplusplus extern "C" { #endif /* {TYPE}.name */ EIF_REFERENCE F631_4806 (EIF_REFERENCE Current) { GTCX EIF_REFERENCE loc1 = (EIF_REFERENCE) 0; EIF_REFERENCE tr1 = NULL; EIF_REFERENCE tr2 = NULL; EIF_REFERENCE Result = ((EIF_REFERENCE) 0); RTLD; RTLI(5); RTLR(0,loc1); RTLR(1,Current); RTLR(2,tr1); RTLR(3,tr2); RTLR(4,Result); RTGC; tr1 = *(EIF_REFERENCE *)(Current); loc1 = tr1; if (EIF_TEST(loc1)) { RTLE; return (EIF_REFERENCE) loc1; } else { tr1 = RTLNS(748, 748, _OBJSIZ_1_0_0_4_0_0_0_0_); tr2 = F631_4831(Current); F743_6149(RTCV(tr1), tr2); Result = (EIF_REFERENCE) tr1; RTAR(Current, Result); *(EIF_REFERENCE *)(Current) = (EIF_REFERENCE) Result; } RTLE; return Result; } /* {TYPE}.generic_parameter_type */ EIF_REFERENCE F631_4807 (EIF_REFERENCE Current, EIF_INTEGER_32 arg1) { GTCX RTEX; EIF_REFERENCE Result = ((EIF_REFERENCE) 0); RTLD; RTLI(2); RTLR(0,Result); RTLR(1,Current); RTEAA("generic_parameter_type", 630, Current, 0, 1, 8674); Result = (EIF_REFERENCE) eif_builtin_TYPE_generic_parameter_type (Current, arg1); if (!Result) {RTEC(EN_FAIL);} RTLE; RTEE; return Result; } /* {TYPE}.type_id */ EIF_INTEGER_32 F631_4808 (EIF_REFERENCE Current) { GTCX EIF_INTEGER_32 Result = ((EIF_INTEGER_32) 0); Result = (EIF_INTEGER_32) eif_builtin_TYPE_type_id (Current); return Result; } /* {TYPE}.hash_code */ EIF_INTEGER_32 F631_4809 (EIF_REFERENCE Current) { GTCX return (EIF_INTEGER_32) (EIF_INTEGER_32) eif_builtin_TYPE_type_id (Current); } /* {TYPE}.is_attached */ EIF_BOOLEAN F631_4813 (EIF_REFERENCE Current) { GTCX EIF_BOOLEAN Result = ((EIF_BOOLEAN) 0); Result = (EIF_BOOLEAN) eif_builtin_TYPE_is_attached (Current); return Result; } /* {TYPE}.is_equal */ EIF_BOOLEAN F631_4814 (EIF_REFERENCE Current, EIF_REFERENCE arg1) { GTCX EIF_INTEGER_32 ti4_1; EIF_INTEGER_32 ti4_2; EIF_BOOLEAN Result = ((EIF_BOOLEAN) 0); RTLD; RTLI(2); RTLR(0,Current); RTLR(1,arg1); RTGC; ti4_1 = (EIF_INTEGER_32) eif_builtin_TYPE_type_id (Current); ti4_2 = (EIF_INTEGER_32) eif_builtin_TYPE_type_id (arg1); Result = (EIF_BOOLEAN) (EIF_BOOLEAN)(ti4_1 == ti4_2); RTLE; return Result; } /* {TYPE}.default */ EIF_NATURAL_64 F631_4820 (EIF_REFERENCE Current) { GTCX EIF_NATURAL_64 loc1 = (EIF_NATURAL_64) 0; RTGC; return (EIF_NATURAL_64) 0; } /* {TYPE}.to_string_8 */ EIF_REFERENCE F631_4828 (EIF_REFERENCE Current) { GTCX EIF_REFERENCE tr1 = NULL; EIF_REFERENCE tr2 = NULL; EIF_REFERENCE Result = ((EIF_REFERENCE) 0); RTLD; RTLI(4); RTLR(0,tr1); RTLR(1,Current); RTLR(2,tr2); RTLR(3,Result); RTGC; tr1 = RTLNS(744, 744, _OBJSIZ_1_1_0_3_0_0_0_0_); tr2 = F631_4806(Current); F743_6149(RTCV(tr1), tr2); Result = (EIF_REFERENCE) tr1; RTLE; return Result; } /* {TYPE}.internal_name */ EIF_REFERENCE F631_4830 (EIF_REFERENCE Current) { return *(EIF_REFERENCE *)(Current); } /* {TYPE}.runtime_name */ EIF_REFERENCE F631_4831 (EIF_REFERENCE Current) { GTCX RTEX; EIF_REFERENCE Result = ((EIF_REFERENCE) 0); RTLD; RTLI(2); RTLR(0,Result); RTLR(1,Current); RTEAA("runtime_name", 630, Current, 0, 0, 8672); Result = (EIF_REFERENCE) eif_builtin_TYPE_runtime_name (Current); if (!Result) {RTEC(EN_FAIL);} RTLE; RTEE; return Result; } void EIF_Minit416 (void) { GTCX } #ifdef __cplusplus } #endif
/* * include/asm-xtensa/page.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version2 as * published by the Free Software Foundation. * * Copyright (C) 2001 - 2007 Tensilica Inc. */ #ifndef _XTENSA_PAGE_H #define _XTENSA_PAGE_H #include <asm/processor.h> #include <asm/types.h> #include <asm/cache.h> #include <platform/hardware.h> #include <asm/kmem_layout.h> /* * PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 #define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #ifdef CONFIG_MMU #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR #define PHYS_OFFSET XCHAL_KSEG_PADDR #define MAX_LOW_PFN (PHYS_PFN(XCHAL_KSEG_PADDR) + \ PHYS_PFN(XCHAL_KSEG_SIZE)) #else #define PAGE_OFFSET PLATFORM_DEFAULT_MEM_START #define PHYS_OFFSET PLATFORM_DEFAULT_MEM_START #define MAX_LOW_PFN PHYS_PFN(0xfffffffful) #endif #define PGTABLE_START 0x80000000 /* * Cache aliasing: * * If the cache size for one way is greater than the page size, we have to * deal with cache aliasing. The cache index is wider than the page size: * * | |cache| cache index * | pfn |off| virtual address * |xxxx:X|zzz| * | : | | * | \ / | | * |trans.| | * | / \ | | * |yyyy:Y|zzz| physical address * * When the page number is translated to the physical page address, the lowest * bit(s) (X) that are part of the cache index are also translated (Y). * If this translation changes bit(s) (X), the cache index is also afected, * thus resulting in a different cache line than before. * The kernel does not provide a mechanism to ensure that the page color * (represented by this bit) remains the same when allocated or when pages * are remapped. When user pages are mapped into kernel space, the color of * the page might also change. * * We use the address space VMALLOC_END ... VMALLOC_END + DCACHE_WAY_SIZE * 2 * to temporarily map a patch so we can match the color. */ #if DCACHE_WAY_SIZE > PAGE_SIZE #define DCACHE_ALIAS_ORDER (DCACHE_WAY_SHIFT - PAGE_SHIFT) #define DCACHE_ALIAS_MASK (PAGE_MASK & (DCACHE_WAY_SIZE - 1)) #define DCACHE_ALIAS(a) (((a) & DCACHE_ALIAS_MASK) >> PAGE_SHIFT) #define DCACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & DCACHE_ALIAS_MASK) == 0) #else #define DCACHE_ALIAS_ORDER 0 #define DCACHE_ALIAS(a) ((void)(a), 0) #endif #define DCACHE_N_COLORS (1 << DCACHE_ALIAS_ORDER) #if ICACHE_WAY_SIZE > PAGE_SIZE #define ICACHE_ALIAS_ORDER (ICACHE_WAY_SHIFT - PAGE_SHIFT) #define ICACHE_ALIAS_MASK (PAGE_MASK & (ICACHE_WAY_SIZE - 1)) #define ICACHE_ALIAS(a) (((a) & ICACHE_ALIAS_MASK) >> PAGE_SHIFT) #define ICACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & ICACHE_ALIAS_MASK) == 0) #else #define ICACHE_ALIAS_ORDER 0 #endif #ifdef __ASSEMBLY__ #define __pgprot(x) (x) #else /* * These are used to make use of C type-checking.. */ typedef struct { unsigned long pte; } pte_t; /* page table entry */ typedef struct { unsigned long pgd; } pgd_t; /* PGD table entry */ typedef struct { unsigned long pgprot; } pgprot_t; typedef struct page *pgtable_t; #define pte_val(x) ((x).pte) #define pgd_val(x) ((x).pgd) #define pgprot_val(x) ((x).pgprot) #define __pte(x) ((pte_t) { (x) } ) #define __pgd(x) ((pgd_t) { (x) } ) #define __pgprot(x) ((pgprot_t) { (x) } ) /* * Pure 2^n version of get_order * Use 'nsau' instructions if supported by the processor or the generic version. */ #if XCHAL_HAVE_NSA static inline __attribute_const__ int get_order(unsigned long size) { int lz; asm ("nsau %0, %1" : "=r" (lz) : "r" ((size - 1) >> PAGE_SHIFT)); return 32 - lz; } #else # include <asm-generic/getorder.h> #endif struct page; struct vm_area_struct; extern void clear_page(void *page); extern void copy_page(void *to, void *from); /* * If we have cache aliasing and writeback caches, we might have to do * some extra work */ #if defined(CONFIG_MMU) && DCACHE_WAY_SIZE > PAGE_SIZE extern void clear_page_alias(void *vaddr, unsigned long paddr); extern void copy_page_alias(void *to, void *from, unsigned long to_paddr, unsigned long from_paddr); #define clear_user_highpage clear_user_highpage void clear_user_highpage(struct page *page, unsigned long vaddr); #define __HAVE_ARCH_COPY_USER_HIGHPAGE void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr, struct vm_area_struct *vma); #else # define clear_user_page(page, vaddr, pg) clear_page(page) # define copy_user_page(to, from, vaddr, pg) copy_page(to, from) #endif /* * This handles the memory map. We handle pages at * XCHAL_KSEG_CACHED_VADDR for kernels with 32 bit address space. * These macros are for conversion of kernel address, not user * addresses. */ #define ARCH_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT) #define __pa(x) \ ((unsigned long) (x) - PAGE_OFFSET + PHYS_OFFSET) #define __va(x) \ ((void *)((unsigned long) (x) - PHYS_OFFSET + PAGE_OFFSET)) #define pfn_valid(pfn) \ ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr) #ifdef CONFIG_DISCONTIGMEM # error CONFIG_DISCONTIGMEM not supported #endif #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) #endif /* __ASSEMBLY__ */ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #include <asm-generic/memory_model.h> #endif /* _XTENSA_PAGE_H */
#pragma once #include "afxcmn.h" #include "DTreeCtrl.h" // CAddItemGroupDlg ¶Ô»°¿ò namespace Dialog{ class CAddItemGroupDlg : public CDialog, public Tool::IDTreeOwner { DECLARE_DYNAMIC(CAddItemGroupDlg) public: CString m_strGroupName; CString m_strParentName; UINT m_uiParentID; private: CString m_strOldGroupName; Tool::CDTreeCtrl m_GroupTree; bool m_bShowTree; HTREEITEM m_CulItem; UINT m_uiGroupID; // Èç¹ûÊÇÐÞ¸Ä×éÐÅÏ¢£¬ÕâÀï¼Ç¼ÁË×éµÄIDºÅ private: CAddItemGroupDlg(CWnd* pParent = NULL); // ±ê×¼¹¹Ô캯Êý virtual ~CAddItemGroupDlg(); void AddGroupChild(HTREEITEM root, UINT parentID); void SetParentName(CString name); public: static CAddItemGroupDlg& GetMe(); // ¶Ô»°¿òÊý¾Ý enum { IDD = IDD_ADD_ITEMGROUP }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedBtShowtree(); afx_msg void OnBnClickedCancel(); afx_msg void OnBnClickedOk(); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo); virtual INT_PTR DoModal(CString parentName = _T("System"), UINT groupID = -1); virtual BOOL OnInitDialog(); virtual void OnTreeDblClick(CTreeCtrl*, HTREEITEM); virtual void OnTreeLClick(CTreeCtrl*, HTREEITEM); virtual void OnTreeRClick(CTreeCtrl*, HTREEITEM,CPoint); virtual void OnTreeKeyDown(CTreeCtrl*, HTREEITEM,UINT); }; }
/* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*- ******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * THIS IS UNPUBLISHED SOURCE CODE OF create3000. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 1999, 2016 Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the Titania Project. * * Titania is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * Titania is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with Titania. If not, see <http://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ #ifndef __TITANIA_X3D_BROWSER_LIGHTING_X3DPICKING_CONTEXT_H__ #define __TITANIA_X3D_BROWSER_LIGHTING_X3DPICKING_CONTEXT_H__ #include "../../Basic/X3DBaseNode.h" #include <stack> namespace titania { namespace X3D { class X3DPickingContext : virtual public X3DBaseNode { public: /// @name Destruction virtual void dispose () override { } virtual ~X3DPickingContext () override; protected: /// @name Friends friend class TransformSensor; friend class PickableGroup; friend struct PickingHierarchyGuard; friend class Shape; friend class X3DGroupingNode; friend class X3DPickSensorNode; /// @name Construction X3DPickingContext (); virtual void initialize () override; /// @name Member access void addTransformSensor (TransformSensor* const transformSensorNode); void removeTransformSensor (TransformSensor* const transformSensorNode); void addPickSensor (X3DPickSensorNode* const pickSensorNode); void removePickSensor (X3DPickSensorNode* const pickSensorNode); std::stack <bool> & getPickable () { return pickable; } const std::stack <bool> & getPickable () const { return pickable; } std::vector <std::set <X3DPickSensorNode*>> & getPickSensors () { return pickSensorNodes; } const std::vector <std::set <X3DPickSensorNode*>> & getPickSensors () const { return pickSensorNodes; } std::vector <X3DChildNode*> & getPickingHierarchy () { return pickingHierarchy; } const std::vector <X3DChildNode*> & getPickingHierarchy () const { return pickingHierarchy; } private: /// @name Event handlers void enable (); void picking (); /// @name Members std::set <TransformSensor*> transformSensorNodes; std::stack <bool> pickable; std::vector <std::set <X3DPickSensorNode*>> pickSensorNodes; std::vector <X3DChildNode*> pickingHierarchy; }; } // X3D } // titania #endif
// Copyright 2008 Wincent Colaiuta // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #include "str.h" str_t *str_new(void) { str_t *str = ALLOC_N(str_t, 1); str->ptr = NULL; str->len = 0; str->capacity = 0; return str; } str_t *str_new_size(long len) { str_t *str = ALLOC_N(str_t, 1); str->ptr = ALLOC_N(char, len); str->len = 0; str->capacity = len; return str; } str_t *str_new_copy(char *src, long len) { str_t *str = ALLOC_N(str_t, 1); str->ptr = ALLOC_N(char, len); memcpy(str->ptr, src, len); str->len = len; str->capacity = len; return str; } str_t *str_new_no_copy(char *src, long len) { str_t *str = ALLOC_N(str_t, 1); str->ptr = src; str->len = len; str->capacity = len; return str; } str_t *str_new_from_string(VALUE string) { string = StringValue(string); return str_new_copy(RSTRING_PTR(string), RSTRING_LEN(string)); } VALUE string_from_str(str_t *str) { return rb_str_new(str->ptr, str->len); } void str_grow(str_t *str, long len) { if (str->capacity < len) { if (str->ptr) REALLOC_N(str->ptr, char, len); else str->ptr = ALLOC_N(char, len); str->capacity = len; } } void str_append(str_t *str, char *src, long len) { long new_len = str->len + len; if (str->capacity < new_len) { if (str->ptr) REALLOC_N(str->ptr, char, new_len); else str->ptr = ALLOC_N(char, new_len); str->capacity = new_len; } memcpy(str->ptr + str->len, src, len); str->len = new_len; } void str_append_str(str_t *str, str_t *other) { str_append(str, other->ptr, other->len); } void str_swap(str_t **a, str_t **b) { str_t *c; c = *a; *a = *b; *b = c; } void str_clear(str_t *str) { str->len = 0; } void str_free(str_t *str) { if (str->ptr) free(str->ptr); free(str); }
#include </usr/include/artik/base/artik_module.h> #include </usr/include/artik/base/artik_loop.h> #include </usr/include/artik/bluetooth/artik_bluetooth.h> #include "../Hardware/hardLibrary.h"; int main (int argc, char** argv) { int pipe = atoi(argv[1]); artik_bt_device *devices = NULL; int *num = 0; artik_error ret = S_OK; ret = lista_dispositivos_cercanos_Bluetooth_F (devices, num, 20000); fprintf(pipe, "{closeDevices:["); for (i = 0; i < *num; i++) { fprintf(pipe, "{deviceAddr:%s,\n", devices[i].remote_address ? devices[i]. remote_address : "(null)"); fprintf(pipe, "ID:%s},\n", devices[i].remote_name ? devices[i]. remote_name : "(null)"); } fprintf(pipe, "{}]}"); }
#include <stdio.h> #include <stdlib.h> #include <getopt.h> #include <stdint.h> #include <string.h> #include "vpn_opt.h" #include "error.h" #include "utils.h" void print_usage() { printf("Usage: main -c -s [IP] -p [PORT]\n"); } int vpn_opt(int argc, char *argv[], options_main* opt) { int option = 0; int port; int long_index = 0; opt->proxy = 0; static struct option long_options[] = { {"tls", no_argument, 0, 't' }, {"proxy", no_argument, 0, 'Z' }, {"server", required_argument, 0, 's' }, {"client", required_argument, 0, 'c' }, {"port", required_argument, 0, 'p' }, {"ipproxy", required_argument, 0, 'C' }, {"portproxy", required_argument, 0, 'P' } }; while ((option = getopt_long(argc, argv,"tZs:c:p:C:P:", long_options, &long_index)) != -1) { switch (option) { case 's' : opt->MODE = 1; strncpy(opt->ip, optarg, 16); break; case 'c' : opt->MODE = 0; strncpy(opt->ip, optarg, 16); break; case 'p' : port = atoi(optarg); if(port < 1 || port > 65535) vpn_error_exit("port 1-65535", vpn_return(1)); opt->port = atoi(optarg); break; case 'C' : opt->proxy = 1; strncpy(opt->ip_proxy, optarg, 16); break; case 'P' : port = atoi(optarg); if(port < 1 || port > 65535) vpn_error_exit("port 1-65535", vpn_return(1)); opt->port_proxy = atoi(optarg); break; case 'Z' : opt->proxy = 1; break; case 't' : opt->tls = 1; if ( opt->MODE == 1){ strcpy(opt->crt, "keys/server.crt"); strcpy(opt->key, "keys/server.key"); }else if( opt->MODE == 0){ strcpy(opt->crt, "keys/client.crt"); strcpy(opt->key, "keys/client.key"); } break; default: print_usage(); return 1; } } return 0; }
#ifndef _APP_DELEGATE_H_ #define _APP_DELEGATE_H_ #include "cocos2d.h" /** @brief The cocos2d Application. The reason for implement as private inheritance is to hide some interface call by Director. */ class AppDelegate : private cocos2d::Application { public: AppDelegate(); virtual ~AppDelegate(); virtual void initGLContextAttrs(); /** @brief Implement Director and Scene init code here. @return true Initialize success, app continue. @return false Initialize failed, app terminate. */ virtual bool applicationDidFinishLaunching(); /** @brief The function be called when the application enter background @param the pointer of the application */ virtual void applicationDidEnterBackground(); /** @brief The function be called when the application enter foreground @param the pointer of the application */ virtual void applicationWillEnterForeground(); void addMusic(); }; #endif // _APP_DELEGATE_H_
//========= Copyright © 1996-2003, Valve LLC, All rights reserved. ============ // // Purpose: // //============================================================================= #ifndef IVP_H #define IVP_H #ifdef _WIN32 #pragma once #endif #include "utlvector.h" class CPhysCollide; class CTextBuffer; class IPhysicsCollision; extern IPhysicsCollision *physcollision; // a list of all of the materials in the world model extern int RemapWorldMaterial( int materialIndexIn ); class CPhysCollisionEntry { public: CPhysCollisionEntry( CPhysCollide *pCollide ); virtual void WriteToTextBuffer( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex ) = 0; virtual void DumpCollide( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex ) = 0; unsigned int GetCollisionBinarySize(); unsigned int WriteCollisionBinary( char *pDest ); protected: void DumpCollideFileName( const char *pName, int modelIndex, CTextBuffer *pTextBuffer ); protected: CPhysCollide *m_pCollide; }; class CPhysCollisionEntryStaticMesh : public CPhysCollisionEntry { public: CPhysCollisionEntryStaticMesh( CPhysCollide *pCollide, const char *pMaterialName ); virtual void WriteToTextBuffer( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex ); virtual void DumpCollide( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex ); private: const char *m_pMaterial; }; class CTextBuffer { public: CTextBuffer( void ); ~CTextBuffer( void ); inline int GetSize( void ) { return m_buffer.Count(); } inline char *GetData( void ) { return m_buffer.Base(); } void WriteText( const char *pText ); void WriteIntKey( const char *pKeyName, int outputData ); void WriteStringKey( const char *pKeyName, const char *outputData ); void WriteFloatKey( const char *pKeyName, float outputData ); void WriteFloatArrayKey( const char *pKeyName, const float *outputData, int count ); void CopyStringQuotes( const char *pString ); void Terminate( void ); private: void CopyData( const char *pData, int len ); CUtlVector<char> m_buffer; }; #endif // IVP_H
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Code/Dev/appNativa/source/rareobjc/../rare/core/com/appnativa/rare/ui/event/iItemChangeListener.java // // Created by decoteaud on 3/11/16. // #ifndef _RAREiItemChangeListener_H_ #define _RAREiItemChangeListener_H_ @class RAREItemChangeEvent; #import "JreEmulation.h" #include "java/util/EventListener.h" @protocol RAREiItemChangeListener < JavaUtilEventListener, NSObject, JavaObject > - (void)itemChangedWithRAREItemChangeEvent:(RAREItemChangeEvent *)e; @end #define ComAppnativaRareUiEventIItemChangeListener RAREiItemChangeListener #endif // _RAREiItemChangeListener_H_
#pragma once class MarketTradesModel : public QAbstractItemModel, public Entity::Listener { public: enum class Column { first, date = first, price, amount, last = amount, }; public: MarketTradesModel(Entity::Manager& channelEntityManager); ~MarketTradesModel(); // void reset(); // // void setTrades(const QList<DataProtocol::Trade>& trades); // void addTrade(const DataProtocol::Trade& trade); // // void clearAbove(int tradeCount); private: class Trade { public: quint64 date; double price; double amount; enum class Icon { up, down, neutral, } icon; }; private: Entity::Manager& channelEntityManager; EMarketSubscription* eSubscription; QList<Trade*> trades; QVariant upIcon; QVariant downIcon; QVariant neutralIcon; private: // QAbstractItemModel virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; virtual QModelIndex parent(const QModelIndex& child) const; virtual int rowCount(const QModelIndex& parent) const; virtual int columnCount(const QModelIndex& parent) const; virtual QVariant data(const QModelIndex& index, int role) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; private: // Entity::Listener virtual void addedEntity(Entity& entity); virtual void updatedEntitiy(Entity& oldEntity, Entity& newEntity); virtual void removedEntity(Entity& entity); virtual void removedAll(quint32 type); };
#ifndef CONTROL_2XXXX_H #define CONTROL_2XXXX_H void hard_reset_to_bootloader(void); void hard_reset_to_user_code(void); #endif // ..._H
#ifndef IQMOL_SHADERLIBRARY_H #define IQMOL_SHADERLIBRARY_H /******************************************************************************* Copyright (C) 2011-2013 Andrew Gilbert This file is part of IQmol, a free molecular visualization program. See <http://iqmol.org> for more details. IQmol 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. IQmol 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 IQmol. If not, see <http://www.gnu.org/licenses/>. ********************************************************************************/ #include <QtGlobal> #ifdef Q_OS_LINUX #define GL_GLEXT_PROTOTYPES #include <GL/gl.h> #include <GL/glext.h> #endif #include <QColor> #include <QSize> #include <QVariant> #include <QStringList> #include "QGLViewer/vec.h" #include <QDebug> #ifdef Q_OS_WIN32 #undef IQMOL_SHADERS #else #define IQMOL_SHADERS #endif class QGLFramebufferObject; class mat4x4; namespace IQmol { enum Texture_t { NormalBuffer, FilterBuffer, RotationTexture }; struct Texture { GLuint id; QSize size; Texture_t slot; GLfloat* data; }; enum GLArrayType {GLfloat1v, GLfloat2v, GLfloat3v, GLfloat4v}; struct GLFloatArray { GLArrayType type; GLuint size; GLfloat* ptr; }; // ShaderLibrary manages the use of GLSL shaders. // Note the only supported uniform variable types are float and bool class ShaderLibrary { public: static const QString NoShader; static ShaderLibrary& instance(); QStringList availableShaders() const { return s_shaders.keys(); } QString const& currentShader() { return s_currentShader; } bool bindShader(QString const& name); bool suspend(); bool resume(); void resizeScreenBuffers(QSize const& windowSize, double* projectionMatrix); void bindNormalMap(GLfloat near0, GLfloat far0); void releaseNormalMap(); void generateFilters(); void bindTextures(QString const& shader); void releaseTextures(); void clearFrameBuffers(); void loadAllShaders(); QVariantMap uniformUserVariableList(QString const& shaderName); bool setUniformVariables(QString const& shaderName, QVariantMap const& map); bool setTextureVariable(QString const& shader, QString const& name, Texture const&); void setFilterVariables(QVariantMap const& map); void setFiltersAvailable(bool tf) { m_filtersAvailable = tf; }; bool filtersAvailable() { return m_filtersAvailable; }; bool filtersActive() { return m_filtersActive; }; bool shadersInitialized() const { return m_shadersInitialized; } // This does not filter for NoShader template <class T> bool setUniformVariable(QString const& shaderName, QString const& variable, T const& value) { #ifdef IQMOL_SHADERS if (!s_shaders.contains(shaderName)) { qDebug() << "Shader not found:" << shaderName; return false; } unsigned program(s_shaders.value(shaderName)); glUseProgram(program); QByteArray raw(variable.toLocal8Bit()); const char* c_str(raw.data()); GLint location(glGetUniformLocation(program, c_str)); if (location < 0) { // qDebug() << "Shader location not found:" << shaderName << variable; return false; } setUniformVariable(program, location, value); return true; #else return false; #endif } private: static QGLFramebufferObject* s_normalBuffer; static QGLFramebufferObject* s_filterBuffer; static GLuint s_rotationTextureId; static GLuint s_rotationTextureSize; static GLfloat* s_rotationTextureData; static QMap<QString, unsigned> s_shaders; static ShaderLibrary* s_instance; static QString s_currentShader; static void destroy(); void initializeTextures(); bool m_filtersAvailable; bool m_filtersActive; bool m_shadersInitialized; void init(); void loadPreferences(); unsigned createProgram(QString const& vertexPath, QString const& fragmentPath); unsigned loadShader(QString const& path, unsigned const mode); QVariantMap parseUniformVariables(QString const& vertexShaderPath); static QVariantMap s_currentMaterial; bool setMaterialParameters(QVariantMap const& map); void setUniformVariable(GLuint program, GLint location, QSize const&); void setUniformVariable(GLuint program, GLint location, QSizeF const&); void setUniformVariable(GLuint program, GLint location, bool); void setUniformVariable(GLuint program, GLint location, double); void setUniformVariable(GLuint program, GLint location, GLfloat); void setUniformVariable(GLuint program, GLint location, QColor const&); void setUniformVariable(GLuint program, GLint location, Texture const&); void setUniformVariable(GLuint program, GLint location, GLFloatArray const& value); void setUniformVariable(GLuint program, GLint location, mat4x4 const& value); ShaderLibrary() : m_filtersAvailable(false), m_filtersActive(false), m_shadersInitialized(false) { } explicit ShaderLibrary(ShaderLibrary const&) { } ~ShaderLibrary(); }; } // end namespace IQmol #endif
/******************************************************************* Part of the Fritzing project - http://fritzing.org Copyright (c) 2007-2014 Fachhochschule Potsdam - http://fh-potsdam.de Fritzing 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. Fritzing 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 Fritzing. If not, see <http://www.gnu.org/licenses/>. ******************************************************************** $Revision: 6904 $: $Author: irascibl@gmail.com $: $Date: 2013-02-26 16:26:03 +0100 (Di, 26. Feb 2013) $ ********************************************************************/ #ifndef EDITABLEDATEWIDGET_H_ #define EDITABLEDATEWIDGET_H_ #include "abstracteditablelabelwidget.h" #include <QDateEdit> class EditableDateWidget : public AbstractEditableLabelWidget { Q_OBJECT public: EditableDateWidget(QDate date, WaitPushUndoStack *undoStack, QWidget *parent=0, QString title="", bool noSpacing=false, bool edited=false); protected: QString editionText(); void setEditionText(QString text); QWidget* myEditionWidget(); void setEmptyTextToEdit(); QDateEdit *m_dateEdit; }; #endif /* EDITABLEDATEWIDGET_H_ */
//******************************************************************************* // tinyRTX Filename: srtxuser.h (System Real Time eXecutive to USER interface) // // Copyright 2014 Sycamore Software, Inc. ** www.tinyRTX.com ** // Distributed under the terms of the GNU Lesser General Purpose License v3 // // This file is part of tinyRTX. tinyRTX is free software: you can redistribute // it and/or modify it under the terms of the GNU Lesser General Public License // version 3 as published by the Free Software Foundation. // // tinyRTX 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 // (filename copying.lesser.txt) and the GNU General Public License (filename // copying.txt) along with tinyRTX. If not, see <http://www.gnu.org/licenses/>. // // Revision history: // 17Oct03 SHiggins@tinyRTX.com Created from scratch. // 30Jul14 SHiggins@tinyRTX.com Reduce from 4 tasks to 3 to reduce stack needs. // 25Aug14 SHiggins@tinyRTX.com Create srtxuser.h from srtxuser.inc to use in srtxuser.c. // //******************************************************************************* // // Counts to load task timer at initialization (must be non-zero.) // Each task will be first scheduled at the SRTX-timer event which // occurs as equated below. However, please note that immediately // after initialization is complete, a single "faux" SRTX-timer // event occurs, which allows all tasks equated to "1" below to run. // Allowed range is (1 - 255). // #define SRTX_CNT_INIT_TASK1 1 #define SRTX_CNT_INIT_TASK2 1 #define SRTX_CNT_INIT_TASK3 1 // // Counts to reload task timer each expiration. This is the number of // SRTX-timer events which must occur before the task is again scheduled. // Allowed range is (1 - 255). // #define SRTX_CNT_RELOAD_TASK1 0x01 // 1 = 100 ms #define SRTX_CNT_RELOAD_TASK2 0x0a // 10 = 1.000 sec #define SRTX_CNT_RELOAD_TASK3 0x32 // 50 = 5.000 sec
void pr(int a, float b) { __print_int(a); __print_float(b); } int main() { int a; float b; a = -27; b = -0.07; pr(a, b); a = !5; b = !3.4; pr(a, b); a = !0; b = !0.0; pr(a, b); a = ~5; __print_int(a); a = 2 + 6; b = 2 + 6.5; pr(a, b); a = 7 - 4; b = 7.35 - 4; pr(a, b); a = 3 * 5; b = 3.3 * 5.2; pr(a, b); a = 5 / 2; b = 5.0 / 2.0; pr(a, b); a = 7 % 3; __print_int(a); a = 4 << 2; __print_int(a); a = 28 >> 1; __print_int(a); __print_int(2 < 7); __print_int(4 <= 0.2); __print_int(3.94 > 5); __print_int(8.23 >= 8.23); __print_int(3 == 3); __print_int(5.3 == 2); __print_int(2 != 5.7); __print_int(8.4 != 8.4); __print_int(2 && 5); __print_int(4.3 && 0); __print_int(0 || 7.2); __print_int(0.0 || 0.0); __print_int(5 | 2); __print_int(6 & 5); __print_int(5 ^ 6); a = (3, 7); b = (5.4, 2.7); pr(a, b); a = 5 ? 2 : 4; b = 0 ? 5.6 : 3.8; pr(a, b); return 0; }
/* * Unfuddle Tracker is a time tracking tool for Unfuddle service. * Copyright (C) 2012 Viatcheslav Gachkaylo <vgachkaylo@crystalnix.com> * * This file is part of Unfuddle Tracker. * * Unfuddle Tracker 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. * * Unfuddle Tracker 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 Unfuddle Tracker. If not, see <http://www.gnu.org/licenses/>. */ #ifndef APPLICATION_H #define APPLICATION_H #include <QApplication> #include <QSystemTrayIcon> #include <QMenu> #include <QAction> #include "screensnap/screensnap.h" #include "mainwindow.h" #include "preferencesdialog.h" class Application : public QApplication { Q_OBJECT public: explicit Application(int& argc, char* argv[]); ~Application(); static Application& instance(); static bool hasInstance(); QSystemTrayIcon& trayIcon(); MainWindow& mainWindow() { return m_mainWindow; } void applyDefaultSettings(); void enableScreensnap(); void disableScreensnap(); signals: public slots: void preferencesChanged(); private slots: void loggedIn(); void loggedOut(); void trayIconActivated(QSystemTrayIcon::ActivationReason reason); void showAboutDialog(); protected: void openAWindow(bool raise = false); #ifdef Q_WS_MAC QMenu m_dockMenu; QScopedPointer<QMenu> m_mac_screensnapMenu; #endif private: Screensnap m_screensnap; QSystemTrayIcon m_trayIcon; QMenu m_mainMenu; QMenu m_trayIconMenu; QAction m_quitAction; QAction m_preferencesAction; QAction m_logoutAction; QAction m_aboutAction; MainWindow m_mainWindow; PreferencesDialog m_preferencesDlg; QScopedPointer<QMenu> m_screensnapMenu; static Application* m_instance; }; #endif // APPLICATION_H
// // LTMediaCollectionCell.h // LesTaxinomes // // Created by Pierre-Loup Tristant on 06/03/13. // Copyright (c) 2013 Les Petits Débrouillards Bretagne. All rights reserved. // #import <UIKit/UIKit.h> #import "LTMedia.h" @interface LTMediaCollectionCell : UICollectionViewCell @property (nonatomic, strong) LTMedia *media; + (NSString *)reuseIdentifier; @end
//////////////////////////////////////////////////////////////////////////// // Created : 06.05.2010 // Author : Dmitriy Iassenev // Copyright (C) GSC Game World - 2010 //////////////////////////////////////////////////////////////////////////// #ifndef XRAY_STDLIB_EXTENSIONS_INLINE_H_INCLUDED #define XRAY_STDLIB_EXTENSIONS_INLINE_H_INCLUDED namespace xray { inline int sprintf ( pstr buffer, u32 const buffer_size, pcstr const format, ... ) { va_list mark; va_start ( mark, format ); return vsprintf( buffer, buffer_size, format, mark ); } template <int Size> inline int sprintf ( char (&buffer)[Size], pcstr const format, ... ) { va_list mark; va_start ( mark, format ); return vsprintf( &buffer[0], Size, format, mark ); } inline pstr strlwr ( pstr source, u32 const count ) { #ifdef _MSC_VER errno_t const error = _strlwr_s( source, count ); R_ASSERT_U ( !error, "cannot lowercase string \"%s\" (%d)", source, count ); #else // #ifdef _MSC_VER for ( pstr i=source; *i; ++i ) *i = tolower( *i ); #endif // #ifdef _MSC_VER return source; } inline pstr strupr ( pstr source, u32 const count ) { #ifdef _MSC_VER errno_t const error = _strupr_s( source, count ); R_ASSERT_U ( !error, "cannot uppercase string \"%s\" (%d)", source, count ); #else // #ifdef _MSC_VER for ( pstr i=source; *i; ++i ) *i = toupper( *i ); #endif // #ifdef _MSC_VER return source; } inline s64 fseek64 ( FILE* const file, u64 const offset, u32 origin ) { #ifdef _MSC_VER return _lseeki64( _fileno(file), offset, origin ); #else // #ifdef _MSC_VER return lseek64( fileno(file), offset, origin ); #endif // #ifdef _MSC_VER } inline int unlink ( pcstr const file_name ) { #ifdef _MSC_VER return ::_unlink( file_name ); #else // #ifdef _MSC_VER return ::unlink( file_name ); #endif // #ifdef _MSC_VER } } // namespace xray #endif // #ifndef XRAY_STDLIB_EXTENSIONS_INLINE_H_INCLUDED
// This is a Demo of the Irrlicht Engine (c) 2005 by N.Gebhardt. // This file is not documentated. #ifndef __C_MAIN_MENU_H_INCLUDED__ #define __C_MAIN_MENU_H_INCLUDED__ #include <irrlicht.h> using namespace irr; class CMainMenu : public IEventReceiver { public: CMainMenu(); bool run(bool& outFullscreen, bool& outMusic, bool& outShadows, bool& outAdditive, bool &outVSync, bool& outAA, video::E_DRIVER_TYPE& outDriver); virtual bool OnEvent(const SEvent& event); private: void setTransparency(); gui::IGUIButton* startButton; IrrlichtDevice *MenuDevice; s32 selected; bool start; bool fullscreen; bool music; bool shadows; bool additive; bool transparent; bool vsync; bool aa; scene::IAnimatedMesh* quakeLevel; scene::ISceneNode* lightMapNode; scene::ISceneNode* dynamicNode; video::SColor SkinColor [ gui::EGDC_COUNT ]; void getOriginalSkinColor(); }; #endif
// -*- C++ -*- #ifndef HERWIG_GammaPMETest_H #define HERWIG_GammaPMETest_H // // This is the declaration of the GammaPMETest class. // #include "ThePEG/Handlers/AnalysisHandler.h" #include "Herwig/Utilities/Histogram.h" namespace Herwig { using namespace ThePEG; /** * Here is the documentation of the GammaPMETest class. * * @see \ref GammaPMETestInterfaces "The interfaces" * defined for GammaPMETest. */ class GammaPMETest: public AnalysisHandler { public: /** @name Virtual functions required by the AnalysisHandler class. */ //@{ /** * Analyze a given Event. Note that a fully generated event * may be presented several times, if it has been manipulated in * between. The default version of this function will call transform * to make a lorentz transformation of the whole event, then extract * all final state particles and call analyze(tPVector) of this * analysis object and those of all associated analysis objects. The * default version will not, however, do anything on events which * have not been fully generated, or have been manipulated in any * way. * @param event pointer to the Event to be analyzed. * @param ieve the event number. * @param loop the number of times this event has been presented. * If negative the event is now fully generated. * @param state a number different from zero if the event has been * manipulated in some way since it was last presented. */ virtual void analyze(tEventPtr event, long ieve, int loop, int state); //@} public: /** * The standard Init function used to initialize the interfaces. * Called exactly once for each class by the class description system * before the main function starts or * when this class is dynamically loaded. */ static void Init(); protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ virtual IBPtr fullclone() const; //@} protected: /** @name Standard Interfaced functions. */ //@{ /** * Initialize this object. Called in the run phase just before * a run begins. */ virtual void doinitrun(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ virtual void dofinish(); //@} private: /** * The assignment operator is private and must never be called. * In fact, it should not even be implemented. */ GammaPMETest & operator=(const GammaPMETest &) = delete; private: /** * Histograms */ HistogramPtr _rap,_phi,_pt,_mhat,_yhat; }; } #endif /* HERWIG_GammaPMETest_H */
/* Author: cuckoo Date: 2017/07/06 11:13:17 Update: Problem: Number of Digit One Difficulty: Hard Source: https://leetcode.com/problems/number-of-digit-one/#/description */ #include <string> using std::string; #include <cmath> // for pow() class Solution { public: int countDigitOne(int n) { return countDigitOneFirst(n); } int countDigitOneFirst(int n) { if(n <= 0) return 0; string n_str = std::to_string(n); return CountDigtiOneFirstAux(n_str, 0); } int CountDigtiOneFirstAux(string &n, int index) { int first = n[index] - '0'; if(index == n.size() - 1) return first == 0 ? 0 : 1; int length = n.size() - index; // 首位为1的数目 int first_one_count = 0; if(first > 1) first_one_count = std::pow(10, length - 1); else if(first == 1) first_one_count = std::stoi(n.substr(index + 1)) + 1; // 其他位为1的数目 int other_one_count = first * (length - 1) * std::pow(10, length - 2); return first_one_count + other_one_count + CountDigtiOneFirstAux(n, index + 1); } // from Editorial Solution int countDigitOneSecond(int n) { int result = 0; for(long long i = 1; i <= n; i *= 10) { long long divider = i * 10; result += n / divider * i + std::min(std::max(n % divider - i + 1, 0LL), i); } return result; } };
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <semaphore.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> #include <assert.h> #include "semconfig.h" sem_t *mysem = NULL; pid_t child; int main(int argc, char **argv) { sem_unlink(TESTSEM); if ( (mysem = sem_open(TESTSEM, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR, 0)) != NULL ) { if ( (child = fork()) == 0 ) { /* child */ usleep(250); LOG("child: sempost"); sem_post(mysem); int tmp = 0; assert ( sem_getvalue(mysem, &tmp) == 0 && tmp == 1 ); LOG("child: done"); usleep(250); exit(0); } else if (child > 0) { /* parent */ LOG("parent: semwait"); sem_wait(mysem); LOG("parent: waitpid"); waitpid(child, NULL, 0); } else if (child < 0) { perror("fork"); } } else { sem_close(mysem); exit(1); } int sval = 1; assert ( sem_getvalue(mysem, &sval) == 0 && sval == 0 ); assert (sval == 0); sem_unlink(TESTSEM); exit(0); }
/***************************************************************************** This file is part of QSS Solver. QSS Solver 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. QSS Solver 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 QSS Solver. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ #ifndef CVODE_INTEGRATOR_H_ #define CVODE_INTEGRATOR_H_ #include "../common/simulator.h" /** * */ void CVODE_integrate(SIM_simulator simulator); #endif /* CVODE_INTEGRATOR_H_ */
INPUT_PORTS_START( iqblock ) PORT_START PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // "test mode" only PORT_START PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) // "test mode" only PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL // "test mode" only PORT_START PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) // "test mode" only PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) // "test mode" only PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL // "test mode" only PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL // "test mode" only PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START PORT_DIPNAME( 0x03, 0x03, "Unknown SW 0-0&1" ) // Difficulty ? Read notes above PORT_DIPSETTING( 0x03, "0" ) PORT_DIPSETTING( 0x02, "1" ) PORT_DIPSETTING( 0x01, "2" ) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPNAME( 0x0c, 0x0c, "Helps" ) PORT_DIPSETTING( 0x0c, "1" ) PORT_DIPSETTING( 0x08, "2" ) PORT_DIPSETTING( 0x04, "3" ) PORT_DIPSETTING( 0x00, "4" ) PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coin_A ) ) PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_6C ) ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START PORT_DIPNAME( 0x01, 0x00, "Demo Sounds?" ) // To be confirmed ! Read notes above PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Free_Play ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) INPUT_PORTS_END GAME( 1993, iqblock, 0, iqblock, iqblock, iqblock, ROT0, "IGS", "IQ-Block", 0 ) GAME( 1993, grndtour, 0, iqblock, iqblock, grndtour, ROT0, "IGS", "Grand Tour", 0 ) GAME( 19??, cabaret, 0, cabaret, iqblock, cabaret, ROT0, "IGS", "Cabaret", GAME_NOT_WORKING | GAME_NO_SOUND )
/* * This file is part of the Colobot: Gold Edition source code * Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam * http://epsitec.ch; http://colobot.info; http://github.com/colobot * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://gnu.org/licenses */ /** * \file common/image.h * \brief Class for loading and saving images */ #pragma once #include "graphics/core/color.h" #include "math/intpoint.h" #include <memory> #include <string> // Forward declaration without including headers to clutter the code struct SDL_Surface; //! Implementation-specific image data /** Note that the struct has no destructor and the surface will not be freed at destruction. */ struct ImageData { //! SDL surface with image data SDL_Surface* surface = nullptr; }; /** \class CImage \brief Image loaded from file Wrapper around SDL_Image library to load images. Also contains function for saving images to PNG. */ class CImage { public: //! Constructs empty image (with nullptr data) CImage(); //! Constructs a RGBA image of given size CImage(Math::IntPoint size); //! Destroys image, calling Free() virtual ~CImage(); CImage(const CImage &other) = delete; void operator=(const CImage &other) = delete; //! Frees the allocated image data void Free(); //! Returns whether the image is empty (has null data) bool IsEmpty() const; //! Returns the image data; if empty - returns nullptr ImageData* GetData(); //! Returns the image size Math::IntPoint GetSize() const; //! Fills the whole image with given color void Fill(Gfx::IntColor color); //! Sets the color at given pixel void SetPixel(Math::IntPoint pixel, Gfx::Color color); //! Sets the precise color at given pixel void SetPixelInt(Math::IntPoint pixel, Gfx::IntColor color); //! Returns the color at given pixel Gfx::Color GetPixel(Math::IntPoint pixel); //! Returns the precise color at given pixel Gfx::IntColor GetPixelInt(Math::IntPoint pixel); //! Pads the image to nearest power of 2 dimensions void PadToNearestPowerOfTwo(); //! Convert the image to RGBA surface void ConvertToRGBA(); //! Loads an image from the specified file bool Load(const std::string &fileName); //! Saves the image to the specified file in PNG format bool SavePNG(const std::string &fileName); //! Returns the last error std::string GetError(); //! Flips the image vertically void FlipVertically(); //! sets/replaces the pixels from the surface void SetDataPixels(void *pixels); private: //! Blit to new RGBA surface with given size void BlitToNewRGBASurface(int width, int height); //! Last encountered error std::string m_error; //! Image data std::unique_ptr<ImageData> m_data; };
/********************************************************** * Version $Id$ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Points_Random.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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. // // // // SAGA 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, 5th Floor, Boston, MA 02110-1301, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_To_Points_Random_H #define HEADER_INCLUDED__Grid_To_Points_Random_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_To_Points_Random : public CSG_Module_Grid { public: CGrid_To_Points_Random(void); virtual ~CGrid_To_Points_Random(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Vectorization") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_To_Points_Random_H
/* * Copyright (C) 2012 Apple 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 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 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 JITDriver_h #define JITDriver_h #include <wtf/Platform.h> #if ENABLE(JIT) #include "BytecodeGenerator.h" #include "DFGDriver.h" #include "JIT.h" #include "LLIntEntrypoints.h" namespace JSC { template<typename CodeBlockType> inline bool jitCompileIfAppropriate(JSGlobalData& globalData, OwnPtr<CodeBlockType>& codeBlock, JITCode& jitCode, JITCode::JITType jitType, JITCompilationEffort effort) { if (jitType == codeBlock->getJITType()) return true; if (!globalData.canUseJIT()) return true; codeBlock->unlinkIncomingCalls(); JITCode oldJITCode = jitCode; bool dfgCompiled = false; if (jitType == JITCode::DFGJIT) dfgCompiled = DFG::tryCompile(globalData, codeBlock.get(), jitCode); if (dfgCompiled) { if (codeBlock->alternative()) codeBlock->alternative()->unlinkIncomingCalls(); } else { if (codeBlock->alternative()) { codeBlock = static_pointer_cast<CodeBlockType>(codeBlock->releaseAlternative()); jitCode = oldJITCode; return false; } jitCode = JIT::compile(&globalData, codeBlock.get(), effort); if (!jitCode) { jitCode = oldJITCode; return false; } } codeBlock->setJITCode(jitCode, MacroAssemblerCodePtr()); return true; } inline bool jitCompileFunctionIfAppropriate(JSGlobalData& globalData, OwnPtr<FunctionCodeBlock>& codeBlock, JITCode& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, SharedSymbolTable*& symbolTable, JITCode::JITType jitType, JITCompilationEffort effort) { if (jitType == codeBlock->getJITType()) return true; if (!globalData.canUseJIT()) return true; codeBlock->unlinkIncomingCalls(); JITCode oldJITCode = jitCode; MacroAssemblerCodePtr oldJITCodeWithArityCheck = jitCodeWithArityCheck; bool dfgCompiled = false; if (jitType == JITCode::DFGJIT) dfgCompiled = DFG::tryCompileFunction(globalData, codeBlock.get(), jitCode, jitCodeWithArityCheck); if (dfgCompiled) { if (codeBlock->alternative()) codeBlock->alternative()->unlinkIncomingCalls(); } else { if (codeBlock->alternative()) { codeBlock = static_pointer_cast<FunctionCodeBlock>(codeBlock->releaseAlternative()); symbolTable = codeBlock->sharedSymbolTable(); jitCode = oldJITCode; jitCodeWithArityCheck = oldJITCodeWithArityCheck; return false; } jitCode = JIT::compile(&globalData, codeBlock.get(), effort, &jitCodeWithArityCheck); if (!jitCode) { jitCode = oldJITCode; jitCodeWithArityCheck = oldJITCodeWithArityCheck; return false; } } codeBlock->setJITCode(jitCode, jitCodeWithArityCheck); return true; } } // namespace JSC #endif // ENABLE(JIT) #endif // JITDriver_h
/* Test of u16_prev() function. Copyright (C) 2010-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2010. */ #include <config.h> #include "unistr.h" #include "macros.h" static int check (const uint16_t *input, size_t input_length, ucs4_t *puc) { ucs4_t uc; /* Test recognition when at the beginning of the string. */ if (u16_prev (&uc, input + input_length, input) != input) return 1; /* Test recognition when preceded by a 1-unit character. */ { uint16_t buf[100]; uint16_t *ptr; size_t i; ucs4_t uc1; ptr = buf; *ptr++ = 0x2102; for (i = 0; i < input_length; i++) ptr[i] = input[i]; if (u16_prev (&uc1, ptr + input_length, buf) != ptr) return 2; if (uc1 != uc) return 3; } /* Test recognition when preceded by a 2-unit character. */ { uint16_t buf[100]; uint16_t *ptr; size_t i; ucs4_t uc1; ptr = buf; *ptr++ = 0xD835; *ptr++ = 0xDD1E; for (i = 0; i < input_length; i++) ptr[i] = input[i]; if (u16_prev (&uc1, ptr + input_length, buf) != ptr) return 4; if (uc1 != uc) return 5; } *puc = uc; return 0; } static int check_invalid (const uint16_t *input, size_t input_length) { ucs4_t uc; /* Test recognition when at the beginning of the string. */ uc = 0xBADFACE; if (u16_prev (&uc, input + input_length, input) != NULL) return 1; if (uc != 0xBADFACE) return 2; #if CONFIG_UNICODE_SAFETY /* Test recognition when preceded by a 1-unit character. */ { uint16_t buf[100]; uint16_t *ptr; size_t i; ptr = buf; *ptr++ = 0x2102; for (i = 0; i < input_length; i++) ptr[i] = input[i]; uc = 0xBADFACE; if (u16_prev (&uc, ptr + input_length, buf) != NULL) return 3; if (uc != 0xBADFACE) return 4; } /* Test recognition when preceded by a 2-unit character. */ { uint16_t buf[100]; uint16_t *ptr; size_t i; ptr = buf; *ptr++ = 0xD835; *ptr++ = 0xDD1E; for (i = 0; i < input_length; i++) ptr[i] = input[i]; uc = 0xBADFACE; if (u16_prev (&uc, ptr + input_length, buf) != NULL) return 5; if (uc != 0xBADFACE) return 6; } #endif return 0; } int main () { ucs4_t uc; /* Test ISO 646 unit input. */ { ucs4_t c; uint16_t buf[1]; for (c = 0; c < 0x80; c++) { buf[0] = c; uc = 0xBADFACE; ASSERT (check (buf, 1, &uc) == 0); ASSERT (uc == c); } } /* Test BMP unit input. */ { static const uint16_t input[] = { 0x20AC }; uc = 0xBADFACE; ASSERT (check (input, SIZEOF (input), &uc) == 0); ASSERT (uc == 0x20AC); } /* Test 2-units character input. */ { static const uint16_t input[] = { 0xD835, 0xDD1F }; uc = 0xBADFACE; ASSERT (check (input, SIZEOF (input), &uc) == 0); ASSERT (uc == 0x1D51F); } /* Test incomplete/invalid 1-unit input. */ { static const uint16_t input[] = { 0xD835 }; ASSERT (check_invalid (input, SIZEOF (input)) == 0); } { static const uint16_t input[] = { 0xDD1F }; ASSERT (check_invalid (input, SIZEOF (input)) == 0); } return 0; }
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. 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. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSGTEXTURE_P_H #define QSGTEXTURE_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <QtQuick/qtquickglobal.h> #include <private/qobject_p.h> #include <QtGui/qopengl.h> #include "qsgtexture.h" #include <QtQuick/private/qsgcontext_p.h> QT_BEGIN_NAMESPACE class QSGTexturePrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QSGTexture) public: QSGTexturePrivate(); uint wrapChanged : 1; uint filteringChanged : 1; uint horizontalWrap : 1; uint verticalWrap : 1; uint mipmapMode : 2; uint filterMode : 2; }; class Q_QUICK_PRIVATE_EXPORT QSGPlainTexture : public QSGTexture { Q_OBJECT public: QSGPlainTexture(); virtual ~QSGPlainTexture(); void setOwnsTexture(bool owns) { m_owns_texture = owns; } bool ownsTexture() const { return m_owns_texture; } void setTextureId(int id); int textureId() const; void setTextureSize(const QSize &size) { m_texture_size = size; } QSize textureSize() const { return m_texture_size; } void setHasAlphaChannel(bool alpha) { m_has_alpha = alpha; } bool hasAlphaChannel() const { return m_has_alpha; } bool hasMipmaps() const { return mipmapFiltering() != QSGTexture::None; } void setImage(const QImage &image); const QImage &image() { return m_image; } virtual void bind(); static QSGPlainTexture *fromImage(const QImage &image) { QSGPlainTexture *t = new QSGPlainTexture(); t->setImage(image); return t; } protected: QImage m_image; GLuint m_texture_id; QSize m_texture_size; QRectF m_texture_rect; uint m_has_alpha : 1; uint m_dirty_texture : 1; uint m_dirty_bind_options : 1; uint m_owns_texture : 1; uint m_mipmaps_generated : 1; uint m_retain_image: 1; }; Q_QUICK_PRIVATE_EXPORT bool qsg_safeguard_texture(QSGTexture *); QT_END_NAMESPACE #endif // QSGTEXTURE_P_H