text
stringlengths
4
6.14k
// // TJNetManager.h // TJMVVM // // Created by Tang杰 on 17/2/21. // Copyright © 2017年 Tang杰. All rights reserved. // #import <Foundation/Foundation.h> #import "TJRequest.h" #import <AFNetworking/AFNetworking.h> typedef void (^progress)(NSProgress *progress); typedef void (^success)(NSDictionary *responseObject); typedef void (^failure)(NSError *error); #define TJ_NetManager [TJNetManager netManager] @interface TJNetManager : NSObject /** 当前网络可用 */ @property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable; /** 当前处于移动网络 */ @property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN; /** 当前处于WiFi网络 */ @property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi; /** 声明单利方法 @return 返回单利 */ + (instancetype)netManager; /** 返回当前会话任务 @param requestBlock 请求体(在block内部配置request,默认method = GET,needLogin = YES) @param progress 请求进度 @param success 请求成功返回数据字典 @param failure 请求失败返回错误信息 @return 当前会话 */ - (NSURLSessionDataTask *)sendRequest:(TJRequest *(^)(TJRequest *request))requestBlock progress:(progress)progress success:(success)success failure:(failure)failure; /** 向请求头添加参数 @param value 参数值 @param key 参数键 */ - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)key; /** 取消所有请求 */ - (void)cancelAllOperations; /** 结束当前请求 @param request 当前请求 */ - (void)cancelCurrentRequest:(TJRequest *)request; /** 开始观察网络状态变化 @param block 返回网络状态 */ - (void)startObservationNetworkStatusChangesBlock:(void(^)(AFNetworkReachabilityStatus status))block; /** 开始监控网络变化 */ - (void)startMonitoring; /** 结束观察网络状态变化 */ - (void)stopMonitoring; - (NSError *)getFailureInfo:(NSDictionary *)response; /** 区别云端和固件http请求数据的格式 云端 AFHTTPRequestSerializer 固件 AFJSONRequestSerializer **/ - (void)setHttpRequestSerializer:(AFHTTPRequestSerializer *)serializer; @end
#ifndef __INCREMENTAL_READ_INTERFACE_H #define __INCREMENTAL_READ_INTERFACE_H #include "FileListNodeContext.h" #include "Export.h" class RAK_DLL_EXPORT IncrementalReadInterface { public: /// Read part of a file into \a destination /// Return the number of bytes written. Return 0 when file is done. /// \param[in] filename Filename to read /// \param[in] startReadBytes What offset from the start of the file to read from /// \param[in] numBytesToRead How many bytes to read. This is also how many bytes have been allocated to preallocatedDestination /// \param[out] preallocatedDestination Write your data here /// \return The number of bytes read, or 0 if none virtual unsigned int GetFilePart( char *filename, unsigned int startReadBytes, unsigned int numBytesToRead, void *preallocatedDestination, FileListNodeContext context); }; #endif
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_ #define MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_ #include <stddef.h> #include <stdint.h> #include <memory> #include <vector> #include "webrtc/api/sequence_checker.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/include/ulpfec_receiver.h" #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" #include "webrtc/rtc_base/system/no_unique_address.h" namespace webrtc { class UlpfecReceiverImpl : public UlpfecReceiver { public: explicit UlpfecReceiverImpl(uint32_t ssrc, RecoveredPacketReceiver* callback, rtc::ArrayView<const RtpExtension> extensions); ~UlpfecReceiverImpl() override; bool AddReceivedRedPacket(const RtpPacketReceived& rtp_packet, uint8_t ulpfec_payload_type) override; int32_t ProcessReceivedFec() override; FecPacketCounter GetPacketCounter() const override; void SetRtpExtensions(rtc::ArrayView<const RtpExtension> extensions) override; private: const uint32_t ssrc_; RtpHeaderExtensionMap extensions_ RTC_GUARDED_BY(&sequence_checker_); RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_checker_; RecoveredPacketReceiver* const recovered_packet_callback_; const std::unique_ptr<ForwardErrorCorrection> fec_; // TODO(nisse): The AddReceivedRedPacket method adds one or two packets to // this list at a time, after which it is emptied by ProcessReceivedFec. It // will make things simpler to merge AddReceivedRedPacket and // ProcessReceivedFec into a single method, and we can then delete this list. std::vector<std::unique_ptr<ForwardErrorCorrection::ReceivedPacket>> received_packets_ RTC_GUARDED_BY(&sequence_checker_); ForwardErrorCorrection::RecoveredPacketList recovered_packets_ RTC_GUARDED_BY(&sequence_checker_); FecPacketCounter packet_counter_ RTC_GUARDED_BY(&sequence_checker_); }; } // namespace webrtc #endif // MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_
// Copyright 2013 Sina Inc. All rights reserved. // Author: sijia2@staff.sina.com.cn (Sijia Yu) // Description: retrieval handler supplied to the other class #ifndef SRC_RETRIEVAL_RETRIEVAL_HANDLER_H_ #define SRC_RETRIEVAL_RETRIEVAL_HANDLER_H_ #include <boost/shared_ptr.hpp> #include <vector> #include <map> #include "gflags/gflags.h" #include "glog/logging.h" #include "../indexing/instant_index.h" #include "./RecommEngine.h" #include "./recomm_engine_types.h" #include "./recomm_engine_constants.h" #include "./index_reader.h" #include "./ranker.h" #include "./result_set.h" #define MAX_DOC_RETURN 30 namespace recomm_engine { namespace retrieving { class RetrievalHandler { public: RetrievalHandler(); ~RetrievalHandler(); int open(); int retrieve(const idl::RetrievalRequest& request, idl::RetrievalResponse* response); protected: void makeReply(idl::RetrievalResponse* response, int doc_num, result_set* doc_set); protected: Ranker *m_ranker; // compute score for per doc }; } // namespace retrieving } // namespace recomm_engine #endif // SRC_RETRIEVAL_RETRIEVAL_HANDLER_H_
// // ZXAppDelegate.h // screenShotDemo // // Created by zx on 1/31/15. // Copyright (c) 2015 zx. All rights reserved. // #import <UIKit/UIKit.h> @interface ZXAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* * The Minimal snprintf() implementation * Copyright (c) 2013 Michal Ludvig <michal@logix.cz> * * This is a minimal snprintf() implementation optimised * for embedded systems with a very limited program memory. * mini_snprintf() doesn't support _all_ the formatting * the glibc does but on the other hand is a lot smaller. * Here are some numbers from my STM32 project (.bin file size): * no snprintf(): 10768 bytes * mini snprintf(): 11420 bytes (+ 652 bytes) * glibc snprintf(): 34860 bytes (+24092 bytes) * Wasting nearly 24kB of memory just for snprintf() on * a chip with 32kB flash is crazy. Use mini_snprintf() instead. */ #include <string.h> #include <stdarg.h> #include "mini_printf.h" static unsigned int mini_strlen(const char *s) { unsigned int len = 0; while (s[len++]) /* do nothing */; return len; } static unsigned int mini_itoa(int value, unsigned int radix, unsigned int uppercase, char *buffer, unsigned int zero_pad) { char *pbuffer = buffer; int negative = 0; unsigned int i, len; /* No support for unusual radixes. */ if (radix > 16) return 0; if (value < 0) { negative = 1; value = -value; } /* This builds the string back to front ... */ do { int digit = value % radix; *(pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10); value /= radix; } while (value > 0); for (i = (pbuffer - buffer); i < zero_pad; i++) *(pbuffer++) = '0'; if (negative) *(pbuffer++) = '-'; *(pbuffer) = '\0'; /* ... now we reverse it (could do it recursively but will * conserve the stack space) */ len = (pbuffer - buffer); for (i = 0; i < len / 2; i++) { char j = buffer[i]; buffer[i] = buffer[len-i-1]; buffer[len-i-1] = j; } return len; } int mini_vsnprintf(char *buffer, unsigned int buffer_len, char *fmt, va_list va) { char *pbuffer = buffer; char bf[24]; char ch; int _putc(char ch) { if ((unsigned int)((pbuffer - buffer) + 1) >= buffer_len) return 0; *(pbuffer++) = ch; *(pbuffer) = '\0'; return 1; } int _puts(char *s, unsigned int len) { unsigned int i; if (buffer_len - (pbuffer - buffer) - 1 < len) len = buffer_len - (pbuffer - buffer) - 1; /* Copy to buffer */ for (i = 0; i < len; i++) *(pbuffer++) = s[i]; *(pbuffer) = '\0'; return len; } while ((ch=*(fmt++))) { if ((unsigned int)((pbuffer - buffer) + 1) >= buffer_len) break; if (ch!='%') _putc(ch); else { char zero_pad = 0; char *ptr; unsigned int len; ch=*(fmt++); /* Zero padding requested */ if (ch=='0') { ch=*(fmt++); if (ch == '\0') goto end; if (ch >= '0' && ch <= '9') zero_pad = ch - '0'; ch=*(fmt++); } switch (ch) { case 0: goto end; case 'u': case 'd': len = mini_itoa(va_arg(va, unsigned int), 10, 0, bf, zero_pad); _puts(bf, len); break; case 'x': case 'X': len = mini_itoa(va_arg(va, unsigned int), 16, (ch=='X'), bf, zero_pad); _puts(bf, len); break; case 'c' : _putc((char)(va_arg(va, int))); break; case 's' : ptr = va_arg(va, char*); _puts(ptr, mini_strlen(ptr)); break; default: _putc(ch); break; } } } end: return pbuffer - buffer; } int mini_snprintf(char* buffer, unsigned int buffer_len, char *fmt, ...) { int ret; va_list va; va_start(va, fmt); ret = mini_vsnprintf(buffer, buffer_len, fmt, va); va_end(va); return ret; }
#ifndef ThirdInnerPlan_H_ #define ThirdInnerPlan_H_ #include "DomainCondition.h" #include "engine/BasicUtilityFunction.h" #include "engine/UtilityFunction.h" #include "engine/DefaultUtilityFunction.h" /*PROTECTED REGION ID(incl1464091819666) ENABLED START*/ //Add inlcudes here /*PROTECTED REGION END*/ using namespace alica; namespace alicaAutogenerated { /*PROTECTED REGION ID(meth1464091819666) ENABLED START*/ //Add other things here /*PROTECTED REGION END*/ class UtilityFunction1464091819666 : public BasicUtilityFunction { shared_ptr<UtilityFunction> getUtilityFunction(Plan* plan); }; class RunTimeCondition1464096415101 : public DomainCondition { bool evaluate(shared_ptr<RunningPlan> rp); }; } /* namespace alica */ #endif
#ifndef __FASTFORWARD_PERFORMANCE_MANAGER_H #define __FASTFORWARD_PERFORMANCE_MANAGER_H #include "fixed_types.h" #include "subsecond_time.h" class FastForwardPerformanceManager { public: static FastForwardPerformanceManager* create(); FastForwardPerformanceManager(); void enable(); void disable(); protected: friend class FastforwardPerformanceModel; void recalibrateInstructionsCallback(core_id_t core_id); private: const SubsecondTime m_sync_interval; bool m_enabled; SubsecondTime m_target_sync_time; static SInt64 hook_instr_count(UInt64 self, UInt64 core_id) { ((FastForwardPerformanceManager*)self)->instr_count(core_id); return 0; } static SInt64 hook_periodic(UInt64 self, UInt64 time) { ((FastForwardPerformanceManager*)self)->periodic(*(subsecond_time_t*)&time); return 0; } void instr_count(core_id_t core_id); void periodic(SubsecondTime time); void step(); }; #endif // __FASTFORWARD_PERFORMANCE_MANAGER_H
#pragma once #include <vector> #include "Boop.h" #include "Food.h" #include "ContactListener.h" #include <chrono> class Tournament { private: ContactListener *contactListener; std::chrono::milliseconds deltaTime; std::chrono::high_resolution_clock::time_point lastRun = std::chrono::high_resolution_clock::now(); public: std::vector<Boop*> deadBoops; Tournament(); void setBoops(std::vector<Boop*> newBoops); void manageFood(); std::vector<Food*> foods; std::vector<Boop*> boops; b2Body *groundBody; b2World *physWorld; void run(); void reset(); };
#import <MUKSignal/MUKSignal-Base.h> NS_ASSUME_NONNULL_BEGIN /** A signal which can be observed with a suspendable subscription. When a subscriber is suspended, dispatching a signal does not invoke a subscriber. When subscriber is resumed it receives the last dispatched payload. */ @interface MUKSignal<__covariant T> (Suspending) /** Suspend a subscriber @param token Subscription token */ - (void)suspend:(id)token; /** Resume a subscriber @param token A suspended subscriber token */ - (void)resume:(id)token; /** Get suspension status @param token Subscription token @returns YES when subscription is suspended */ - (BOOL)isSuspended:(id)token; /** Get suspended dispatch payload. @param token A suspended subscriber token @returns Suspended dispatch payload which will be dispatched when signal is resumed. */ - (nullable T)suspendedDispatchPayload:(id)token; /** Merge dispatch payload with previous suspended payload. This method is not called if there isn't a suspended payload. @param payload Dispatched payload @param suspendedPayload Stored suspended payload. It could be nil if suspended dispatch has a nil payload. @returns Merged payload. Default implementation returns payload (trumps suspended one). */ - (nullable T)mergedDispatchPayload:(nullable T)payload withSuspendedPayload:(nullable T)suspendedPayload; @end NS_ASSUME_NONNULL_END
#include "x86.h" #define TIMER_PORT 0x40 #define FREQ_8253 1193182 void init_timer() { int counter = FREQ_8253 / 100; assert(counter < 65536); out_byte(TIMER_PORT + 3, 0x34); out_byte(TIMER_PORT + 0, counter % 256); out_byte(TIMER_PORT + 0, counter / 256); }
/////////////////////////////////////////////////////////////////////////////// // Name: wx/osx/core/stdpaths.h // Purpose: wxStandardPaths for CoreFoundation systems // Author: David Elliott // Modified by: // Created: 2004-10-27 // RCS-ID: $Id$ // Copyright: (c) 2004 David Elliott // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_MAC_STDPATHS_H_ #define _WX_MAC_STDPATHS_H_ struct __CFBundle; struct __CFURL; typedef const __CFURL * wxCFURLRef; typedef __CFBundle * wxCFBundleRef; // we inherit the GUI CF-based wxStandardPaths implementation from the Unix one // used for console programs if possible (i.e. if we're under a Unix system at // all) #if defined(__UNIX__) #include "wx/unix/stdpaths.h" #define wxStandardPathsCFBase wxStandardPaths #else #define wxStandardPathsCFBase wxStandardPathsBase #endif // ---------------------------------------------------------------------------- // wxStandardPaths // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxStandardPathsCF : public wxStandardPathsCFBase { public: wxStandardPathsCF(); virtual ~wxStandardPathsCF(); // wxMac specific: allow user to specify a different bundle wxStandardPathsCF(wxCFBundleRef bundle); void SetBundle(wxCFBundleRef bundle); // implement base class pure virtuals virtual wxString GetExecutablePath() const; virtual wxString GetConfigDir() const; virtual wxString GetUserConfigDir() const; virtual wxString GetDataDir() const; virtual wxString GetLocalDataDir() const; virtual wxString GetUserDataDir() const; virtual wxString GetPluginsDir() const; virtual wxString GetResourcesDir() const; virtual wxString GetLocalizedResourcesDir(const wxString& lang, ResourceCat category = ResourceCat_None) const; virtual wxString GetDocumentsDir() const; protected: // this function can be called with any of CFBundleCopyXXXURL function // pointer as parameter wxString GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const; wxCFBundleRef m_bundle; }; #endif // _WX_MAC_STDPATHS_H_
/* annoStreamer -- returns items sorted by genomic position to successive nextRow calls */ #ifndef ANNOSTREAMER_H #define ANNOSTREAMER_H #include "annoAssembly.h" #include "annoFilter.h" #include "annoRow.h" // The real work of fetching and filtering data is left to subclass // implementations. The purpose of this module is to provide an // interface for communication with other components of the // annoGratorQuery framework, and simple methods shared by all // subclasses. struct annoStreamer /* Generic interface to configure a data source's filters and output data, and then * retrieve data, which must be sorted by genomic position. Subclasses of this * will do all the actual work. */ { struct annoStreamer *next; // Public methods struct asObject *(*getAutoSqlObject)(struct annoStreamer *self); /* Get autoSql representation (do not modify or free asObj!) * There is no setter because changing the asObj should never be externally imposed. * Subclasses must use annoStreamerSetAutoSqlObject to change their internal asObj. */ char *(*getName)(struct annoStreamer *self); void (*setName)(struct annoStreamer *self, char *name); /* Get and set name (short identifier, unique among streamers in a query). */ void (*setRegion)(struct annoStreamer *self, char *chrom, uint rStart, uint rEnd); /* Set genomic region for query; if chrom is NULL, region is whole genome. * This must be called on all annoGrator components in query, not a subset. */ char *(*getHeader)(struct annoStreamer *self); /* Get the file header as a string (possibly NULL, possibly multi-line). */ void (*setFilters)(struct annoStreamer *self, struct annoFilter *newFilters); void (*addFilters)(struct annoStreamer *self, struct annoFilter *newFilters); /* Set/add filters. Memory management of filters is up to caller. */ struct annoRow *(*nextRow)(struct annoStreamer *self, char *minChrom, uint minEnd, struct lm *lm); /* Get the next item from this source. If minChrom is non-NULL, optionally use * that as a hint to skip items that precede {minChrom, minEnd}. * Use localmem lm to store returned annoRow. */ void (*close)(struct annoStreamer **pSelf); /* Close connection to source and free self. */ // Public members -- callers are on the honor system to access these read-only. struct annoAssembly *assembly; // Genome assembly that provides coords for annotations struct asObject *asObj; // Annotation data definition char *name; // Short identifier, e.g. name of file or database table struct annoFilter *filters; // Filters to constrain output char *chrom; // Non-NULL if querying a particular region uint regionStart; // If chrom is non-NULL, region start coord uint regionEnd; // If chrom is non-NULL, region end coord boolean positionIsGenome; // True if doing a whole-genome query enum annoRowType rowType; // Type of annotations (words or wiggle data) int numCols; // For word-based annotations, number of words/columns }; struct annoStreamRows /* An annoStreamer and (possibly NULL) list of rows it generated. */ { struct annoStreamer *streamer; // annoStreamer interface for metadata about row data struct annoRow *rowList; // row data }; // ---------------------- annoStreamer default methods ----------------------- struct asObject *annoStreamerGetAutoSqlObject(struct annoStreamer *self); /* Return parsed autoSql definition of this streamer's data type. */ void annoStreamerSetAutoSqlObject(struct annoStreamer *self, struct asObject *asObj); /* Use new asObj and update internal state derived from asObj. */ char *annoStreamerGetName(struct annoStreamer *self); /* Returns cloned name of streamer; free when done. */ void annoStreamerSetName(struct annoStreamer *self, char *name); /* Sets streamer name to clone of name. */ void annoStreamerSetRegion(struct annoStreamer *self, char *chrom, uint rStart, uint rEnd); /* Set genomic region for query; if chrom is NULL, position is genome. * Many subclasses should make their own setRegion method that calls this and * configures their data connection to change to the new position. */ void annoStreamerSetFilters(struct annoStreamer *self, struct annoFilter *newFilters); /* Replace any existing filters with newFilters. It is up to calling code to * free old filters and allocate newFilters. */ void annoStreamerAddFilters(struct annoStreamer *self, struct annoFilter *newFilters); /* Add newFilter(s). It is up to calling code to allocate newFilters. */ void annoStreamerInit(struct annoStreamer *self, struct annoAssembly *assembly, struct asObject *asObj, char *name); /* Initialize a newly allocated annoStreamer with default annoStreamer methods and * default filters and columns based on asObj. * In general, subclasses' constructors will call this first; override nextRow, close, * and probably setRegion; and then initialize their private data. */ void annoStreamerFree(struct annoStreamer **pSelf); /* Free self. This should be called at the end of subclass close methods, after * subclass-specific connections are closed and resources are freed. */ boolean annoStreamerFindBed3Columns(struct annoStreamer *self, int *retChromIx, int *retStartIx, int *retEndIx, char **retChromField, char **retStartField, char **retEndField); /* Scan autoSql for recognized column names corresponding to BED3 columns. * Set ret*Ix to list index of each column if found, or -1 if not found. * Set ret*Field to column name if found, or NULL if not found. * If all three are found, return TRUE; otherwise return FALSE. */ // ----------------------------------------------------------------------------- struct annoStreamRows *annoStreamRowsNew(struct annoStreamer *streamerList); /* Returns an array of aSR, one for each streamer in streamerList. * Typically array is reused by overwriting elements' rowList pointers. * Free array when done. */ #endif//ndef ANNOSTREAMER_H
// // TACAppleMaps.h // TACKit // // Created by masato_arai on 2015/04/27. // Copyright (c) 2015年 Tea and Coffee. All rights reserved. // #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface TACAppleMaps : NSObject @property (nonatomic) CLLocation *location; @property (nonatomic) NSString *mapItemName; @property (nonatomic) CLLocationDistance latitudinalMeters; @property (nonatomic) CLLocationDistance longitudinalMeters; - (void)open; @end
// ---------------------------------------------------------------------------- // ATMEL Microcontroller Software Support - ROUSSET - // ---------------------------------------------------------------------------- // DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE // DISCLAIMED. IN NO EVENT SHALL ATMEL 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. // ---------------------------------------------------------------------------- //*---------------------------------------------------------------------------- //* File Name : main.h //* Object : //* //* 1.0 27/03/03 HIi : Creation //* 1.01 03/05/04 HIi : AT9C_VERSION incremented to 1.01 //* 1.02 15/06/04 HIi : AT9C_VERSION incremented to 1.02 ==> //* Add crc32 to verify dataflash download //* 1.03 25/05/05 GGi : AT9C_VERSION incremented to 1.03 ==> 9261 version //*---------------------------------------------------------------------------- #ifndef lcdback_back_h #define lcdback_back_h #include <linux/kernel.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/mm.h> #include <asm/uaccess.h> /* for put_user */ #include <asm/io.h> #define AT91C_VERSION "VER 1.0" #define DEVICENAME "lcdback_back" #define lcdback_MAJOR 241 #define AT91C_FRAME_BUFFER 0x20000000 #define AT91C_ATMEL_LOGO 0x20020000 #define AT91C_ATMEL_WAVE 0x20030000 #define AT91C_MATRIX_EBICSA 0xffffee30 #define AT91C_SMC_SETUP5 0xffffec50 #define AT91C_SMC_PULSE5 0xffffec54 #define AT91C_SMC_CYCLE5 0xffffec58 #define AT91C_SMC_CTRL5 0xffffec5c #define AT91C_PIOB_PER 0xfffff600 volatile unsigned int *paddr; unsigned int lcdback_count=0; void lcdback_lcd(unsigned int ); int lcdback_init(void); #endif
/* SOGoUserSettings.h - this file is part of SOGo * * Copyright (C) 2009-2014 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef SOGOUSERSETTINGS_H #define SOGOUSERSETTINGS_H #import "SOGoDefaultsSource.h" @class NSArray; @class NSMutableDictionary; @class NSString; @interface SOGoUserSettings : SOGoDefaultsSource + (SOGoUserSettings *) settingsForUser: (NSString *) userId; - (NSArray *) subscribedCalendars; - (NSArray *) subscribedAddressBooks; @end #endif /* SOGOUSERSETTINGS_H */
#ifndef BLKTRACE_H #define BLKTRACE_H #include <stdio.h> #include <limits.h> #include <byteswap.h> #include <endian.h> #include <sys/types.h> #include "blktrace_api.h" #include "rbtree.h" #define MINORBITS 20 #define MINORMASK ((1U << MINORBITS) - 1) #define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) #define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) #define SECONDS(x) ((unsigned long long)(x) / 1000000000) #define NANO_SECONDS(x) ((unsigned long long)(x) % 1000000000) #define DOUBLE_TO_NANO_ULL(d) ((unsigned long long)((d) * 1000000000)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) #define t_sec(t) ((t)->bytes >> 9) #define t_kb(t) ((t)->bytes >> 10) #define t_b(t) ((t)->bytes & 1023) typedef __u32 u32; typedef __u8 u8; struct io_stats { unsigned long qreads, qwrites, creads, cwrites, mreads, mwrites; unsigned long ireads, iwrites, rrqueue, wrqueue; unsigned long long qread_kb, qwrite_kb, cread_kb, cwrite_kb; unsigned long long qread_b, qwrite_b, cread_b, cwrite_b; unsigned long long iread_kb, iwrite_kb; unsigned long long mread_kb, mwrite_kb; unsigned long long mread_b, mwrite_b, iread_b, iwrite_b; unsigned long qreads_pc, qwrites_pc, ireads_pc, iwrites_pc; unsigned long rrqueue_pc, wrqueue_pc, creads_pc, cwrites_pc; unsigned long long qread_kb_pc, qwrite_kb_pc, iread_kb_pc, iwrite_kb_pc; unsigned long long qread_b_pc, qwrite_b_pc, iread_b_pc, iwrite_b_pc; unsigned long io_unplugs, timer_unplugs; }; struct per_cpu_info { unsigned int cpu; unsigned int nelems; int fd; int fdblock; char fname[PATH_MAX]; struct io_stats io_stats; struct rb_root rb_last; unsigned long rb_last_entries; unsigned long last_sequence; unsigned long smallest_seq_read; struct skip_info *skips_head; struct skip_info *skips_tail; }; extern FILE *ofp; extern int data_is_native; extern struct timespec abs_start_time; #define CHECK_MAGIC(t) (((t)->magic & 0xffffff00) == BLK_IO_TRACE_MAGIC) #define SUPPORTED_VERSION (0x07) #if __BYTE_ORDER == __LITTLE_ENDIAN #define be16_to_cpu(x) __bswap_16(x) #define be32_to_cpu(x) __bswap_32(x) #define be64_to_cpu(x) __bswap_64(x) #define cpu_to_be16(x) __bswap_16(x) #define cpu_to_be32(x) __bswap_32(x) #define cpu_to_be64(x) __bswap_64(x) #elif __BYTE_ORDER == __BIG_ENDIAN #define be16_to_cpu(x) (x) #define be32_to_cpu(x) (x) #define be64_to_cpu(x) (x) #define cpu_to_be16(x) (x) #define cpu_to_be32(x) (x) #define cpu_to_be64(x) (x) #else #error "Bad arch" #endif static inline int verify_trace(struct blk_io_trace *t) { if (!CHECK_MAGIC(t)) { fprintf(stderr, "bad trace magic %x\n", t->magic); return 1; } if ((t->magic & 0xff) != SUPPORTED_VERSION) { fprintf(stderr, "unsupported trace version %x\n", t->magic & 0xff); return 1; } return 0; } static inline void trace_to_cpu(struct blk_io_trace *t) { if (data_is_native) return; t->magic = be32_to_cpu(t->magic); t->sequence = be32_to_cpu(t->sequence); t->time = be64_to_cpu(t->time); t->sector = be64_to_cpu(t->sector); t->bytes = be32_to_cpu(t->bytes); t->action = be32_to_cpu(t->action); t->pid = be32_to_cpu(t->pid); t->device = be32_to_cpu(t->device); t->cpu = be32_to_cpu(t->cpu); t->error = be16_to_cpu(t->error); t->pdu_len = be16_to_cpu(t->pdu_len); } /* * check whether data is native or not */ static inline int check_data_endianness(u32 magic) { if ((magic & 0xffffff00) == BLK_IO_TRACE_MAGIC) { data_is_native = 1; return 0; } magic = __bswap_32(magic); if ((magic & 0xffffff00) == BLK_IO_TRACE_MAGIC) { data_is_native = 0; return 0; } return 1; } extern void set_all_format_specs(char *); extern int add_format_spec(char *); extern void process_fmt(char *, struct per_cpu_info *, struct blk_io_trace *, unsigned long long, int, unsigned char *); extern int valid_act_opt(int); extern int find_mask_map(char *); extern char *find_process_name(pid_t); #endif
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* Cherokee * * Authors: * Alvaro Lopez Ortega <alvaro@alobbs.com> * * Copyright (C) 2001-2010 Alvaro Lopez Ortega * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #include "logger_combined.h" #include "logger_ncsa.h" #include "plugin_loader.h" /* Plug-in definition */ PLUGIN_INFO_LOGGER_EASIEST_INIT(combined); ret_t cherokee_logger_combined_new (cherokee_logger_t **logger, cherokee_virtual_server_t *vsrv, cherokee_config_node_t *config) { ret_t ret; CHEROKEE_NEW_STRUCT(n, logger_combined); /* Init the base class object */ cherokee_logger_init_base (LOGGER(n), PLUGIN_INFO_PTR(combined), config); MODULE(n)->init = (logger_func_init_t) cherokee_logger_ncsa_init; MODULE(n)->free = (logger_func_free_t) cherokee_logger_ncsa_free; LOGGER(n)->flush = (logger_func_flush_t) cherokee_logger_ncsa_flush; LOGGER(n)->reopen = (logger_func_flush_t) cherokee_logger_ncsa_reopen; LOGGER(n)->write_access = (logger_func_write_access_t) cherokee_logger_ncsa_write_access; /* Init the base class: NCSA */ ret = cherokee_logger_ncsa_init_base (n, vsrv, config); if (unlikely(ret < ret_ok)) return ret; /* Active the "Combined" bit */ n->combined = true; /* Return the object */ *logger = LOGGER(n); return ret_ok; } /* Library init function */ static cherokee_boolean_t _combined_is_init = false; void PLUGIN_INIT_NAME(name) (cherokee_plugin_loader_t *loader) { if (_combined_is_init) return; _combined_is_init = true; cherokee_plugin_loader_load (loader, "ncsa"); }
/* This file is part of Motion. * * Motion 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. * * Motion 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 Motion. If not, see <https://www.gnu.org/licenses/>. */ /* * picture.h * * Copyright 2002 by Jeroen Vreeken (pe1rxq@amsat.org) * Portions of this file are Copyright by Lionnel Maugis * */ #ifndef _INCLUDE_PICTURE_H_ #define _INCLUDE_PICTURE_H_ void overlay_smartmask(struct context *cnt, unsigned char *out); void overlay_fixed_mask(struct context *cnt, unsigned char *out); void put_fixed_mask(struct context *cnt, const char *file); void overlay_largest_label(struct context *cnt, unsigned char *out); int put_picture_memory(struct context *cnt, unsigned char* dest_image, int image_size , unsigned char *image, int quality, int width, int height); void put_picture(struct context *cnt, char *file, unsigned char *image, int ftype); unsigned char *get_pgm(FILE *picture, int width, int height); void pic_scale_img(int width_src, int height_src, unsigned char *img_src, unsigned char *img_dst); unsigned prepare_exif(unsigned char **exif, const struct context *cnt , const struct timeval *tv_in1, const struct coord *box); #endif /* _INCLUDE_PICTURE_H_ */
#ifndef __JUNIPER_FPGA_INTERFACE__ #define __JUNIPER_FPGA_INTERFACE__ #include <stdint.h> #define JUNIPER_FPGA_OK 0 #define JUNIPER_FPGA_FAIL_NOFILE -1 #define JUNIPER_FPGA_FAIL_DRVERR -2 #define JUNIPER_FPGA_SYSCALL_IN_ARGS_SIZE 21 #define JUNIPER_FPGA_SYSCALL_OUT_ARGS_SIZE 5 #define JUNIPER_FPGA_SYSCALL_OUT_KNOCK1 0xAA #define JUNIPER_FPGA_SYSCALL_OUT_KNOCK2 0x55 typedef struct { uint8_t cmd; uint32_t arg1; uint32_t arg2; uint32_t arg3; uint32_t arg4; uint32_t arg5; } juniper_fpga_syscall_args; int juniper_fpga_num_devices(); int juniper_fpga_num_partitions(int devNo); // If positive (or zero), the idle status // If negative, error. int juniper_fpga_partition_idle(int devNo, int partNo); int juniper_fpga_partition_interrupted(int devNo, int partNo); int juniper_fpga_partition_start(int devNo, int partNo); int juniper_fpga_partition_get_mem_base(int devNo, int partNo, uint32_t* base); int juniper_fpga_partition_set_mem_base(int devNo, int partNo, uint32_t base); int juniper_fpga_partition_get_arg(int devNo, int partNo, int argNo, uint32_t* arg); int juniper_fpga_partition_set_arg(int devNo, int partNo, int argNo, uint32_t arg); int juniper_fpga_partition_get_retval(int devNo, int partNo, uint32_t* rv); int juniper_fpga_partition_get_syscall_args(int devNo, int partNo, juniper_fpga_syscall_args* args); int juniper_fpga_partition_set_syscall_return(int devNo, int partNo, unsigned int val); #endif
#include <stdio.h> #include "mms.h" const char *url = "mms://od-msn.msn.com/3/mbr/apprentice_bts.wmv"; int main(int argc, char *argv[]) { mms_t *this = NULL; char buf[1024]; int i, res; FILE* f; if((this = mms_connect(NULL, NULL, url, 1))) printf("Connect OK\n"); f = fopen("/tmp/mmsdownload.test", "w"); for(i = 0; i < 10000; i++) { res = mms_read(NULL, this, buf, 1024); if(!res) break; fwrite(buf, 1, res, f); } if(i > 0) printf("OK, read %d times\n", i); else printf("Failed to read from stream\n"); }
/* * Copyright (C) 2016 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. */ #pragma once #if ENABLE(B3_JIT) #include "AirArg.h" namespace JSC { namespace B3 { namespace Air { template<typename T> struct ArgThingHelper; template<> struct ArgThingHelper<Tmp> { static bool is(const Arg& arg) { return arg.isTmp(); } static Tmp as(const Arg& arg) { if (is(arg)) return arg.tmp(); return Tmp(); } template<typename Functor> static void forEachFast(Arg& arg, const Functor& functor) { arg.forEachTmpFast(functor); } template<typename Functor> static void forEach(Arg& arg, Arg::Role role, Arg::Type type, Arg::Width width, const Functor& functor) { arg.forEachTmp(role, type, width, functor); } }; template<> struct ArgThingHelper<Arg> { static bool is(const Arg&) { return true; } static Arg as(const Arg& arg) { return arg; } template<typename Functor> static void forEachFast(Arg& arg, const Functor& functor) { functor(arg); } template<typename Functor> static void forEach(Arg& arg, Arg::Role role, Arg::Type type, Arg::Width width, const Functor& functor) { functor(arg, role, type, width); } }; template<> struct ArgThingHelper<StackSlot*> { static bool is(const Arg& arg) { return arg.isStack(); } static StackSlot* as(const Arg& arg) { return arg.stackSlot(); } template<typename Functor> static void forEachFast(Arg& arg, const Functor& functor) { if (!arg.isStack()) return; StackSlot* stackSlot = arg.stackSlot(); functor(stackSlot); arg = Arg::stack(stackSlot, arg.offset()); } template<typename Functor> static void forEach(Arg& arg, Arg::Role role, Arg::Type type, Arg::Width width, const Functor& functor) { if (!arg.isStack()) return; StackSlot* stackSlot = arg.stackSlot(); // FIXME: This is way too optimistic about the meaning of "Def". It gets lucky for // now because our only use of "Anonymous" stack slots happens to want the optimistic // semantics. We could fix this by just changing the comments that describe the // semantics of "Anonymous". // https://bugs.webkit.org/show_bug.cgi?id=151128 functor(stackSlot, role, type, width); arg = Arg::stack(stackSlot, arg.offset()); } }; template<> struct ArgThingHelper<Reg> { static bool is(const Arg& arg) { return arg.isReg(); } static Reg as(const Arg& arg) { return arg.reg(); } template<typename Functor> static void forEachFast(Arg& arg, const Functor& functor) { arg.forEachTmpFast( [&] (Tmp& tmp) { if (!tmp.isReg()) return; Reg reg = tmp.reg(); functor(reg); tmp = Tmp(reg); }); } template<typename Functor> static void forEach(Arg& arg, Arg::Role argRole, Arg::Type argType, Arg::Width argWidth, const Functor& functor) { arg.forEachTmp( argRole, argType, argWidth, [&] (Tmp& tmp, Arg::Role role, Arg::Type type, Arg::Width width) { if (!tmp.isReg()) return; Reg reg = tmp.reg(); functor(reg, role, type, width); tmp = Tmp(reg); }); } }; template<typename Thing> bool Arg::is() const { return ArgThingHelper<Thing>::is(*this); } template<typename Thing> Thing Arg::as() const { return ArgThingHelper<Thing>::as(*this); } template<typename Thing, typename Functor> void Arg::forEachFast(const Functor& functor) { ArgThingHelper<Thing>::forEachFast(*this, functor); } template<typename Thing, typename Functor> void Arg::forEach(Role role, Type type, Width width, const Functor& functor) { ArgThingHelper<Thing>::forEach(*this, role, type, width, functor); } } } } // namespace JSC::B3::Air #endif // ENABLE(B3_JIT)
/* * PC Speaker beeper driver for Linux * * Copyright (c) 2002 Vojtech Pavlik * Copyright (c) 1992 Orest Zborowski * */ /* * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation */ #include <linux/init.h> #include <linux/input.h> #include <asm/io.h> #include "pcsp.h" static void pcspkr_do_sound(unsigned int count) { unsigned long flags; atomic_spin_lock_irqsave(&i8253_lock, flags); if (count) { /* set command for counter 2, 2 byte write */ outb_p(0xB6, 0x43); /* select desired HZ */ outb_p(count & 0xff, 0x42); outb((count >> 8) & 0xff, 0x42); /* enable counter 2 */ outb_p(inb_p(0x61) | 3, 0x61); } else { /* disable counter 2 */ outb(inb_p(0x61) & 0xFC, 0x61); } atomic_spin_unlock_irqrestore(&i8253_lock, flags); } void pcspkr_stop_sound(void) { pcspkr_do_sound(0); } static int pcspkr_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { unsigned int count = 0; if (atomic_read(&pcsp_chip.timer_active) || !pcsp_chip.pcspkr) return 0; switch (type) { case EV_SND: switch (code) { case SND_BELL: if (value) value = 1000; case SND_TONE: break; default: return -1; } break; default: return -1; } if (value > 20 && value < 32767) count = PIT_TICK_RATE / value; pcspkr_do_sound(count); return 0; } int __devinit pcspkr_input_init(struct input_dev **rdev, struct device *dev) { int err; struct input_dev *input_dev = input_allocate_device(); if (!input_dev) return -ENOMEM; input_dev->name = "PC Speaker"; input_dev->phys = "isa0061/input0"; input_dev->id.bustype = BUS_ISA; input_dev->id.vendor = 0x001f; input_dev->id.product = 0x0001; input_dev->id.version = 0x0100; input_dev->dev.parent = dev; input_dev->evbit[0] = BIT(EV_SND); input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); input_dev->event = pcspkr_input_event; err = input_register_device(input_dev); if (err) { input_free_device(input_dev); return err; } *rdev = input_dev; return 0; } int pcspkr_input_remove(struct input_dev *dev) { pcspkr_stop_sound(); input_unregister_device(dev); /* this also does kfree() */ return 0; }
/* SPDX-License-Identifier: GPL-2.0+ */ /* * K2HK: SoC definitions * * (C) Copyright 2012-2014 * Texas Instruments Incorporated, <www.ti.com> */ #ifndef __ASM_ARCH_HARDWARE_K2HK_H #define __ASM_ARCH_HARDWARE_K2HK_H #define KS2_ARM_PLL_EN BIT(13) /* PA SS Registers */ #define KS2_PASS_BASE 0x02000000 /* Power and Sleep Controller (PSC) Domains */ #define KS2_LPSC_MOD 0 #define KS2_LPSC_DUMMY1 1 #define KS2_LPSC_USB 2 #define KS2_LPSC_EMIF25_SPI 3 #define KS2_LPSC_TSIP 4 #define KS2_LPSC_DEBUGSS_TRC 5 #define KS2_LPSC_TETB_TRC 6 #define KS2_LPSC_PKTPROC 7 #define KS2_LPSC_PA KS2_LPSC_PKTPROC #define KS2_LPSC_SGMII 8 #define KS2_LPSC_CPGMAC KS2_LPSC_SGMII #define KS2_LPSC_CRYPTO 9 #define KS2_LPSC_PCIE 10 #define KS2_LPSC_SRIO 11 #define KS2_LPSC_VUSR0 12 #define KS2_LPSC_CHIP_SRSS 13 #define KS2_LPSC_MSMC 14 #define KS2_LPSC_GEM_1 16 #define KS2_LPSC_GEM_2 17 #define KS2_LPSC_GEM_3 18 #define KS2_LPSC_GEM_4 19 #define KS2_LPSC_GEM_5 20 #define KS2_LPSC_GEM_6 21 #define KS2_LPSC_GEM_7 22 #define KS2_LPSC_EMIF4F_DDR3A 23 #define KS2_LPSC_EMIF4F_DDR3B 24 #define KS2_LPSC_TAC 25 #define KS2_LPSC_RAC 26 #define KS2_LPSC_RAC_1 27 #define KS2_LPSC_FFTC_A 28 #define KS2_LPSC_FFTC_B 29 #define KS2_LPSC_FFTC_C 30 #define KS2_LPSC_FFTC_D 31 #define KS2_LPSC_FFTC_E 32 #define KS2_LPSC_FFTC_F 33 #define KS2_LPSC_AI2 34 #define KS2_LPSC_TCP3D_0 35 #define KS2_LPSC_TCP3D_1 36 #define KS2_LPSC_TCP3D_2 37 #define KS2_LPSC_TCP3D_3 38 #define KS2_LPSC_VCP2X4_A 39 #define KS2_LPSC_CP2X4_B 40 #define KS2_LPSC_VCP2X4_C 41 #define KS2_LPSC_VCP2X4_D 42 #define KS2_LPSC_VCP2X4_E 43 #define KS2_LPSC_VCP2X4_F 44 #define KS2_LPSC_VCP2X4_G 45 #define KS2_LPSC_VCP2X4_H 46 #define KS2_LPSC_BCP 47 #define KS2_LPSC_DXB 48 #define KS2_LPSC_VUSR1 49 #define KS2_LPSC_XGE 50 #define KS2_LPSC_ARM_SREFLEX 51 /* DDR3B definitions */ #define KS2_DDR3B_EMIF_CTRL_BASE 0x21020000 #define KS2_DDR3B_EMIF_DATA_BASE 0x60000000 #define KS2_DDR3B_DDRPHYC 0x02328000 #define KS2_CIC2_DDR3_ECC_IRQ_NUM 0x0D3 /* DDR3 ECC system irq number */ #define KS2_CIC2_DDR3_ECC_CHAN_NUM 0x01D /* DDR3 ECC int mapped to CIC2 channel 29 */ /* SGMII SerDes */ #define KS2_LANES_PER_SGMII_SERDES 4 /* Number of DSP cores */ #define KS2_NUM_DSPS 8 /* NETCP pktdma */ #define KS2_NETCP_PDMA_CTRL_BASE 0x02004000 #define KS2_NETCP_PDMA_TX_BASE 0x02004400 #define KS2_NETCP_PDMA_TX_CH_NUM 9 #define KS2_NETCP_PDMA_RX_BASE 0x02004800 #define KS2_NETCP_PDMA_RX_CH_NUM 26 #define KS2_NETCP_PDMA_SCHED_BASE 0x02004c00 #define KS2_NETCP_PDMA_RX_FLOW_BASE 0x02005000 #define KS2_NETCP_PDMA_RX_FLOW_NUM 32 #define KS2_NETCP_PDMA_TX_SND_QUEUE 648 /* NETCP */ #define KS2_NETCP_BASE 0x02000000 #endif /* __ASM_ARCH_HARDWARE_H */
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * 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. * * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/tags/release-1-1-1/engines/groovie/debug.h $ * $Id: debug.h 35060 2008-11-14 21:32:20Z fingolfin $ * */ #ifndef GROOVIE_DEBUG_H #define GROOVIE_DEBUG_H #include "gui/debugger.h" #include "engines/engine.h" namespace Groovie { class Script; class GroovieEngine; class Debugger : public GUI::Debugger { public: Debugger(GroovieEngine *vm); ~Debugger(); private: GroovieEngine *_vm; Script *_script; OSystem *_syst; int getNumber(const char *arg); bool cmd_step(int argc, const char **argv); bool cmd_go(int argc, const char **argv); bool cmd_pc(int argc, const char **argv); bool cmd_bg(int argc, const char **argv); bool cmd_fg(int argc, const char **argv); bool cmd_mem(int argc, const char **argv); bool cmd_loadgame(int argc, const char **argv); bool cmd_savegame(int argc, const char **argv); bool cmd_playref(int argc, const char **argv); bool cmd_dumppal(int argc, const char **argv); }; } // End of Groovie namespace #endif // GROOVIE_DEBUG_H
/* * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2011-2016 ArkCORE <http://www.arkania.net/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _LOGINDATABASE_H #define _LOGINDATABASE_H #include "DatabaseWorkerPool.h" #include "MySQLConnection.h" class LoginDatabaseConnection : public MySQLConnection { public: //- Constructors for sync and async connections LoginDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) { } LoginDatabaseConnection(ACE_Activation_Queue* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) { } //- Loads database type specific prepared statements void DoPrepareStatements(); }; typedef DatabaseWorkerPool<LoginDatabaseConnection> LoginDatabaseWorkerPool; enum LoginDatabaseStatements { /* Naming standard for defines: {DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed} When updating more than one field, consider looking at the calling function name for a suiting suffix. */ LOGIN_SEL_REALMLIST, LOGIN_DEL_EXPIRED_IP_BANS, LOGIN_UPD_EXPIRED_ACCOUNT_BANS, LOGIN_SEL_IP_BANNED, LOGIN_INS_IP_AUTO_BANNED, LOGIN_SEL_ACCOUNT_BANNED, LOGIN_SEL_ACCOUNT_BANNED_ALL, LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, LOGIN_INS_ACCOUNT_AUTO_BANNED, LOGIN_DEL_ACCOUNT_BANNED, LOGIN_SEL_SESSIONKEY, LOGIN_UPD_VS, LOGIN_UPD_LOGONPROOF, LOGIN_SEL_LOGONCHALLENGE, LOGIN_SEL_LOGON_COUNTRY, LOGIN_UPD_FAILEDLOGINS, LOGIN_SEL_FAILEDLOGINS, LOGIN_SEL_ACCOUNT_ID_BY_NAME, LOGIN_SEL_ACCOUNT_LIST_BY_NAME, LOGIN_SEL_ACCOUNT_INFO_BY_NAME, LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, LOGIN_SEL_NUM_CHARS_ON_REALM, LOGIN_SEL_ACCOUNT_BY_IP, LOGIN_INS_IP_BANNED, LOGIN_DEL_IP_NOT_BANNED, LOGIN_SEL_IP_BANNED_ALL, LOGIN_SEL_IP_BANNED_BY_IP, LOGIN_SEL_ACCOUNT_BY_ID, LOGIN_INS_ACCOUNT_BANNED, LOGIN_UPD_ACCOUNT_NOT_BANNED, LOGIN_DEL_REALM_CHARACTERS_BY_REALM, LOGIN_DEL_REALM_CHARACTERS, LOGIN_INS_REALM_CHARACTERS, LOGIN_SEL_SUM_REALM_CHARACTERS, LOGIN_INS_ACCOUNT, LOGIN_INS_REALM_CHARACTERS_INIT, LOGIN_UPD_EXPANSION, LOGIN_UPD_ACCOUNT_LOCK, LOGIN_UPD_ACCOUNT_LOCK_CONTRY, LOGIN_INS_LOG, LOGIN_UPD_USERNAME, LOGIN_UPD_PASSWORD, LOGIN_UPD_EMAIL, LOGIN_UPD_REG_EMAIL, LOGIN_UPD_MUTE_TIME, LOGIN_UPD_MUTE_TIME_LOGIN, LOGIN_UPD_LAST_IP, LOGIN_UPD_ACCOUNT_ONLINE, LOGIN_UPD_UPTIME_PLAYERS, LOGIN_DEL_OLD_LOGS, LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, LOGIN_INS_ACCOUNT_ACCESS, LOGIN_GET_ACCOUNT_ID_BY_USERNAME, LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, LOGIN_GET_GMLEVEL_BY_REALMID, LOGIN_GET_USERNAME_BY_ID, LOGIN_SEL_CHECK_PASSWORD, LOGIN_SEL_CHECK_PASSWORD_BY_NAME, LOGIN_SEL_PINFO, LOGIN_SEL_PINFO_BANS, LOGIN_SEL_GM_ACCOUNTS, LOGIN_SEL_ACCOUNT_INFO, LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, LOGIN_SEL_ACCOUNT_ACCESS, LOGIN_SEL_ACCOUNT_RECRUITER, LOGIN_SEL_BANS, LOGIN_SEL_ACCOUNT_WHOIS, LOGIN_SEL_REALMLIST_SECURITY_LEVEL, LOGIN_DEL_ACCOUNT, LOGIN_SEL_TRIAL_DATA, LOGIN_SEL_IP2NATION_COUNTRY, LOGIN_SEL_AUTOBROADCAST, LOGIN_GET_EMAIL_BY_ID, LOGIN_SEL_ACCOUNT_ACCESS_BY_ID, LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS, LOGIN_INS_RBAC_ACCOUNT_PERMISSION, LOGIN_DEL_RBAC_ACCOUNT_PERMISSION, MAX_LOGINDATABASE_STATEMENTS }; #endif
/* IKFilterBrowserView Copyright (c) 2006 Apple Computer, Inc. All rights reserved. */ #import <AppKit/AppKit.h> #import <QuartzCore/QuartzCore.h> /*! @header IKFilterBrowserView @copyright 2006 Apple Computer, Inc. All rights reserved. @availability Coming to a Leopard installation near you @abstract View containing the elements of the IKFilterBrowser @discussion See discussion in IKFilterBrowserPanel */ @interface IKFilterBrowserView : NSView { @private IBOutlet id _actionButton; IBOutlet id _addCollectionButton; IBOutlet id _browser; IBOutlet id _descriptionField; IBOutlet id _previewView; IBOutlet id _removeCollectionButton; IBOutlet id _searchField; IBOutlet id _OKButton; IBOutlet id _CancelButton; NSMutableArray *_foundFilters; NSDictionary *_options; BOOL _showPreviewView; BOOL _useNarrowLayout; id _modalDelegate; void* _priv[8]; } /*! @method setPreviewState: @abstract Use this method to show and hide the Preview @discussion Use this method to show and hide the Preview from the program. @param inState Boolean for visibility of the preview. */ - (void)setPreviewState:(BOOL)inState; /*! @method filterName @abstract Returns the name of the currently selected filter. @discussion Use this method in response to a IKFilterBrowserFilterSelectedNotification or IKFilterBrowserFilterDoubleClickNotification or afer returning from a modal session. */ - (NSString*)filterName; @end
/* mmx ditherer Copyright (C) 2000 Martin Vogt This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation. For more information look at the file COPYRIGHT in this package */ #ifndef __DITHERMMX_H #define __DITHERMMX_H #include "ditherDef.h" // The mmx dither routine come from NIST // NIST is an mpeg2/dvd player // more: http://home.germany.net/100-5083/ extern void ditherBlock(unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod); extern void dither32_mmx(unsigned char* lum, unsigned char* cr, unsigned char* cb, unsigned char* out, int rows, int cols, int mod); #endif
/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Code Aurora Forum nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written * permission. * * Alternatively, provided that this notice is retained in full, this software * may be relicensed by the recipient under the terms of the GNU General Public * License version 2 ("GPL") and only version 2, in which case the provisions of * the GPL apply INSTEAD OF those given above. If the recipient relicenses the * software under the GPL, then the identification text in the MODULE_LICENSE * macro must be changed to reflect "GPLv2" instead of "Dual BSD/GPL". Once a * recipient changes the license terms to the GPL, subsequent recipients shall * not relicense under alternate licensing terms, including the BSD or dual * BSD/GPL terms. In addition, the following license statement immediately * below and between the words START and END shall also then apply when this * software is relicensed under the GPL: * * START * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 2 and only version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * END * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/fb.h> #include <linux/string.h> #include <linux/version.h> #include <linux/backlight.h> #include "msm_fb.h" static int msm_fb_bl_get_brightness(struct backlight_device *pbd) { return pbd->props.brightness; } static int msm_fb_bl_update_status(struct backlight_device *pbd) { struct msm_fb_data_type *mfd = bl_get_data(pbd); __u32 bl_lvl; bl_lvl = pbd->props.brightness; #ifdef CONFIG_FB_MSM_MDDI_TC358723XBG_VGA_QCIF bl_lvl = 15 -pbd->props.brightness; #else bl_lvl = mfd->fbi->bl_curve[bl_lvl]; #endif msm_fb_set_backlight(mfd, bl_lvl, 1); return 0; } static struct backlight_ops msm_fb_bl_ops = { .get_brightness = msm_fb_bl_get_brightness, .update_status = msm_fb_bl_update_status, }; void msm_fb_config_backlight(struct msm_fb_data_type *mfd) { struct msm_fb_panel_data *pdata; struct backlight_device *pbd; struct fb_info *fbi; char name[16]; fbi = mfd->fbi; pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if ((pdata) && (pdata->set_backlight)) { snprintf(name, sizeof(name), "msmfb_bl%d", mfd->index); pbd = backlight_device_register(name, fbi->dev, mfd, &msm_fb_bl_ops); if (!IS_ERR(pbd)) { fbi->bl_dev = pbd; #ifdef CONFIG_FB_MSM_MDDI_TC358723XBG_VGA_QCIF pbd->props.max_brightness = 15; pbd->props.brightness = 15; #else fb_bl_default_curve(fbi, 0, mfd->panel_info.bl_min, mfd->panel_info.bl_max); pbd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; pbd->props.brightness = FB_BACKLIGHT_LEVELS - 1; #endif backlight_update_status(pbd); } else { fbi->bl_dev = NULL; printk(KERN_ERR "msm_fb: backlight_device_register failed!\n"); } } }
/* * ip_vs_est.c: simple rate estimator for IPVS * * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Changes: Hans Schillstrom <hans.schillstrom@ericsson.com> * Network name space (netns) aware. * Global data moved to netns i.e struct netns_ipvs * Affected data: est_list and est_lock. * estimation_timer() runs with timer per netns. * get_stats()) do the per cpu summing. */ #define KMSG_COMPONENT "IPVS" #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt #include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/sysctl.h> #include <linux/list.h> #include <net/ip_vs.h> /* This code is to estimate rate in a shorter interval (such as 8 seconds) for virtual services and real servers. For measure rate in a long interval, it is easy to implement a user level daemon which periodically reads those statistical counters and measure rate. Currently, the measurement is activated by slow timer handler. Hope this measurement will not introduce too much load. We measure rate during the last 8 seconds every 2 seconds: avgrate = avgrate*(1-W) + rate*W where W = 2^(-2) NOTES. * The stored value for average bps is scaled by 2^5, so that maximal rate is ~2.15Gbits/s, average pps and cps are scaled by 2^10. * A lot code is taken from net/sched/estimator.c */ /* * Make a summary from each cpu */ static void ip_vs_read_cpu_stats(struct ip_vs_stats_user *sum, struct ip_vs_cpu_stats *stats) { int i; for_each_possible_cpu(i) { struct ip_vs_cpu_stats *s = per_cpu_ptr(stats, i); unsigned int start; __u64 inbytes, outbytes; if (i) { sum->conns += s->ustats.conns; sum->inpkts += s->ustats.inpkts; sum->outpkts += s->ustats.outpkts; do { start = u64_stats_fetch_begin(&s->syncp); inbytes = s->ustats.inbytes; outbytes = s->ustats.outbytes; } while (u64_stats_fetch_retry(&s->syncp, start)); sum->inbytes += inbytes; sum->outbytes += outbytes; } else { sum->conns = s->ustats.conns; sum->inpkts = s->ustats.inpkts; sum->outpkts = s->ustats.outpkts; do { start = u64_stats_fetch_begin(&s->syncp); sum->inbytes = s->ustats.inbytes; sum->outbytes = s->ustats.outbytes; } while (u64_stats_fetch_retry(&s->syncp, start)); } } } static void estimation_timer(unsigned long arg) { struct ip_vs_estimator *e; struct ip_vs_stats *s; u32 n_conns; u32 n_inpkts, n_outpkts; u64 n_inbytes, n_outbytes; u32 rate; struct net *net = (struct net *)arg; struct netns_ipvs *ipvs; ipvs = net_ipvs(net); spin_lock(&ipvs->est_lock); list_for_each_entry(e, &ipvs->est_list, list) { s = container_of(e, struct ip_vs_stats, est); spin_lock(&s->lock); ip_vs_read_cpu_stats(&s->ustats, s->cpustats); n_conns = s->ustats.conns; n_inpkts = s->ustats.inpkts; n_outpkts = s->ustats.outpkts; n_inbytes = s->ustats.inbytes; n_outbytes = s->ustats.outbytes; /* scaled by 2^10, but divided 2 seconds */ rate = (n_conns - e->last_conns) << 9; e->last_conns = n_conns; e->cps += ((long)rate - (long)e->cps) >> 2; rate = (n_inpkts - e->last_inpkts) << 9; e->last_inpkts = n_inpkts; e->inpps += ((long)rate - (long)e->inpps) >> 2; rate = (n_outpkts - e->last_outpkts) << 9; e->last_outpkts = n_outpkts; e->outpps += ((long)rate - (long)e->outpps) >> 2; rate = (n_inbytes - e->last_inbytes) << 4; e->last_inbytes = n_inbytes; e->inbps += ((long)rate - (long)e->inbps) >> 2; rate = (n_outbytes - e->last_outbytes) << 4; e->last_outbytes = n_outbytes; e->outbps += ((long)rate - (long)e->outbps) >> 2; spin_unlock(&s->lock); } spin_unlock(&ipvs->est_lock); mod_timer(&ipvs->est_timer, jiffies + 2*HZ); } void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats) { struct netns_ipvs *ipvs = net_ipvs(net); struct ip_vs_estimator *est = &stats->est; INIT_LIST_HEAD(&est->list); spin_lock_bh(&ipvs->est_lock); list_add(&est->list, &ipvs->est_list); spin_unlock_bh(&ipvs->est_lock); } void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats) { struct netns_ipvs *ipvs = net_ipvs(net); struct ip_vs_estimator *est = &stats->est; spin_lock_bh(&ipvs->est_lock); list_del(&est->list); spin_unlock_bh(&ipvs->est_lock); } void ip_vs_zero_estimator(struct ip_vs_stats *stats) { struct ip_vs_estimator *est = &stats->est; struct ip_vs_stats_user *u = &stats->ustats; /* reset counters, caller must hold the stats->lock lock */ est->last_inbytes = u->inbytes; est->last_outbytes = u->outbytes; est->last_conns = u->conns; est->last_inpkts = u->inpkts; est->last_outpkts = u->outpkts; est->cps = 0; est->inpps = 0; est->outpps = 0; est->inbps = 0; est->outbps = 0; } /* Get decoded rates */ void ip_vs_read_estimator(struct ip_vs_stats_user *dst, struct ip_vs_stats *stats) { struct ip_vs_estimator *e = &stats->est; dst->cps = (e->cps + 0x1FF) >> 10; dst->inpps = (e->inpps + 0x1FF) >> 10; dst->outpps = (e->outpps + 0x1FF) >> 10; dst->inbps = (e->inbps + 0xF) >> 5; dst->outbps = (e->outbps + 0xF) >> 5; } int __net_init ip_vs_estimator_net_init(struct net *net) { struct netns_ipvs *ipvs = net_ipvs(net); INIT_LIST_HEAD(&ipvs->est_list); spin_lock_init(&ipvs->est_lock); setup_timer(&ipvs->est_timer, estimation_timer, (unsigned long)net); mod_timer(&ipvs->est_timer, jiffies + 2 * HZ); return 0; } void __net_exit ip_vs_estimator_net_cleanup(struct net *net) { del_timer_sync(&net_ipvs(net)->est_timer); }
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class dv_DoubleVector */ #ifndef _Included_dv_DoubleVector #define _Included_dv_DoubleVector #ifdef __cplusplus extern "C" { #endif /* * Class: dv_DoubleVector * Method: DV_SetCUDDManager * Signature: (J)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1SetCUDDManager (JNIEnv *, jclass, jlong); /* * Class: dv_DoubleVector * Method: DV_CreateZeroVector * Signature: (I)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1CreateZeroVector (JNIEnv *, jobject, jint); /* * Class: dv_DoubleVector * Method: DV_ConvertMTBDD * Signature: (JJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1ConvertMTBDD (JNIEnv *, jobject, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_GetElement * Signature: (JII)D */ JNIEXPORT jdouble JNICALL Java_dv_DoubleVector_DV_1GetElement (JNIEnv *, jobject, jlong, jint, jint); /* * Class: dv_DoubleVector * Method: DV_SetElement * Signature: (JIID)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1SetElement (JNIEnv *, jobject, jlong, jint, jint, jdouble); /* * Class: dv_DoubleVector * Method: DV_SetAllElements * Signature: (JID)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1SetAllElements (JNIEnv *, jobject, jlong, jint, jdouble); /* * Class: dv_DoubleVector * Method: DV_RoundOff * Signature: (JII)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1RoundOff (JNIEnv *, jobject, jlong, jint, jint); /* * Class: dv_DoubleVector * Method: DV_SubtractFromOne * Signature: (JI)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1SubtractFromOne (JNIEnv *, jobject, jlong, jint); /* * Class: dv_DoubleVector * Method: DV_Add * Signature: (JIJ)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1Add (JNIEnv *, jobject, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_TimesConstant * Signature: (JID)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1TimesConstant (JNIEnv *, jobject, jlong, jint, jdouble); /* * Class: dv_DoubleVector * Method: DV_DotProduct * Signature: (JIJ)D */ JNIEXPORT jdouble JNICALL Java_dv_DoubleVector_DV_1DotProduct (JNIEnv *, jobject, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_Filter * Signature: (JJJIJ)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1Filter (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_MaxMTBDD * Signature: (JJJIJ)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1MaxMTBDD (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_Clear * Signature: (J)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1Clear (JNIEnv *, jobject, jlong); /* * Class: dv_DoubleVector * Method: DV_GetNNZ * Signature: (JI)I */ JNIEXPORT jint JNICALL Java_dv_DoubleVector_DV_1GetNNZ (JNIEnv *, jobject, jlong, jint); /* * Class: dv_DoubleVector * Method: DV_FirstFromBDD * Signature: (JJJIJ)D */ JNIEXPORT jdouble JNICALL Java_dv_DoubleVector_DV_1FirstFromBDD (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_MinOverBDD * Signature: (JJJIJ)D */ JNIEXPORT jdouble JNICALL Java_dv_DoubleVector_DV_1MinOverBDD (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_MaxOverBDD * Signature: (JJJIJ)D */ JNIEXPORT jdouble JNICALL Java_dv_DoubleVector_DV_1MaxOverBDD (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_SumOverBDD * Signature: (JJJIJ)D */ JNIEXPORT jdouble JNICALL Java_dv_DoubleVector_DV_1SumOverBDD (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_SumOverMTBDD * Signature: (JJJIJ)D */ JNIEXPORT jdouble JNICALL Java_dv_DoubleVector_DV_1SumOverMTBDD (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_SumOverDDVars * Signature: (JJJIIIJJ)V */ JNIEXPORT void JNICALL Java_dv_DoubleVector_DV_1SumOverDDVars (JNIEnv *, jobject, jlong, jlong, jlong, jint, jint, jint, jlong, jlong); /* * Class: dv_DoubleVector * Method: DV_BDDGreaterThanEquals * Signature: (JDJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1BDDGreaterThanEquals (JNIEnv *, jobject, jlong, jdouble, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_BDDGreaterThan * Signature: (JDJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1BDDGreaterThan (JNIEnv *, jobject, jlong, jdouble, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_BDDLessThanEquals * Signature: (JDJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1BDDLessThanEquals (JNIEnv *, jobject, jlong, jdouble, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_BDDLessThan * Signature: (JDJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1BDDLessThan (JNIEnv *, jobject, jlong, jdouble, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_BDDInterval * Signature: (JDDJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1BDDInterval (JNIEnv *, jobject, jlong, jdouble, jdouble, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_BDDCloseValueAbs * Signature: (JDDJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1BDDCloseValueAbs (JNIEnv *, jobject, jlong, jdouble, jdouble, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_BDDCloseValueRel * Signature: (JDDJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1BDDCloseValueRel (JNIEnv *, jobject, jlong, jdouble, jdouble, jlong, jint, jlong); /* * Class: dv_DoubleVector * Method: DV_ConvertToMTBDD * Signature: (JJIJ)J */ JNIEXPORT jlong JNICALL Java_dv_DoubleVector_DV_1ConvertToMTBDD (JNIEnv *, jobject, jlong, jlong, jint, jlong); #ifdef __cplusplus } #endif #endif
/* * Copyright (c) 2004, Bull SA. All rights reserved. * Created by: Laurent.Vivier@bull.net * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. */ /* * assertion: * * aio_read() shall fail with [EINVAL] or the error status of the operation * shall be [EINVAL] if aio_offset would be invalid, or aio_reqprio is not * a valid value, or aio_nbytes is an invalid value. * * Testing invalid reqprio * * method: * * - Create an aiocb with an invalid aio_reqprio * - call aio_read with this aiocb */ #define _XOPEN_SOURCE 600 #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> #include <errno.h> #include <stdlib.h> #include <aio.h> #include "posixtest.h" #define TNAME "aio_read/11-2.c" int main() { char tmpfname[256]; #define BUF_SIZE 111 char buf[BUF_SIZE]; int fd; struct aiocb aiocb; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) return PTS_UNSUPPORTED; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_read_11_2%d", getpid()); unlink(tmpfname); fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); if (fd == -1) { printf(TNAME " Error at open(): %s\n", strerror(errno)); exit(PTS_UNRESOLVED); } unlink(tmpfname); memset(&aiocb, 0, sizeof(struct aiocb)); aiocb.aio_fildes = fd; aiocb.aio_buf = buf; aiocb.aio_reqprio = -1; aiocb.aio_nbytes = BUF_SIZE; if (aio_read(&aiocb) != -1) { printf(TNAME " bad aio_read return value()\n"); exit(PTS_FAIL); } if (errno != EINVAL) { printf(TNAME " errno is not EINVAL %s\n", strerror(errno)); exit(PTS_FAIL); } close(fd); printf("Test PASSED\n"); return PTS_PASS; }
#ifndef LITCUDATRACKPARAM_H_ #define LITCUDATRACKPARAM_H_ 1 #include <iostream> struct LitCudaTrackParam { float X, Y, Z, Tx, Ty, Qp; float C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14; friend std::ostream& operator<<(std::ostream& strm, const LitCudaTrackParam& par) { strm << "LitCudaTrackParam: " << "X=" << par.X << " Y=" << par.Y << " Z=" << par.Z << " Tx=" << par.Tx << " Ty=" << par.Ty << " Qp=" << par.Qp << std::endl; return strm; } }; #endif
//=========================================================================== // FullScreen Titlebar Constants // 2004 - All rights reservered //=========================================================================== // // Project/Product : FullScreenTitlebar // FileName : FullScreenTitleBarConst.h // Author(s) : Lars Werner // Homepage : http://lars.werner.no // // Description : All the consts used in the FullScreentitlebar // // Classes : None // // History // Vers. Date Aut. Type Description // ----- -------- ---- ------- ----------------------------------------- // 1.00 22 01 04 LW Create Original //=========================================================================== //Width and heigth for the toolbar #define tbWidth 700 #define tbHeigth 20 //Default size on every picture used as buttons #define tbcxPicture 16 #define tbcyPicture 14 //Margins for placing buttons on screen #define tbTopSpace 3 #define tbLeftSpace 20 #define tbRightSpace 20 #define tbButtonSpace 1 //Color and layout #define tbFont "Arial" #define tbFontSize 10 #define tbTextColor RGB(220,220,220) #define tbStartColor RGB(64,64,64) #define tbEndColor RGB(32,32,32) #define tbGradientWay FALSE //TRUE = Vertical, FALSE = Horiz #define tbBorderPenColor RGB(192,192,192) #define tbBorderPenShadow RGB(100,100,100) //Triangularpoint is used to make the RGN so the window is not rectangular #define tbTriangularPoint 10 //This is the width of the pen used to draw the border... #define tbBorderWidth 2 //About showing the window #define tbHideAtStartup FALSE //Hide window when created #define tbPinNotPushedIn TRUE //Is the pin pushed in or out at startup (sorry for invertion!) #define tbScrollWindow TRUE //Animate window to scroll up/down #define tbScrollDelay 20 //Timer variable for scrolling the window (cycletime) [ms] #define tbAutoScrollTime 10 //* tbAutoScrollDelay milliseconds steps. Meaning if it is 10 then = 10 (steps) * 100ms (tbAutoScrollDelay) = 1000ms delay #define tbScrollTimerID 1 //Timer id #define tbAutoScrollTimer 2 //Timer id #define tbAutoScrollDelay 100 //Timer variable for how many times the cursor is not over the window. If it is tbAutoScrollTime then it will hide if autohide //================================================= //Resource part //================================================= #define tbIDC_CLOSE 10 #define tbIDC_MAXIMIZE 20 #define tbIDC_MINIMIZE 30 #define tbIDC_PIN 40 //================================================= // Windows Message part //================================================= //FALSE = Send a custon WM message, TRUE = Send Minimize, maximize and close to parent #define tbDefault FALSE //Own defines messages #define tbWM_CLOSE WM_USER+1000 #define tbWM_MINIMIZE WM_USER+1001 #define tbWM_MAXIMIZE WM_USER+1002 //================================================= // Menus with ID's and messages //================================================= #define tbMENUID IDR_tbMENU //Resource name for the menu #define tbWMCOMMANDIDStart 50000 //Start: This is the internal id number sendt into the WM_COMMAND on each item #define tbWMCOMMANDIDEnd 51000 //End: This is the internal id number sendt into the WM_COMMAND on each item #define tbWMUSERID 2000 //This is WM_USER+n setting. Eg: if first item is clicked you will get an WM_USER+n+0 to the parent, and WM_USER+n+1 for the next item ect ect #define tbLastIsStandard TRUE //TRUE = Bottom of the menu is close, minimize and maximize, FALSE = The menu does not contain anything
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // // $Revision: $ // $NoKeywords: $ //=============================================================================// #ifndef ICLIENTMODE_H #define ICLIENTMODE_H #include <vgui/VGUI.h> class CViewSetup; class C_BaseEntity; class C_BasePlayer; class CUserCmd; namespace vgui { class Panel; class AnimationController; } // Message mode types enum { MM_NONE = 0, MM_SAY, MM_SAY_TEAM, }; abstract_class IClientMode { // Misc. public: virtual ~IClientMode() {} virtual int ClientModeCSNormal(void *) = 0; // Called before the HUD is initialized. virtual void InitViewport() = 0; // One time init when .dll is first loaded. virtual void Init() = 0; // Called when vgui is shutting down. virtual void VGui_Shutdown() = 0; // One time call when dll is shutting down virtual void Shutdown() = 0; // Called when switching from one IClientMode to another. // This can re-layout the view and such. // Note that Enable and Disable are called when the DLL initializes and shuts down. virtual void Enable() = 0; virtual void EnableWithRootPanel(vgui::VPANEL pRoot) = 0; // Called when it's about to go into another client mode. virtual void Disable() = 0; // Called when initializing or when the view changes. // This should move the viewport into the correct position. virtual void Layout(bool bForce = false) = 0; // Gets at the viewport, if there is one... virtual vgui::Panel *GetViewport() = 0; // Gets a panel hierarchically below the viewport by name like so "ASWHudInventoryMode/SuitAbilityPanel/ItemPanel1"... virtual vgui::Panel *GetPanelFromViewport(const char *pchNamePath) = 0; // Gets at the viewports vgui panel animation controller, if there is one... virtual vgui::AnimationController *GetViewportAnimationController() = 0; // called every time shared client dll/engine data gets changed, // and gives the cdll a chance to modify the data. virtual void ProcessInput(bool bActive) = 0; // The mode can choose to draw/not draw entities. virtual bool ShouldDrawDetailObjects() = 0; virtual bool ShouldDrawEntity(C_BaseEntity *pEnt) = 0; virtual bool ShouldDrawLocalPlayer(C_BasePlayer *pPlayer) = 0; virtual bool ShouldDrawParticles() = 0; // The mode can choose to not draw fog virtual bool ShouldDrawFog(void) = 0; virtual void OverrideView(CViewSetup *pSetup) = 0; // 18 virtual void OverrideAudioState(AudioState_t *pAudioState) = 0; // 19 virtual int KeyInput(int down, ButtonCode_t keynum, const char *pszCurrentBinding) = 0; // 20 virtual void StartMessageMode(int iMessageModeType) = 0; virtual vgui::Panel *GetMessagePanel() = 0; virtual void OverrideMouseInput(float *x, float *y) = 0; virtual bool CreateMove(float flInputSampleTime, CUserCmd *cmd) = 0; // 24 virtual void LevelInit(const char *newmap) = 0; virtual void LevelShutdown(void) = 0; // Certain modes hide the view model virtual bool ShouldDrawViewModel(void) = 0; virtual bool ShouldDrawCrosshair(void) = 0; // Let mode override viewport for engine virtual void AdjustEngineViewport(int& x, int& y, int& width, int& height) = 0; //29 // Called before rendering a view. virtual void PreRender(CViewSetup *pSetup) = 0; // 30 // Called after everything is rendered. virtual void PostRender(void) = 0; virtual void PostRenderVGui() = 0; virtual void ActivateInGameVGuiContext(vgui::Panel *pPanel) = 0; virtual void DeactivateInGameVGuiContext() = 0; virtual float GetViewModelFOV(void) = 0; virtual bool CanRecordDemo(char *errorMsg, int length) const = 0; virtual const char* GetServerName(void) = 0; virtual void SetServerName(char* name) = 0; virtual const char* GetMapName(void) = 0; virtual void SetMapName(char* name) = 0; // 41 virtual void OnColorCorrectionWeightsReset(void) = 0; virtual float GetColorCorrectionScale(void) const = 0; virtual int HudElementKeyInput(int down, ButtonCode_t keynum, const char *pszCurrentBinding) = 0; virtual void DoPostScreenSpaceEffects(const CViewSetup *pSetup) = 0; // 45 // Updates. public: // Called every frame. virtual void Update() = 0; virtual void SetBlurFade(float scale) = 0; virtual float GetBlurFade(void) = 0; virtual void ReloadScheme(void) = 0; virtual void ReloadSchemeWithRoot(unsigned int root) = 0; virtual void OverrideRenderBounds(int& a1, int& a2, int& a3, int& a4, int& a5, int& a6) = 0; // 50 virtual void FireGameEvent(IGameEvent* gameEvent) = 0; }; extern IClientMode* GetClientMode(); extern IClientMode* GetFullscreenClientMode(); #endif
/* move to /include/linux/ ,in case conflict with qcom */ /*Add synaptics new driver "Synaptics DSX I2C V2.0"*/ /* * Synaptics DSX touchscreen driver * * Copyright (C) 2012 Synaptics Incorporated * * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _SYNAPTICS_DSX_H_ #define _SYNAPTICS_DSX_H_ #ifdef CONFIG_HUAWEI_KERNEL #define ENABLE_VIRTUAL_KEYS #endif /*CONFIG_HUAWEI_KERNEL*/ /* * synaptics_dsx_cap_button_map - 0d button map * @nbuttons: number of 0d buttons * @map: pointer to array of button types */ struct synaptics_dsx_cap_button_map { unsigned char nbuttons; unsigned char *map; }; #ifdef CONFIG_HUAWEI_KERNEL #ifdef ENABLE_VIRTUAL_KEYS struct syanptics_virtual_keys { struct kobj_attribute kobj_attr; u16 *data; int size; }; #endif #endif /*CONFIG_HUAWEI_KERNEL*/ /* * struct synaptics_dsx_platform_data - dsx platform data * @x_flip: x flip flag * @y_flip: y flip flag * @irq_gpio: attention interrupt gpio * @power_gpio: power switch gpio * @power_on_state: power switch active state * @reset_gpio: reset gpio * @reset_on_state: reset active state * @irq_flags: irq flags * @panel_x: x-axis resolution of display panel * @panel_y: y-axis resolution of display panel * @power_delay_ms: delay time to wait after power-on * @reset_delay_ms: delay time to wait after reset * @reset_active_ms: reset active time * @regulator_name: pointer to name of regulator * @gpio_config: pointer to gpio configuration function * @cap_button_map: pointer to 0d button map */ struct synaptics_dsx_platform_data { bool x_flip; bool y_flip; bool i2c_pull_up; bool power_down_enable; bool disable_gpios; bool do_lockdown; unsigned irq_gpio; u32 irq_flags; u32 reset_flags; unsigned reset_gpio; unsigned panel_minx; unsigned panel_miny; unsigned panel_maxx; unsigned panel_maxy; unsigned disp_minx; unsigned disp_miny; unsigned disp_maxx; unsigned disp_maxy; unsigned reset_delay; const char *fw_image_name; int (*gpio_config)(unsigned gpio, bool configure); struct synaptics_rmi4_capacitance_button_map *capacitance_button_map; }; #endif
/* * This file is part of the coreboot project. * * Copyright (C) 2007-2010 coresystems GmbH * Copyright (C) 2012 Google 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <stdint.h> #include <stdlib.h> #include <string.h> #include <cbfs.h> #include <console/console.h> #include <cpu/intel/haswell/haswell.h> #include <northbridge/intel/haswell/haswell.h> #include <northbridge/intel/haswell/raminit.h> #include <southbridge/intel/lynxpoint/pch.h> #include <southbridge/intel/lynxpoint/lp_gpio.h> #include <variant/gpio.h> #include "../../variant.h" const struct rcba_config_instruction rcba_config[] = { /* * GFX INTA -> PIRQA (MSI) * D28IP_P1IP PCIE INTA -> PIRQA * D29IP_E1P EHCI INTA -> PIRQD * D20IP_XHCI XHCI INTA -> PIRQC (MSI) * D31IP_SIP SATA INTA -> PIRQF (MSI) * D31IP_SMIP SMBUS INTB -> PIRQG * D31IP_TTIP THRT INTC -> PIRQA * D27IP_ZIP HDA INTA -> PIRQG (MSI) */ /* Device interrupt pin register (board specific) */ RCBA_SET_REG_32(D31IP, (INTC << D31IP_TTIP) | (NOINT << D31IP_SIP2) | (INTB << D31IP_SMIP) | (INTA << D31IP_SIP)), RCBA_SET_REG_32(D29IP, (INTA << D29IP_E1P)), RCBA_SET_REG_32(D28IP, (INTA << D28IP_P1IP) | (INTC << D28IP_P3IP) | (INTB << D28IP_P4IP)), RCBA_SET_REG_32(D27IP, (INTA << D27IP_ZIP)), RCBA_SET_REG_32(D26IP, (INTA << D26IP_E2P)), RCBA_SET_REG_32(D22IP, (NOINT << D22IP_MEI1IP)), RCBA_SET_REG_32(D20IP, (INTA << D20IP_XHCI)), /* Device interrupt route registers */ RCBA_SET_REG_32(D31IR, DIR_ROUTE(PIRQG, PIRQC, PIRQB, PIRQA)),/* LPC */ RCBA_SET_REG_32(D29IR, DIR_ROUTE(PIRQD, PIRQD, PIRQD, PIRQD)),/* EHCI */ RCBA_SET_REG_32(D28IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)),/* PCIE */ RCBA_SET_REG_32(D27IR, DIR_ROUTE(PIRQG, PIRQG, PIRQG, PIRQG)),/* HDA */ RCBA_SET_REG_32(D22IR, DIR_ROUTE(PIRQA, PIRQA, PIRQA, PIRQA)),/* ME */ RCBA_SET_REG_32(D21IR, DIR_ROUTE(PIRQE, PIRQF, PIRQF, PIRQF)),/* SIO */ RCBA_SET_REG_32(D20IR, DIR_ROUTE(PIRQC, PIRQC, PIRQC, PIRQC)),/* XHCI */ RCBA_SET_REG_32(D23IR, DIR_ROUTE(PIRQH, PIRQH, PIRQH, PIRQH)),/* SDIO */ /* Disable unused devices (board specific) */ RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS), RCBA_END_CONFIG, }; /* Copy SPD data for on-board memory */ static void copy_spd(struct pei_data *peid) { const int gpio_vector[] = {13, 9, 47, -1}; int spd_index = get_gpios(gpio_vector); char *spd_file; size_t spd_file_len; printk(BIOS_DEBUG, "SPD index %d\n", spd_index); spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD, &spd_file_len); if (!spd_file) die("SPD data not found."); /* Limiting to a single dimm for 2GB configuration * Identified by bit 3 */ if (spd_index & 0x4) peid->dimm_channel1_disabled = 3; if (spd_file_len < ((spd_index + 1) * sizeof(peid->spd_data[0]))) { printk(BIOS_ERR, "SPD index override to 0 - old hardware?\n"); spd_index = 0; } if (spd_file_len < sizeof(peid->spd_data[0])) die("Missing SPD data."); memcpy(peid->spd_data[0], spd_file + spd_index * sizeof(peid->spd_data[0]), sizeof(peid->spd_data[0])); } void variant_romstage_entry(unsigned long bist) { struct pei_data pei_data = { .pei_version = PEI_VERSION, .mchbar = (uintptr_t)DEFAULT_MCHBAR, .dmibar = (uintptr_t)DEFAULT_DMIBAR, .epbar = DEFAULT_EPBAR, .pciexbar = DEFAULT_PCIEXBAR, .smbusbar = SMBUS_IO_BASE, .wdbbar = 0x4000000, .wdbsize = 0x1000, .hpet_address = HPET_ADDR, .rcba = (uintptr_t)DEFAULT_RCBA, .pmbase = DEFAULT_PMBASE, .gpiobase = DEFAULT_GPIOBASE, .temp_mmio_base = 0xfed08000, .system_type = 5, /* ULT */ .tseg_size = CONFIG_SMM_TSEG_SIZE, .spd_addresses = { 0xff, 0x00, 0xff, 0x00 }, .ec_present = 1, // 0 = leave channel enabled // 1 = disable dimm 0 on channel // 2 = disable dimm 1 on channel // 3 = disable dimm 0+1 on channel .dimm_channel0_disabled = 2, .dimm_channel1_disabled = 2, .max_ddr3_freq = 1600, .usb_xhci_on_resume = 1, .usb2_ports = { /* Length, Enable, OCn#, Location */ { 0x0040, 1, 0, /* P0: Port A, CN10 */ USB_PORT_BACK_PANEL }, { 0x0040, 1, 2, /* P1: Port B, CN11 */ USB_PORT_BACK_PANEL }, { 0x0080, 1, USB_OC_PIN_SKIP, /* P2: CCD */ USB_PORT_INTERNAL }, { 0x0040, 1, USB_OC_PIN_SKIP, /* P3: BT */ USB_PORT_MINI_PCIE }, { 0x0080, 1, USB_OC_PIN_SKIP, /* P4: SD Card */ USB_PORT_INTERNAL }, { 0x0040, 1, USB_OC_PIN_SKIP, /* P5: LTE */ USB_PORT_INTERNAL }, { 0x0040, 1, USB_OC_PIN_SKIP, /* P6: SIM CARD */ USB_PORT_FLEX }, { 0x0000, 0, USB_OC_PIN_SKIP, /* P7: EMPTY */ USB_PORT_SKIP }, }, .usb3_ports = { /* Enable, OCn# */ { 1, 0 }, /* P1; Port A, CN10 */ { 1, 2 }, /* P2; Port B, CN11 */ { 0, USB_OC_PIN_SKIP }, /* P3; */ { 0, USB_OC_PIN_SKIP }, /* P4; */ }, }; struct romstage_params romstage_params = { .pei_data = &pei_data, .gpio_map = &mainboard_gpio_map, .rcba_config = &rcba_config[0], .bist = bist, .copy_spd = copy_spd, }; /* Call into the real romstage main with this board's attributes. */ romstage_common(&romstage_params); }
/* * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _SHORTVECTOR_H #define _SHORTVECTOR_H #include <G3D/Vector3.h> namespace VMAP { /** Vector with 16 bit fix point values 12.4 bit. */ class ShortVector { private: short iX; short iY; short iZ; const static short maxvalue = 0x7fff; const static short minvalue = -0x7fff; const static int fixpointdiv = 16; const static short fixpoint_maxvalue = maxvalue / fixpointdiv; const static short fixpoint_minvalue = minvalue / fixpointdiv; inline short float2Short(float fv) const { short sv; debugAssert((fv <= fixpoint_maxvalue || fv >= 1000000) && (fv >= fixpoint_minvalue || fv <= -1000000)); if(fv >= fixpoint_maxvalue) sv=maxvalue; else if(fv <= fixpoint_minvalue) sv=minvalue; else sv = (short) (fv * fixpointdiv + 0.5); return(sv); } inline float short2Float(short sv) const { float fv; if(sv >= maxvalue) fv=G3D::inf(); else if(sv <= minvalue) fv=-G3D::inf(); else fv = ((float)sv) / fixpointdiv; return fv; } inline float getFX() const { return(short2Float(iX)); } inline float getFY() const { return(short2Float(iY)); } inline float getFZ() const { return(short2Float(iZ)); } public: inline ShortVector() {} inline ShortVector(const G3D::Vector3& pVector) { iX = float2Short(pVector.x); iY = float2Short(pVector.y); iZ = float2Short(pVector.z); } inline ShortVector(float pX, float pY, float pZ) { iX = float2Short(pX); iY = float2Short(pY); iZ = float2Short(pZ); } inline ShortVector(short pX, short pY, short pZ) { iX = pX; iY = pY; iZ = pZ; } inline ShortVector(const ShortVector& pShortVector) { iX = pShortVector.iX; iY = pShortVector.iY; iZ = pShortVector.iZ; } inline float getX() const { return(iX); } inline float getY() const { return(iY); } inline float getZ() const { return(iZ); } inline G3D::Vector3 getVector3() const { return(G3D::Vector3(getFX(), getFY(), getFZ())); } inline ShortVector min(const ShortVector pShortVector) { ShortVector result = pShortVector; if(pShortVector.iX > iX) { result.iX = iX; } if(pShortVector.iY > iY) { result.iY = iY; } if(pShortVector.iZ > iZ) { result.iZ = iZ; } return(result); } inline ShortVector max(const ShortVector pShortVector) { ShortVector result = pShortVector; if(pShortVector.iX < iX) { result.iX = iX; } if(pShortVector.iY < iY) { result.iY = iY; } if(pShortVector.iZ < iZ) { result.iZ = iZ; } return(result); } inline bool operator==(const ShortVector& v) const { return (iX == v.iX && iY == v.iY && iZ == v.iZ); } inline bool operator!=(const ShortVector& v) const { return !(iX == v.iX && iY == v.iY && iZ == v.iZ); } }; } #endif
/* * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MANGOS_INSTANCE_DATA_H #define MANGOS_INSTANCE_DATA_H #include "Common.h" class Map; class Unit; class Player; class GameObject; class Creature; class MANGOS_DLL_SPEC InstanceData { public: explicit InstanceData(Map *map) : instance(map) {} virtual ~InstanceData() {} Map *instance; //On creation, NOT load. virtual void Initialize() {} //On load virtual void Load(const char* /*data*/) {} //When save is needed, this function generates the data virtual const char* Save() { return ""; } void SaveToDB(); //Called every map update virtual void Update(uint32 /*diff*/) {} //Used by the map's CanEnter function. //This is to prevent players from entering during boss encounters. virtual bool IsEncounterInProgress() const { return false; }; //Called when a player successfully enters the instance. virtual void OnPlayerEnter(Player *) {} //Called when a gameobject is created virtual void OnObjectCreate(GameObject *) {} //called on creature creation virtual void OnCreatureCreate(Creature * /*creature*/) {} //All-purpose data storage 64 bit virtual uint64 GetData64(uint32 /*Data*/) { return 0; } virtual void SetData64(uint32 /*Data*/, uint64 /*Value*/) { } //All-purpose data storage 32 bit virtual uint32 GetData(uint32 /*Type*/) { return 0; } virtual void SetData(uint32 /*Type*/, uint32 /*Data*/) {} // Achievement criteria additional requirements check // NOTE: not use this if same can be checked existed requirement types from AchievementCriteriaRequirementType virtual bool CheckAchievementCriteriaMeet(uint32 /*criteria_id*/, Player const* /*source*/, Unit const* /*target*/ = NULL, uint32 /*miscvalue1*/ = 0); }; #endif
#pragma once #include <cstdio> #include <string> #include "../Math/Vector2D.h" #include <tinyxml2.h> #ifdef _DEBUG #undef DEBUG #endif namespace OT { class Game; namespace Item { class Factory; class Item; class AbstractPrototype { public: std::string id; std::string name; int price; int2 size; int icon; int entrance_offset; int exit_offset; virtual Item * make(Game * game) = 0; virtual ~AbstractPrototype() {} std::string desc() { char c[512]; snprintf(c, 512, "Prototype '%s' $%i %s", this->id.c_str(), this->price, this->size.desc().c_str()); return c; } }; template <typename T> class Prototype : public AbstractPrototype { friend class Factory; protected: Item * make(Game * game) { return new T(game, this); } }; } }
/* * ***** BEGIN GPL LICENSE BLOCK ***** * * 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. * * The Original Code is Copyright (C) 2005 Blender Foundation. * All rights reserved. * * The Original Code is: all of this file. * * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ /** \file blender/nodes/texture/nodes/node_texture_decompose.c * \ingroup texnodes */ #include "node_texture_util.h" #include "NOD_texture.h" #include <math.h> static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f }, { -1, 0, "" } }; static bNodeSocketTemplate outputs[] = { { SOCK_FLOAT, 0, N_("Red") }, { SOCK_FLOAT, 0, N_("Green") }, { SOCK_FLOAT, 0, N_("Blue") }, { SOCK_FLOAT, 0, N_("Alpha") }, { -1, 0, "" } }; static void valuefn_r(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[0]; } static void valuefn_g(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[1]; } static void valuefn_b(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[2]; } static void valuefn_a(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[3]; } static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out) { tex_output(node, execdata, in, out[0], &valuefn_r, data); tex_output(node, execdata, in, out[1], &valuefn_g, data); tex_output(node, execdata, in, out[2], &valuefn_b, data); tex_output(node, execdata, in, out[3], &valuefn_a, data); } void register_node_type_tex_decompose(void) { static bNodeType ntype; tex_node_type_base(&ntype, TEX_NODE_DECOMPOSE, "Separate RGBA", NODE_CLASS_OP_COLOR, 0); node_type_socket_templates(&ntype, inputs, outputs); node_type_exec(&ntype, NULL, NULL, exec); nodeRegisterType(&ntype); }
#ifndef TIMELINEPANE_H #define TIMELINEPANE_H #include "maincursor.inc" #include "mtimebar.inc" #include "mwindow.inc" #include "mwindowgui.inc" #include "patchbay.inc" #include "samplescroll.inc" #include "trackcanvas.inc" #include "trackscroll.inc" class TimelinePane { public: // coordinates are relative to the main window TimelinePane(MWindow *mwindow, int number, int x, int y, int w, int h); ~TimelinePane(); void create_objects(); void resize_event(int x, int y, int w, int h); void update(int scrollbars, int do_canvas, int timebar, int patchbay); void activate(); void create_track_scroll(int view_x, int view_y, int view_w, int view_h); void create_sample_scroll(int view_x, int view_y, int view_w, int view_h); MWindow *mwindow; MWindowGUI *gui; MainCursor *cursor; PatchBay *patchbay; MTimeBar *timebar; SampleScroll *samplescroll; TrackScroll *trackscroll; TrackCanvas *canvas; // number of the name int number; // total area including widgets int x, y, w, h; // area for drawing tracks, excluding the widgets int view_x, view_y, view_w, view_h; }; #endif
/*************************************************************************** qgswcsgecapabilities.h ------------------------- begin : January 16 , 2017 copyright : (C) 2013 by René-Luc D'Hont ( parts from qgswcsserver ) (C) 2017 by David Marteau email : rldhont at 3liz dot com david dot marteau at 3liz dot com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSWCSGETCAPABILITIES_H #define QGSWCSGETCAPABILITIES_H #include <QDomDocument> namespace QgsWcs { /** * Create ContentMetadata element for get capabilities document */ QDomElement getContentMetadataElement( QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project ); /** * Create Service element for get capabilities document */ QDomElement getServiceElement( QDomDocument &doc, const QgsProject *project ); /** * Create get capabilities document */ QDomDocument createGetCapabilitiesDocument( QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request ); /** Output WCS GetCapabilities response */ void writeGetCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response ); } // samespace QgsWcs #endif
/* Gcolor3ColorItem * * Copyright (C) 2018 Jente Hidskes * * Author: Jente Hidskes <hjdskes@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GCOLOR3_COLOR_ITEM_H__ #define __GCOLOR3_COLOR_ITEM_H__ #include <gtk/gtk.h> G_BEGIN_DECLS typedef struct _Gcolor3ColorItem Gcolor3ColorItem; typedef struct _Gcolor3ColorItemClass Gcolor3ColorItemClass; typedef struct _Gcolor3ColorItemPrivate Gcolor3ColorItemPrivate; #define GCOLOR3_TYPE_COLOR_ITEM (gcolor3_color_item_get_type ()) #define GCOLOR3_COLOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCOLOR3_TYPE_COLOR_ITEM, Gcolor3ColorItem)) #define GCOLOR3_COLOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCOLOR3_TYPE_COLOR_ITEM, Gcolor3ColorItemClass)) #define GCOLOR3_IS_COLOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCOLOR3_TYPE_COLOR_ITEM)) #define GCOLOR3_IS_COLOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCOLOR3_TYPE_COLOR_ITEM)) #define GCOLOR3_COLOR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCOLOR3_TYPE_COLOR_ITEM, Gcolor3ColorItemClass)) struct _Gcolor3ColorItem { GObject base_instance; }; struct _Gcolor3ColorItemClass { GObjectClass parent_class; }; GType gcolor3_color_item_get_type (void) G_GNUC_CONST; Gcolor3ColorItem *gcolor3_color_item_new (const gchar *key, const gchar *hex); G_END_DECLS #endif /* __GCOLOR3_COLOR_ITEM_H__ */
/* Copyright holders: Sarah Walker see COPYING for more details */ extern const device_t s3_virge_vlb_device; extern const device_t s3_virge_pci_device; extern const device_t s3_virge_988_vlb_device; extern const device_t s3_virge_988_pci_device; extern const device_t s3_virge_375_vlb_device; extern const device_t s3_virge_375_pci_device; extern const device_t s3_virge_375_4_vlb_device; extern const device_t s3_virge_375_4_pci_device;
/* * Copyright (c) 2010 Cyrille Berger <cberger@cberger.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KIS_MASK_GENERATOR_BENCHMARK_H #define KIS_MASK_GENERATOR_BENCHMARK_H #include <QtTest/QtTest> class KisMaskGeneratorBenchmark : public QObject { Q_OBJECT private slots: void benchmarkCircle(); void benchmarkSquare(); }; #endif
/* * Copyright (C) 2007 Neil Jagdish Patel <njpatel@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Author : Neil Jagdish Patel <njpatel@gmail.com> * * Notes : Contains functions allowing Awn to get a icon from XOrg using the * xid. Please note that all icon reading code has been lifted from * libwnck (XUtils.c), so track bugfixes in libwnck. */ #include "config.h" #include "awn-x.h" #include "xutils.h" #include <X11/Xlib.h> #include <X11/Xatom.h> #include <gdk/gdk.h> #include <gdk/gdkx.h> #include <string.h>
/* * qsort.c * Qsort algorithm * * Based on technology: * Copyright (c) 1980, 1983 The Regents of the University of California. * All rights reserved. * * Our own version of the system qsort routine which is faster by an * average of 25%, with lows and highs of 10% and 50%. * * The THRESHold below is the insertion sort threshold, and has been * adjusted for records of size 48 bytes. The MTHREShold is where we * stop finding a better median. */ #define THRESH 4 /* threshold for insertion */ #define MTHRESH 6 /* threshold for median */ static int (*qcmp)(); /* the comparison routine */ static int qsz; /* size of each record */ static int thresh; /* THRESHold in chars */ static int mthresh; /* MTHRESHold in chars */ static int qst(); /* * qsort() * * First, set up some global parameters for qst to share. Then, quicksort * with qst(), and then a cleanup insertion sort ourselves. Sound simple? * It's not... */ void qsort(void *base, int n, unsigned int size, int (*compar)(void *, void *)) { register char c, *i, *j, *lo, *hi; char *min, *max; if (n <= 1) { return; } qsz = size; qcmp = compar; thresh = qsz * THRESH; mthresh = qsz * MTHRESH; max = base + n * qsz; if (n >= THRESH) { qst(base, max); hi = base + thresh; } else { hi = max; } /* * First put smallest element, which must be in the first THRESH, in * the first position as a sentinel. This is done just by searching * the first THRESH elements (or the first n if n < THRESH), finding * the min, and swapping it into the first position. */ for (j = lo = base; (lo += qsz) < hi;) { if (qcmp(j, lo) > 0) { j = lo; } } if (j != base) { /* swap j into place */ for (i = base, hi = base + qsz; i < hi; ) { c = *j; *j++ = *i; *i++ = c; } } /* * With our sentinel in place, we now run the following hyper-fast * insertion sort. For each remaining element, min, from [1] to [n-1], * set hi to the index of the element AFTER which this one goes. * Then, do the standard insertion sort shift on a character at a time * basis for each element in the frob. */ for (min = base; (hi = min += qsz) < max; ) { while (qcmp(hi -= qsz, min) > 0) /* void */; if ((hi += qsz) != min) { for (lo = min + qsz; --lo >= min; ) { c = *lo; for (i = j = lo; (j -= qsz) >= hi; i = j) { *i = *j; } *i = c; } } } } /* * qst() * * Do a quicksort * First, find the median element, and put that one in the first place as the * discriminator. (This "median" is just the median of the first, last and * middle elements). (Using this median instead of the first element is a big * win). Then, the usual partitioning/swapping, followed by moving the * discriminator into the right place. Then, figure out the sizes of the two * partions, do the smaller one recursively and the larger one via a repeat of * this code. Stopping when there are less than THRESH elements in a partition * and cleaning up with an insertion sort (in our caller) is a huge win. * All data swaps are done in-line, which is space-losing but time-saving. * (And there are only three places where this is done). */ static int qst(char *base, char *max) { register char c, *i, *j, *jj; register int ii; char *mid, *tmp; int lo, hi; /* * At the top here, lo is the number of characters of elements in the * current partition. (Which should be max - base). * Find the median of the first, last, and middle element and make * that the middle element. Set j to largest of first and middle. * If max is larger than that guy, then it's that guy, else compare * max with loser of first and take larger. Things are set up to * prefer the middle, then the first in case of ties. */ lo = max - base; /* number of elements as chars */ do { mid = i = base + qsz * ((lo / qsz) >> 1); if (lo >= mthresh) { j = (qcmp((jj = base), i) > 0 ? jj : i); if (qcmp(j, (tmp = max - qsz)) > 0) { /* switch to first loser */ j = (j == jj ? i : jj); if (qcmp(j, tmp) < 0) { j = tmp; } } if (j != i) { ii = qsz; do { c = *i; *i++ = *j; *j++ = c; } while (--ii); } } /* * Semi-standard quicksort partitioning/swapping */ for (i = base, j = max - qsz; ; ) { while (i < mid && qcmp(i, mid) <= 0) { i += qsz; } while (j > mid) { if (qcmp(mid, j) <= 0) { j -= qsz; continue; } tmp = i + qsz; /* value of i after swap */ if (i == mid) { /* j <-> mid, new mid is j */ mid = jj = j; } else { /* i <-> j */ jj = j; j -= qsz; } goto swap; } if (i == mid) { break; } else { /* i <-> mid, new mid is i */ jj = mid; tmp = mid = i; /* value of i after swap */ j -= qsz; } swap: ii = qsz; do { c = *i; *i++ = *jj; *jj++ = c; } while (--ii); i = tmp; } /* * Look at sizes of the two partitions, do the smaller * one first by recursion, then do the larger one by * making sure lo is its size, base and max are update * correctly, and branching back. But only repeat * (recursively or by branching) if the partition is * of at least size THRESH. */ i = (j = mid) + qsz; if ((lo = j - base) <= (hi = max - i)) { if (lo >= thresh) { qst(base, j); } base = i; lo = hi; } else { if (hi >= thresh) { qst(i, max); } max = j; } } while (lo >= thresh); }
/* * Copyright (C) 1996-2022 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ #ifndef SQUID_PEERPOOLMGR_H #define SQUID_PEERPOOLMGR_H #include "base/AsyncJob.h" #include "base/JobWait.h" #include "comm/forward.h" #include "security/forward.h" class HttpRequest; class CachePeer; class CommConnectCbParams; /// Maintains an fixed-size "standby" PconnPool for a single CachePeer. class PeerPoolMgr: public AsyncJob { CBDATA_CLASS(PeerPoolMgr); public: typedef CbcPointer<PeerPoolMgr> Pointer; // syncs mgr state whenever connection-related peer or pool state changes static void Checkpoint(const Pointer &mgr, const char *reason); explicit PeerPoolMgr(CachePeer *aPeer); virtual ~PeerPoolMgr(); protected: /* AsyncJob API */ virtual void start(); virtual void swanSong(); virtual bool doneAll() const; /// whether the peer is still out there and in a valid state we can safely use bool validPeer() const; /// Starts new connection, or closes the excess connections /// according pool configuration void checkpoint(const char *reason); /// starts the process of opening a new standby connection (if possible) void openNewConnection(); /// closes 'howMany' standby connections void closeOldConnections(const int howMany); /// Comm::ConnOpener calls this when done opening a connection for us void handleOpenedConnection(const CommConnectCbParams &params); /// Security::PeerConnector callback void handleSecuredPeer(Security::EncryptorAnswer &answer); /// the final step in connection opening (and, optionally, securing) sequence void pushNewConnection(const Comm::ConnectionPointer &conn); private: CachePeer *peer; ///< the owner of the pool we manage RefCount<HttpRequest> request; ///< fake HTTP request for conn opening code /// waits for a transport connection to the peer to be established/opened JobWait<Comm::ConnOpener> transportWait; /// waits for the established transport connection to be secured/encrypted JobWait<Security::BlindPeerConnector> encryptionWait; unsigned int addrUsed; ///< counter for cycling through peer addresses }; #endif /* SQUID_PEERPOOLMGR_H */
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License version 2 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 2 along with this program; If not, see * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. * * GPL HEADER END */ /* * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * * lustre/include/linux/lustre_lib.h * * Basic Lustre library routines. */ #ifndef _LINUX_LUSTRE_LIB_H #define _LINUX_LUSTRE_LIB_H #ifndef _LUSTRE_LIB_H #error Do not #include this file directly. #include <lustre_lib.h> instead #endif #ifndef __KERNEL__ # include <string.h> # include <sys/types.h> #else # include <linux/rwsem.h> # include <linux/sched.h> # include <linux/signal.h> # include <linux/types.h> #endif #include <linux/lustre_compat25.h> #ifndef LP_POISON #if BITS_PER_LONG > 32 # define LI_POISON ((int)0x5a5a5a5a5a5a5a5a) # define LL_POISON ((long)0x5a5a5a5a5a5a5a5a) # define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a) #else # define LI_POISON ((int)0x5a5a5a5a) # define LL_POISON ((long)0x5a5a5a5a) # define LP_POISON ((void *)(long)0x5a5a5a5a) #endif #endif #define OBD_IOC_DATA_TYPE long #define LUSTRE_FATAL_SIGS (sigmask(SIGKILL) | sigmask(SIGINT) | \ sigmask(SIGTERM) | sigmask(SIGQUIT) | \ sigmask(SIGALRM)) #ifdef __KERNEL__ /* initialize ost_lvb according to inode */ static inline void inode_init_lvb(struct inode *inode, struct ost_lvb *lvb) { lvb->lvb_size = i_size_read(inode); lvb->lvb_blocks = inode->i_blocks; lvb->lvb_mtime = LTIME_S(inode->i_mtime); lvb->lvb_atime = LTIME_S(inode->i_atime); lvb->lvb_ctime = LTIME_S(inode->i_ctime); } #else /* defined in liblustre/llite_lib.h */ #endif #endif /* _LUSTRE_LIB_H */
extern struct vfsmount * sysfs_mount; extern struct kmem_cache *sysfs_dir_cachep; extern struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent *); extern int sysfs_create(struct dentry *, int mode, int (*init)(struct inode *)); extern int sysfs_dirent_exist(struct sysfs_dirent *, const unsigned char *); extern int sysfs_make_dirent(struct sysfs_dirent *, struct dentry *, void *, umode_t, int); extern int sysfs_add_file(struct dentry *, const struct attribute *, int); extern int sysfs_hash_and_remove(struct dentry * dir, const char * name); extern struct sysfs_dirent *sysfs_find(struct sysfs_dirent *dir, const char * name); extern int sysfs_create_subdir(struct kobject *, const char *, struct dentry **); extern void sysfs_remove_subdir(struct dentry *); extern const unsigned char * sysfs_get_name(struct sysfs_dirent *sd); extern void sysfs_drop_dentry(struct sysfs_dirent *sd, struct dentry *parent); extern int sysfs_setattr(struct dentry *dentry, struct iattr *iattr); extern struct rw_semaphore sysfs_rename_sem; extern struct super_block * sysfs_sb; extern const struct file_operations sysfs_dir_operations; extern const struct file_operations sysfs_file_operations; extern const struct file_operations bin_fops; extern struct inode_operations sysfs_dir_inode_operations; extern struct inode_operations sysfs_symlink_inode_operations; struct sysfs_symlink { char * link_name; struct kobject * target_kobj; }; static inline struct kobject * to_kobj(struct dentry * dentry) { struct sysfs_dirent * sd = dentry->d_fsdata; return ((struct kobject *) sd->s_element); } static inline struct attribute * to_attr(struct dentry * dentry) { struct sysfs_dirent * sd = dentry->d_fsdata; return ((struct attribute *) sd->s_element); } static inline struct bin_attribute * to_bin_attr(struct dentry * dentry) { struct sysfs_dirent * sd = dentry->d_fsdata; return ((struct bin_attribute *) sd->s_element); } static inline struct kobject *sysfs_get_kobject(struct dentry *dentry) { struct kobject * kobj = NULL; spin_lock(&dcache_lock); if (!d_unhashed(dentry)) { struct sysfs_dirent * sd = dentry->d_fsdata; if (sd->s_type & SYSFS_KOBJ_LINK) { struct sysfs_symlink * sl = sd->s_element; kobj = kobject_get(sl->target_kobj); } else kobj = kobject_get(sd->s_element); } spin_unlock(&dcache_lock); return kobj; } static inline void release_sysfs_dirent(struct sysfs_dirent * sd) { if (sd->s_type & SYSFS_KOBJ_LINK) { struct sysfs_symlink * sl = sd->s_element; kfree(sl->link_name); kobject_put(sl->target_kobj); kfree(sl); } kfree(sd->s_iattr); kmem_cache_free(sysfs_dir_cachep, sd); } static inline struct sysfs_dirent * sysfs_get(struct sysfs_dirent * sd) { if (sd) { WARN_ON(!atomic_read(&sd->s_count)); atomic_inc(&sd->s_count); } return sd; } static inline void sysfs_put(struct sysfs_dirent * sd) { if (atomic_dec_and_test(&sd->s_count)) release_sysfs_dirent(sd); }
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* * brasero * Copyright (C) Philippe Rouquier 2009 <bonfire-app@wanadoo.fr> * * brasero 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. * * brasero is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _BRASERO_SETTING_H_ #define _BRASERO_SETTING_H_ #include <glib-object.h> G_BEGIN_DECLS typedef enum { BRASERO_SETTING_VALUE_NONE, /** gint value **/ BRASERO_SETTING_WIN_WIDTH, BRASERO_SETTING_WIN_HEIGHT, BRASERO_SETTING_STOCK_FILE_CHOOSER_PERCENT, BRASERO_SETTING_BRASERO_FILE_CHOOSER_PERCENT, BRASERO_SETTING_PLAYER_VOLUME, BRASERO_SETTING_DISPLAY_PROPORTION, BRASERO_SETTING_DISPLAY_LAYOUT, BRASERO_SETTING_DATA_DISC_COLUMN, BRASERO_SETTING_DATA_DISC_COLUMN_ORDER, BRASERO_SETTING_IMAGE_SIZE_WIDTH, BRASERO_SETTING_IMAGE_SIZE_HEIGHT, BRASERO_SETTING_VIDEO_SIZE_HEIGHT, BRASERO_SETTING_VIDEO_SIZE_WIDTH, /** gboolean **/ BRASERO_SETTING_WIN_MAXIMIZED, BRASERO_SETTING_SHOW_SIDEPANE, BRASERO_SETTING_SHOW_PREVIEW, /** gchar * **/ BRASERO_SETTING_DISPLAY_LAYOUT_AUDIO, BRASERO_SETTING_DISPLAY_LAYOUT_DATA, BRASERO_SETTING_DISPLAY_LAYOUT_VIDEO, /** gchar ** **/ BRASERO_SETTING_SEARCH_ENTRY_HISTORY, } BraseroSettingValue; #define BRASERO_TYPE_SETTING (brasero_setting_get_type ()) #define BRASERO_SETTING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_SETTING, BraseroSetting)) #define BRASERO_SETTING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_SETTING, BraseroSettingClass)) #define BRASERO_IS_SETTING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_SETTING)) #define BRASERO_IS_SETTING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_SETTING)) #define BRASERO_SETTING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_SETTING, BraseroSettingClass)) typedef struct _BraseroSettingClass BraseroSettingClass; typedef struct _BraseroSetting BraseroSetting; struct _BraseroSettingClass { GObjectClass parent_class; /* Signals */ void(* value_changed) (BraseroSetting *self, gint value); }; struct _BraseroSetting { GObject parent_instance; }; GType brasero_setting_get_type (void) G_GNUC_CONST; BraseroSetting * brasero_setting_get_default (void); gboolean brasero_setting_get_value (BraseroSetting *setting, BraseroSettingValue setting_value, gpointer *value); gboolean brasero_setting_set_value (BraseroSetting *setting, BraseroSettingValue setting_value, gconstpointer value); gboolean brasero_setting_load (BraseroSetting *setting); gboolean brasero_setting_save (BraseroSetting *setting); G_END_DECLS #endif /* _BRASERO_SETTING_H_ */
/* * This file is part of the coreboot project. * * Copyright (C) 2012 Google 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <arch/acpi.h> #include <types.h> #include <console/console.h> #include <ec/google/chromeec/ec.h> #include "ec.h" void link_ec_init(void) { printk(BIOS_DEBUG, "link_ec_init\n"); post_code(0xf0); /* Restore SCI event mask on resume. */ if (acpi_slp_type == 3) { google_chromeec_log_events(LINK_EC_LOG_EVENTS | LINK_EC_S3_WAKE_EVENTS); /* Disable SMI and wake events */ google_chromeec_set_smi_mask(0); /* Clear pending events */ while (google_chromeec_get_event() != 0); google_chromeec_set_sci_mask(LINK_EC_SCI_EVENTS); } else { google_chromeec_log_events(LINK_EC_LOG_EVENTS | LINK_EC_S5_WAKE_EVENTS); } /* Clear wake events, these are enabled on entry to sleep */ google_chromeec_set_wake_mask(0); post_code(0xf1); }
% ClassName GstElement % TYPE_CLASS_NAME GST_TYPE_ELEMENT % pkg-config gstreamer-0.10 % includes #include <gst/gst.h> % prototypes static GstPad *gst_replace_request_new_pad (GstElement * element, GstPadTemplate * templ, const gchar * name); static void gst_replace_release_pad (GstElement * element, GstPad * pad); static GstStateChangeReturn gst_replace_get_state (GstElement * element, GstState * state, GstState * pending, GstClockTime timeout); static GstStateChangeReturn gst_replace_set_state (GstElement * element, GstState state); static GstStateChangeReturn gst_replace_change_state (GstElement * element, GstStateChange transition); static void gst_replace_set_bus (GstElement * element, GstBus * bus); static GstClock *gst_replace_provide_clock (GstElement * element); static gboolean gst_replace_set_clock (GstElement * element, GstClock * clock); static GstIndex *gst_replace_get_index (GstElement * element); static void gst_replace_set_index (GstElement * element, GstIndex * index); static gboolean gst_replace_send_event (GstElement * element, GstEvent * event); static const GstQueryType *gst_replace_get_query_types (GstElement * element); static gboolean gst_replace_query (GstElement * element, GstQuery * query); % declare-class GstElement *element_class = GST_ELEMENT (klass); % set-methods element_class-> = GST_DEBUG_FUNCPTR (gst_replace_); % methods static GstPad * gst_replace_request_new_pad (GstElement * element, GstPadTemplate * templ, const gchar * name) { return NULL; } static void gst_replace_release_pad (GstElement * element, GstPad * pad) { } static GstStateChangeReturn gst_replace_get_state (GstElement * element, GstState * state, GstState * pending, GstClockTime timeout) { return GST_STATE_CHANGE_OK; } static GstStateChangeReturn gst_replace_set_state (GstElement * element, GstState state) { return GST_STATE_CHANGE_OK; } static GstStateChangeReturn gst_replace_change_state (GstElement * element, GstStateChange transition) { return GST_STATE_CHANGE_OK; } static void gst_replace_set_bus (GstElement * element, GstBus * bus) { } static GstClock * gst_replace_provide_clock (GstElement * element) { } static gboolean gst_replace_set_clock (GstElement * element, GstClock * clock) { } static GstIndex * gst_replace_get_index (GstElement * element) { } static void gst_replace_set_index (GstElement * element, GstIndex * index) { } static gboolean gst_replace_send_event (GstElement * element, GstEvent * event) { } static const GstQueryType * gst_replace_get_query_types (GstElement * element) { } static gboolean gst_replace_query (GstElement * element, GstQuery * query) { } % end
/* * UCIMF - Unicode Console InputMethod Framework * * Copyright (c) 2006-2007 Chun-Yu Lee (Mat) and Open RazzmatazZ Laboratory (OrzLab) * * 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 __Type__ #define __Type__ #include <string> #include <vector> using namespace std; class ustring { public: ustring(){}; ustring(const ustring& ustr){ udata = ustr.udata; }; ustring(const char* encoding, const char* data); ustring(const string& encoding, const string& data); ~ustring(){}; string out(const char* encoding) const; unsigned long operator[](int i) const{ return udata[i]; }; const ustring& operator=(const ustring& ustr); ustring operator+(const ustring& str) const; bool operator==(const ustring& ustr) const; int size() const{ return udata.size(); }; void clear(){ udata.clear(); }; private: vector<unsigned long> udata; }; #endif
/* SPDX-License-Identifier: GPL-2.0+ */ /* * (C) Copyright 2010-2013 * NVIDIA Corporation <www.nvidia.com> */ #ifndef _TEGRA124_PMU_H_ #define _TEGRA124_PMU_H_ /* Set core and CPU voltages to nominal levels */ int pmu_set_nominal(void); #endif /* _TEGRA124_PMU_H_ */
/* -LICENSE-START- ** Copyright (c) 2016 Blackmagic Design ** ** Permission is hereby granted, free of charge, to any person or organization ** obtaining a copy of the software and accompanying documentation covered by ** this license (the "Software") to use, reproduce, display, distribute, ** execute, and transmit the Software, and to prepare derivative works of the ** Software, and to permit third-parties to whom the Software is furnished to ** do so, all subject to the following: ** ** The copyright notices in the Software and this entire statement, including ** the above license grant, this restriction and the following disclaimer, ** must be included in all copies of the Software, in whole or in part, and ** all derivative works of the Software, unless such copies or derivative ** works are solely in the form of machine-executable object code generated by ** a source language processor. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ** DEALINGS IN THE SOFTWARE. ** -LICENSE-END- */ #ifndef BMD_DECKLINKAPIDISCOVERY_H #define BMD_DECKLINKAPIDISCOVERY_H #ifndef BMD_CONST #if defined(_MSC_VER) #define BMD_CONST __declspec(selectany) static const #else #define BMD_CONST static const #endif #endif #ifndef BMD_PUBLIC #define BMD_PUBLIC #endif // Type Declarations // Interface ID Declarations BMD_CONST REFIID IID_IDeckLink = /* C418FBDD-0587-48ED-8FE5-640F0A14AF91 */ {0xC4,0x18,0xFB,0xDD,0x05,0x87,0x48,0xED,0x8F,0xE5,0x64,0x0F,0x0A,0x14,0xAF,0x91}; // Forward Declarations class IDeckLink; /* Interface IDeckLink - represents a DeckLink device */ class BMD_PUBLIC IDeckLink : public IUnknown { public: virtual HRESULT GetModelName (/* out */ CFStringRef *modelName) = 0; virtual HRESULT GetDisplayName (/* out */ CFStringRef *displayName) = 0; protected: virtual ~IDeckLink () {} // call Release method to drop reference count }; /* Functions */ extern "C" { } #endif /* defined(BMD_DECKLINKAPIDISCOVERY_H) */
/* @(#) $Header: /usr/local/dslrepos/uClinux-dist/user/tcpdump_web/af.h,v 1.1 2009/10/08 07:41:51 kaohj Exp $ (LBL) */ /* * Copyright (c) 1998-2006 The TCPDUMP project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ extern struct tok af_values[]; extern struct tok bsd_af_values[]; /* RFC1700 address family numbers */ #define AFNUM_INET 1 #define AFNUM_INET6 2 #define AFNUM_NSAP 3 #define AFNUM_HDLC 4 #define AFNUM_BBN1822 5 #define AFNUM_802 6 #define AFNUM_E163 7 #define AFNUM_E164 8 #define AFNUM_F69 9 #define AFNUM_X121 10 #define AFNUM_IPX 11 #define AFNUM_ATALK 12 #define AFNUM_DECNET 13 #define AFNUM_BANYAN 14 #define AFNUM_E164NSAP 15 #define AFNUM_VPLS 25 /* draft-kompella-ppvpn-l2vpn */ #define AFNUM_L2VPN 196 /* still to be approved by IANA */ /* * BSD AF_ values. * * Unfortunately, the BSDs don't all use the same value for AF_INET6, * so, because we want to be able to read captures from all of the BSDs, * we check for all of them. */ #define BSD_AFNUM_INET 2 #define BSD_AFNUM_NS 6 /* XEROX NS protocols */ #define BSD_AFNUM_ISO 7 #define BSD_AFNUM_APPLETALK 16 #define BSD_AFNUM_IPX 23 #define BSD_AFNUM_INET6_BSD 24 /* OpenBSD (and probably NetBSD), BSD/OS */ #define BSD_AFNUM_INET6_FREEBSD 28 #define BSD_AFNUM_INET6_DARWIN 30
/* * File: wgl_ext_api.c * Purpose: Wrapper functions for Win32 OpenGL wgl extension functions * * Authors: Jon TURNEY * * Copyright (c) Jon TURNEY 2009 * * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifdef HAVE_XWIN_CONFIG_H #include <xwin-config.h> #endif #include <X11/Xwindows.h> #include <GL/gl.h> #include <GL/glext.h> #include <glx/glxserver.h> #include <glx/glxext.h> #include <GL/wglext.h> #include <wgl_ext_api.h> #include "glwindows.h" #define RESOLVE_DECL(type) \ static type type##proc = NULL; #define PRERESOLVE(type, symbol) \ type##proc = (type)wglGetProcAddress(symbol); #define RESOLVE_RET(type, symbol, retval) \ if (type##proc == NULL) { \ ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \ __glXErrorCallBack(0); \ return retval; \ } #define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,) #define RESOLVED_PROC(type) type##proc /* * Include generated cdecl wrappers for stdcall WGL functions * * There are extensions to the wgl*() API as well; again we call * these functions by using wglGetProcAddress() to get a pointer * to the function, and wrapping it for cdecl/stdcall conversion * * We arrange to resolve the functions up front, as they need a * context to work, as we like to use them to be able to select * a context. Again, this assumption fails badly on multimontor * systems... */ #include "generated_wgl_wrappers.c"
/* * settings.h * * Created on: 5.5.2015 * Author: horinek */ #ifndef set_menu_audio_H_ #define set_menu_audio_H_ #include "../gui.h" #define gui_set_menu_audio_loop gui_list_draw #define gui_set_menu_audio_irqh gui_list_irqh void gui_set_menu_audio_init(); void gui_set_menu_audio_stop(); void gui_set_menu_audio_item(uint8_t index, char * text, uint8_t * flags, char * sub_text); void gui_set_menu_audio_action(uint8_t index); #endif /* set_menu_audio_H_ */
/************************************************************************ This software is part of React, a control engine Copyright (C) 2005,2006 Donald Wayne Carr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #include <semaphore.h> #include <pthread.h> #include "reactpoint.h" #include "db_point.h" #include "db.h" #include "iodriver.h" #include "iodriver.h" class simple_ascii_driver_t : public io_driver_t { private: double last_good[2]; double ai_vals[32]; double tmp_ai_vals[32]; bool di_vals[32]; bool tmp_di_vals[32]; bool do_vals[32]; bool tmp_do_vals[32]; int di_offset; int do_offset; int ai_offset; int ao_offset; int serial_fd; public: simple_ascii_driver_t(react_drv_base_t *react, const char *device); void read(void); void end_read(void); bool get_di(int channel); double get_ai(int channel); long get_count(int channel); void send_do(int channel, bool val); void send_ao(int channel, double val); void resend_dos(void); void close(void); }; int init_simple_ascii(const char *device, char *error, int size); int read_simple_ascii(int fd, double *ai_vals, int max_ai, bool *di_vals, int max_di, bool *do_vals, int max_do, char *error, int size); int send_simple_ascii(int fd, int channel, bool val, char *error, int size);
#ifndef PENDING_COMMAND_H #define PENDING_COMMAND_H #include "pb/commands.pb.h" #include "pb/response.pb.h" #include <QVariant> class PendingCommand : public QObject { Q_OBJECT signals: void finished(const Response &response, const CommandContainer &commandContainer, const QVariant &extraData); void finished(Response::ResponseCode respCode); private: CommandContainer commandContainer; QVariant extraData; int ticks; public: PendingCommand(const CommandContainer &_commandContainer, QVariant _extraData = QVariant()); CommandContainer &getCommandContainer(); void setExtraData(const QVariant &_extraData); QVariant getExtraData() const; void processResponse(const Response &response); int tick(); }; #endif
/* * IBM System z Huge TLB Page Support for Kernel. * * Copyright 2007 IBM Corp. * Author(s): Gerald Schaefer <gerald.schaefer@de.ibm.com> */ #include <linux/mm.h> #include <linux/hugetlb.h> #include <asm/io.h> #include <asm/pgalloc.h> void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *pteptr, pte_t pteval) { pmd_t *pmdp = (pmd_t *) pteptr; unsigned long mask, offset = 1UL << 20; if (!MACHINE_HAS_HPAGE) { offset = 2048; pteptr = (pte_t *) pte_page(pteval)->private; mask = pte_val(pteval) & (_SEGMENT_ENTRY_INV | _SEGMENT_ENTRY_RO); pte_val(pteval) = (_PMD_ENTRY + __pa(pteptr)) | mask; } pmd_val(*pmdp) = pte_val(pteval); pmd_val1(*pmdp) = pte_val(pteval) + offset; } int arch_prepare_hugepage(struct page *page) { struct page *ptepage; unsigned long addr = page_to_phys(page); pte_t pte; pte_t *ptep; int i; if (MACHINE_HAS_HPAGE) return 0; ptepage = pte_alloc_one(&init_mm, addr); if (!ptepage) return -ENOMEM; pte = mk_pte(page, PAGE_RW); ptep = (pte_t *) page_to_phys(ptepage); for (i = 0; i < PTRS_PER_PTE; i++) { set_pte_at(&init_mm, addr + i * PAGE_SIZE, ptep + i, pte); pte_val(pte) += PAGE_SIZE; } pte_lock_init(ptepage); page->private = (unsigned long) ptep; inc_zone_page_state(ptepage, NR_PAGETABLE); return 0; } void arch_release_hugepage(struct page *page) { struct page *ptepage; if (MACHINE_HAS_HPAGE) return; ptepage = virt_to_page(page->private); if (!ptepage) return; pte_lock_deinit(ptepage); pte_free(ptepage); page->private = 0; dec_zone_page_state(ptepage, NR_PAGETABLE); } pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) { pgd_t *pgdp; pud_t *pudp; pmd_t *pmdp = NULL; pgdp = pgd_offset(mm, addr); pudp = pud_alloc(mm, pgdp, addr); if (pudp) pmdp = pmd_alloc(mm, pudp, addr); return (pte_t *) pmdp; } pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) { pgd_t *pgdp; pud_t *pudp; pmd_t *pmdp = NULL; pgdp = pgd_offset(mm, addr); if (pgd_present(*pgdp)) { pudp = pud_offset(pgdp, addr); if (pud_present(*pudp)) pmdp = pmd_offset(pudp, addr); } return (pte_t *) pmdp; } int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep) { return 0; } struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) { return ERR_PTR(-EINVAL); } int pmd_huge(pmd_t pmd) { if (!MACHINE_HAS_HPAGE) return 0; return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE); } struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, pmd_t *pmdp, int write) { struct page *page; if (!MACHINE_HAS_HPAGE) return NULL; page = pmd_page(*pmdp); if (page) page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT); return page; }
/* Unicorn Emulator Engine */ /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2015 */ #ifndef UC_QEMU_TARGET_ARM_H #define UC_QEMU_TARGET_ARM_H // functions to read & write registers int arm_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int count); int arm_reg_write(struct uc_struct *uc, unsigned int *regs, void *const *vals, int count); int arm64_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int count); int arm64_reg_write(struct uc_struct *uc, unsigned int *regs, void *const *vals, int count); void arm_reg_reset(struct uc_struct *uc); void arm64_reg_reset(struct uc_struct *uc); __attribute__ ((visibility ("default"))) void arm_uc_init(struct uc_struct* uc); __attribute__ ((visibility ("default"))) void arm64_uc_init(struct uc_struct* uc); extern const int ARM_REGS_STORAGE_SIZE; extern const int ARM64_REGS_STORAGE_SIZE; #endif
/* * This file is part of the UCB release of Plan 9. It is subject to the license * terms in the LICENSE file found in the top-level directory of this * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No * part of the UCB release of Plan 9, including this file, may be copied, * modified, propagated, or distributed except according to the terms contained * in the LICENSE file. */ #include <u.h> #include <libc.h> #include <bio.h> int Bputrune(Biobufhdr *bp, long c) { Rune rune; char str[UTFmax]; int n; rune = c; if(rune < Runeself) { Bputc(bp, rune); return 1; } n = runetochar(str, &rune); if(n == 0) return Bbad; if(Bwrite(bp, str, n) != n) return Beof; return n; }
/** * (c) 2015 Alexandro Sanchez Bach. All rights reserved. * Released under GPL v2 license. Read LICENSE for more details. */ #pragma once #include "nucleus/common.h" namespace sys { // Process objects enum { // Official SYS_MEM_OBJECT = 0x08, SYS_INTR_TAG_OBJECT = 0x0A, SYS_INTR_SERVICE_HANDLE_OBJECT = 0x0B, SYS_EVENT_PORT_OBJECT = 0x0E, SYS_TIMER_OBJECT = 0x11, SYS_TRACE_OBJECT = 0x21, SYS_SPUIMAGE_OBJECT = 0x22, SYS_PRX_OBJECT = 0x23, SYS_SPUPORT_OBJECT = 0x24, SYS_UNK65_OBJECT = 0x41, SYS_UNK66_OBJECT = 0x42, SYS_UNK67_OBJECT = 0x43, SYS_FS_FD_OBJECT = 0x73, SYS_MUTEX_OBJECT = 0x85, SYS_COND_OBJECT = 0x86, SYS_RWLOCK_OBJECT = 0x88, SYS_EVENT_QUEUE_OBJECT = 0x8D, SYS_LWMUTEX_OBJECT = 0x95, SYS_SEMAPHORE_OBJECT = 0x96, SYS_LWCOND_OBJECT = 0x97, SYS_EVENT_FLAG_OBJECT = 0x98, // Custom SYS_PPU_THREAD_OBJECT = 0x01, }; // ELF file headers struct sys_process_param_t { BE<U32> size; BE<U32> magic; BE<U32> version; BE<U32> sdk_version; BE<S32> primary_prio; BE<U32> primary_stacksize; BE<U32> malloc_pagesize; BE<U32> ppc_seg; BE<U32> crash_dump_param_addr; }; struct sys_process_prx_param_t { BE<U32> size; BE<U32> magic; BE<U32> version; BE<U32> unk0; BE<U32> libentstart; BE<U32> libentend; BE<U32> libstubstart; BE<U32> libstubend; BE<U16> ver; BE<U16> unk1; BE<U32> unk2; }; // Auxiliary classes struct sys_process_t { sys_process_param_t param; sys_process_prx_param_t prx_param; }; // SysCalls S32 sys_process_getpid(); S32 sys_process_getppid(); S32 sys_process_get_number_of_object(U32 object, BE<U32>* nump); S32 sys_process_get_id(U32 object, BE<U32>* buffer, U32 size, BE<U32>* set_size); S32 sys_process_get_paramsfo(U8* buffer); S32 sys_process_get_sdk_version(U32 pid, BE<U32>* version); S32 sys_process_get_status(U64 unk); S32 sys_process_exit(S32 errorcode); S32 sys_process_kill(U32 pid); S32 sys_process_wait_for_child(U32 pid, BE<U32>* status, U64 unk); S32 sys_process_wait_for_child2(U64 unk1, U64 unk2, U64 unk3, U64 unk4, U64 unk5, U64 unk6); S32 sys_process_detach_child(U64 unk); void sys_game_process_exitspawn(U32 path_addr, U32 argv_addr, U32 envp_addr, U32 data_addr, U32 data_size, U32 prio, U64 flags); void sys_game_process_exitspawn2(U32 path_addr, U32 argv_addr, U32 envp_addr, U32 data_addr, U32 data_size, U32 prio, U64 flags); } // namespace sys
#ifndef __NETNS_CORE_H__ #define __NETNS_CORE_H__ struct ctl_table_header; struct prot_inuse; struct netns_core { /* core sysctls */ struct ctl_table_header *sysctl_hdr; int sysctl_somaxconn; struct prot_inuse __percpu *inuse; }; #endif
#ifndef MPLAYER_CACHE2_H #define MPLAYER_CACHE2_H #include "stream.h" void cache_uninit(stream_t *s); int cache_do_control(stream_t *stream, int cmd, void *arg); #endif /* MPLAYER_CACHE2_H */
/* This file is part of the Astrometry.net suite. Copyright 2006, 2007 Dustin Lang, Keir Mierle and Sam Roweis. The Astrometry.net suite 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. The Astrometry.net suite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the Astrometry.net suite ; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "dualtree.h" #include "bl.h" /* At each step of the recursion, we have a query node ("ynode") and a list of candidate search nodes ("nodes" and "leaves" in the "xtree"). General idea: - if we've hit a leaf in the "ytree", callback results; done. - if there are only leaves, no "x"/search nodes left, callback results; done. - for each element in x node list: - if decision(xnode, ynode) - add children of xnode to child search list - recurse on ynode's children with the child search list - empty the child search list The search order is depth-first, left-to-right in the "y" tree. */ static void dualtree_recurse(kdtree_t* xtree, kdtree_t* ytree, il* nodes, il* leaves, int ynode, dualtree_callbacks* callbacks) { // annoyances: // -trees are of different heights, so we can reach the leaves of one // before the leaves of the other. if we hit a leaf in the query // tree, just call the result function with all the search nodes, // leaves or not. if we hit a leaf in the search tree, add it to // the leaf-list. // -we want to share search lists between the children, but that means // that the children can't modify the lists - or if they do, they // have to undo any changes they make. if we only append items, then // we can undo changes by remembering the original list length and removing // everything after it when we're done. int leafmarker; il* childnodes; decision_function decision; void* decision_extra; int i, N; // if the query node is a leaf... if (KD_IS_LEAF(ytree, ynode)) { // ... then run the result function on each search node. result_function result = callbacks->result; void* result_extra = callbacks->result_extra; if (callbacks->start_results) callbacks->start_results(callbacks->start_extra, ytree, ynode); if (result) { // non-leaf nodes N = il_size(nodes); for (i=0; i<N; i++) result(result_extra, xtree, il_get(nodes, i), ytree, ynode); // leaf nodes N = il_size(leaves); for (i=0; i<N; i++) result(result_extra, xtree, il_get(leaves, i), ytree, ynode); } if (callbacks->end_results) callbacks->end_results(callbacks->end_extra, ytree, ynode); return; } // if there are search leaves but no search nodes, run the result // function on each leaf. (Note that the query node is not a leaf!) if (!il_size(nodes)) { result_function result = callbacks->result; void* result_extra = callbacks->result_extra; if (callbacks->start_results) callbacks->start_results(callbacks->start_extra, ytree, ynode); // leaf nodes if (result) { N = il_size(leaves); for (i=0; i<N; i++) result(result_extra, xtree, il_get(leaves, i), ytree, ynode); } if (callbacks->end_results) callbacks->end_results(callbacks->end_extra, ytree, ynode); return; } leafmarker = il_size(leaves); childnodes = il_new(32); decision = callbacks->decision; decision_extra = callbacks->decision_extra; N = il_size(nodes); for (i=0; i<N; i++) { int child1, child2; int xnode = il_get(nodes, i); if (!decision(decision_extra, xtree, xnode, ytree, ynode)) continue; child1 = KD_CHILD_LEFT(xnode); child2 = KD_CHILD_RIGHT(xnode); if (KD_IS_LEAF(xtree, child1)) { il_append(leaves, child1); il_append(leaves, child2); } else { il_append(childnodes, child1); il_append(childnodes, child2); } } //printf("dualtree: start left child of y node %i is %i\n", ynode, KD_CHILD_LEFT(ynode)); // recurse on the Y children! dualtree_recurse(xtree, ytree, childnodes, leaves, KD_CHILD_LEFT(ynode), callbacks); //printf("dualtree: done left child of y node %i is %i\n", ynode, KD_CHILD_LEFT(ynode)); //printf("dualtree: start right child of y node %i is %i\n", ynode, KD_CHILD_RIGHT(ynode)); dualtree_recurse(xtree, ytree, childnodes, leaves, KD_CHILD_RIGHT(ynode), callbacks); //printf("dualtree: done right child of y node %i is %i\n", ynode, KD_CHILD_LEFT(ynode)); // put the "leaves" list back the way it was... il_remove_index_range(leaves, leafmarker, il_size(leaves)-leafmarker); il_free(childnodes); } void dualtree_search(kdtree_t* xtree, kdtree_t* ytree, dualtree_callbacks* callbacks) { int xnode, ynode; il* nodes = il_new(32); il* leaves = il_new(32); // root nodes. xnode = ynode = 0; if (KD_IS_LEAF(xtree, xnode)) il_append(leaves, xnode); else il_append(nodes, xnode); dualtree_recurse(xtree, ytree, nodes, leaves, ynode, callbacks); il_free(nodes); il_free(leaves); }
/// /// \file barry.h /// Main header file for applications /// /* Copyright (C) 2005-2012, Net Direct Inc. (http://www.netdirect.ca/) 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 in the COPYING file at the root directory of this project for more details. */ #ifndef __BARRY_BARRY_H__ #define __BARRY_BARRY_H__ /** \mainpage Barry Reference Manual \section getting_started Getting Started Welcome to the Barry reference manual. This entire manual was generated via Doxygen from comments in the code. You can view the code here as well, in the Files section. The best place to get started at the moment is to examine the source code to the Barry command line tool: btool.cc \section classes Major Classes To get started with the API, see the Barry::Controller class. */ // This lists all the headers that the application needs. // Only these headers get installed. #include "data.h" #include "usbwrap.h" // to be moved to libusb someday #include "common.h" // Init() #include "error.h" // exceptions #include "configfile.h" #include "probe.h" // device prober class #include "dataqueue.h" #include "socket.h" #include "router.h" #include "protocol.h" // application-safe header #include "parser.h" #include "builder.h" #include "ldif.h" #include "ldifio.h" #include "controller.h" #include "m_desktop.h" #include "m_ipmodem.h" #include "m_serial.h" #include "m_javaloader.h" #include "m_raw_channel.h" #include "m_jvmdebug.h" #include "version.h" #include "log.h" #include "sha1.h" #include "iconv.h" #include "bmp.h" #include "cod.h" #include "record.h" #include "threadwrap.h" #include "vsmartptr.h" #include "pipe.h" #include "connector.h" #include "fifoargs.h" // Include the JDW Debug Parser classes #include "dp_codinfo.h" // Include the JDWP Server classes #include "j_manager.h" #include "j_server.h" // Include the template helpers after the record classes #include "m_desktoptmpl.h" #include "recordtmpl.h" #ifdef __BARRY_BOOST_MODE__ // Boost serialization seems to be picky about header order, do them all here #include <iomanip> #include <iostream> #include <fstream> #include <vector> #include <string> #include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_oarchive.hpp> #include <boost/archive/archive_exception.hpp> #include "s11n-boost.h" #endif #endif
/* * Author: MontaVista Software, Inc. <source@mvista.com> * * 2007 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. */ #include <linux/init.h> #include <linux/mvl_patch.h> static __init int regpatch(void) { return mvl_register_patch(1388); } module_init(regpatch);
/** ****************************************************************************** * @file bsp_xxx.c * @author fire * @version V1.0 * @date 2013-xx-xx * @brief adc1 Ó¦ÓÃbsp / DMA ģʽ ****************************************************************************** * @attention * * ʵÑéÆ½Ì¨:Ò°»ð iSO STM32 ¿ª·¢°å * ÂÛ̳ :http://www.chuxue123.com * ÌÔ±¦ :http://firestm32.taobao.com * ****************************************************************************** */ #include "bsp_adc.h" #define ADC1_DR_Address ((u32)0x40012400+0x4c) __IO uint16_t ADC_ConvertedValue; //__IO u16 ADC_ConvertedValueLocal; /** * @brief ʹÄÜADC1ºÍDMA1µÄʱÖÓ£¬³õʼ»¯PC.01 * @param ÎÞ * @retval ÎÞ */ static void ADC1_GPIO_Config(void) { GPIO_InitTypeDef GPIO_InitStructure; /* Enable DMA clock */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); /* Enable ADC1 and GPIOC clock */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_GPIOC, ENABLE); /* Configure PC.01 as analog input */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOC, &GPIO_InitStructure); // PC1,ÊäÈëʱ²»ÓÃÉèÖÃËÙÂÊ } /** * @brief ÅäÖÃADC1µÄ¹¤×÷ģʽΪMDAģʽ * @param ÎÞ * @retval ÎÞ */ static void ADC1_Mode_Config(void) { DMA_InitTypeDef DMA_InitStructure; ADC_InitTypeDef ADC_InitStructure; /* DMA channel1 configuration */ DMA_DeInit(DMA1_Channel1); DMA_InitStructure.DMA_PeripheralBaseAddr = ADC1_DR_Address; //ADCµØÖ· DMA_InitStructure.DMA_MemoryBaseAddr = (u32)&ADC_ConvertedValue; //ÄÚ´æµØÖ· DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC; DMA_InitStructure.DMA_BufferSize = 1; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; //ÍâÉèµØÖ·¹Ì¶¨ DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable; //ÄÚ´æµØÖ·¹Ì¶¨ DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; //°ë×Ö DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; //Ñ­»·´«Êä DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; DMA_Init(DMA1_Channel1, &DMA_InitStructure); /* Enable DMA channel1 */ DMA_Cmd(DMA1_Channel1, ENABLE); /* ADC1 configuration */ ADC_InitStructure.ADC_Mode = ADC_Mode_Independent; //¶ÀÁ¢ADCģʽ ADC_InitStructure.ADC_ScanConvMode = DISABLE ; //½ûֹɨÃèģʽ£¬É¨ÃèģʽÓÃÓÚ¶àͨµÀ²É¼¯ ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; //¿ªÆôÁ¬Ðø×ª»»Ä£Ê½£¬¼´²»Í£µØ½øÐÐADCת»» ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None; //²»Ê¹ÓÃÍⲿ´¥·¢×ª»» ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; //²É¼¯Êý¾ÝÓÒ¶ÔÆë ADC_InitStructure.ADC_NbrOfChannel = 1; //Ҫת»»µÄͨµÀÊýÄ¿1 ADC_Init(ADC1, &ADC_InitStructure); /*ÅäÖÃADCʱÖÓ£¬ÎªPCLK2µÄ8·ÖƵ£¬¼´9MHz*/ RCC_ADCCLKConfig(RCC_PCLK2_Div8); /*ÅäÖÃADC1µÄͨµÀ11Ϊ55. 5¸ö²ÉÑùÖÜÆÚ£¬ÐòÁÐΪ1 */ ADC_RegularChannelConfig(ADC1, ADC_Channel_11, 1, ADC_SampleTime_55Cycles5); /* Enable ADC1 DMA */ ADC_DMACmd(ADC1, ENABLE); /* Enable ADC1 */ ADC_Cmd(ADC1, ENABLE); /*¸´Î»Ð£×¼¼Ä´æÆ÷ */ ADC_ResetCalibration(ADC1); /*µÈ´ýУ׼¼Ä´æÆ÷¸´Î»Íê³É */ while(ADC_GetResetCalibrationStatus(ADC1)); /* ADCУ׼ */ ADC_StartCalibration(ADC1); /* µÈ´ýУ׼Íê³É*/ while(ADC_GetCalibrationStatus(ADC1)); /* ÓÉÓÚûÓвÉÓÃÍⲿ´¥·¢£¬ËùÒÔʹÓÃÈí¼þ´¥·¢ADCת»» */ ADC_SoftwareStartConvCmd(ADC1, ENABLE); } /** * @brief ADC1³õʼ»¯ * @param ÎÞ * @retval ÎÞ */ void ADC1_Init(void) { ADC1_GPIO_Config(); ADC1_Mode_Config(); } /*********************************************END OF FILE**********************/
/*************************************************************************** * Copyright (C) 2008 by Ely Levy <elylevy@cs.huji.ac.il> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #ifndef OKULAR_GENERATOR_MOBI_H #define OKULAR_GENERATOR_MOBI_H #include <core/textdocumentgenerator.h> class MobiGenerator : public Okular::TextDocumentGenerator { Q_OBJECT Q_INTERFACES( Okular::Generator ) public: MobiGenerator( QObject *parent, const QVariantList &args ); ~MobiGenerator() {} // [INHERITED] reparse configuration void addPages( KConfigDialog* dlg ); }; #endif
/* ********************************************************************************************************* * uC/GUI * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : GUIPolyR.c Purpose : Polygon rotation ---------------------------------------------------------------------- */ #include <math.h> #include "GUI.h" /********************************************************************* * * Public code * ********************************************************************** */ /********************************************************************* * * GUI_MagnifyPolygon */ void GUI_MagnifyPolygon(GUI_POINT* pDest, const GUI_POINT* pSrc, int NumPoints, int Mag) { int j; for (j=0; j<NumPoints; j++) { (pDest+j)->x = (pSrc+j)->x * Mag; (pDest+j)->y = (pSrc+j)->y * Mag; } } /*************************** End of file ****************************/
/* Copyright (C) 2004-2011 John E. Davis This file is part of the S-Lang Library. The S-Lang Library 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. The S-Lang Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* These routines are simple and inefficient. They were designed to work on * SunOS when using Electric Fence. */ #include "slinclud.h" #include "slang.h" #include "_slang.h" char *SLstrcpy(register char *aa, register char *b) { char *a = aa; while ((*a++ = *b++) != 0); return aa; } int SLstrcmp(register char *a, register char *b) { while (*a && (*a == *b)) { a++; b++; } if (*a) return((unsigned char) *a - (unsigned char) *b); else if (*b) return ((unsigned char) *a - (unsigned char) *b); else return 0; } char *SLstrncpy(char *a, register char *b,register int n) { register char *aa = a; while ((n > 0) && *b) { *aa++ = *b++; n--; } while (n-- > 0) *aa++ = 0; return (a); }
#ifndef BASICWORKER_H #define BASICWORKER_H #include <QThread> #include <qhexedit/document/qhexdocument.h> class BasicWorker : public QThread { Q_OBJECT public: explicit BasicWorker(QHexDocument *document, QObject *parent = 0); public slots: void abort(); protected: QHexDocument* _document; bool _cancontinue; }; #endif // BASICWORKER_H
/* QWinFF - a qt4 gui frontend for ffmpeg * Copyright (C) 2011-2013 Timothy Lin <lzh9102@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 FFPLAYPREVIEWER_H #define FFPLAYPREVIEWER_H #include "abstractpreviewer.h" class QProcess; class FFplayPreviewer : public AbstractPreviewer { Q_OBJECT public: explicit FFplayPreviewer(QObject *parent = 0); virtual ~FFplayPreviewer(); bool available() const; /** Play the media file with ffplay. * If a media file is being played, it will be stopped before * playing the new one. */ void play(const QString& filename); void play(const QString &filename, int t_begin, int t_end); void playFrom(const QString &filename, int t_begin); void playUntil(const QString &filename, int t_end); void stop(); /** Set the window size of ffplay. * This option takes effect after invoking start() again. */ void setWindowSize(int w, int h); /** Set the ffplay window title. * This option takes effect after invoking start() again. * If str is empty, default title is displayed (filename). */ void setWindowTitle(QString str); static bool FFplayAvailable(); signals: public slots: private: QProcess *m_proc; int m_w, m_h; QString m_title; void ffplay_start(const QString&, int, int); }; #endif // FFPLAYPREVIEWER_H
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #ifdef USE_BEEPER #define BEEP_TOGGLE systemBeepToggle() #define BEEP_OFF systemBeep(false) #define BEEP_ON systemBeep(true) #else #define BEEP_TOGGLE do {} while (0) #define BEEP_OFF do {} while (0) #define BEEP_ON do {} while (0) #endif void systemBeep(bool on); void systemBeepToggle(void); struct beeperDevConfig_s; void beeperInit(const struct beeperDevConfig_s *beeperDevConfig);
/////////////////////////////////////////////////////////////////////////////// // String Tokenizer class // This class is a very covenient class for manipulating tokens inside a string. // It offers many functions for manipulating tokens. // With all this functions,token manipulations becomes very easy! // This code is copyrighted. // Author: Gonzales Cenelia ///////////////////////////////////////////////////////////////////////// #ifndef __TOKENIZER_H__ #define __TOKENIZER_H__ #pragma warning(disable:4786) #include <string> #include <vector> typedef std::vector<std::string> vstring; class Tokenizer { public: Tokenizer() {}; ~Tokenizer() {}; void setPosition( int pos ); void resetPosition(void); void setString( std::string str ); void setDelim( std::string str ); void cleanString( char *str ); void cleanString(std::string &str); void cleanString(std::string &str, std::string delim); void tokenize(std::string str, vstring &v); int getTokenNumber( std::string str ); void tokenize( vstring &v ); int countTokens(); std::string currentToken(); std::string firstToken(); std::string nextToken(); std::string lastToken(); private: bool isDelim(char c); void skipDelim(); private: std::string::iterator currentPosition; std::string thisToken; std::string delim; std::string buffer; }; #endif
/* $Id: lircd.h,v 5.16 2007/09/29 17:13:14 lirc Exp $ */ /**************************************************************************** ** lircd.h ***************************************************************** **************************************************************************** * */ #ifndef _LIRCD_H #define _LIRCD_H #include <syslog.h> #include <sys/time.h> #include "ir_remote.h" #define PACKET_SIZE (256) #define WHITE_SPACE " \t" struct peer_connection { char *host; unsigned short port; struct timeval reconnect; int connection_failure; int socket; }; extern int debug; void sigterm(int sig); void dosigterm(int sig); void sighup(int sig); void dosighup(int sig); void config(void); void nolinger(int sock); void remove_client(int fd); void add_client(int); int add_peer_connection(char *server); void connect_to_peers(); int get_peer_message(struct peer_connection *peer); void start_server(mode_t permission,int nodaemon); #ifdef DEBUG #define LOGPRINTF(level,fmt,args...) \ if(level<=debug) logprintf(LOG_DEBUG,fmt, ## args ) #define LOGPERROR(level,s) \ if(level<=debug) logperror(LOG_DEBUG,s) #else #define LOGPRINTF(level,fmt,args...) \ do {} while(0) #define LOGPERROR(level,s) \ do {} while(0) #endif void logprintf(int prio,char *format_str, ...); void logperror(int prio,const char *s); void daemonize(void); void sigalrm(int sig); void dosigalrm(int sig); int parse_rc(int fd,char *message,char *arguments,struct ir_remote **remote, struct ir_ncode **code,int *reps,int n); int send_success(int fd,char *message); int send_error(int fd,char *message,char *format_str, ...); int send_remote_list(int fd,char *message); int send_remote(int fd,char *message,struct ir_remote *remote); int send_name(int fd,char *message,struct ir_ncode *code); int list(int fd,char *message,char *arguments); int set_transmitters(int fd, char *message, char *arguments); int simulate(int fd, char *message, char *arguments); int send_once(int fd,char *message,char *arguments); int send_start(int fd,char *message,char *arguments); int send_stop(int fd,char *message,char *arguments); int send_core(int fd,char *message,char *arguments,int once); int version(int fd,char *message,char *arguments); int get_pid(int fd,char *message,char *arguments); int get_command(int fd); void broadcast_message(const char *message); int waitfordata(long maxusec); void loop(void); struct protocol_directive { char *name; int (*function)(int fd,char *message,char *arguments); }; #endif /* _LIRCD_H */
/* * Copyright (C) 2015-2018 Département de l'Instruction Publique (DIP-SEM) * * Copyright (C) 2013 Open Education Foundation * * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour * l'Education Numérique en Afrique (GIP ENA) * * This file is part of OpenBoard. * * OpenBoard 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 3 of the License, * with a specific linking exception for the OpenSSL project's * "OpenSSL" library (or with modified versions of it that use the * same license as the "OpenSSL" library). * * OpenBoard 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 OpenBoard. If not, see <http://www.gnu.org/licenses/>. */ #ifndef UBFLOATINGPALLETTE_H_ #define UBFLOATINGPALLETTE_H_ #include <QWidget> #include <QPoint> typedef enum { eMinimizedLocation_None, eMinimizedLocation_Left, eMinimizedLocation_Top, eMinimizedLocation_Right, eMinimizedLocation_Bottom }eMinimizedLocation; class UBFloatingPalette : public QWidget { Q_OBJECT public: UBFloatingPalette(Qt::Corner = Qt::TopLeftCorner, QWidget *parent = 0); virtual void mouseMoveEvent(QMouseEvent *event); virtual void mousePressEvent(QMouseEvent *event); virtual void mouseReleaseEvent(QMouseEvent *event); /** * Add another floating palette to the associated palette. All associated palettes will have the same width * that is calculated as the minimum width of all associated palettes. */ void addAssociatedPalette(UBFloatingPalette* pOtherPalette); void removeAssociatedPalette(UBFloatingPalette* pOtherPalette); virtual void adjustSizeAndPosition(bool pUp = true); void setCustomPosition(bool pFlag); QSize preferredSize(); void setBackgroundBrush(const QBrush& brush); void setGrip(bool newGrip); void setMinimizePermission(bool permission); protected: virtual void enterEvent(QEvent *event); virtual void showEvent(QShowEvent *event); virtual void paintEvent(QPaintEvent *event); virtual int radius(); virtual int border(); virtual int gripSize(); QBrush mBackgroundBrush; bool mbGrip; static const int sLayoutContentMargin = 12; static const int sLayoutSpacing = 15; void moveInsideParent(const QPoint &position); bool mCustomPosition; bool mIsMoving; virtual int getParentRightOffset(); eMinimizedLocation minimizedLocation(){return mMinimizedLocation;} private: void removeAllAssociatedPalette(); void minimizePalette(const QPoint& pos); QList<UBFloatingPalette*> mAssociatedPalette; QPoint mDragPosition; bool mCanBeMinimized; eMinimizedLocation mMinimizedLocation; Qt::Corner mDefaultPosition; signals: void mouseEntered(); void minimizeStart(eMinimizedLocation location); void maximizeStart(); void maximized(); void moving(); }; #endif /* UBFLOATINGPALLETTE_H_ */
/**************************************************************************** ** ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include <QMetaType> #include <QSize> namespace QmlDesigner { class ChangePreviewImageSizeCommand { public: ChangePreviewImageSizeCommand() = default; ChangePreviewImageSizeCommand(const QSize &size) : size(size) {} friend QDataStream &operator<<(QDataStream &out, const ChangePreviewImageSizeCommand &command); friend QDataStream &operator>>(QDataStream &in, ChangePreviewImageSizeCommand &command); friend QDebug operator<<(QDebug debug, const ChangePreviewImageSizeCommand &command); public: QSize size; }; } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangePreviewImageSizeCommand)
//timer02.c // use atmega timer2 as main system timer instead of timer0 // timer0 is used for fast pwm (OC0B output) // original OVF handler is disabled #include "system_timer.h" #ifdef SYSTEM_TIMER_2 #include <avr/io.h> #include <avr/interrupt.h> #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; TCNT0 = 0; // Fast PWM duty (0-255). // Due to invert mode (following rows) the duty is set to 255, which means zero all the time (bed not heating) OCR0B = 255; // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); TCCR0B = (1 << CS01); // CLK/8 prescaling TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; // Everything, that used to be on timer0 was moved to timer2 (delay, beeping, millis etc.) //setup timer2 TCCR2A = 0x00; //COM_A-B=00, WGM_0-1=00 TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1<<TOIE2); TIMSK2 &= ~(1<<OCIE2A); TIMSK2 &= ~(1<<OCIE2B); //set timer2 OCR registers (OCRB interrupt generated 0.5ms after OVF interrupt) OCR2A = 0; CRITICAL_SECTION_END; } // The following code is OVF handler for timer 2 // it was copy-pasted from wiring.c and modified for timer2 // variables timer0_overflow_count and timer0_millis are declared in wiring.c // the prescaler is set so that timer0 ticks every 64 clock cycles, and the // the overflow handler is called every 256 ticks. #define MICROSECONDS_PER_TIMER0_OVERFLOW (clockCyclesToMicroseconds(64 * 256)) // the whole number of milliseconds per timer0 overflow #define MILLIS_INC (MICROSECONDS_PER_TIMER0_OVERFLOW / 1000) // the fractional number of milliseconds per timer0 overflow. we shift right // by three to fit these numbers into a byte. (for the clock speeds we care // about - 8 and 16 MHz - this doesn't lose precision.) #define FRACT_INC ((MICROSECONDS_PER_TIMER0_OVERFLOW % 1000) >> 3) #define FRACT_MAX (1000 >> 3) volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { // copy these to local variables so they can be stored in registers // (volatile variables must be read from memory on every access) unsigned long m = timer2_millis; unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; timer2_millis = m; timer2_overflow_count++; } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; // disable interrupts while we read timer0_millis or we might get an // inconsistent value (e.g. in the middle of a write to timer0_millis) cli(); m = timer2_millis; SREG = oldSREG; return m; } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; cli(); m = timer2_overflow_count; #if defined(TCNT2) t = TCNT2; #elif defined(TCNT2L) t = TCNT2L; #else #error TIMER 2 not defined #endif #ifdef TIFR2 if ((TIFR2 & _BV(TOV2)) && (t < 255)) m++; #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); } void delay2(unsigned long ms) { uint32_t start = micros2(); while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) { ms--; start += 1000; } } } #endif //SYSTEM_TIMER_2
/* * Vortex OpenSplice * * This software and documentation are Copyright 2006 to TO_YEAR ADLINK * Technology Limited, its affiliated companies and licensors. All rights * reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** \file os/linux/code/os_time.c * \brief Linux time management * * Implements time management for Linux * by including the common services and * the SVR4 os_timeGet implementation and * the POSIX os_nanoSleep implementation */ #include "../common/code/os_time.c" #include "../posix/code/os_time.c" #include "../common/code/os_time_ctime.c"
/* libparted Copyright (C) 1998-2001, 2007-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/>. */ #include <config.h> #include <string.h> #include <uuid/uuid.h> #include "fat.h" PedFileSystem* fat_alloc (const PedGeometry* geom) { PedFileSystem* fs; fs = (PedFileSystem*) ped_malloc (sizeof (PedFileSystem)); if (!fs) goto error; fs->type_specific = (FatSpecific*) ped_malloc (sizeof (FatSpecific)); if (!fs->type_specific) goto error_free_fs; FatSpecific* fs_info = (FatSpecific*) fs->type_specific; fs_info->boot_sector = NULL; fs_info->info_sector = NULL; fs->geom = ped_geometry_duplicate (geom); if (!fs->geom) goto error_free_type_specific; fs->checked = 0; return fs; error_free_type_specific: free (fs->type_specific); error_free_fs: free (fs); error: return NULL; } void fat_free (PedFileSystem* fs) { FatSpecific* fs_info = (FatSpecific*) fs->type_specific; free (fs_info->boot_sector); ped_geometry_destroy (fs->geom); free (fs->type_specific); free (fs); } PedGeometry* fat_probe (PedGeometry* geom, FatType* fat_type) { PedFileSystem* fs; FatSpecific* fs_info; PedGeometry* result; fs = fat_alloc (geom); if (!fs) goto error; fs_info = (FatSpecific*) fs->type_specific; if (!fat_boot_sector_read (&fs_info->boot_sector, geom)) goto error_free_fs; if (!fat_boot_sector_analyse (fs_info->boot_sector, fs)) goto error_free_fs; *fat_type = fs_info->fat_type; result = ped_geometry_new (geom->dev, geom->start, fs_info->sector_count); fat_free (fs); return result; error_free_fs: fat_free (fs); error: return NULL; } PedGeometry* fat_probe_fat16 (PedGeometry* geom) { FatType fat_type; PedGeometry* probed_geom = fat_probe (geom, &fat_type); if (probed_geom) { if (fat_type == FAT_TYPE_FAT16) return probed_geom; ped_geometry_destroy (probed_geom); } return NULL; } PedGeometry* fat_probe_fat32 (PedGeometry* geom) { FatType fat_type; PedGeometry* probed_geom = fat_probe (geom, &fat_type); if (probed_geom) { if (fat_type == FAT_TYPE_FAT32) return probed_geom; ped_geometry_destroy (probed_geom); } return NULL; } static PedFileSystemOps fat16_ops = { probe: fat_probe_fat16, }; static PedFileSystemOps fat32_ops = { probe: fat_probe_fat32, }; PedFileSystemType fat16_type = { next: NULL, ops: &fat16_ops, name: "fat16", }; PedFileSystemType fat32_type = { next: NULL, ops: &fat32_ops, name: "fat32", }; void ped_file_system_fat_init () { if (sizeof (FatBootSector) != 512) { ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL, _("GNU Parted was miscompiled: the FAT boot sector " "should be 512 bytes. FAT support will be disabled.")); } else { ped_file_system_type_register (&fat16_type); ped_file_system_type_register (&fat32_type); } } void ped_file_system_fat_done () { ped_file_system_type_unregister (&fat16_type); ped_file_system_type_unregister (&fat32_type); }
/* * Broadcom Proprietary and Confidential. Copyright 2016 Broadcom * All Rights Reserved. * * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation; * the contents of this file may not be disclosed to third parties, copied * or duplicated in any form, in whole or in part, without the prior * written permission of Broadcom Corporation. */ /** @file * Defines globally accessible resource functions */ #pragma once #include "platform_config.h" #include "wiced_resource.h" #ifdef __cplusplus extern "C" { #endif /****************************************************** * Macros ******************************************************/ /****************************************************** * Constants ******************************************************/ /****************************************************** * Enumerations ******************************************************/ /****************************************************** * Type Definitions ******************************************************/ /****************************************************** * Structures ******************************************************/ /****************************************************** * Global Variables ******************************************************/ #ifdef USES_RESOURCE_FILESYSTEM #include "wicedfs.h" extern wicedfs_filesystem_t resource_fs_handle; #endif /* ifdef USES_RESOURCE_FILESYSTEM */ /****************************************************** * Function Declarations ******************************************************/ /* Resource reading */ extern resource_result_t resource_get_readonly_buffer ( const resource_hnd_t* resource, uint32_t offset, uint32_t maxsize, uint32_t* size_out, const void** buffer ); extern resource_result_t resource_free_readonly_buffer( const resource_hnd_t* handle, const void* buffer ); extern resource_result_t platform_read_external_resource( const resource_hnd_t* resource, uint32_t offset, uint32_t maxsize, uint32_t* size, void* buffer ); #ifdef __cplusplus } /*extern "C" */ #endif
/* Copyright (C) 2008 Bradley Arsenault 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 GameObjectives_h #define GameObjectives_h #include <string> #include <vector> #include "SDL_net.h" namespace GAGCore { class OutputStream; class InputStream; } ///This class stores the list of game objectives, which the map script may arbitrarily ///hide, reveal, set as complete, or set as incomplete class GameObjectives { public: GameObjectives(); enum GameObjectiveType { Primary = 0, Secondary, Invalid }; ///This gets the number of objectives there are int getNumberOfObjectives(); ///This adds a new objective void addNewObjective(const std::string& objective, bool hidden, bool complete, bool failed, GameObjectiveType type, int scriptNumber); ///This removes the given objective void removeObjective(int n); ///This sets the text for the game objective at n void setGameObjectiveText(int n, const std::string& objective); ///This returns the text for the game objective at n const std::string& getGameObjectiveText(int n); ///This sets the given objective text as hidden void setObjectiveHidden(int n); ///This sets the given objective text as visible void setObjectiveVisible(int n); ///This returns true if the given objective text is visible bool isObjectiveVisible(int n); ///This sets the given objective text as complete void setObjectiveComplete(int n); ///This sets the given objective text as incomplete void setObjectiveIncomplete(int n); ///This sets the given objective text as failed void setObjectiveFailed(int n); ///This returns true if the given objective is complete bool isObjectiveComplete(int n); ///This returns true if the given objective is failed bool isObjectiveFailed(int n); ///This sets the given objective type void setObjectiveType(int n, GameObjectiveType type); ///This returns the given objective type GameObjectiveType getObjectiveType(int n); ///This sets the script number, which is how scripts will reference the given object void setScriptNumber(int n, int scriptNumber); ///This returns the script number, which is how scripts will reference the given object int getScriptNumber(int n); ///Encodes this GameObjectives into a bit stream void encodeData(GAGCore::OutputStream* stream) const; ///Decodes this GameObjectives from a bit stream void decodeData(GAGCore::InputStream* stream, Uint32 versionMinor); private: std::vector<std::string> texts; std::vector<bool> hidden; std::vector<bool> completed; std::vector<bool> failed; std::vector<GameObjectiveType> types; std::vector<int> scriptNumbers; std::string invalidText; }; #endif
/* This source file is part of Rigs of Rods Copyright 2005-2012 Pierre-Michel Ricordel Copyright 2007-2012 Thomas Fischer For more information, see http://www.rigsofrods.com/ Rigs of Rods is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation. Rigs of Rods 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 Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ /* This class is the skeleton of motion platform control in RoR. Please derive your own class from this to make it work with your motion platform! Imre, Nagy Jr. (ror@nebulon.hu) */ #ifdef USE_MPLATFORM #ifndef MPLATFORM_BASE_H #define MPLATFORM_BASE_H #include "RoRPrerequisites.h" //#include "Ogre.h" //#include "rornet.h" typedef struct // struct is used for motion platforms { int time; float x; // absolute coordinates float y; float z; float x_acc; // accelerations regarding to different vectors float y_acc; float z_acc; float head; // orientations float roll; float pitch; float head_acc; // accelerations of orientations float roll_acc; float pitch_acc; float steer; // user inputs float throttle; float brake; float clutch; float speed; // different stats float rpm; int gear; float avg_friction; } mstat_t; class MPlatform_Base : public ZeroedMemoryAllocator { public: MPlatform_Base(); virtual ~MPlatform_Base(); virtual bool connect(); // initialize connection to motion platform virtual bool disconnect(); // clean up connection with motion platform // update motion platform. returning false if cannot update, like sending buffer is full virtual bool update(Ogre::Vector3 pos, Ogre::Quaternion quat, mstat_t statinfo); virtual bool update(float posx, float posy, float posz, float roll, float pitch, float head, float roll_acc, float pitch_acc, float head_acc); private: }; #endif #endif
/* * Copyright (C) 2008-2018 Free Software Foundation, Inc. * Written by Simon Josefsson. * * 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 <https://www.gnu.org/licenses/>. */ #include <config.h> /* Get gethostname() declaration. */ #include <unistd.h> #include "signature.h" SIGNATURE_CHECK (gethostname, int, (char *, size_t)); /* Get HOST_NAME_MAX definition. */ #include <limits.h> #include <stdio.h> #include <string.h> #include <errno.h> #define NOHOSTNAME "magic-gnulib-test-string" int main (int argc, char *argv[] _GL_UNUSED) { char buf[HOST_NAME_MAX]; int rc; if (strlen (NOHOSTNAME) >= HOST_NAME_MAX) { printf ("HOST_NAME_MAX impossibly small?! %d\n", HOST_NAME_MAX); return 2; } strcpy (buf, NOHOSTNAME); rc = gethostname (buf, sizeof (buf)); if (rc != 0) { printf ("gethostname failed, rc %d errno %d\n", rc, errno); return 1; } if (strcmp (buf, NOHOSTNAME) == 0) { printf ("gethostname left buffer untouched.\n"); return 1; } if (argc > 1) printf ("hostname: %s\n", buf); return 0; }
/* * This file is part of NumptyPhysics <http://thp.io/2015/numptyphysics/> * Coyright (c) 2014 Thomas Perl <m@thp.io> * * 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. */ #include "glaserl_program.h" #include <stdio.h> #include <stdlib.h> #include <string.h> static GLuint make_shader(GLenum type, const char *source) { GLuint shader = glCreateShader(type); const char *shader_src[] = { GLASERL_GLSL_PRECISION_INFO, source }; glShaderSource(shader, 2, shader_src, 0); glCompileShader(shader); GLint result = GL_FALSE; glGetShaderiv(shader, GL_COMPILE_STATUS, &result); if (!result) { GLint size = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &size); char *tmp = (char *)malloc(size); glGetShaderInfoLog(shader, size, NULL, tmp); printf("Failed to link shader: %s\n", tmp); free(tmp); exit(0); } return shader; } static GLuint make_program(const char *vertex_shader, const char *fragment_shader) { GLuint program = glCreateProgram(); glAttachShader(program, make_shader(GL_VERTEX_SHADER, vertex_shader)); glAttachShader(program, make_shader(GL_FRAGMENT_SHADER, fragment_shader)); glLinkProgram(program); GLint result = GL_FALSE; glGetProgramiv(program, GL_LINK_STATUS, &result); if (!result) { printf("Failed to link program!\n"); exit(0); } return program; } glaserl_program_t * glaserl_program_new(const char *vertex_shader_src, const char *fragment_shader_src, ...) { va_list args; va_start(args, fragment_shader_src); return glaserl_program_newv(vertex_shader_src, fragment_shader_src, args); } glaserl_program_t * glaserl_program_newv(const char *vertex_shader_src, const char *fragment_shader_src, va_list args) { glaserl_program_t *program; int i; program = (glaserl_program_t *)calloc(sizeof(glaserl_program_t), 1); program->program = make_program(vertex_shader_src, fragment_shader_src); program->stride = 0; // Attributes i = 0; for (;;) { const char *name = va_arg(args, const char *); if (name == NULL) { break; } int size = va_arg(args, int); program->attributes[i].name = strdup(name); program->attributes[i].size = size; program->attributes[i].location = glGetAttribLocation(program->program, name); program->stride += size * sizeof(float); i++; } // Uniforms i = 0; for (;;) { const char *name = va_arg(args, const char *); if (name == NULL) { break; } program->uniforms[i].name = strdup(name); program->uniforms[i].location = glGetUniformLocation(program->program, name); i++; } va_end(args); return program; } void glaserl_program_enable(glaserl_program_t *program) { glUseProgram(program->program); glaserl_program_attrib_t *attr = program->attributes; size_t offset = 0; float *fbuffer = 0; while (attr && attr->name) { glEnableVertexAttribArray(attr->location); glVertexAttribPointer(attr->location, attr->size, GL_FLOAT, GL_FALSE, program->stride, fbuffer + offset); offset += attr->size; attr++; } } void glaserl_program_disable(glaserl_program_t *program) { glaserl_program_attrib_t *attr = program->attributes; while (attr && attr->name) { glDisableVertexAttribArray(attr->location); attr++; } glUseProgram(0); } GLint glaserl_program_uniform_location(glaserl_program_t *program, const char *uniform) { glaserl_program_uniform_t *unif = program->uniforms; while (unif && unif->name) { if (strcmp(unif->name, uniform) == 0) { return unif->location; } unif++; } return -1; } void glaserl_program_destroy(glaserl_program_t *program) { // TODO }
/* * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_TEST_MOCK_VOE_CHANNEL_PROXY_H_ #define WEBRTC_TEST_MOCK_VOE_CHANNEL_PROXY_H_ #include <string> #include "testing/gmock/include/gmock/gmock.h" #include "webrtc/voice_engine/channel_proxy.h" namespace webrtc { namespace test { class MockVoEChannelProxy : public voe::ChannelProxy { public: MOCK_METHOD1(SetRTCPStatus, void(bool enable)); MOCK_METHOD1(SetLocalSSRC, void(uint32_t ssrc)); MOCK_METHOD1(SetRTCP_CNAME, void(const std::string& c_name)); MOCK_METHOD2(SetNACKStatus, void(bool enable, int max_packets)); MOCK_METHOD2(SetSendAbsoluteSenderTimeStatus, void(bool enable, int id)); MOCK_METHOD2(SetSendAudioLevelIndicationStatus, void(bool enable, int id)); MOCK_METHOD2(SetReceiveAbsoluteSenderTimeStatus, void(bool enable, int id)); MOCK_METHOD2(SetReceiveAudioLevelIndicationStatus, void(bool enable, int id)); MOCK_METHOD1(EnableSendTransportSequenceNumber, void(int id)); MOCK_METHOD1(EnableReceiveTransportSequenceNumber, void(int id)); MOCK_METHOD3(RegisterSenderCongestionControlObjects, void(RtpPacketSender* rtp_packet_sender, TransportFeedbackObserver* transport_feedback_observer, PacketRouter* packet_router)); MOCK_METHOD1(RegisterReceiverCongestionControlObjects, void(PacketRouter* packet_router)); MOCK_METHOD0(ResetCongestionControlObjects, void()); MOCK_CONST_METHOD0(GetRTCPStatistics, CallStatistics()); MOCK_CONST_METHOD0(GetRemoteRTCPReportBlocks, std::vector<ReportBlock>()); MOCK_CONST_METHOD0(GetNetworkStatistics, NetworkStatistics()); MOCK_CONST_METHOD0(GetDecodingCallStatistics, AudioDecodingCallStats()); MOCK_CONST_METHOD0(GetSpeechOutputLevelFullRange, int32_t()); MOCK_CONST_METHOD0(GetDelayEstimate, uint32_t()); MOCK_METHOD1(SetSendTelephoneEventPayloadType, bool(int payload_type)); MOCK_METHOD2(SendTelephoneEventOutband, bool(int event, int duration_ms)); MOCK_METHOD1(SetInputMute, void(bool muted)); // TODO(solenberg): Talk the compiler into accepting this mock method: // MOCK_METHOD1(SetSink, void(std::unique_ptr<AudioSinkInterface> sink)); MOCK_METHOD1(RegisterExternalTransport, void(Transport* transport)); MOCK_METHOD0(DeRegisterExternalTransport, void()); MOCK_METHOD3(ReceivedRTPPacket, bool(const uint8_t* packet, size_t length, const PacketTime& packet_time)); MOCK_METHOD2(ReceivedRTCPPacket, bool(const uint8_t* packet, size_t length)); MOCK_CONST_METHOD0(GetAudioDecoderFactory, const rtc::scoped_refptr<AudioDecoderFactory>&()); MOCK_METHOD1(SetChannelOutputVolumeScaling, void(float scaling)); }; } // namespace test } // namespace webrtc #endif // WEBRTC_TEST_MOCK_VOE_CHANNEL_PROXY_H_
/* * mpi_life * * Coursework 5DV152 Parallel Programming for Multicore based Systems * at Umea University, March 2017 * * Lorenz Gerber * * Version 0.1 * * Licensed under GPLv3 * */ /** * @file mpi_life.c * @author Lorenz Gerber * @date 26 March 2017 * @brief File contains the main method for mpi_life * * mpi_life is a mpi implementation of conway's game * of life. Certain parts of the code are inspired * by Davind Joiner's implementation found on shodor.org. */ #include "mpi_life.h" /** * @brief Main function * * This is the main function to be started for * mpi_life, an implementation of conways game * of life. */ int main(int argc, char ** argv) { int count; double start, finish; struct life_t life; init(&life, &argc, &argv); MPI_Barrier(MPI_COMM_WORLD); start = MPI_Wtime(); for (count = 0; count < life.generations; count++) { copy_bounds(&life); eval_rules(&life); update_grid(&life); } finish = MPI_Wtime(); if(life.rank == 0){ printf("%e\n", finish-start); } cleanup(&life); return 0; }
#ifndef BiogeographicCladoEvent_H #define BiogeographicCladoEvent_H namespace RevBayesCore { namespace BiogeographicCladoEvent { const unsigned NUM_STATES = 6; const unsigned SYMPATRY_NARROW = 0; // A -> A | A const unsigned SYMPATRY_WIDESPREAD = 1; // ABCD -> ABCD | ABCD const unsigned SYMPATRY_SUBSET = 2; // ABCD -> ABCD | A const unsigned ALLOPATRY = 3; // ABCD -> AB | CD const unsigned PARAPATRY = 4; // ABCD -> ABC | BCD const unsigned JUMP_DISPERSAL = 5; // ABC -> ABC | D }; }; #endif /* defined(BiogeographicCladoEvent_H) */
#ifndef __SDL_RADIO_BUTTON_H_ #define __SDL_RADIO_BUTTON_H_ #include <SDL/SDL.h> #include "globals.h" #include "sdl_check_button.h" class sdl_radio_button : public sdl_check_button { public: sdl_radio_button(int num, int x, int y, sdl_user *who, funcptr *stuff, sdl_widget**, int amnt, int indx); virtual ~sdl_radio_button(); virtual void mouse_click(SDL_MouseButtonEvent *here); void set(); protected: sdl_widget **options; int num_options; int me; }; #endif
/* Copyright © 2017-2019 by The qTox Project Contributors This file is part of qTox, a Qt-based graphical interface for Tox. qTox is libre 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. qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CONTACT_H #define CONTACT_H #include "src/core/contactid.h" #include <QObject> #include <QString> class Contact : public QObject { Q_OBJECT public: virtual ~Contact() = 0; virtual void setName(const QString& name) = 0; virtual QString getDisplayedName() const = 0; virtual uint32_t getId() const = 0; virtual const ContactId& getPersistentId() const = 0; virtual void setEventFlag(bool flag) = 0; virtual bool getEventFlag() const = 0; virtual bool useHistory() const = 0; // TODO: remove after added history in group chat signals: void displayedNameChanged(const QString& newName); }; #endif // CONTACT_H
#include "common.h" #include "log.h" #include <getopt.h> #include <ccnet.h> #include "seafile-session.h" #include "gc-core.h" #include "verify.h" #include "utils.h" static char *config_dir = NULL; static char *seafile_dir = NULL; CcnetClient *ccnet_client; SeafileSession *seaf; static const char *short_opts = "hvc:d:VDi"; static const struct option long_opts[] = { { "help", no_argument, NULL, 'h', }, { "version", no_argument, NULL, 'v', }, { "config-file", required_argument, NULL, 'c', }, { "seafdir", required_argument, NULL, 'd', }, { "verify", no_argument, NULL, 'V' }, { "dry-run", no_argument, NULL, 'D' }, { "ignore-errors", no_argument, NULL, 'i' }, }; static void usage () { fprintf (stderr, "usage: seafserv-gc [-c config_dir] [-d seafile_dir]\n" "Additional options:\n" "-V, --verify: check for missing blocks\n"); } static void load_history_config () { int keep_history_days; GError *error = NULL; seaf->keep_history_days = -1; keep_history_days = g_key_file_get_integer (seaf->config, "history", "keep_days", &error); if (error == NULL) seaf->keep_history_days = keep_history_days; } #ifdef WIN32 /* Get the commandline arguments in unicode, then convert them to utf8 */ static char ** get_argv_utf8 (int *argc) { int i = 0; char **argv = NULL; const wchar_t *cmdline = NULL; wchar_t **argv_w = NULL; cmdline = GetCommandLineW(); argv_w = CommandLineToArgvW (cmdline, argc); if (!argv_w) { printf("failed to CommandLineToArgvW(), GLE=%lu\n", GetLastError()); return NULL; } argv = (char **)malloc (sizeof(char*) * (*argc)); for (i = 0; i < *argc; i++) { argv[i] = wchar_to_utf8 (argv_w[i]); } return argv; } #endif int main(int argc, char *argv[]) { int c; int verify = 0; int dry_run = 0; int ignore_errors = 0; #ifdef WIN32 argv = get_argv_utf8 (&argc); #endif config_dir = DEFAULT_CONFIG_DIR; while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) != EOF) { switch (c) { case 'h': usage(); exit(0); case 'v': exit(-1); break; case 'c': config_dir = strdup(optarg); break; case 'd': seafile_dir = strdup(optarg); break; case 'V': verify = 1; break; case 'D': dry_run = 1; break; case 'i': ignore_errors = 1; break; default: usage(); exit(-1); } } g_type_init(); if (seafile_log_init ("-", "info", "debug") < 0) { seaf_warning ("Failed to init log.\n"); exit (1); } ccnet_client = ccnet_client_new(); if ((ccnet_client_load_confdir(ccnet_client, config_dir)) < 0) { seaf_warning ("Read config dir error\n"); return -1; } if (seafile_dir == NULL) seafile_dir = g_build_filename (config_dir, "seafile-data", NULL); seaf = seafile_session_new(seafile_dir, ccnet_client); if (!seaf) { seaf_warning ("Failed to create seafile session.\n"); exit (1); } load_history_config (); if (verify) { verify_repos (); return 0; } gc_core_run (dry_run, ignore_errors); return 0; }
/* gb-greeter-window.h * * Copyright (C) 2015 Christian Hergert <christian@hergert.me> * * 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 GB_GREETER_WINDOW_H #define GB_GREETER_WINDOW_H #include <gtk/gtk.h> #include <ide.h> G_BEGIN_DECLS #define GB_TYPE_GREETER_WINDOW (gb_greeter_window_get_type()) G_DECLARE_FINAL_TYPE (GbGreeterWindow, gb_greeter_window, GB, GREETER_WINDOW, GtkApplicationWindow) IdeRecentProjects *gb_greeter_window_get_recent_projects (GbGreeterWindow *self); void gb_greeter_window_set_recent_projects (GbGreeterWindow *self, IdeRecentProjects *recent_projects); G_END_DECLS #endif /* GB_GREETER_WINDOW_H */
// Copyright 2012 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_IA32_FRAMES_IA32_H_ #define V8_IA32_FRAMES_IA32_H_ namespace v8 { namespace internal { // Register lists // Note that the bit values must match those used in actual instruction encoding const int kNumRegs = 8; // Caller-saved registers const RegList kJSCallerSaved = 1 << 0 | // eax 1 << 1 | // ecx 1 << 2 | // edx 1 << 3 | // ebx - used as a caller-saved register in JavaScript code 1 << 7; // edi - callee function const int kNumJSCallerSaved = 5; typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; // Number of registers for which space is reserved in safepoints. const int kNumSafepointRegisters = 8; const int kNoAlignmentPadding = 0; const int kAlignmentPaddingPushed = 2; const int kAlignmentZapValue = 0x12345678; // Not heap object tagged. // ---------------------------------------------------- class EntryFrameConstants : public AllStatic { public: static const int kCallerFPOffset = -6 * kPointerSize; static const int kFunctionArgOffset = +3 * kPointerSize; static const int kReceiverArgOffset = +4 * kPointerSize; static const int kArgcOffset = +5 * kPointerSize; static const int kArgvOffset = +6 * kPointerSize; }; class ExitFrameConstants : public AllStatic { public: static const int kFrameSize = 2 * kPointerSize; static const int kCodeOffset = -2 * kPointerSize; static const int kSPOffset = -1 * kPointerSize; static const int kCallerFPOffset = 0 * kPointerSize; static const int kCallerPCOffset = +1 * kPointerSize; // FP-relative displacement of the caller's SP. It points just // below the saved PC. static const int kCallerSPDisplacement = +2 * kPointerSize; static const int kConstantPoolOffset = 0; // Not used }; class JavaScriptFrameConstants : public AllStatic { public: // FP-relative. static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset; static const int kLastParameterOffset = +2 * kPointerSize; static const int kFunctionOffset = StandardFrameConstants::kMarkerOffset; // Caller SP-relative. static const int kParam0Offset = -2 * kPointerSize; static const int kReceiverOffset = -1 * kPointerSize; static const int kDynamicAlignmentStateOffset = kLocal0Offset; }; class ArgumentsAdaptorFrameConstants : public AllStatic { public: // FP-relative. static const int kLengthOffset = StandardFrameConstants::kExpressionsOffset; static const int kFrameSize = StandardFrameConstants::kFixedFrameSize + kPointerSize; }; class ConstructFrameConstants : public AllStatic { public: // FP-relative. static const int kImplicitReceiverOffset = -5 * kPointerSize; static const int kConstructorOffset = kMinInt; static const int kLengthOffset = -4 * kPointerSize; static const int kCodeOffset = StandardFrameConstants::kExpressionsOffset; static const int kFrameSize = StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; }; class InternalFrameConstants : public AllStatic { public: // FP-relative. static const int kCodeOffset = StandardFrameConstants::kExpressionsOffset; }; inline Object* JavaScriptFrame::function_slot_object() const { const int offset = JavaScriptFrameConstants::kFunctionOffset; return Memory::Object_at(fp() + offset); } inline void StackHandler::SetFp(Address slot, Address fp) { Memory::Address_at(slot) = fp; } } } // namespace v8::internal #endif // V8_IA32_FRAMES_IA32_H_
/* * copyright (c) 2010 Sveriges Television AB <info@casparcg.com> * * This file is part of CasparCG. * * CasparCG 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. * * CasparCG 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 CasparCG. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef _STRING_CONVERT_H_ #define _STRING_CONVERT_H_ #include <locale> #include <iostream> #include <string> #include <sstream> #include <boost/lexical_cast.hpp> namespace caspar { namespace utils { std::wstring widen(const std::string& str, const std::locale& locale = std::locale()) { std::wstringstream wsstr ; wsstr.imbue(locale); const std::ctype<wchar_t>& ctfacet = std::use_facet<std::ctype<wchar_t>>(wsstr.getloc()) ; for(size_t i = 0 ;i < str.size(); ++i) wsstr << ctfacet.widen(str[i]) ; return wsstr.str() ; } std::string narrow(const std::wstring& str, const std::locale& locale = std::locale()) { std::stringstream sstr; sstr.imbue(locale); const std::ctype<char>& ctfacet = std::use_facet<std::ctype<char>>(sstr.getloc()); for(size_t i = 0; i < str.size(); ++i) sstr << ctfacet.narrow(str[i], 0) ; return sstr.str() ; } std::string narrow_to_latin1(const std::wstring& wideString) { std::string destBuffer; //28591 = ISO 8859-1 Latin I int bytesWritten = 0; int multibyteBufferCapacity = WideCharToMultiByte(28591, 0, wideString.c_str(), -1, 0, 0, nullptr, nullptr); if(multibyteBufferCapacity > 0) { destBuffer.resize(multibyteBufferCapacity); bytesWritten = WideCharToMultiByte(28591, 0, wideString.c_str(), -1, &destBuffer[0], destBuffer.size(), nullptr, nullptr); } destBuffer.resize(bytesWritten); return destBuffer; } template <typename T> T lexical_cast_or_default(const std::wstring str, T defaultValue) { try { if(!str.empty()) return boost::lexical_cast<T>(str); } catch(...){} return defaultValue; } }} #endif
#ifndef DATA_ACTION_T_H #define DATA_ACTION_T_H #include <enum/action/action.h> /** @ingroup data * @addtogroup action_t action_t */ /** @ingroup action_t * @page action_t_overview Overview * * This data used to hold actions */ #define DATA_ACTIONT(...) { TYPE_ACTIONT, (action_t []){ __VA_ARGS__ } } #define DATA_PTR_ACTIONT(...) { TYPE_ACTIONT, __VA_ARGS__ } #define DEREF_TYPE_ACTIONT(_data) *(action_t *)((_data)->ptr) #define REF_TYPE_ACTIONT(_dt) (&(_dt)) #define HAVEBUFF_TYPE_ACTIONT 1 #define UNVIEW_TYPE_ACTIONT(_ret, _dt, _view) { _dt = *(action_t *)((_view)->ptr); _ret = 0; } API ssize_t data_action_t(data_t *data, action_t action); #endif