text
stringlengths
4
6.14k
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef SPU_CONTACT_RESULT2_H #define SPU_CONTACT_RESULT2_H #ifndef _WIN32 #include <stdint.h> #endif #include "../SpuDoubleBuffer.h" #include "bullet/LinearMath/btTransform.h" #include "bullet/BulletCollision//NarrowPhaseCollision/btPersistentManifold.h" #include "bullet/BulletCollision//NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" class btCollisionShape; struct SpuCollisionPairInput { ppu_address_t m_collisionShapes[2]; btCollisionShape* m_spuCollisionShapes[2]; ppu_address_t m_persistentManifoldPtr; btVector3 m_primitiveDimensions0; btVector3 m_primitiveDimensions1; int m_shapeType0; int m_shapeType1; float m_collisionMargin0; float m_collisionMargin1; btTransform m_worldTransform0; btTransform m_worldTransform1; bool m_isSwapped; bool m_useEpa; }; struct SpuClosestPointInput : public btDiscreteCollisionDetectorInterface::ClosestPointInput { struct SpuConvexPolyhedronVertexData* m_convexVertexData[2]; }; ///SpuContactResult exports the contact points using double-buffered DMA transfers, only when needed ///So when an existing contact point is duplicated, no transfer/refresh is performed. class SpuContactResult : public btDiscreteCollisionDetectorInterface::Result { btTransform m_rootWorldTransform0; btTransform m_rootWorldTransform1; ppu_address_t m_manifoldAddress; btPersistentManifold* m_spuManifold; bool m_RequiresWriteBack; btScalar m_combinedFriction; btScalar m_combinedRestitution; bool m_isSwapped; DoubleBuffer<btPersistentManifold, 1> g_manifoldDmaExport; public: SpuContactResult(); virtual ~SpuContactResult(); btPersistentManifold* GetSpuManifold() const { return m_spuManifold; } virtual void setShapeIdentifiersA(int partId0,int index0); virtual void setShapeIdentifiersB(int partId1,int index1); void setContactInfo(btPersistentManifold* spuManifold, ppu_address_t manifoldAddress,const btTransform& worldTrans0,const btTransform& worldTrans1, btScalar restitution0,btScalar restitution1, btScalar friction0,btScalar friction01, bool isSwapped); void writeDoubleBufferedManifold(btPersistentManifold* lsManifold, btPersistentManifold* mmManifold); virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth); void flush(); }; #endif //SPU_CONTACT_RESULT2_H
/* ResidualVM - A 3D game interpreter * * ResidualVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the AUTHORS * file distributed with this source distribution. * * Additional copyright for this file: * Copyright (C) 1999-2000 Revolution Software Ltd. * This code is based on source code created by Revolution Software, * used with permission. * * 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 ICB_RAP_API_HH #define ICB_RAP_API_HH #include "engines/icb/gfx/psx_pcdefines.h" namespace ICB { #define RAP_API_SCHEMA 10 #define RAP_API_ID "RAP" // A bone-bone link // tx, ty, tz : is translation // parent : is the the parent bone ID // = nBones means no linkage typedef struct BoneLink { int16 tx, ty, tz; uint16 parent; } BoneLink; // A simple vertex description typedef struct Vertex { int16 vx, vy, vz; uint16 vertId; } Vertex; // A vertex-bone link typedef struct VertexLink { int16 vx, vy, vz; // the position in bone co-ordinate frame int16 primId; // bone id - -ve number means no bone just "local" frame uint32 vertId; // vertex id } VertexLink; // A weighted vertex-bone link typedef struct WeightedVertexLink { VertexLink link; uint32 weight; // % weight (fixed-point int scaled to weightScale) } WeightedVertexLink; // Each polygon is 6 32-bit WORDS // Bit 31 ----> Bit 0 // // 8-bits | 8-bits | 16-bits // -------------------------- // u0 | v0 | cba // u1 | v1 | tsb // u2 | v2 | pad // -------------------------- // n0 | v0 // n1 | v1 // n2 | v2 // // u0, v0 = u,v of vertex 0 : 0-255 // u1, v1 = u,v of vertex 1 : 0-255 // u2, v2 = u,v of vertex 2 : 0-255 // cba = weird PSX flag, giving the VRAM x,y of the CLUT to use // tsb = weird PSX flag, giving the VRAM texture page to use // pad = padding ! // // n0, v0 = index into the the normal and vertex pool for normal/vertex 0 // n1, v1 = index into the the normal and vertex pool for normal/vertex 1 // n2, v2 = index into the the normal and vertex pool for normal/vertex 2 // // The .rap file format // // Notice, how poor ANSI C/C++ is at its representation // const int RAP_NO_PLATFORM = 0; const int RAP_PC_PLATFORM = 1; const int RAP_PSX_PLATFORM = 2; typedef struct rap_API { char id[4]; uint32 schema; uint32 platform; uint32 worldScaleShift; uint32 weightScaleShift; uint32 bothScaleShift; uint32 nNone; uint32 nSingle; uint32 nMultiple; uint32 nFUS3; uint32 nGUS3; uint32 nFTS3; uint32 nGTS3; uint32 nFUL3; uint32 nGUL3; uint32 nFTL3; uint32 nGTL3; uint16 nTRI3; uint16 nFrames; uint32 nAnimTypes; uint32 animPolySize; // in bytes uint16 nBones; int8 jawBone; // -1 - means not there int8 neckBone; // - 1 - means not there uint32 singleLinkOffset; // in bytes uint32 multiLinkOffset; // in bytes uint32 FUS3offset; // in bytes uint32 GUS3offset; // in bytes uint32 FTS3offset; // in bytes uint32 GTS3offset; // in bytes uint32 FUL3offset; // in bytes uint32 GUL3offset; // in bytes uint32 FTL3offset; // in bytes uint32 GTL3offset; // in bytes uint16 TRI3offset; // in bytes uint16 animPolyOffset; // in bytes uint32 normalOffset; // in bytes uint32 boneOffset; // in bytes Vertex noneLinkData[1]; // Vertex noLinkData[nNone]; Vertex *GetNoneLinkPtr() { return noneLinkData; } VertexLink *GetSingleLinkPtr() { return (VertexLink *)(id + singleLinkOffset); } WeightedVertexLink *GetMultiLinkPtr() { return (WeightedVertexLink *)(id + multiLinkOffset); } uint32 *GetFUS3Ptr() { return (uint32 *)(id + FUS3offset); } uint32 *GetGUS3Ptr() { return (uint32 *)(id + GUS3offset); } uint32 *GetFTS3Ptr() { return (uint32 *)(id + FTS3offset); } uint32 *GetGTS3Ptr() { return (uint32 *)(id + GTS3offset); } uint32 *GetFUL3Ptr() { return (uint32 *)(id + FUL3offset); } uint32 *GetGUL3Ptr() { return (uint32 *)(id + GUL3offset); } uint32 *GetFTL3Ptr() { return (uint32 *)(id + FTL3offset); } uint32 *GetGTL3Ptr() { return (uint32 *)(id + GTL3offset); } uint32 *GetTRI3Ptr() { return (uint32 *)(id + TRI3offset); } uint32 *GetNormalPtr() { return (uint32 *)(id + normalOffset); } BoneLink *GetBonePtr() { return (BoneLink *)(id + boneOffset); } uint32 *GetBoneHashPtr() { BoneLink *bPtr = GetBonePtr(); return (uint32 *)(bPtr + nBones); } uint32 *GetAnimPolyPtr() { return (uint32 *)(id + animPolyOffset); } uint32 *GetAnimPolyFrame(int frame) { return (uint32 *)(id + animPolyOffset + nAnimTypes * 2 * sizeof(uint32) + frame * animPolySize); } } rap_API; inline void ConvertRAP(rap_API *rap) { // Do we need to do any conversion ? if (rap->schema == RAP_API_SCHEMA) return; // You can't so a schema check will fail ! return; } } // End of namespace ICB #endif // #ifndef RAP_API_HH
/* * IRC protocol support for Ayttm * * Copyright (C) 2001, Erik Inge Bolso <knan@mo.himolde.no> * and others * * 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 * */ /* * irc.h */ #include "libproxy/networking.h" /* RFC1459 and RFC2812 defines max message size including \n == 512 bytes, but being tolerant of violations is nice nevertheless. */ #define BUF_LEN 512*2 #define AY_IRC_GET_HANDLE(handle,nick,addr,size) {\ strncpy(handle, nick, size);\ strncat(handle, "@", size-strlen(handle));\ strncat(handle, addr, size-strlen(handle));\ } #define DBG_IRC do_irc_debug typedef struct irc_local_account_type { char password[MAX_PREF_LEN]; int fd_tag; int keepalive_tag; int connect_tag; int activity_tag; char *buff; int buff_user; LList *friends; LList *channel_list; LList *current_rooms; irc_account *ia; void (*got_public_chatrooms) (LList *list, void *data); void *public_chatroom_callback_data; AyConnection *connection; } irc_local_account; typedef struct irc_account_type { char server[255]; char realserver[255]; int status; int idle; gboolean dummy; } ay_irc_account; typedef struct _irc_info { char *whois_info; eb_account *me; char *fullmessage; } irc_info; static int is_setting_state = 0; /* Denotes the end of list in irc_command_action array (irc_ca) ... */ #define IRC_END_COMMAND "" /* Max command and action strings length in an irc_command_action struct */ #define MAX_IRC_COMMAND_LEN 255 #define MAX_IRC_ACTION_LEN 255 /* IRC_COMMAND_TYPE: type of command in an irc_command_action struct. */ enum IRC_COMMAND_TYPE { IRC_COMMAND_BUILTIN = 1, IRC_COMMAND_USER_DEF = 2 }; enum { IRC_WELCOME = 0xaa77aa, IRC_TOPIC = 0x775500, IRC_MOTD = 0x885588, IRC_KICK = 0xAA6600, IRC_CTCP_TIME = 0xaabb44, IRC_CTCP_ACTION = 0x00aa00, IRC_CTCP_VERSION = 0x00bbbb }; typedef struct irc_command_action_type { char command[MAX_IRC_COMMAND_LEN]; char action[MAX_IRC_ACTION_LEN]; enum IRC_COMMAND_TYPE command_type; } irc_command_action; /* Local prototypes */ static int ay_irc_query_connected(eb_account *account); static void ay_irc_login(eb_local_account *account); static void ay_irc_logout(eb_local_account *ela); static int ay_irc_send_im(eb_local_account *account_from, eb_account *account_to, char *message); static eb_local_account *ay_irc_read_local_config(LList *pairs); static LList *ay_irc_write_local_config(eb_local_account *account); static eb_account *ay_irc_read_config(eb_account *ea, LList *config); static LList *ay_irc_get_states(); static int ay_irc_get_current_state(eb_local_account *account); static void ay_irc_set_current_state(eb_local_account *account, int state); static char *ay_irc_check_login(const char *user, const char *pass); static void ay_irc_add_user(eb_account *account); static void ay_irc_del_user(eb_account *account); static int ay_irc_is_suitable(eb_local_account *local, eb_account *remote); static eb_account *ay_irc_new_account(eb_local_account *ela, const char *account); static const char *ay_irc_get_status_string(eb_account *account); static void *ay_irc_get_status_pixbuf(eb_account *account); static void ay_irc_set_idle(eb_local_account *account, int idle); static void ay_irc_set_away(eb_local_account *account, char *message, int away); static void ay_irc_send_file(eb_local_account *from, eb_account *to, char *file); static void irc_info_update(info_window *iw); static void irc_info_data_cleanup(info_window *iw); static void ay_irc_get_info(eb_local_account *account_from, eb_account *account_to); static void ay_irc_join_chat_room(Conversation *room); static void ay_irc_leave_chat_room(Conversation *room); static int ay_irc_send_chat_room_message(Conversation *room, char *message); static void ay_irc_send_invite(eb_local_account *account, Conversation *room, char *user, const char *message); static Conversation *ay_irc_make_chat_room(char *name, eb_local_account *account, int is_public); static Conversation *ay_irc_start_conversation(const char *name, eb_local_account *account, int is_room, int is_public, int send_join); static void ay_irc_accept_invite(eb_local_account *account, void *invitation); static void ay_irc_decline_invite(eb_local_account *account, void *invitation); static void eb_irc_read_prefs_config(LList *values); static LList *eb_irc_write_prefs_config(); static void irc_connect_cb(AyConnection *con, AyConnectionStatus error, void *data); void irc_finish_login(eb_local_account *ela); static irc_callbacks *ay_irc_map_callbacks(void);
#include "touchscreen_common.h" int tpd_existed = 0;
// Aseprite // Copyright (C) 2001-2015 David Capello // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. #ifndef APP_UI_SKIN_SKIN_PART_H_INCLUDED #define APP_UI_SKIN_SKIN_PART_H_INCLUDED #pragma once #include "base/shared_ptr.h" #include "gfx/size.h" #include <vector> namespace she { class Surface; } namespace app { namespace skin { class SkinPart { public: typedef std::vector<she::Surface*> Bitmaps; SkinPart(); ~SkinPart(); std::size_t countBitmaps() const { return m_bitmaps.size(); } void clear(); // It doesn't destroy the previous bitmap in the given "index". void setBitmap(std::size_t index, she::Surface* bitmap); she::Surface* getBitmap(std::size_t index) const { return (index < m_bitmaps.size() ? m_bitmaps[index]: NULL); } she::Surface* getBitmapNW() const { return getBitmap(0); } she::Surface* getBitmapN() const { return getBitmap(1); } she::Surface* getBitmapNE() const { return getBitmap(2); } she::Surface* getBitmapE() const { return getBitmap(3); } she::Surface* getBitmapSE() const { return getBitmap(4); } she::Surface* getBitmapS() const { return getBitmap(5); } she::Surface* getBitmapSW() const { return getBitmap(6); } she::Surface* getBitmapW() const { return getBitmap(7); } gfx::Size getSize() const; private: Bitmaps m_bitmaps; }; typedef base::SharedPtr<SkinPart> SkinPartPtr; } // namespace skin } // namespace app #endif
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS // clang-format off PairStyle(yukawa/kk,PairYukawaKokkos<LMPDeviceType>); PairStyle(yukawa/kk/device,PairYukawaKokkos<LMPDeviceType>); PairStyle(yukawa/kk/host,PairYukawaKokkos<LMPHostType>); // clang-format on #else // clang-format off #ifndef LMP_PAIR_YUKAWA_KOKKOS_H #define LMP_PAIR_YUKAWA_KOKKOS_H #include "pair_kokkos.h" #include "pair_yukawa.h" #include "neigh_list_kokkos.h" namespace LAMMPS_NS { template<class DeviceType> class PairYukawaKokkos : public PairYukawa { public: enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes<DeviceType> AT; PairYukawaKokkos(class LAMMPS *); virtual ~PairYukawaKokkos(); void compute(int, int); void init_style(); double init_one(int,int); struct params_yukawa { KOKKOS_INLINE_FUNCTION params_yukawa() { cutsq=0, a = 0; offset = 0; } KOKKOS_INLINE_FUNCTION params_yukawa(int /*i*/) { cutsq=0, a = 0; offset = 0; } F_FLOAT cutsq, a, offset; }; protected: template<bool STACKPARAMS, class Specialisation> KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; template<bool STACKPARAMS, class Specialisation> KOKKOS_INLINE_FUNCTION F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; template<bool STACKPARAMS, class Specialisation> KOKKOS_INLINE_FUNCTION F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, const int& /*itype*/, const int& /*jtype*/) const { return 0; } Kokkos::DualView<params_yukawa**,Kokkos::LayoutRight,DeviceType> k_params; typename Kokkos::DualView<params_yukawa**,Kokkos::LayoutRight,DeviceType>::t_dev_const_um params; params_yukawa m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; typename AT::t_x_array_randomread x; typename AT::t_x_array c_x; typename AT::t_f_array f; typename AT::t_int_1d_randomread type; DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; typename AT::t_tagint_1d tag; int newton_pair; double special_lj[4]; typename AT::tdual_ffloat_2d k_cutsq; typename AT::t_ffloat_2d d_cutsq; int neighflag; int nlocal,nall,eflag,vflag; void allocate(); friend struct PairComputeFunctor<PairYukawaKokkos,FULL,true>; friend struct PairComputeFunctor<PairYukawaKokkos,HALF,true>; friend struct PairComputeFunctor<PairYukawaKokkos,HALFTHREAD,true>; friend struct PairComputeFunctor<PairYukawaKokkos,FULL,false>; friend struct PairComputeFunctor<PairYukawaKokkos,HALF,false>; friend struct PairComputeFunctor<PairYukawaKokkos,HALFTHREAD,false>; friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,FULL,void>( PairYukawaKokkos*,NeighListKokkos<DeviceType>*); friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALF,void>( PairYukawaKokkos*,NeighListKokkos<DeviceType>*); friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALFTHREAD,void>( PairYukawaKokkos*,NeighListKokkos<DeviceType>*); friend EV_FLOAT pair_compute<PairYukawaKokkos,void>( PairYukawaKokkos*,NeighListKokkos<DeviceType>*); friend void pair_virial_fdotr_compute<PairYukawaKokkos>(PairYukawaKokkos*); }; } #endif #endif /* ERROR/WARNING messages: E: Cannot use Kokkos pair style with rRESPA inner/middle UNDOCUMENTED E: Cannot use chosen neighbor list style with yukawa/kk That style is not supported by Kokkos. U: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. U: Incorrect args for pair coefficients Self-explanatory. Check the input script or data file. */
/* Interface for NSValueTransformer for GNUStep Copyright (C) 2006 Free Software Foundation, Inc. Written Dr. H. Nikolaus Schaller Created on Mon Mar 21 2005. Updatesd and documented by Richard Frith-Macdonald This file is part of the GNUstep Base Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. */ #ifndef __NSValueTransformer_h_GNUSTEP_BASE_INCLUDE #define __NSValueTransformer_h_GNUSTEP_BASE_INCLUDE #import <GNUstepBase/GSVersionMacros.h> #if OS_API_VERSION(MAC_OS_X_VERSION_10_3,GS_API_LATEST) && GS_API_VERSION( 10200,GS_API_LATEST) #import <Foundation/NSObject.h> #if defined(__cplusplus) extern "C" { #endif @class NSArray; @class NSString; /** This transformer converts a YES to a NO and a NO to a YES. */ GS_EXPORT NSString* const NSNegateBooleanTransformerName; /** This transformer converts a nil value to a YES.<br /> * Not reversible. */ GS_EXPORT NSString* const NSIsNilTransformerName; /** This transformer converts a non-nil value to a YES.<br /> * Not reversible. */ GS_EXPORT NSString* const NSIsNotNilTransformerName; /** This transformer converts an [NSData] instance to the object * archived in it, or archives an object inot an [NSData]. */ GS_EXPORT NSString* const NSUnarchiveFromDataTransformerName; /** Instances of the NSValueTransformer class are used to convert * values from one representation to another. The base class is * abstract and its methods must be overridden by subclasses to do * the actual work. */ @interface NSValueTransformer : NSObject /** <override-subclass /> * Returns a flag indicating whether the transformer permits reverse * transformations. */ + (BOOL) allowsReverseTransformation; /** * Registers transformer to handle transformations with the specified * name. */ + (void) setValueTransformer: (NSValueTransformer *)transformer forName: (NSString *)name; /** <override-subclass /> * Returns the class of the value produced by this transformer. */ + (Class) transformedValueClass; /** * Returns the transformer registered for the specified name, or nil * if no transformer is registered for name. */ + (NSValueTransformer *) valueTransformerForName: (NSString *)name; /** * Returns an array listing the names of all registered value transformers. */ + (NSArray *) valueTransformerNames; /** * Performs a reverse transformation on the specified value and returns the * resulting object.<br /> * The default implementation raises an exception if * +allowsReverseTransformation returns NO, otherwise it calls * -transformedValue: and returns the result. */ - (id) reverseTransformedValue: (id)value; /** <override-subclass/> * Subclasses should override this method to perform the actual transformation * (and reverse transformation if applicable) and return the result. */ - (id) transformedValue: (id)value; @end #if defined(__cplusplus) } #endif #endif /* OS_API_VERSION */ #endif /* __NSValueTransformer_h_GNUSTEP_BASE_INCLUDE */
/* Copyright (c) 2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License 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. */ #include <linux/delay.h> #include <linux/clk.h> #include <linux/io.h> #include <linux/module.h> #include <linux/proc_fs.h> #include <linux/debugfs.h> #include <linux/videodev2.h> #include <media/v4l2-subdev.h> #include <media/v4l2-device.h> #include <mach/board.h> #include <mach/vreg.h> #include <mach/iommu.h> #include "msm_isp.h" #include "msm_isp_util.h" #include "msm_isp_axi_util.h" #include "msm_isp_stats_util.h" #include "msm_sd.h" #include "msm_isp40.h" #include "msm_isp32.h" static struct msm_sd_req_vb2_q vfe_vb2_ops; static const struct of_device_id msm_vfe_dt_match[] = { { .compatible = "qcom,vfe40", .data = &vfe40_hw_info, }, {} }; MODULE_DEVICE_TABLE(of, msm_vfe_dt_match); static const struct platform_device_id msm_vfe_dev_id[] = { {"msm_vfe32", (kernel_ulong_t) &vfe32_hw_info}, {} }; static struct msm_isp_buf_mgr vfe_buf_mgr; static int __devinit vfe_probe(struct platform_device *pdev) { struct vfe_device *vfe_dev; /*struct msm_cam_subdev_info sd_info;*/ const struct of_device_id *match_dev; int rc = 0; struct msm_iova_partition vfe_partition = { .start = SZ_128K, .size = SZ_2G - SZ_128K, }; struct msm_iova_layout vfe_layout = { .partitions = &vfe_partition, .npartitions = 1, .client_name = "vfe", .domain_flags = 0, }; vfe_dev = kzalloc(sizeof(struct vfe_device), GFP_KERNEL); if (!vfe_dev) { pr_err("%s: no enough memory\n", __func__); return -ENOMEM; } if (pdev->dev.of_node) { of_property_read_u32((&pdev->dev)->of_node, "cell-index", &pdev->id); match_dev = of_match_device(msm_vfe_dt_match, &pdev->dev); vfe_dev->hw_info = (struct msm_vfe_hardware_info *) match_dev->data; } else { vfe_dev->hw_info = (struct msm_vfe_hardware_info *) platform_get_device_id(pdev)->driver_data; } if (!vfe_dev->hw_info) { pr_err("%s: No vfe hardware info\n", __func__); return -EINVAL; } ISP_DBG("%s: device id = %d\n", __func__, pdev->id); vfe_dev->pdev = pdev; rc = vfe_dev->hw_info->vfe_ops.core_ops.get_platform_data(vfe_dev); if (rc < 0) { pr_err("%s: failed to get platform resources\n", __func__); kfree(vfe_dev); return -ENOMEM; } INIT_LIST_HEAD(&vfe_dev->tasklet_q); tasklet_init(&vfe_dev->vfe_tasklet, msm_isp_do_tasklet, (unsigned long)vfe_dev); v4l2_subdev_init(&vfe_dev->subdev.sd, vfe_dev->hw_info->subdev_ops); vfe_dev->subdev.sd.internal_ops = vfe_dev->hw_info->subdev_internal_ops; snprintf(vfe_dev->subdev.sd.name, ARRAY_SIZE(vfe_dev->subdev.sd.name), "vfe"); vfe_dev->subdev.sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; vfe_dev->subdev.sd.flags |= V4L2_SUBDEV_FL_HAS_EVENTS; v4l2_set_subdevdata(&vfe_dev->subdev.sd, vfe_dev); platform_set_drvdata(pdev, &vfe_dev->subdev.sd); mutex_init(&vfe_dev->realtime_mutex); mutex_init(&vfe_dev->core_mutex); spin_lock_init(&vfe_dev->tasklet_lock); spin_lock_init(&vfe_dev->shared_data_lock); media_entity_init(&vfe_dev->subdev.sd.entity, 0, NULL, 0); vfe_dev->subdev.sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV; vfe_dev->subdev.sd.entity.group_id = MSM_CAMERA_SUBDEV_VFE; vfe_dev->subdev.sd.entity.name = pdev->name; rc = msm_sd_register(&vfe_dev->subdev); if (rc != 0) { pr_err("%s: msm_sd_register error = %d\n", __func__, rc); kfree(vfe_dev); goto end; } vfe_dev->buf_mgr = &vfe_buf_mgr; v4l2_subdev_notify(&vfe_dev->subdev.sd, MSM_SD_NOTIFY_REQ_CB, &vfe_vb2_ops); rc = msm_isp_create_isp_buf_mgr(vfe_dev->buf_mgr, &vfe_vb2_ops, &vfe_layout); if (rc < 0) { pr_err("%s: Unable to create buffer manager\n", __func__); kfree(vfe_dev); return -EINVAL; } vfe_dev->buf_mgr->ops->register_ctx(vfe_dev->buf_mgr, &vfe_dev->iommu_ctx[0], vfe_dev->hw_info->num_iommu_ctx); vfe_dev->vfe_open_cnt = 0; end: return rc; } static struct platform_driver vfe_driver = { .probe = vfe_probe, .driver = { .name = "msm_vfe", .owner = THIS_MODULE, .of_match_table = msm_vfe_dt_match, }, .id_table = msm_vfe_dev_id, }; static int __init msm_vfe_init_module(void) { return platform_driver_register(&vfe_driver); } static void __exit msm_vfe_exit_module(void) { platform_driver_unregister(&vfe_driver); } module_init(msm_vfe_init_module); module_exit(msm_vfe_exit_module); MODULE_DESCRIPTION("MSM VFE driver"); MODULE_LICENSE("GPL v2");
/* Unix SMB/CIFS implementation. SAM_ACCOUNT local cache for Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2004. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "includes.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_PASSDB #define LOGIN_CACHE_FILE "login_cache.tdb" #define SAM_CACHE_FORMAT "dwwd" static TDB_CONTEXT *cache; BOOL login_cache_init(void) { char* cache_fname = NULL; /* skip file open if it's already opened */ if (cache) return True; asprintf(&cache_fname, "%s/%s", lp_lockdir(), LOGIN_CACHE_FILE); if (cache_fname) DEBUG(5, ("Opening cache file at %s\n", cache_fname)); else { DEBUG(0, ("Filename allocation failed.\n")); return False; } cache = tdb_open_log(cache_fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644); if (!cache) DEBUG(5, ("Attempt to open %s failed.\n", cache_fname)); SAFE_FREE(cache_fname); return (cache ? True : False); } BOOL login_cache_shutdown(void) { /* tdb_close routine returns -1 on error */ if (!cache) return False; DEBUG(5, ("Closing cache file\n")); return tdb_close(cache) != -1; } /* if we can't read the cache, oh well, no need to return anything */ LOGIN_CACHE * login_cache_read(SAM_ACCOUNT *sampass) { TDB_DATA keybuf, databuf; LOGIN_CACHE *entry; if (!login_cache_init()) return NULL; keybuf.dptr = SMB_STRDUP(pdb_get_nt_username(sampass)); if (!keybuf.dptr || !strlen(keybuf.dptr)) { SAFE_FREE(keybuf.dptr); return NULL; } keybuf.dsize = strlen(keybuf.dptr) + 1; DEBUG(7, ("Looking up login cache for user %s\n", keybuf.dptr)); databuf = tdb_fetch(cache, keybuf); SAFE_FREE(keybuf.dptr); if (!(entry = SMB_MALLOC_P(LOGIN_CACHE))) { DEBUG(1, ("Unable to allocate cache entry buffer!\n")); SAFE_FREE(databuf.dptr); return NULL; } if (tdb_unpack (databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT, &entry->entry_timestamp, &entry->acct_ctrl, &entry->bad_password_count, &entry->bad_password_time) == -1) { DEBUG(7, ("No cache entry found\n")); SAFE_FREE(entry); SAFE_FREE(databuf.dptr); return NULL; } SAFE_FREE(databuf.dptr); DEBUG(5, ("Found login cache entry: timestamp %12u, flags 0x%x, count %d, time %12u\n", (unsigned int)entry->entry_timestamp, entry->acct_ctrl, entry->bad_password_count, (unsigned int)entry->bad_password_time)); return entry; } BOOL login_cache_write(const SAM_ACCOUNT *sampass, LOGIN_CACHE entry) { TDB_DATA keybuf, databuf; BOOL ret; if (!login_cache_init()) return False; keybuf.dptr = SMB_STRDUP(pdb_get_nt_username(sampass)); if (!keybuf.dptr || !strlen(keybuf.dptr)) { SAFE_FREE(keybuf.dptr); return False; } keybuf.dsize = strlen(keybuf.dptr) + 1; entry.entry_timestamp = time(NULL); databuf.dsize = tdb_pack(NULL, 0, SAM_CACHE_FORMAT, entry.entry_timestamp, entry.acct_ctrl, entry.bad_password_count, entry.bad_password_time); databuf.dptr = SMB_MALLOC(databuf.dsize); if (!databuf.dptr) { SAFE_FREE(keybuf.dptr); return False; } if (tdb_pack(databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT, entry.entry_timestamp, entry.acct_ctrl, entry.bad_password_count, entry.bad_password_time) != databuf.dsize) { SAFE_FREE(keybuf.dptr); SAFE_FREE(databuf.dptr); return False; } ret = tdb_store(cache, keybuf, databuf, 0); SAFE_FREE(keybuf.dptr); SAFE_FREE(databuf.dptr); return ret == 0; } BOOL login_cache_delentry(const SAM_ACCOUNT *sampass) { int ret; TDB_DATA keybuf; if (!login_cache_init()) return False; keybuf.dptr = SMB_STRDUP(pdb_get_nt_username(sampass)); if (!keybuf.dptr || !strlen(keybuf.dptr)) { SAFE_FREE(keybuf.dptr); return False; } keybuf.dsize = strlen(keybuf.dptr) + 1; DEBUG(9, ("About to delete entry for %s\n", keybuf.dptr)); ret = tdb_delete(cache, keybuf); DEBUG(9, ("tdb_delete returned %d\n", ret)); SAFE_FREE(keybuf.dptr); return ret == 0; }
/********************************************************************** * * * Voreen - The Volume Rendering Engine * * * * Created between 2005 and 2012 by The Voreen Team * * as listed in CREDITS.TXT <http://www.voreen.org> * * * * This file is part of the Voreen software package. Voreen 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. * * * * Voreen 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 * * in the file "LICENSE.txt" along with this program. * * If not, see <http://www.gnu.org/licenses/>. * * * * The authors reserve all rights not expressly granted herein. For * * non-commercial academic use see the license exception specified in * * the file "LICENSE-academic.txt". To get information about * * commercial licensing please contact the authors. * * * **********************************************************************/ #ifndef VRN_MEDIAN_H #define VRN_MEDIAN_H #include "voreen/core/processors/imageprocessor.h" #include "voreen/core/properties/intproperty.h" namespace voreen { /** * Performs a median filtering. */ class Median : public ImageProcessor { public: Median(); virtual Processor* create() const {return new Median();} virtual std::string getCategory() const { return "Image Processing"; } virtual std::string getClassName() const { return "Median"; } virtual CodeState getCodeState() const { return CODE_STATE_STABLE; } protected: void process(); IntProperty halfKernelDim_; ///< Half the kernel size of the box filter RenderPort inport_; RenderPort outport_; }; } // namespace voreen #endif //VRN_MEDIAN_H
#ifndef HTTP_DOWNLOAD_H #define HTTP_DOWNLOAD_H #include <cstdio> #include <string> #include <winsock2.h> class SockHttpDown { public: SockHttpDown(); ~SockHttpDown(); bool httpGet(const char* url,const char* localfile); std::string httpGet(const char* url); //std::string httpGet(const char* url); void parseURL(const char* url, std::string& hostAddr, int& port, std::string& getPath); protected: bool initSocket(); //³õʼ»¯Socket bool sendRequest(); //·¢ËÍÇëÇóÍ· std::string receiveData(); //½ÓÊÕÊý¾Ý bool closeTransfer(); //¹Ø±Õ´«Êä private: std::string m_hostAddr; //Ä¿±êÖ÷»úIP int m_port; //HTTP¶Ë¿ÚºÅ std::string m_getPath; //Ä¿±êÎļþÏà¶Ô·¾¶ std::string m_saveFileName; //±£´æÎļþ·¾¶ SOCKET m_sock; //Socket FILE* m_fp; //±£´æÎļþÖ¸Õë ULONGLONG m_fileTotalSize; //Ä¿±êÎļþ×Ü´óС ULONGLONG m_receivedDataSize; //ÒѽÓÊÕÊý¾Ý´óС bool m_cancelFlag; //È¡ÏûÏÂÔØ±ê¼Ç }; #endif //HTTP_DOWNLOAD_H
/* * Copyright (C) 2008, 2013-2014 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef JavaScriptCallFrame_h #define JavaScriptCallFrame_h #include "JSCJSValueInlines.h" #include "debugger/DebuggerCallFrame.h" #include "interpreter/CallFrame.h" #include <wtf/Forward.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/text/TextPosition.h> namespace Inspector { class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame> { public: static Ref<JavaScriptCallFrame> create(PassRefPtr<JSC::DebuggerCallFrame> debuggerCallFrame) { return adoptRef(*new JavaScriptCallFrame(debuggerCallFrame)); } JavaScriptCallFrame* caller(); intptr_t sourceID() const { return m_debuggerCallFrame->sourceID(); } const TextPosition position() const { return m_debuggerCallFrame->position(); } int line() const { return m_debuggerCallFrame->line(); } int column() const { return m_debuggerCallFrame->column(); } String functionName() const { return m_debuggerCallFrame->functionName(); } JSC::DebuggerCallFrame::Type type() const { return m_debuggerCallFrame->type(); } JSC::DebuggerScope* scopeChain() const { return m_debuggerCallFrame->scope(); } JSC::JSGlobalObject* vmEntryGlobalObject() const { return m_debuggerCallFrame->vmEntryGlobalObject(); } JSC::JSValue thisValue() const { return m_debuggerCallFrame->thisValue(); } JSC::JSValue evaluate(const String& script, NakedPtr<JSC::Exception>& exception) const { return m_debuggerCallFrame->evaluate(script, exception); } private: JavaScriptCallFrame(PassRefPtr<JSC::DebuggerCallFrame>); RefPtr<JSC::DebuggerCallFrame> m_debuggerCallFrame; RefPtr<JavaScriptCallFrame> m_caller; }; } // namespace Inspector #endif // JavaScriptCallFrame_h
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS AtomStyle(body,AtomVecBody) #else #ifndef LMP_ATOM_VEC_BODY_H #define LMP_ATOM_VEC_BODY_H #include "atom_vec.h" namespace LAMMPS_NS { class AtomVecBody : public AtomVec { public: class Body *bptr; struct Bonus { double quat[4]; double inertia[3]; int ninteger,ndouble; int iindex,dindex; int *ivalue; double *dvalue; int ilocal; }; struct Bonus *bonus; AtomVecBody(class LAMMPS *); ~AtomVecBody(); void process_args(int, char **); void grow(int); void grow_reset(); void copy(int, int, int); int pack_comm(int, int *, double *, int, int *); int pack_comm_vel(int, int *, double *, int, int *); int pack_comm_hybrid(int, int *, double *); void unpack_comm(int, int, double *); void unpack_comm_vel(int, int, double *); int unpack_comm_hybrid(int, int, double *); int pack_reverse(int, int, double *); int pack_reverse_hybrid(int, int, double *); void unpack_reverse(int, int *, double *); int unpack_reverse_hybrid(int, int *, double *); int pack_border(int, int *, double *, int, int *); int pack_border_vel(int, int *, double *, int, int *); int pack_border_hybrid(int, int *, double *); void unpack_border(int, int, double *); void unpack_border_vel(int, int, double *); int unpack_border_hybrid(int, int, double *); int pack_exchange(int, double *); int unpack_exchange(double *); int size_restart(); int pack_restart(int, double *); int unpack_restart(double *); void create_atom(int, double *); void data_atom(double *, imageint, char **); int data_atom_hybrid(int, char **); void data_vel(int, char **); int data_vel_hybrid(int, char **); void pack_data(double **); int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); void pack_vel(double **); int pack_vel_hybrid(int, double *); void write_vel(FILE *, int, double **); int write_vel_hybrid(FILE *, double *); bigint memory_usage(); // manipulate Bonus data structure for extra atom info void clear_bonus(); void data_body(int, int, int, int *, double *); // methods used by other classes to query/set body info double radius_body(int, int, int *, double *); void set_quat(int, double *); int nlocal_bonus; private: tagint *tag; int *type,*mask; imageint *image; double **x,**v,**f; double *radius; double *rmass; double **angmom,**torque; int *body; int nghost_bonus,nmax_bonus; int intdoubleratio; // sizeof(double) / sizeof(int) MyPoolChunk<int> *icp; MyPoolChunk<double> *dcp; void grow_bonus(); void copy_bonus(int, int); }; } #endif #endif /* ERROR/WARNING messages: E: Internal error in atom_style body This error should not occur. Contact the developers. E: Invalid atom_style body command No body style argument was provided. E: Unrecognized body style The choice of body style is unknown. E: Per-processor system is too big The number of owned atoms plus ghost atoms on a single processor must fit in 32-bit integer. E: Invalid atom type in Atoms section of data file Atom types must range from 1 to specified # of types. E: Invalid density in Atoms section of data file Density value cannot be <= 0.0. E: Assigning body parameters to non-body atom Self-explanatory. E: Assigning quat to non-body atom Self-explanatory. */
extern int kprobe_id; void ioctl_random_event(void);
/*************************************************************************** * * * copyright : (C) 2012 C. Barth Netterfield * * netterfield@astro.utoronto.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. * * * ***************************************************************************/ #ifndef LINEDIMENSIONSTAB_H #define LINEDIMENSIONSTAB_H #include "dialogtab.h" #include "viewitem.h" #include "ui_linedimensionstab.h" #include "kst_export.h" namespace Kst { class LineDimensionsTab : public DialogTab, Ui::LineDimensionsTab { Q_OBJECT public: explicit LineDimensionsTab(ViewItem* viewItem, QWidget *parent); void setupDimensions(); double x1() {return _p1X->value();} double x2() {return _p2X->value();} double y1() {return _p1Y->value();} double y2() {return _p2Y->value();} bool lockPosToData() const {return _lockPosToData->isChecked();} bool lockPosToDataDirty() const; void enableSingleEditOptions(bool enabled); void clearTabValues(); public Q_SLOTS: void fillDimensions(bool lock_pos_to_data); private: ViewItem *_viewItem; private Q_SLOTS: void modified(); Q_SIGNALS: void tabModified(); }; } #endif // LINEDIMENSIONSTAB_H
#ifndef _LINUX__INIT_TASK_H #define _LINUX__INIT_TASK_H #include <linux/rcupdate.h> #include <linux/irqflags.h> #include <linux/utsname.h> #include <linux/lockdep.h> #include <linux/ftrace.h> #include <linux/ipc.h> #include <linux/pid_namespace.h> #include <linux/user_namespace.h> #include <linux/securebits.h> #include <net/net_namespace.h> #ifdef CONFIG_SMP # define INIT_PUSHABLE_TASKS(tsk) \ .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), #else # define INIT_PUSHABLE_TASKS(tsk) #endif extern struct files_struct init_files; extern struct fs_struct init_fs; #ifdef CONFIG_CGROUPS #define INIT_THREADGROUP_FORK_LOCK(sig) \ .threadgroup_fork_lock = \ __RWSEM_INITIALIZER(sig.threadgroup_fork_lock), #else #define INIT_THREADGROUP_FORK_LOCK(sig) #endif #define INIT_SIGNALS(sig) { \ .nr_threads = 1, \ .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ .shared_pending = { \ .list = LIST_HEAD_INIT(sig.shared_pending.list), \ .signal = {{0}}}, \ .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ .rlim = INIT_RLIMITS, \ .cputimer = { \ .cputime = INIT_CPUTIME, \ .running = 0, \ .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ }, \ .cred_guard_mutex = \ __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ INIT_THREADGROUP_FORK_LOCK(sig) \ } extern struct nsproxy init_nsproxy; #define INIT_SIGHAND(sighand) { \ .count = ATOMIC_INIT(1), \ .action = { { { .sa_handler = SIG_DFL, } }, }, \ .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \ .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \ } extern struct group_info init_groups; #define INIT_STRUCT_PID { \ .count = ATOMIC_INIT(1), \ .tasks = { \ { .first = NULL }, \ { .first = NULL }, \ { .first = NULL }, \ }, \ .level = 0, \ .numbers = { { \ .nr = 0, \ .ns = &init_pid_ns, \ .pid_chain = { .next = NULL, .pprev = NULL }, \ }, } \ } #define INIT_PID_LINK(type) \ { \ .node = { \ .next = NULL, \ .pprev = NULL, \ }, \ .pid = &init_struct_pid, \ } #ifdef CONFIG_AUDITSYSCALL #define INIT_IDS \ .loginuid = -1, \ .sessionid = -1, #else #define INIT_IDS #endif #ifdef CONFIG_RCU_BOOST #define INIT_TASK_RCU_BOOST() \ .rcu_boost_mutex = NULL, #else #define INIT_TASK_RCU_BOOST() #endif #ifdef CONFIG_TREE_PREEMPT_RCU #define INIT_TASK_RCU_TREE_PREEMPT() \ .rcu_blocked_node = NULL, #else #define INIT_TASK_RCU_TREE_PREEMPT(tsk) #endif #ifdef CONFIG_PREEMPT_RCU #define INIT_TASK_RCU_PREEMPT(tsk) \ .rcu_read_lock_nesting = 0, \ .rcu_read_unlock_special = 0, \ .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \ INIT_TASK_RCU_TREE_PREEMPT() \ INIT_TASK_RCU_BOOST() #else #define INIT_TASK_RCU_PREEMPT(tsk) #endif extern struct cred init_cred; #ifdef CONFIG_PERF_EVENTS # define INIT_PERF_EVENTS(tsk) \ .perf_event_mutex = \ __MUTEX_INITIALIZER(tsk.perf_event_mutex), \ .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list), #else # define INIT_PERF_EVENTS(tsk) #endif /* * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ #define INIT_TASK(tsk) \ { \ .state = 0, \ .stack = &init_thread_info, \ .usage = ATOMIC_INIT(2), \ .flags = PF_KTHREAD, \ .prio = MAX_PRIO-20, \ .static_prio = MAX_PRIO-20, \ .normal_prio = MAX_PRIO-20, \ .policy = SCHED_NORMAL, \ .cpus_allowed = CPU_MASK_ALL, \ .mm = NULL, \ .active_mm = &init_mm, \ .se = { \ .group_node = LIST_HEAD_INIT(tsk.se.group_node), \ }, \ .rt = { \ .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \ .time_slice = HZ, \ .nr_cpus_allowed = NR_CPUS, \ }, \ .tasks = LIST_HEAD_INIT(tsk.tasks), \ INIT_PUSHABLE_TASKS(tsk) \ .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ .real_parent = &tsk, \ .parent = &tsk, \ .children = LIST_HEAD_INIT(tsk.children), \ .sibling = LIST_HEAD_INIT(tsk.sibling), \ .group_leader = &tsk, \ RCU_INIT_POINTER(.real_cred, &init_cred), \ RCU_INIT_POINTER(.cred, &init_cred), \ .comm = "swapper", \ .thread = INIT_THREAD, \ .fs = &init_fs, \ .files = &init_files, \ .signal = &init_signals, \ .sighand = &init_sighand, \ .nsproxy = &init_nsproxy, \ .pending = { \ .list = LIST_HEAD_INIT(tsk.pending.list), \ .signal = {{0}}}, \ .blocked = {{0}}, \ .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ .journal_info = NULL, \ .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ .fs_excl = ATOMIC_INIT(0), \ .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ .timer_slack_ns = 50000, /* 50 usec default slack */ \ .pids = { \ [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ }, \ .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ INIT_IDS \ INIT_PERF_EVENTS(tsk) \ INIT_TRACE_IRQFLAGS \ INIT_LOCKDEP \ INIT_FTRACE_GRAPH \ INIT_TRACE_RECURSION \ INIT_TASK_RCU_PREEMPT(tsk) \ } #define INIT_CPU_TIMERS(cpu_timers) \ { \ LIST_HEAD_INIT(cpu_timers[0]), \ LIST_HEAD_INIT(cpu_timers[1]), \ LIST_HEAD_INIT(cpu_timers[2]), \ } /* Attach to the init_task data structure for proper alignment */ #define __init_task_data __section(.data..init_task) #endif
/***************************************************************************** * * Copyright (C) 2011 Thomas Volkert <thomas@homer-conferencing.com> * * This software is free software. * Your are allowed to redistribute it and/or modify it under the terms of * the GNU General Public License version 2 as published by the Free Software * Foundation. * * This source is published in the hope that it will be useful, but * WITHOUT ANY WARRANTY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License version 2 for more details. * * You should have received a copy of the GNU General Public License version 2 * along with this program. Otherwise, you can write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. * Alternatively, you find an online version of the license text under * http://www.gnu.org/licenses/gpl-2.0.html. * *****************************************************************************/ /* * Purpose: Small function snippets * Since: 2011-09-25 */ #ifndef _SNIPPETS_ #define _SNIPPETS_ #include <QMessageBox> #include <QObject> #include <Logger.h> #include <string.h> #include <stdint.h> #include <HBReflection.h> namespace Homer { namespace Gui { using namespace Homer::Base; /////////////////////////////////////////////////////////////////////////////// #define HttpDownload(pNetworkManager, pUrl, pReplyHandler) { \ LOG_REMOTE(LOG_VERBOSE, std::string(GetObjectNameStr(this).c_str()), __LINE__, "HTTP download of: %s", pUrl.toStdString().c_str()); \ connect(pNetworkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(pReplyHandler(QNetworkReply*))); \ QNetworkRequest tHttpRequest = QNetworkRequest(QUrl(pUrl)); \ tHttpRequest.setRawHeader("User-Agent", "Homer Conferencing/"HOMER_VERSION); \ pNetworkManager->get(tHttpRequest); \ } #define ShowMessage(pTitle, pMessage) DoShowMessage(GetObjectNameStr(this).c_str(), __LINE__, this, pTitle, pMessage) inline void DoShowMessage(std::string pSource, int pLine, QWidget *pParent, QString pTitle, QString pMessage) { LOG_REMOTE(LOG_INFO, pSource, pLine, pMessage.toStdString().c_str()); QMessageBox *tMb = new QMessageBox(QMessageBox::NoIcon, pTitle, pMessage, QMessageBox::Close, pParent); tMb->setStyleSheet(""); tMb->exec(); delete tMb; } #define ShowInfo(pTitle, pMessage) DoShowInfo(GetObjectNameStr(this).c_str(), __LINE__, this, pTitle, pMessage) inline void DoShowInfo(std::string pSource, int pLine, QWidget *pParent, QString pTitle, QString pMessage) { LOG_REMOTE(LOG_INFO, pSource, pLine, pMessage.toStdString().c_str()); QMessageBox *tMb = new QMessageBox(QMessageBox::Information, pTitle, pMessage, QMessageBox::Close, pParent); tMb->setStyleSheet(""); tMb->exec(); delete tMb; } #define ShowWarning(pTitle, pMessage) DoShowWarning(GetObjectNameStr(this).c_str(), __LINE__, this, pTitle, pMessage) inline void DoShowWarning(std::string pSource, int pLine, QWidget *pParent, QString pTitle, QString pMessage) { LOG_REMOTE(LOG_WARN, pSource, pLine, pMessage.toStdString().c_str()); QMessageBox *tMb = new QMessageBox(QMessageBox::Warning, pTitle, pMessage, QMessageBox::Close, pParent); tMb->setStyleSheet(""); tMb->exec(); delete tMb; } #define ShowError(pTitle, pMessage) DoShowError(GetObjectNameStr(this).c_str(), __LINE__, this, pTitle, pMessage) inline void DoShowError(std::string pSource, int pLine, QWidget *pParent, QString pTitle, QString pMessage) { LOG_REMOTE(LOG_ERROR, pSource, pLine, pMessage.toStdString().c_str()); QMessageBox *tMb = new QMessageBox(QMessageBox::Critical, pTitle, pMessage, QMessageBox::Close, pParent); tMb->setStyleSheet(""); tMb->exec(); delete tMb; } inline QString Int2ByteExpression(int64_t pSize) { QString tResult = ""; do{ int64_t tRest = pSize % 1000; pSize /= 1000; if (pSize) { tResult = "." + QString("%1").arg(tRest, 3, 10, (QLatin1Char)'0') + tResult; }else tResult = QString("%1").arg(tRest) + tResult; }while(pSize); return tResult; } /////////////////////////////////////////////////////////////////////////////// }} #endif
/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Default visibility */ #define DEFAULT_VISIBILITY __attribute__((visibility("default"))) /* Start with debug message logging enabled */ /* #undef ENABLE_DEBUG_LOGGING */ /* Message logging */ #define ENABLE_LOGGING 1 /* Define to 1 if you have the <asm/types.h> header file. */ /* #undef HAVE_ASM_TYPES_H */ /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `udev' library (-ludev). */ #define HAVE_LIBUDEV 1 /* Define to 1 if you have the <libudev.h> header file. */ #define HAVE_LIBUDEV_H 1 /* Define to 1 if you have the <linux/filter.h> header file. */ /* #undef HAVE_LINUX_FILTER_H */ /* Define to 1 if you have the <linux/netlink.h> header file. */ /* #undef HAVE_LINUX_NETLINK_H */ /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the <poll.h> header file. */ #define HAVE_POLL_H 1 /* Define to 1 if you have the <signal.h> header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if the system has the type `struct timespec'. */ #define HAVE_STRUCT_TIMESPEC 1 /* syslog() function available */ #define HAVE_SYSLOG_FUNC 1 /* Define to 1 if you have the <syslog.h> header file. */ #define HAVE_SYSLOG_H 1 /* Define to 1 if you have the <sys/socket.h> header file. */ /* #undef HAVE_SYS_SOCKET_H */ /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if your C compiler doesn't accept -c and -o together. */ /* #undef NO_MINUS_C_MINUS_O */ /* Darwin backend */ /* #undef OS_DARWIN */ /* Linux backend */ #define OS_LINUX 1 /* NetBSD backend */ /* #undef OS_NETBSD */ /* OpenBSD backend */ /* #undef OS_OPENBSD */ /* Windows backend */ /* #undef OS_WINDOWS */ /* Name of package */ #define PACKAGE "libusbx" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "libusbx-devel@lists.sourceforge.net" /* Define to the full name of this package. */ #define PACKAGE_NAME "libusbx" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "libusbx 1.0.17" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libusbx" /* Define to the home page for this package. */ #define PACKAGE_URL "http://libusbx.org" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.0.17" /* type of second poll() argument */ #define POLL_NFDS_TYPE nfds_t /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Use POSIX Threads */ #define THREADS_POSIX 1 /* timerfd headers available */ #define USBI_TIMERFD_AVAILABLE 1 /* Enable output to system log */ /* #undef USE_SYSTEM_LOGGING_FACILITY */ /* Use udev for device enumeration/hotplug */ #define USE_UDEV 1 /* Version number of package */ #define VERSION "1.0.17" /* Use GNU extensions */ #define _GNU_SOURCE 1 /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif
/** * @file yahoochat.h The Yahoo! protocol plugin, chat and conference stuff * * purple * * Purple 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 02111-1301 USA */ #ifndef _YAHOOCHAT_H_ #define _YAHOOCHAT_H_ #include "roomlist.h" #include "yahoo_packet.h" void yahoo_process_conference_invite(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_conference_decline(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_conference_logon(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_conference_logoff(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_conference_message(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_chat_online(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_chat_logout(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_chat_join(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_chat_exit(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_chat_message(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_chat_addinvite(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_process_chat_goto(PurpleConnection *gc, struct yahoo_packet *pkt); void yahoo_c_leave(PurpleConnection *gc, int id); int yahoo_c_send(PurpleConnection *gc, int id, PurpleMessage *msg); GList *yahoo_c_info(PurpleConnection *gc); GHashTable *yahoo_c_info_defaults(PurpleConnection *gc, const char *chat_name); void yahoo_c_join(PurpleConnection *gc, GHashTable *data); char *yahoo_get_chat_name(GHashTable *data); void yahoo_c_invite(PurpleConnection *gc, int id, const char *msg, const char *name); void yahoo_conf_leave(YahooData *yd, const char *room, const char *dn, GList *who); void yahoo_chat_goto(PurpleConnection *gc, const char *name); /* room listing functions */ PurpleRoomlist *yahoo_roomlist_get_list(PurpleConnection *gc); void yahoo_roomlist_cancel(PurpleRoomlist *list); void yahoo_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category); /* util */ void yahoo_chat_add_users(PurpleChatConversation *chat, GList *newusers); void yahoo_chat_add_user(PurpleChatConversation *chat, const char *user, const char *reason); #endif /* _YAHOO_CHAT_H_ */
/* * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ #include "linux/slab.h" #include "linux/smp_lock.h" #include "linux/ptrace.h" #include "asm/ptrace.h" #include "asm/pgtable.h" #include "asm/tlbflush.h" #include "asm/uaccess.h" #include "user_util.h" #include "kern_util.h" #include "mem_user.h" #include "kern.h" #include "irq_user.h" #include "tlb.h" #include "os.h" #include "choose-mode.h" #include "mode_kern.h" void flush_thread(void) { arch_flush_thread(&current->thread.arch); CHOOSE_MODE(flush_thread_tt(), flush_thread_skas()); } void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) { CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp); } static long execve1(char *file, char __user * __user *argv, char __user *__user *env) { long error; #ifdef CONFIG_TTY_LOG log_exec(argv, current->tty); #endif error = do_execve(file, argv, env, &current->thread.regs); if (error == 0){ task_lock(current); current->ptrace &= ~PT_DTRACE; task_unlock(current); set_cmdline(current_cmd()); } return(error); } long um_execve(char *file, char __user *__user *argv, char __user *__user *env) { long err; err = execve1(file, argv, env); if(!err) do_longjmp(current->thread.exec_buf, 1); return(err); } long sys_execve(char __user *file, char __user *__user *argv, char __user *__user *env) { long error; char *filename; lock_kernel(); filename = getname(file); error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; error = execve1(filename, argv, env); putname(filename); out: unlock_kernel(); return(error); }
/***************************************************************************** * * XVID MPEG-4 VIDEO CODEC * - Motion module header - * * Copyright(C) 2002-2003 Radoslaw Czyz <xvid@syskin.cjb.net> * 2002 Michael Militzer <michael@xvid.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 * * $Id: motion.h 1988 2011-05-18 09:10:05Z Isibaar $ * ***************************************************************************/ #ifndef _MOTION_H_ #define _MOTION_H_ #include "../portab.h" #include "../global.h" /***************************************************************************** * Modified rounding tables -- defined in estimation_common.c * Original tables see ISO spec tables 7-6 -> 7-9 ****************************************************************************/ extern const uint32_t roundtab[16]; /* K = 4 */ extern const uint32_t roundtab_76[16]; /* K = 2 */ extern const uint32_t roundtab_78[8]; /* K = 1 */ extern const uint32_t roundtab_79[4]; /** MotionEstimation **/ void MotionEstimation(MBParam * const pParam, FRAMEINFO * const current, FRAMEINFO * const reference, const IMAGE * const pRefH, const IMAGE * const pRefV, const IMAGE * const pRefHV, const IMAGE * const pGMC, const uint32_t iLimit, const int num_slices); void MotionEstimationBVOP(MBParam * const pParam, FRAMEINFO * const frame, const int32_t time_bp, const int32_t time_pp, const MACROBLOCK * const f_mbs, const IMAGE * const f_ref, const IMAGE * const f_refH, const IMAGE * const f_refV, const IMAGE * const f_refHV, const FRAMEINFO * const b_reference, const IMAGE * const b_ref, const IMAGE * const b_refH, const IMAGE * const b_refV, const IMAGE * const b_refHV, const int num_slices); void GMEanalysis(const MBParam * const pParam, const FRAMEINFO * const current, const FRAMEINFO * const reference, const IMAGE * const pRefH, const IMAGE * const pRefV, const IMAGE * const pRefHV, const int num_slices); WARPPOINTS GlobalMotionEst(MACROBLOCK * const pMBs, const MBParam * const pParam, const FRAMEINFO * const current, const FRAMEINFO * const reference, const IMAGE * const pRefH, const IMAGE * const pRefV, const IMAGE * const pRefHV, const int num_slices); int GlobalMotionEstRefine( WARPPOINTS *const startwp, MACROBLOCK * const pMBs, const MBParam * const pParam, const FRAMEINFO * const current, const FRAMEINFO * const reference, const IMAGE * const pCurr, const IMAGE * const pRef, const IMAGE * const pRefH, const IMAGE * const pRefV, const IMAGE * const pRefHV); int globalSAD(const WARPPOINTS *const wp, const MBParam * const pParam, const MACROBLOCK * const pMBs, const FRAMEINFO * const current, const IMAGE * const pRef, const IMAGE * const pCurr, uint8_t *const GMCblock); int MEanalysis( const IMAGE * const pRef, const FRAMEINFO * const Current, const MBParam * const pParam, const int maxIntra, const int intraCount, const int bCount, const int b_thresh, const MACROBLOCK * const prev_mbs); /** MotionCompensation **/ void MBMotionCompensation(MACROBLOCK * const mb, const uint32_t i, const uint32_t j, const IMAGE * const ref, const IMAGE * const refh, const IMAGE * const refv, const IMAGE * const refhv, const IMAGE * const refGMC, IMAGE * const cur, int16_t * dct_codes, const uint32_t width, const uint32_t height, const uint32_t edged_width, const int32_t quarterpel, const int32_t rounding, uint8_t * const tmp); void MBMotionCompensationBVOP(MBParam * pParam, MACROBLOCK * const mb, const uint32_t i, const uint32_t j, IMAGE * const cur, const IMAGE * const f_ref, const IMAGE * const f_refh, const IMAGE * const f_refv, const IMAGE * const f_refhv, const IMAGE * const b_ref, const IMAGE * const b_refh, const IMAGE * const b_refv, const IMAGE * const b_refhv, int16_t * dct_codes, uint8_t * const tmp); #endif /* _MOTION_H_ */
/**************************************************************************** ** ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. ** ** This file is part of an example program for Qt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ #ifndef FontDisplayer_H #define FontDisplayer_H #include <qframe.h> #include <qmainwindow.h> class QSlider; class FontRowTable : public QFrame { Q_OBJECT public: FontRowTable( QWidget* parent=0, const char* name=0 ); QSize sizeHint() const; signals: void fontInformation(const QString&); public slots: void setRow(int); void chooseFont(); protected: QSize cellSize() const; void paintEvent( QPaintEvent* ); private: QFont tablefont; int row; }; class FontDisplayer : public QMainWindow { Q_OBJECT public: FontDisplayer( QWidget* parent=0, const char* name=0 ); }; #endif
/* * Testing UART. */ #include <runtime/lib.h> #include <kernel/uos.h> #include <uart/uart.h> ARRAY (task, 200); uart_t uart; void hello (void *data) { for (;;) { puts (&uart, "\nHello, World! "); getchar (&uart); } } void uos_init (void) { /*UBRR = ((int) (KHZ * 1000L / 9600) + 8) / 16 - 1;*/ uart_init (&uart, 0, 90, KHZ, 9600); task_create (hello, 0, "hello", 1, task, sizeof (task)); }
/* Test iscanonical and canonicalizel for ldbl-96. Copyright (C) 2016-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <float.h> #include <math.h> #include <math_ldbl.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> struct test { bool sign; uint16_t exponent; bool high; uint64_t mantissa; bool canonical; }; #define M68K_VARIANT (LDBL_MIN_EXP == -16382) static const struct test tests[] = { { false, 0, true, 0, M68K_VARIANT }, { true, 0, true, 0, M68K_VARIANT }, { false, 0, true, 1, M68K_VARIANT }, { true, 0, true, 1, M68K_VARIANT }, { false, 0, true, 0x100000000ULL, M68K_VARIANT }, { true, 0, true, 0x100000000ULL, M68K_VARIANT }, { false, 0, false, 0, true }, { true, 0, false, 0, true }, { false, 0, false, 1, true }, { true, 0, false, 1, true }, { false, 0, false, 0x100000000ULL, true }, { true, 0, false, 0x100000000ULL, true }, { false, 1, true, 0, true }, { true, 1, true, 0, true }, { false, 1, true, 1, true }, { true, 1, true, 1, true }, { false, 1, true, 0x100000000ULL, true }, { true, 1, true, 0x100000000ULL, true }, { false, 1, false, 0, false }, { true, 1, false, 0, false }, { false, 1, false, 1, false }, { true, 1, false, 1, false }, { false, 1, false, 0x100000000ULL, false }, { true, 1, false, 0x100000000ULL, false }, { false, 0x7ffe, true, 0, true }, { true, 0x7ffe, true, 0, true }, { false, 0x7ffe, true, 1, true }, { true, 0x7ffe, true, 1, true }, { false, 0x7ffe, true, 0x100000000ULL, true }, { true, 0x7ffe, true, 0x100000000ULL, true }, { false, 0x7ffe, false, 0, false }, { true, 0x7ffe, false, 0, false }, { false, 0x7ffe, false, 1, false }, { true, 0x7ffe, false, 1, false }, { false, 0x7ffe, false, 0x100000000ULL, false }, { true, 0x7ffe, false, 0x100000000ULL, false }, { false, 0x7fff, true, 0, true }, { true, 0x7fff, true, 0, true }, { false, 0x7fff, true, 1, true }, { true, 0x7fff, true, 1, true }, { false, 0x7fff, true, 0x100000000ULL, true }, { true, 0x7fff, true, 0x100000000ULL, true }, { false, 0x7fff, false, 0, M68K_VARIANT }, { true, 0x7fff, false, 0, M68K_VARIANT }, { false, 0x7fff, false, 1, M68K_VARIANT }, { true, 0x7fff, false, 1, M68K_VARIANT }, { false, 0x7fff, false, 0x100000000ULL, M68K_VARIANT }, { true, 0x7fff, false, 0x100000000ULL, M68K_VARIANT }, }; static int do_test (void) { int result = 0; for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { long double ld; SET_LDOUBLE_WORDS (ld, tests[i].exponent | (tests[i].sign << 15), (tests[i].mantissa >> 32) | (tests[i].high << 31), tests[i].mantissa & 0xffffffffULL); bool canonical = iscanonical (ld); if (canonical == tests[i].canonical) { printf ("PASS: iscanonical test %zu\n", i); long double ldc = 12345.0L; bool canonicalize_ret = canonicalizel (&ldc, &ld); if (canonicalize_ret == !canonical) { printf ("PASS: canonicalizel test %zu\n", i); bool canon_ok; if (!canonical) canon_ok = ldc == 12345.0L; else if (isnan (ld)) canon_ok = isnan (ldc) && !issignaling (ldc); else canon_ok = ldc == ld; if (canon_ok) printf ("PASS: canonicalized value test %zu\n", i); else { printf ("FAIL: canonicalized value test %zu\n", i); result = 1; } } else { printf ("FAIL: canonicalizel test %zu\n", i); result = 1; } } else { printf ("FAIL: iscanonical test %zu\n", i); result = 1; } } return result; } #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
/** ***************************************************************************** ** ** File : syscalls.c ** ** Author : Auto-generated by STM32CubeIDE ** ** Abstract : STM32CubeIDE Minimal System calls file ** ** For more information about which c-functions ** need which of these lowlevel functions ** please consult the Newlib libc-manual ** ** Environment : STM32CubeIDE MCU ** ** Distribution: The file is distributed as is, without any warranty ** of any kind. ** ***************************************************************************** ** ** <h2><center>&copy; COPYRIGHT(c) 2018 STMicroelectronics</center></h2> ** ** Redistribution and use in source and binary forms, with or without modification, ** are permitted provided that the following conditions are met: ** 1. Redistributions of source code must retain the above copyright notice, ** this list of conditions and the following disclaimer. ** 2. Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. ** 3. Neither the name of STMicroelectronics nor the names of its contributors ** may be used to endorse or promote products derived from this software ** without specific prior written permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** ** ***************************************************************************** */ /* Includes */ #include <sys/stat.h> #include <stdlib.h> #include <errno.h> #include <stdio.h> #include <signal.h> #include <time.h> #include <sys/time.h> #include <sys/times.h> /* Variables */ //#undef errno extern int errno; extern int __io_putchar(int ch) __attribute__((weak)); extern int __io_getchar(void) __attribute__((weak)); register char * stack_ptr asm("sp"); char *__env[1] = { 0 }; char **environ = __env; /* Functions */ void initialise_monitor_handles() { } int _getpid(void) { return 1; } int _kill(int pid, int sig) { errno = EINVAL; return -1; } void _exit (int status) { _kill(status, -1); while (1) {} /* Make sure we hang here */ } __attribute__((weak)) int _read(int file, char *ptr, int len) { int DataIdx; for (DataIdx = 0; DataIdx < len; DataIdx++) { *ptr++ = __io_getchar(); } return len; } __attribute__((weak)) int _write(int file, char *ptr, int len) { int DataIdx; for (DataIdx = 0; DataIdx < len; DataIdx++) { __io_putchar(*ptr++); } return len; } int _close(int file) { return -1; } int _fstat(int file, struct stat *st) { st->st_mode = S_IFCHR; return 0; } int _isatty(int file) { return 1; } int _lseek(int file, int ptr, int dir) { return 0; } int _open(char *path, int flags, ...) { /* Pretend like we always fail */ return -1; } int _wait(int *status) { errno = ECHILD; return -1; } int _unlink(char *name) { errno = ENOENT; return -1; } int _times(struct tms *buf) { return -1; } int _stat(char *file, struct stat *st) { st->st_mode = S_IFCHR; return 0; } int _link(char *old, char *new) { errno = EMLINK; return -1; } int _fork(void) { errno = EAGAIN; return -1; } int _execve(char *name, char **argv, char **env) { errno = ENOMEM; return -1; }
/* SynS_ron.c modified from synchan.c */ static char rcsid[] = "$Id: SynS.c,v 1.1 2006/01/09 16:35:29 svitak Exp $"; #define VOLTAGE 0 #include <math.h> #include "SynGS_ext.h" static int DEBUG_Synchan = 0; static double savedata[2]; /* * This object calculates the voltage dependent modulation of spike mediated * transmission in the leech HN cells. Therefore, it needs the presynaptic * membrane potential. */ int SynS_f(channel,action) register struct SynS_type *channel; Action *action; { double dt; int has_state; MsgIn *spikemsg; MsgIn *msg; double V, modinf; double modtau =0.2; int n; if(Debug(DEBUG_Synchan) > 1){ ActionHeader("SynS",channel,action); } SELECT_ACTION(action){ case INIT: break; case PROCESS: MSGLOOP(channel,msg) { case VOLTAGE: /* membrane potential */ V = MSGVALUE(msg,0); break; } dt = Clockrate(channel); /* Sec */ /* update modulation factor using exponetial euler * */ modinf = channel->A+channel->B/(1+exp(channel->C*(V+channel->D))); /* e.g. modinf = 0.1+0.9/(1+exp(-1000*(V+0.040))); */ modtau = channel->E; /* exponetial euler */ channel->m_SynS=(channel->m_SynS)*exp(-dt/modtau)+ \ modinf*(1.0-exp(-dt/modtau)) ; /*printf ("Voltage %f dt %f m_SynS %f \n", V, dt, channel->m_SynS);*/ break; case CHECK: has_state = 0; MSGLOOP(channel,msg) { case VOLTAGE: has_state = 1; break; } if (has_state == 0) ErrorMessage("SynS","No membrane potential.", channel); break; /* CHECK */ case RESET: channel->m_SynS = 0; break; case SAVE2: savedata[0]=(double)(channel->m_SynS); n=1; fwrite(&n,sizeof(int),1,(FILE*)action->data); fwrite(savedata,sizeof(double),1,(FILE*)action->data); break; case RESTORE2: fread(&n,sizeof(int),1,(FILE*)action->data); if (n != 1) { ErrorMessage("SynS_ron","Invalid savedata length",channel); return(n); } fread(savedata,sizeof(double),1,(FILE*)action->data); channel->m_SynS =(float)savedata[0]; break; } return(0); }
#define CONFIG_GENERIC_CALIBRATE_DELAY 1
/* POSIX compatible FILE stream write function. Copyright (C) 2008-2010 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2008. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> /* Specification. */ #include <stdio.h> /* Replace these functions only if module 'sigpipe' is requested. */ #if GNULIB_SIGPIPE /* On native Windows platforms, SIGPIPE does not exist. When write() is called on a pipe with no readers, WriteFile() fails with error GetLastError() = ERROR_NO_DATA, and write() in consequence fails with error EINVAL. This write() function is at the basis of the function which flushes the buffer of a FILE stream. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ # include <errno.h> # include <signal.h> # include <io.h> # define WIN32_LEAN_AND_MEAN /* avoid including junk */ # include <windows.h> # define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \ if (ferror (stream)) \ return (EXPRESSION); \ else \ { \ RETTYPE ret; \ SetLastError (0); \ ret = (EXPRESSION); \ if (FAILED && GetLastError () == ERROR_NO_DATA && ferror (stream)) \ { \ int fd = fileno (stream); \ if (fd >= 0 \ && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\ { \ /* Try to raise signal SIGPIPE. */ \ raise (SIGPIPE); \ /* If it is currently blocked or ignored, change errno from \ EINVAL to EPIPE. */ \ errno = EPIPE; \ } \ } \ return ret; \ } # if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */ int printf (const char *format, ...) { int retval; va_list args; va_start (args, format); retval = vfprintf (stdout, format, args); va_end (args); return retval; } # endif # if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */ int fprintf (FILE *stream, const char *format, ...) { int retval; va_list args; va_start (args, format); retval = vfprintf (stream, format, args); va_end (args); return retval; } # endif # if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */ int vprintf (const char *format, va_list args) { return vfprintf (stdout, format, args); } # endif # if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */ int vfprintf (FILE *stream, const char *format, va_list args) #undef vfprintf { CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF) } # endif int putchar (int c) { return fputc (c, stdout); } int fputc (int c, FILE *stream) #undef fputc { CALL_WITH_SIGPIPE_EMULATION (int, fputc (c, stream), ret == EOF) } int fputs (const char *string, FILE *stream) #undef fputs { CALL_WITH_SIGPIPE_EMULATION (int, fputs (string, stream), ret == EOF) } int puts (const char *string) #undef puts { FILE *stream = stdout; CALL_WITH_SIGPIPE_EMULATION (int, puts (string), ret == EOF) } size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream) #undef fwrite { CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n) } # endif #endif
/* { dg-do run } */ #include <stdio.h> #include "init13.h" #include "dump.h" int main (void) { struct R1 Local_R1; struct R2 Local_R2; Local_R1.F = My_R1.F + (1.0f + 1.0f * I); put ("Local_R1 :"); dump (&Local_R1, sizeof (struct R1)); new_line (); /* { dg-output "Local_R1 : ee 87 84 40 db 0f 09 c0.*\n" } */ Local_R2.F = My_R2.F + (1.0f + 1.0f * I); put ("Local_R2 :"); dump (&Local_R2, sizeof (struct R2)); new_line (); /* { dg-output "Local_R2 : 40 84 87 ee c0 09 0f db.*\n" } */ Local_R1.F = Pi - Pi * I; put ("Local_R1 :"); dump (&Local_R1, sizeof (struct R1)); new_line (); /* { dg-output "Local_R1 : db 0f 49 40 db 0f 49 c0.*\n" } */ Local_R2.F = Pi - Pi * I; put ("Local_R2 :"); dump (&Local_R2, sizeof (struct R2)); new_line (); /* { dg-output "Local_R2 : 40 49 0f db c0 49 0f db.*\n" } */ Local_R1.F = Local_R1.F + (1.0f + 1.0f * I); put ("Local_R1 :"); dump (&Local_R1, sizeof (struct R1)); new_line (); /* { dg-output "Local_R1 : ee 87 84 40 db 0f 09 c0.*\n" } */ Local_R2.F = Local_R2.F + (1.0f + 1.0f * I); put ("Local_R2 :"); dump (&Local_R2, sizeof (struct R2)); new_line (); /* { dg-output "Local_R2 : 40 84 87 ee c0 09 0f db.*\n" } */ return 0; }
/* arch/arm64/include/asm/crash_notes.h * * 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; either version 2 * of the License, or (at your option) any later version. */ /* * Copyright (C) 2015 Sony Mobile Communications Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. */ #ifndef __ARM64_CRASH_NOTES_H #define __ARM64_CRASH_NOTES_H #include <asm/ptrace.h> #define PSTATE_NZCV_MASK (PSR_N_BIT | PSR_Z_BIT | PSR_C_BIT | PSR_V_BIT) #define PSTATE_DAIF_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT) static inline void crash_notes_save_regs(struct pt_regs *regs) { struct pstate { u64 nzcv; u64 daif; u64 current_el; u64 sp_sel; } pstate; /* 31 General purpose registers x0-x30 */ __asm__ __volatile__("str x0, %0" : "=m"(regs->regs[0])); __asm__ __volatile__("str x1, %0" : "=m"(regs->regs[1])); __asm__ __volatile__("str x2, %0" : "=m"(regs->regs[2])); __asm__ __volatile__("str x3, %0" : "=m"(regs->regs[3])); __asm__ __volatile__("str x4, %0" : "=m"(regs->regs[4])); __asm__ __volatile__("str x5, %0" : "=m"(regs->regs[5])); __asm__ __volatile__("str x6, %0" : "=m"(regs->regs[6])); __asm__ __volatile__("str x7, %0" : "=m"(regs->regs[7])); __asm__ __volatile__("str x8, %0" : "=m"(regs->regs[8])); __asm__ __volatile__("str x9, %0" : "=m"(regs->regs[9])); __asm__ __volatile__("str x10, %0" : "=m"(regs->regs[10])); __asm__ __volatile__("str x11, %0" : "=m"(regs->regs[11])); __asm__ __volatile__("str x12, %0" : "=m"(regs->regs[12])); __asm__ __volatile__("str x13, %0" : "=m"(regs->regs[13])); __asm__ __volatile__("str x14, %0" : "=m"(regs->regs[14])); __asm__ __volatile__("str x15, %0" : "=m"(regs->regs[15])); __asm__ __volatile__("str x16, %0" : "=m"(regs->regs[16])); __asm__ __volatile__("str x17, %0" : "=m"(regs->regs[17])); __asm__ __volatile__("str x18, %0" : "=m"(regs->regs[18])); __asm__ __volatile__("str x19, %0" : "=m"(regs->regs[19])); __asm__ __volatile__("str x20, %0" : "=m"(regs->regs[20])); __asm__ __volatile__("str x21, %0" : "=m"(regs->regs[21])); __asm__ __volatile__("str x22, %0" : "=m"(regs->regs[22])); __asm__ __volatile__("str x23, %0" : "=m"(regs->regs[23])); __asm__ __volatile__("str x24, %0" : "=m"(regs->regs[24])); __asm__ __volatile__("str x25, %0" : "=m"(regs->regs[25])); __asm__ __volatile__("str x26, %0" : "=m"(regs->regs[26])); __asm__ __volatile__("str x27, %0" : "=m"(regs->regs[27])); __asm__ __volatile__("str x28, %0" : "=m"(regs->regs[28])); __asm__ __volatile__("str x29, %0" : "=m"(regs->regs[29])); __asm__ __volatile__("str x30, %0" : "=m"(regs->regs[30])); /* Save program counter & stack pointer here */ __asm__ __volatile__( "mov %[_ARM_sp], sp\n\t" "adr %[_ARM_pc], 1f\n\t" "1:" : [_ARM_pc] "=r" (regs->pc), [_ARM_sp] "=r" (regs->sp) ); /* Obtain pstate through system registers */ __asm__ __volatile__("mrs %0, nzcv" : "=&r"(pstate.nzcv)); __asm__ __volatile__("mrs %0, daif" : "=&r"(pstate.daif)); __asm__ __volatile__("mrs %0, currentel" : "=&r"(pstate.current_el)); __asm__ __volatile__("mrs %0, spsel" : "=&r"(pstate.sp_sel)); regs->pstate = pstate.nzcv & PSTATE_NZCV_MASK; regs->pstate |= pstate.daif & PSTATE_DAIF_MASK; regs->pstate |= pstate.current_el & PSR_MODE_MASK; regs->pstate |= pstate.sp_sel & 1; } #endif
#ifndef DEF_RECENTITEMTYPES #define DEF_RECENTITEMTYPES #define REIT_CONTACT "contact" #define REIT_CONFERENCE "conference" #define REIT_METACONTACT "metacontact" #endif // DEF_RECENTITEMTYPES
/* * SmartDec decompiler - SmartDec is a native code to C/C++ decompiler * Copyright (C) 2015 Alexander Chernov, Katerina Troshina, Yegor Derevenets, * Alexander Fokin, Sergey Levin, Leonid Tsvetkov * * This file is part of SmartDec decompiler. * * SmartDec decompiler 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. * * SmartDec decompiler 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 SmartDec decompiler. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <nc/config.h> #include "Statement.h" #include <memory> /* unique_ptr */ namespace nc { namespace core { namespace likec { /** * While loop. */ class While: public Statement { std::unique_ptr<Expression> condition_; ///< Loop condition. std::unique_ptr<Statement> body_; ///< Loop body. public: /** * Class constructor. * * \param[in] tree Owning tree. * \param[in] condition Valid pointer to the loop condition. * \param[in] body Valid pointer to the loop body. */ While(Tree &tree, std::unique_ptr<Expression> condition, std::unique_ptr<Statement> body): Statement(tree, WHILE), condition_(std::move(condition)), body_(std::move(body)) {} /** * \return Loop condition. */ Expression *condition() { return condition_.get(); } /** * \return Loop condition. */ const Expression *condition() const { return condition_.get(); } /** * \return Loop body. */ Statement *body() { return body_.get(); } /** * \return Loop body. */ const Statement *body() const { return body_.get(); } virtual void visitChildNodes(Visitor<TreeNode> &visitor) override; virtual While *rewrite() override; protected: virtual void doPrint(PrintContext &context) const override; }; } // namespace likec } // namespace core } // namespace nc NC_REGISTER_CLASS_KIND(nc::core::likec::Statement, nc::core::likec::While, nc::core::likec::Statement::WHILE) /* vim:set et sts=4 sw=4: */
/* -*- c++ -*- */ /* * Copyright 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_GR_PFB_CLOCK_SYNC_FFF_H #define INCLUDED_GR_PFB_CLOCK_SYNC_FFF_H #include <gr_block.h> class gr_pfb_clock_sync_fff; typedef boost::shared_ptr<gr_pfb_clock_sync_fff> gr_pfb_clock_sync_fff_sptr; gr_pfb_clock_sync_fff_sptr gr_make_pfb_clock_sync_fff (double sps, float gain, const std::vector<float> &taps, unsigned int filter_size=32, float init_phase=0, float max_rate_deviation=1.5); class gr_fir_fff; /*! * \class gr_pfb_clock_sync_fff * * \brief Timing synchronizer using polyphase filterbanks * * \ingroup filter_blk * */ class gr_pfb_clock_sync_fff : public gr_block { private: /*! * Build the polyphase filterbank timing synchronizer. */ friend gr_pfb_clock_sync_fff_sptr gr_make_pfb_clock_sync_fff (double sps, float gain, const std::vector<float> &taps, unsigned int filter_size, float init_phase, float max_rate_deviation); bool d_updated; double d_sps; double d_sample_num; float d_alpha; float d_beta; int d_nfilters; std::vector<gr_fir_fff*> d_filters; std::vector<gr_fir_fff*> d_diff_filters; std::vector< std::vector<float> > d_taps; std::vector< std::vector<float> > d_dtaps; float d_k; float d_rate; float d_rate_i; float d_rate_f; float d_max_dev; int d_filtnum; int d_taps_per_filter; /*! * Build the polyphase filterbank timing synchronizer. */ gr_pfb_clock_sync_fff (double sps, float gain, const std::vector<float> &taps, unsigned int filter_size, float init_phase, float max_rate_deviation); void create_diff_taps(const std::vector<float> &newtaps, std::vector<float> &difftaps); public: ~gr_pfb_clock_sync_fff (); /*! * Resets the filterbank's filter taps with the new prototype filter */ void set_taps (const std::vector<float> &taps, std::vector< std::vector<float> > &ourtaps, std::vector<gr_fir_fff*> &ourfilter); std::vector<float> channel_taps(int channel); std::vector<float> diff_channel_taps(int channel); /*! * Print all of the filterbank taps to screen. */ void print_taps(); void print_diff_taps(); void set_alpha(float alpha) { d_alpha = alpha; } void set_beta(float beta) { d_beta = beta; } void set_max_rate_deviation(float m) { d_max_dev = m; } bool check_topology(int ninputs, int noutputs); int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif
/** * This file is part of the "libstx" project * Copyright (c) 2015 Paul Asmuth, FnordCorp B.V. * * libstx is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License v3.0. You should have received a * copy of the GNU General Public License along with this program. If not, see * <http://www.gnu.org/licenses/>. */ #pragma once #include <stx/uri.h> #include <stx/io/file.h> #include <stx/http/httpmessage.h> #include "stx/http/httprequest.h" #include "stx/http/httpresponse.h" #include "stx/http/httpstats.h" #include "stx/http/httpconnectionpool.h" #include "stx/http/httpclient.h" namespace stx { namespace http { struct HTTPSSEEvent { String data; Option<String> name; }; class HTTPSSEParser { public: void onEvent(Function<void (const HTTPSSEEvent& ev)> fn); void parse(const char* data, size_t size); protected: void parseEvent(const char* data, size_t size); Buffer buf_; Function<void (const HTTPSSEEvent& ev)> on_event_; }; } }
/* Copyright 2005-2009 Last.fm Ltd. - Primarily authored by Max Howell, Jono Cole and Doug Mansell This file is part of the Last.fm Desktop Application Suite. lastfm-desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. lastfm-desktop 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 lastfm-desktop. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SCROB_SOCKET_H #define SCROB_SOCKET_H #include <lastfm/global.h> #include <lastfm/Track.h> #include <QLocalSocket> #include <QQueue> /** @author Christian Muehlhaeuser <chris@last.fm> * @contributor Erik Jaelevik <erik@last.fm> * @rewrite Max Howell <max@last.fm> */ class ScrobSocket : public QLocalSocket { Q_OBJECT public: ScrobSocket( const QString& clientId, QObject* parent = 0); ~ScrobSocket(); public slots: void start( const Track& ); void pause(); void resume(); void stop(); private slots: void transmit( const QString& data ); void onError( QLocalSocket::LocalSocketError ); void onReadyRead(); void onConnected(); void onDisconnected(); private: void doConnect(); Track m_track; QQueue<QString> m_msgQueue; bool m_bInConnect; QString m_clientId; }; #endif
/* SPDX-License-Identifier: GPL-3.0-or-later * Copyright © 2016-2018 The TokTok team. * Copyright © 2014 Tox project. */ /** * Implementation of the TCP relay server part of Tox. */ #ifndef C_TOXCORE_TOXCORE_TCP_SERVER_H #define C_TOXCORE_TOXCORE_TCP_SERVER_H #include "crypto_core.h" #include "onion.h" #define MAX_INCOMING_CONNECTIONS 256 #define TCP_MAX_BACKLOG MAX_INCOMING_CONNECTIONS #define ARRAY_ENTRY_SIZE 6 typedef enum TCP_Status { TCP_STATUS_NO_STATUS, TCP_STATUS_CONNECTED, TCP_STATUS_UNCONFIRMED, TCP_STATUS_CONFIRMED, } TCP_Status; typedef struct TCP_Server TCP_Server; non_null() const uint8_t *tcp_server_public_key(const TCP_Server *tcp_server); non_null() size_t tcp_server_listen_count(const TCP_Server *tcp_server); /** Create new TCP server instance. */ non_null(1, 4, 5) nullable(6) TCP_Server *new_TCP_server(const Logger *logger, bool ipv6_enabled, uint16_t num_sockets, const uint16_t *ports, const uint8_t *secret_key, Onion *onion); /** Run the TCP_server */ non_null() void do_TCP_server(TCP_Server *tcp_server, const Mono_Time *mono_time); /** Kill the TCP server */ non_null() void kill_TCP_server(TCP_Server *tcp_server); #endif
#ifndef ExampleWithVectorMemberOBJ_H #define ExampleWithVectorMemberOBJ_H // std includes #include <atomic> #include <iostream> // data model specific includes #include "podio/ObjBase.h" #include "ExampleWithVectorMemberData.h" #include <vector> // forward declarations class ExampleWithVectorMember; class ConstExampleWithVectorMember; class ExampleWithVectorMemberObj : public podio::ObjBase { public: /// constructor ExampleWithVectorMemberObj(); /// copy constructor (does a deep-copy of relation containers) ExampleWithVectorMemberObj(const ExampleWithVectorMemberObj&); /// constructor from ObjectID and ExampleWithVectorMemberData /// does not initialize the internal relation containers ExampleWithVectorMemberObj(const podio::ObjectID id, ExampleWithVectorMemberData data); virtual ~ExampleWithVectorMemberObj(); public: ExampleWithVectorMemberData data; std::vector<int>* m_count; }; #endif
/* Memory allocation aligned to system page boundaries. Copyright (C) 2005, 2008, 2010-2013 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/>. */ #ifndef _PAGEALIGN_ALLOC_H # define _PAGEALIGN_ALLOC_H # include <stddef.h> /* Allocate a block of memory of SIZE bytes, aligned on a system page boundary. If SIZE is not a multiple of the system page size, it will be rounded up to the next multiple. Return a pointer to the start of the memory block. Upon allocation failure, return NULL and set errno. */ extern void *pagealign_alloc (size_t size) # if __GNUC__ >= 3 __attribute__ ((__malloc__)) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) __attribute__ ((__alloc_size__ (1))) # endif # endif ; /* Like pagealign_alloc, except it exits the program if the allocation fails. */ extern void *pagealign_xalloc (size_t size) # if __GNUC__ >= 3 __attribute__ ((__malloc__)) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) __attribute__ ((__alloc_size__ (1))) # endif # endif ; /* Free a memory block. PTR must be a non-NULL pointer returned by pagealign_alloc or pagealign_xalloc. */ extern void pagealign_free (void *ptr); #endif /* _PAGEALIGN_ALLOC_H */
#ifndef LIBUSEFUL_EXPECT_H #define LIBUSEFUL_EXPECT_H #include "file.h" #define DIALOG_END 1 #define DIALOG_FAIL 2 #define DIALOG_OPTIONAL 4 typedef struct { int Flags; int Match; char *Expect; char *Reply; } TExpectDialog; #ifdef __cplusplus extern "C" { #endif int STREAMExpectAndReply(STREAM *S, char *Expect, char *Reply); int STREAMExpectSilence(STREAM *S, int wait); void ExpectDialogAdd(ListNode *Dialogs, char *Expect, char *Reply, int Flags); int STREAMExpectDialog(STREAM *S, ListNode *Dialogs); void ExpectDialogDestroy(void *Item); #ifdef __cplusplus } #endif #endif
/* * Copyright 2001-2008 Texas Instruments - http://www.ti.com/ * * 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. */ /* * ======== uuidutil.h ======== * DSP-BIOS Bridge driver support functions for TI OMAP processors. * Description: * This file contains the specification of UUID helper functions. * *! Revision History *! ================ *! 09-Nov-2000 kc: Modified description of UUID utility functions. *! 29-Sep-2000 kc: Appended "UUID_" prefix to UUID helper functions. *! 10-Aug-2000 kc: Created. *! */ #ifndef UUIDUTIL_ #define UUIDUTIL_ #ifdef __cplusplus extern "C" { #endif #define MAXUUIDLEN 37 /* * ======== UUID_UuidToString ======== * Purpose: * Converts a DSP_UUID to an ANSI string. * Parameters: * pUuid: Pointer to a DSP_UUID object. * pszUuid: Pointer to a buffer to receive a NULL-terminated UUID * string. * size: Maximum size of the pszUuid string. * Returns: * Requires: * pUuid & pszUuid are non-NULL values. * Ensures: * Lenghth of pszUuid is less than MAXUUIDLEN. * Details: * UUID string limit currently set at MAXUUIDLEN. */ VOID UUID_UuidToString(IN struct DSP_UUID * pUuid, OUT CHAR * pszUuid, INT size); /* * ======== UUID_UuidFromString ======== * Purpose: * Converts an ANSI string to a DSP_UUID. * Parameters: * pszUuid: Pointer to a string that represents a DSP_UUID object. * pUuid: Pointer to a DSP_UUID object. * Returns: * Requires: * pUuid & pszUuid are non-NULL values. * Ensures: * Details: * We assume the string representation of a UUID has the following format: * "12345678_1234_1234_1234_123456789abc". */ extern VOID UUID_UuidFromString(IN CHAR * pszUuid, OUT struct DSP_UUID * pUuid); #ifdef __cplusplus } #endif #endif /* UUIDUTIL_ */
/* * (C) 2003-2006 Gabest * (C) 2006-2014 see Authors.txt * * This file is part of MPC-HC. * * MPC-HC 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. * * MPC-HC 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/>. * */ #pragma once #include "WinHotkeyCtrl.h" #define LVN_DOLABELEDIT (LVN_FIRST+1) class CInPlaceWinHotkey : public CWinHotkeyCtrl { private: int m_iItem; int m_iSubItem; CString m_sInitText; BOOL m_bESC; // To indicate whether ESC key was pressed public: CInPlaceWinHotkey(int iItem, int iSubItem, CString sInitText); virtual ~CInPlaceWinHotkey(); protected: virtual BOOL PreTranslateMessage(MSG* pMsg); DECLARE_MESSAGE_MAP() public: afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnNcDestroy(); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); }; class CInPlaceEdit : public CEdit { protected: int m_iItem; int m_iSubItem; CString m_sInitText; BOOL m_bESC; // To indicate whether ESC key was pressed public: CInPlaceEdit(int iItem, int iSubItem, CString sInitText); virtual ~CInPlaceEdit(); protected: virtual BOOL PreTranslateMessage(MSG* pMsg); DECLARE_MESSAGE_MAP() public: afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnNcDestroy(); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); }; class CInPlaceFloatEdit : public CInPlaceEdit { public: CInPlaceFloatEdit(int iItem, int iSubItem, CString sInitText); virtual ~CInPlaceFloatEdit(); protected: DECLARE_MESSAGE_MAP() public: afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); }; class CInPlaceComboBox : public CComboBox { private: int m_iItem; int m_iSubItem; CAtlList<CString> m_lstItems; int m_nSel; BOOL m_bESC; // To indicate whether ESC key was pressed public: CInPlaceComboBox(int iItem, int iSubItem, CAtlList<CString>& plstItems, int nSel); virtual ~CInPlaceComboBox(); protected: virtual BOOL PreTranslateMessage(MSG* pMsg); DECLARE_MESSAGE_MAP() public: afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnNcDestroy(); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnCloseup(); }; class CInPlaceListBox : public CListBox { private: int m_iItem; int m_iSubItem; CAtlList<CString> m_lstItems; int m_nSel; BOOL m_bESC; // To indicate whether ESC key was pressed public: CInPlaceListBox(int iItem, int iSubItem, CAtlList<CString>& plstItems, int nSel); virtual ~CInPlaceListBox(); protected: virtual BOOL PreTranslateMessage(MSG* pMsg); DECLARE_MESSAGE_MAP() public: afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnNcDestroy(); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); }; // CPlayerListCtrl class CPlayerListCtrl : public CListCtrl { DECLARE_DYNAMIC(CPlayerListCtrl) private: int m_nItemClicked, m_nSubItemClicked; int m_tStartEditingDelay; UINT_PTR m_nTimerID; bool PrepareInPlaceControl(int nRow, int nCol, CRect& rect); public: CPlayerListCtrl(int tStartEditingDelay = 500); virtual ~CPlayerListCtrl(); int HitTestEx(const CPoint& point, int* col) const; CImageList* CreateDragImageEx(LPPOINT lpPoint); int GetBottomIndex() const; CWinHotkeyCtrl* ShowInPlaceWinHotkey(int nItem, int nCol); CEdit* ShowInPlaceEdit(int nItem, int nCol); CEdit* ShowInPlaceFloatEdit(int nItem, int nCol); CComboBox* ShowInPlaceComboBox(int nItem, int nCol, CAtlList<CString>& lstItems, int nSel, bool bShowDropDown = false); CListBox* ShowInPlaceListBox(int nItem, int nCol, CAtlList<CString>& lstItems, int nSel); bool m_fInPlaceDirty; protected: virtual void PreSubclassWindow(); virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const; DECLARE_MESSAGE_MAP() public: afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); afx_msg void OnLvnMarqueeBegin(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnLvnInsertitem(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnLvnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnEnChangeEdit1(); afx_msg void OnEnChangeWinHotkey1(); afx_msg void OnCbnDropdownCombo1(); afx_msg void OnCbnSelendokCombo1(); afx_msg void OnLbnSelChangeList1(); afx_msg BOOL OnHdnItemchanging(UINT id, NMHDR* pNMHDR, LRESULT* pResult); afx_msg BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnXButtonDown(UINT nFlags, UINT nButton, CPoint point); afx_msg void OnXButtonUp(UINT nFlags, UINT nButton, CPoint point); afx_msg void OnXButtonDblClk(UINT nFlags, UINT nButton, CPoint point); };
/* * Copyright (C) 2013 Samsung Electronics * * Configuration settings for the SAMSUNG SMDK5420 board. * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __CONFIG_SMDK5420_H #define __CONFIG_SMDK5420_H #include <configs/exynos5420-common.h> #include <configs/exynos5-dt-common.h> #include <configs/exynos5-common.h> #undef CONFIG_LCD #undef CONFIG_EXYNOS_FB #undef CONFIG_EXYNOS_DP #undef CONFIG_KEYBOARD #define CONFIG_BOARD_COMMON #define CONFIG_SMDK5420 /* which is in a SMDK5420 */ #define CONFIG_SYS_SDRAM_BASE 0x20000000 #define CONFIG_SYS_TEXT_BASE 0x23E00000 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_IRAM_TOP - 0x800) /* select serial console configuration */ #define CONFIG_SERIAL3 /* use SERIAL 3 */ #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" #define CONFIG_IDENT_STRING " for SMDK5420" #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" /* USB */ #define CONFIG_USB_XHCI_EXYNOS /* DRAM Memory Banks */ #define CONFIG_NR_DRAM_BANKS 7 #define SDRAM_BANK_SIZE (512UL << 20UL) /* 512 MB */ #endif /* __CONFIG_SMDK5420_H */
#include <stdio.h> #include <conio.h> #define MAX 10 int deque[MAX]; int left =-1 ; int right = -1 ; void inputdeque(void); void outputdeque(void); void insertleft(void); void insertright(void); void deleteleft(void); void deleteright(void); void display(void); int main( ) { int option; printf("\n *****MAIN MENU*****"); printf("\n 1.Input restricted deque"); printf("\n 2.Output restricted deque"); printf("\n Enter your option : "); scanf("%d",&option); switch (option) { case 1 : inputdeque(); break; case 2 : outputdeque(); break; } return 0; } void inputdeque( ) { int option; do { printf("\n\n INPUT RESTRICTED DEQUE"); printf("\n 1.Insert at right"); printf("\n 2.Delete from left"); printf("\n 3.Delete from right"); printf("\n 4.Display"); printf("\n 5.Quit"); printf("\n Enter your option : "); scanf("%d",&option); switch (option) { case 1 : insertright(); break; case 2 : deleteleft(); break; case 3 : deleteright(); break; case 4 : display(); break; } } while (option!=5); } void outputdeque( ) { int option; do { printf("\n\n OUTPUT RESTRICTED DEQUE"); printf("\n 1.Insert at right"); printf("\n 2.Insert at left"); printf("\n 3.Delete from left"); printf("\n 4.Display"); printf("\n 5.Quit"); printf("\n Enter your option : "); scanf("%d",&option); switch(option) { case 1 : insertright(); break; case 2 : insertleft(); break; case 3 : deleteleft(); break; case 4 : display(); break; } } while (option!=5); } void insertright( ) { int val; printf("\n Enter the value to be added:"); scanf("%d", &val); if ( (left == 0 && right == MAX-1 ) || (left == right+1) ) { printf("\n OVERFLOW"); return; } if (left == -1) // Queue is Empty Inititally { left = 0; right = 0; } else { if (right == MAX-1) //right is at last position of queue right = 0; else right = right+1; } deque[right] = val ; } void insertleft( ) { int val; printf("\n Enter the value to be added:"); scanf("%d", &val); if( (left ==0 && right == MAX-1) || (left == right+1) ) { printf("\n OVERFLOW"); return; } if (left == -1) //If queue is initially empty { left = 0; right = 0; } else { if(left == 0) left = MAX - 1 ; else left = left - 1 ; } deque[left] = val; } void deleteleft( ) { if ( left == -1 ) { printf("\n UNDERFLOW"); return ; } printf("\n The deleted element is : %d", deque[left]); if (left == right) /*Queue has only one element */ { left = -1 ; right = -1 ; } else { if ( left == MAX - 1 ) left = 0; else left = left+1; } } void deleteright() { if ( left == -1 ) { printf("\n UNDERFLOW"); return ; } printf("\n The element deleted is : %d", deque[right]); if (left == right) /*queue has only one element*/ { left = -1 ; right = -1 ; } else { if (right == 0) right = MAX - 1 ; else right = right - 1 ; } } void display( ) { int front = left, rear = right; if ( front == -1 ) { printf("\n QUEUE IS EMPTY"); return; } printf("\n The elements of the queue are : "); if (front <= rear ) { while (front <= rear) { printf("%d ",deque[front]); front++; } } else { while (front <= MAX - 1) { printf("%d ", deque[front]); front++; } front = 0; while (front <= rear) { printf("%d ",deque[front]); front++; } } printf("\n"); }
/* * Copyright (c) 2013 Qualcomm Atheros, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted (subject to the limitations in the * disclaimer below) 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 Qualcomm Atheros nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE * GRANTED BY THIS LICENSE. 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. */ /*************************************************************************/ /* Copyright (c) 2006 Atheros Communications, Inc., All Rights Reserved */ /* */ /* Module Name : sys_cfg.h */ /* */ /* Abstract */ /* This file contains definition of platform and sysmte config . */ /* */ /* NOTES */ /* None */ /* */ /*************************************************************************/ #ifndef _SYS_CFG_H_ #define _SYS_CFG_H_ /************************** FPGA version **************************/ #define MAGPIE_FPGA_RAM_256K 1 /************************** ROM DEFINE ***************************/ #if defined(_ROM_) #include "rom_cfg.h" #if MAGPIE_FPGA_RAM_256K == 1 #undef MAX_BUF_NUM #define MAX_BUF_NUM 100 #endif #elif defined(_RAM_) #include "rom_cfg.h" #include "magpie_mem.h" /************************* Resource DEFS ***********************/ #define MAX_DESC_NUM 100 #ifdef RX_SCATTER #define MAX_BUF_NUM 60 #else #define MAX_BUF_NUM 40 #endif #if MAGPIE_FPGA_RAM_256K == 1 #undef MAX_BUF_NUM #define MAX_BUF_NUM 100 #endif #undef SYSTEM_MODULE_DBG #define SYSTEM_MODULE_DBG 1 /************************* WLAN DEFS ***************************/ #define MAGPIE_ENABLE_WLAN 1 #define MAGPIE_ENABLE_PCIE 1 #define MAGPIE_ENABLE_WLAN_IN_TARGET 0 #define MAGPIE_ENABLE_WLAN_SELF_TX 0 #define MAGPIE_ENABLE_WLAN_RATE_CTRL 1 #define WLAN_MAX_RXBUF 15 #define WLAN_MAX_TXBUF 10 /****************************** WATCH DOG *******************************/ #define WDT_DEFAULT_TIMEOUT_VALUE 3*ONE_MSEC*1000 // Initial value is 3 seconds, firmware changes it to 65 milliseconds #endif #endif /* _SYS_CFG_H_ */
/* Copyright (C) 2001-2017 Peter Selinger. This file is part of Potrace. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ #ifndef CURVE_H #define CURVE_H #include "auxiliary.h" /* vertex is c[1] for tag=POTRACE_CORNER, and the intersection of .c[-1][2]..c[0] and c[1]..c[2] for tag=POTRACE_CURVETO. alpha is only defined for tag=POTRACE_CURVETO and is the alpha parameter of the curve: .c[-1][2]..c[0] = alpha*(.c[-1][2]..vertex), and c[2]..c[1] = alpha*(c[2]..vertex). Beta is so that (.beta[i])[.vertex[i],.vertex[i+1]] = .c[i][2]. */ struct privcurve_s { int n; /* number of segments */ int *tag; /* tag[n]: POTRACE_CORNER or POTRACE_CURVETO */ dpoint_t (*c)[3]; /* c[n][i]: control points. c[n][0] is unused for tag[n]=POTRACE_CORNER */ /* the remainder of this structure is special to privcurve, and is used in EPS debug output and special EPS "short coding". These fields are valid only if "alphacurve" is set. */ int alphacurve; /* have the following fields been initialized? */ dpoint_t *vertex; /* for POTRACE_CORNER, this equals c[1] */ double *alpha; /* only for POTRACE_CURVETO */ double *alpha0; /* "uncropped" alpha parameter - for debug output only */ double *beta; }; typedef struct privcurve_s privcurve_t; struct sums_s { double x; double y; double x2; double xy; double y2; }; typedef struct sums_s sums_t; /* the path structure is filled in with information about a given path as it is accumulated and passed through the different stages of the Potrace algorithm. Backends only need to read the fcurve and fm fields of this data structure, but debugging backends may read other fields. */ struct potrace_privpath_s { int len; point_t *pt; /* pt[len]: path as extracted from bitmap */ int *lon; /* lon[len]: (i,lon[i]) = longest straight line from i */ int x0, y0; /* origin for sums */ sums_t *sums; /* sums[len+1]: cache for fast summing */ int m; /* length of optimal polygon */ int *po; /* po[m]: optimal polygon */ privcurve_t curve; /* curve[m]: array of curve elements */ privcurve_t ocurve; /* ocurve[om]: array of curve elements */ privcurve_t *fcurve; /* final curve: this points to either curve or ocurve. Do not free this separately. */ }; typedef struct potrace_privpath_s potrace_privpath_t; /* shorter names */ typedef potrace_privpath_t privpath_t; typedef potrace_path_t path_t; path_t *path_new(void); void path_free(path_t *p); void pathlist_free(path_t *plist); int privcurve_init(privcurve_t *curve, int n); void privcurve_to_curve(privcurve_t *pc, potrace_curve_t *c); #endif /* CURVE_H */
/********************************************************************* CombLayer : MNCPX Input builder * File: geomInc/Pnt.h * * Copyright (c) 2004-2013 by Stuart Ansell * * 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 Geometry_Pnt_h #define Geometry_Pnt_h namespace Geometry { /*! \class Pnt \brief Pnt in a 3D system \version 1.0 \date December 2010 \author S. Ansell */ class Pnt : public Intersect { private: int index; ///< Creation index Vec3D Cent; ///< Current points public: Pnt(); Pnt(const Vec3D&); Pnt(const int,const Vec3D&); Pnt(const Pnt&); Pnt& operator=(const Pnt&); virtual ~Pnt() {} ///< Destructor Pnt& operator()(const Vec3D&); /// Debug function to get index int getIndex() const { return index; } /// Calc area double area() const { return 0.0;} /// Valid centre bool hasCentre() const { return true; } /// calculate the centre Vec3D centre() const { return Cent; } Vec3D ParamPt(const double) const; void write(std::ostream&) const; }; } // NAMESPACE Geometry #endif
/* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") 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, 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: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "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 OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Tier 2 Encoder * * $Id$ */ #ifndef JPC_T2ENC_H #define JPC_T2ENC_H /******************************************************************************\ * Includes. \******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <assert.h> #include "jpc_enc.h" /******************************************************************************\ * Functions. \******************************************************************************/ /* Encode the packets for a tile. */ int jpc_enc_encpkts(jpc_enc_t *enc, jas_stream_t *out); /* Encode the specified packet. */ int jpc_enc_encpkt(jpc_enc_t *enc, jas_stream_t *out, int compno, int lvlno, int prcno, int lyrno); /* Save the tier-2 coding state. */ void jpc_save_t2state(jpc_enc_t *enc); /* Restore the tier-2 coding state. */ void jpc_restore_t2state(jpc_enc_t *enc); /* Initialize the tier-2 coding state. */ void jpc_init_t2state(jpc_enc_t *enc, int raflag); /* Create a packet iterator for the encoder. */ jpc_pi_t *jpc_enc_pi_create(jpc_enc_cp_t *cp, jpc_enc_tile_t *tile); #endif
/*************************************************************************** * * * ########### ########### ########## ########## * * ############ ############ ############ ############ * * ## ## ## ## ## ## ## * * ## ## ## ## ## ## ## * * ########### #### ###### ## ## ## ## ###### * * ########### #### # ## ## ## ## # # * * ## ## ###### ## ## ## ## # # * * ## ## # ## ## ## ## # # * * ############ ##### ###### ## ## ## ##### ###### * * ########### ########### ## ## ## ########## * * * * S E C U R E M O B I L E N E T W O R K I N G * * * * This file is part of NexMon. * * * * Copyright (c) 2016 NexMon Team * * * * NexMon 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. * * * * NexMon 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 NexMon. If not, see <http://www.gnu.org/licenses/>. * * * **************************************************************************/ #include <firmware_version.h> // definition of firmware version macros #include <patcher.h> // macros used to craete patches such as BLPatch, BPatch, ... __attribute__((at(0x1E9418, "", CHIP_VER_BCM4358, FW_VER_7_112_200_17))) __attribute__((at(0x1E9518, "", CHIP_VER_BCM4358, FW_VER_7_112_201_3))) __attribute__((naked)) void patch_console_size_1(void) { asm("mov r0, 0x800\n"); } __attribute__((at(0x1E9434, "", CHIP_VER_BCM4358, FW_VER_7_112_200_17))) __attribute__((at(0x1E9534, "", CHIP_VER_BCM4358, FW_VER_7_112_201_3))) __attribute__((naked)) void patch_console_size_2(void) { asm("mov r2, 0x800\n"); }
char* g; void main() { char* h; h = "Hello world"; printf("h[6]=%c\n", h[6]); g = "This is a great class!!"; printf("g[11]=%c\n", g[11]); }
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #ifndef _UL_DL_Mode_H_ #define _UL_DL_Mode_H_ #include <asn_application.h> /* Including external dependencies */ #include "UL-CompressedModeMethod.h" #include "DL-CompressedModeMethod.h" #include <constr_SEQUENCE.h> #include <constr_CHOICE.h> #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum UL_DL_Mode_PR { UL_DL_Mode_PR_NOTHING, /* No components present */ UL_DL_Mode_PR_ul, UL_DL_Mode_PR_dl, UL_DL_Mode_PR_ul_and_dl } UL_DL_Mode_PR; /* UL-DL-Mode */ typedef struct UL_DL_Mode { UL_DL_Mode_PR present; union UL_DL_Mode_u { UL_CompressedModeMethod_t ul; DL_CompressedModeMethod_t dl; struct UL_DL_Mode__ul_and_dl { UL_CompressedModeMethod_t ul; DL_CompressedModeMethod_t dl; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ul_and_dl; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } UL_DL_Mode_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_UL_DL_Mode; #ifdef __cplusplus } #endif #endif /* _UL_DL_Mode_H_ */ #include <asn_internal.h>
/* * Gatekeeper - DoS protection system. * Copyright (C) 2016 Digirati LTDA. * * 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 <stdio.h> #include <string.h> #include <argp.h> #include <unistd.h> #include <ifaddrs.h> #include <sys/ioctl.h> #include <net/if.h> #include <linux/ethtool.h> #include <linux/sockios.h> /* Argp's global variables. */ const char *argp_program_version = "generate-if-map 1.0"; /* Arguments. */ static char adoc[] = "<IF_MAP_LUA>"; static char doc[] = "generate-if-map -- generate the mapping " "network interface device name to its bus information"; static struct argp_option options[] = { {"gatekeeper-if-map", 'o', "FILE", 0, "Output the mapping to a Lua FILE", 1}, { 0 } }; struct args { char *filename; }; static error_t parse_opt(int key, char *arg, struct argp_state *state) { struct args *args = state->input; switch (key) { case 'o': args->filename = arg; break; case ARGP_KEY_INIT: args->filename = NULL; break; case ARGP_KEY_ARG: if (args->filename) argp_error(state, "Wrong number of arguments; only one is allowed"); args->filename = arg; break; case ARGP_KEY_END: if (!args->filename) argp_error(state, "The mapping Lua file was not specified"); break; default: return ARGP_ERR_UNKNOWN; } return 0; } static struct argp argp = {options, parse_opt, adoc, doc, NULL, NULL, NULL}; int main(int argc, char **argv) { FILE *f; struct ifaddrs *addrs, *iter; int sock; int ret; struct args args = { /* Defaults. */ .filename = "./lua/if_map.lua", }; /* Read parameters. */ argp_parse(&argp, argc, argv, 0, NULL, &args); f = fopen(args.filename, "w"); if (f == NULL) { perror("fopen"); return -1; } ret = getifaddrs(&addrs); if (ret == -1) { perror("getifaddrs"); goto file; } sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock == -1) { perror("socket"); goto addrs; } fprintf(f, "return {\n"); iter = addrs; while (iter != NULL) { struct ifreq ifr; struct ethtool_cmd cmd; struct ethtool_drvinfo drvinfo; /* * Use AF_PACKET to only get each interface once, * and skip the loopback interface. */ if (iter->ifa_addr == NULL || iter->ifa_addr->sa_family != AF_PACKET || strcmp(iter->ifa_name, "lo") == 0) goto next; memset(&ifr, 0, sizeof(ifr)); memset(&cmd, 0, sizeof(cmd)); memset(&drvinfo, 0, sizeof(drvinfo)); strcpy(ifr.ifr_name, iter->ifa_name); ifr.ifr_data = (void *)&drvinfo; drvinfo.cmd = ETHTOOL_GDRVINFO; if (ioctl(sock, SIOCETHTOOL, &ifr) < 0) { perror("ioctl"); goto next; } fprintf(f, "\t[\"%s\"] = \"%s\",\n", iter->ifa_name, drvinfo.bus_info); next: iter = iter->ifa_next; } fprintf(f, "}\n"); close(sock); addrs: freeifaddrs(addrs); file: fclose(f); return ret; }
#ifndef ZORG_INTERNAL_LIBTOMCRYPT_H_ #define ZORG_INTERNAL_LIBTOMCRYPT_H_ #include <zorg/zorg.h> namespace ZORG { namespace LibTomCrypt { ErrorCode convertErrorCode(int e); } } #endif // EOF
/* Copyright (c) 2005-2015 by Jakob Schröter <js@camaya.net> This file is part of the gloox library. http://camaya.net/gloox This software is distributed under a license. The full license agreement can be found in the file LICENSE in this distribution. This software may not be copied, modified, sold or distributed other than expressed in the named license agreement. This software is distributed without any warranty. */ #ifndef LOGSINK_H__ #define LOGSINK_H__ #include "gloox.h" #include "loghandler.h" #include <string> // #include <fstream> namespace gloox { /** * @brief An implementation of log sink and source. * * To log the output of your Client or Component, use ClientBase's * @link ClientBase::logInstance() logInstance() @endlink to get hold of the LogSink * object for that ClientBase. Register your LogHandler with that instance. * * You should not need to use this class directly. * * @author Jakob Schröter <js@camaya.net> * @since 0.8 */ class GLOOX_API LogSink { public: /** * Constructor. */ LogSink(); /** * Virtual destructor. */ virtual ~LogSink(); /** * Use this function to log a message with given LogLevel and LogIdentifier. * dbg(), warn(), and err() are alternative shortcuts. * @param level The severity of the logged event. * @param area The part of the program/library the message comes from. * @param message The actual log message. */ void log( LogLevel level, LogArea area, const std::string& message ) const; /** * Use this function to log a debug message with given LogIdentifier. * This is a convenience wrapper around log(). * @param area The part of the program/library the message comes from. * @param message The actual log message. */ void dbg( LogArea area, const std::string& message ) const { log( LogLevelDebug, area, message ); } /** * Use this function to log a warning message with given LogIdentifier. * This is a convenience wrapper around log(). * @param area The part of the program/library the message comes from. * @param message The actual log message. */ void warn( LogArea area, const std::string& message ) const { log( LogLevelWarning, area, message ); } /** * Use this function to log a error message with given LogIdentifier. * This is a convenience wrapper around log(). * @param area The part of the program/library the message comes from. * @param message The actual log message. */ void err( LogArea area, const std::string& message ) const { log( LogLevelError, area, message ); } /** * Registers @c lh as object that receives all debug messages of the specified type. * Suitable for logging to a file, etc. * @param level The LogLevel for this handler. * @param areas Bit-wise ORed LogAreas the LogHandler wants to be informed about. * @param lh The object to receive exchanged data. */ void registerLogHandler( LogLevel level, int areas, LogHandler* lh ); /** * Removes the given object from the list of log handlers. * @param lh The object to remove from the list. */ void removeLogHandler( LogHandler* lh ); private: struct LogInfo { LogLevel level; int areas; }; LogSink( const LogSink& /*copy*/ ); typedef std::map<LogHandler*, LogInfo> LogHandlerMap; LogHandlerMap m_logHandlers; }; } #endif // LOGSINK_H__
/* scxtract.c: Copyright (C) 1991 Barry Vercoe; 2012 John ffitch This file is part of Csound. The Csound Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. Csound 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 Csound; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "csoundCore.h" /* SCXTRACT.C */ #include "corfile.h" #include "extract.h" extern void sfree(CSOUND *csound); extern int sread(CSOUND *csound); //extern void sread_init(CSOUND *csound); extern void swritestr(CSOUND *csound, CORFIL *sco, int first); /* called from xmain.c or some other main */ /* extracts events from each score sect */ /* according to the controlling xfile */ extern void sread_initstr(CSOUND *, CORFIL *sco); int scxtract(CSOUND *csound, CORFIL *scin, FILE *xfile) { int n; EXTRACT_STATICS* extractStatics = csound->Calloc(csound, sizeof(EXTRACT_STATICS)); corfile_seek(scin, 0, SEEK_END); corfile_puts(csound, "\n#exit\n", scin); corfile_rewind(scin); csound->scoreout = NULL; csound->scorestr = scin; csound->scstr = corfile_create_w(csound); csound->sectcnt = 0; readxfil(csound, extractStatics, xfile); sread_initstr(csound, scin); while ((n = sread(csound)) > 0) { /* allout(); */ /* textout(); */ extract(csound, extractStatics); swritestr(csound, csound->scstr, 1); } //printf("***extracted: >>%s<<\n", csound->scstr->body); corfile_flush(csound, csound->scstr); sfree(csound); /* return all memory used */ csound->Free(csound, extractStatics); return 0; }
/* * Copyright (C) 2011, Nokia <ivan.frade@nokia.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "config.h" #ifdef __linux__ #include <errno.h> #include <sched.h> #include "tracker-sched.h" gboolean tracker_sched_idle (void) { struct sched_param sp; /* Set process scheduling parameters: * This is used so we don't steal scheduling priority from * the most important applications - like the phone * application which has a real time requirement here. This * is detailed in Nokia bug #95573 */ g_message ("Setting scheduler policy to SCHED_IDLE"); if (sched_getparam (0, &sp) == 0) { if (sched_setscheduler (0, SCHED_IDLE, &sp) != 0) { //LCOV_EXCL_START const gchar *str = g_strerror (errno); g_warning ("Could not set scheduler policy, %s", str ? str : "no error given"); return FALSE; } } else { const gchar *str = g_strerror (errno); g_warning ("Could not get scheduler policy, %s", str ? str : "no error given"); return FALSE; } //LCOV_EXCL_END return TRUE; } #else /* __linux__ */ #include <glib.h> #include "tracker-sched.h" gboolean tracker_sched_idle (void) { return TRUE; } #endif /* __linux__ */
/* * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de> * 2016 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. * */ /** * @ingroup auto_init_gnrc_netif * @{ * * @file * @brief Auto initialization for XBee network interfaces * * @author Kaspar Schleiser <kaspar@schleiser.de> * @author Hauke Petersen <hauke.petersen@fu-berlin.de> */ #ifdef MODULE_XBEE #include "log.h" #include "board.h" #include "net/gnrc/netdev2/xbee_adpt.h" #include "xbee_params.h" /** * @brief Calculate the number of configured XBee devices */ #define XBEE_NUM (sizeof(xbee_params) / sizeof(xbee_params_t)) /** * @brief Define stack parameters for the MAC layer thread */ #define XBEE_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) #ifndef XBEE_MAC_PRIO #define XBEE_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO) #endif /** * @brief Allocate memory for device descriptors, stacks, and GNRC adaption */ static xbee_t xbee_devs[XBEE_NUM]; static gnrc_netdev2_t gnrc_adpt[XBEE_NUM]; static char stacks[XBEE_NUM][XBEE_MAC_STACKSIZE]; void auto_init_xbee(void) { for (unsigned i = 0; i < XBEE_NUM; i++) { LOG_DEBUG("[auto_init_netif] initializing xbee #%u\n", i); xbee_setup(&xbee_devs[i], &xbee_params[i]); gnrc_netdev2_xbee_init(&gnrc_adpt[i], &xbee_devs[i]); gnrc_netdev2_init(stacks[i], XBEE_MAC_STACKSIZE, XBEE_MAC_PRIO, "xbee", &gnrc_adpt[i]); } } #else typedef int dont_be_pedantic; #endif /* MODULE_XBEE */ /** @} */
//Compile with: //gcc -g thumb_example_01.c -o thumb_example_01 `pkg-config --cflags --libs elementary` #include <Elementary.h> static void _generation_started_cb(void *data, Evas_Object *o, void *event_info) { printf("thumbnail generation started.\n"); } static void _generation_finished_cb(void *data, Evas_Object *o, void *event_info) { printf("thumbnail generation finished.\n"); } static void _generation_error_cb(void *data, Evas_Object *o, void *event_info) { printf("thumbnail generation error.\n"); } EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win; Evas_Object *thumb; char buf[PATH_MAX]; elm_need_ethumb(); elm_app_info_set(elm_main, "elementary", "images/plant_01.jpg"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("thumb", "Thumbnailer"); elm_win_autodel_set(win, EINA_TRUE); thumb = elm_thumb_add(win); evas_object_smart_callback_add(thumb, "generate,start", _generation_started_cb, NULL); evas_object_smart_callback_add(thumb, "generate,stop", _generation_finished_cb, NULL); evas_object_smart_callback_add(thumb, "generate,error", _generation_error_cb, NULL); elm_thumb_size_set(thumb, 160, 160); elm_thumb_editable_set(thumb, EINA_FALSE); snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); elm_thumb_file_set(thumb, buf, NULL); elm_thumb_reload(thumb); evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, thumb); evas_object_show(thumb); evas_object_resize(win, 320, 320); evas_object_show(win); elm_run(); /* and run the program now, starting to handle all * events, etc. */ /* exit code */ return 0; } ELM_MAIN()
/** * utils.h * * Copyright (C) 2007 Laurent Montel <montel@kde.org> * Copyright (C) 2008 Jarosław Staniek <staniek@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA */ //TODO: Move this into kdepimlibs/kpimutils #ifndef KDEPIM_UTILS_H #define KDEPIM_UTILS_H #include "kdepim_export.h" class QString; namespace KPIM { class KDEPIM_EXPORT Utils { public: static QString rot13( const QString &s ); }; } #endif
void foo() { if (a) { b; } #if definedEx(C) else if (d) { e; } #endif return f; }
/* * VendorReturnToPositionTask.h * * Created on: 1/22/2012 * Author: Kyle */ #ifndef VENDORRETURNTOPOSITIONTASK_H_ #define VENDORRETURNTOPOSITIONTASK_H_ #include "server/zone/objects/creature/CreatureObject.h" class VendorReturnToPositionTask : public Task { WeakReference<CreatureObject*> vendor; float heading; public: VendorReturnToPositionTask(CreatureObject* cr, int va) { vendor = cr; heading = va; } void run() { ManagedReference<CreatureObject*> strongref = vendor.get(); if(strongref == NULL) return; Locker locker(strongref); strongref->updateDirection(heading); strongref->removePendingTask("vendorreturn"); } }; #endif /* VENDORRETURNTOPOSITIONTASK_H_ */
//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by TimedMsgBox.rc // #define IDI_TIMEDMSGBOX 101 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
/*** * Excerpted from "Test-Driven Development for Embedded C", * published by The Pragmatic Bookshelf. * Copyrights apply to this code. It may not be used to create training material, * courses, books, articles, and the like. Contact us if you are in doubt. * We make no guarantees that this code is fit for any purpose. * Visit http://www.pragmaticprogrammer.com/titles/jgade for more book information. ***/ /*- ------------------------------------------------------------------ -*/ /*- Copyright (c) James W. Grenning -- All Rights Reserved -*/ /*- For use by owners of Test-Driven Development for Embedded C, -*/ /*- and attendees of Renaissance Software Consulting, Co. training -*/ /*- classes. -*/ /*- -*/ /*- Available at http://pragprog.com/titles/jgade/ -*/ /*- ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3 -*/ /*- -*/ /*- Authorized users may use this source code in your own -*/ /*- projects, however the source code may not be used to -*/ /*- create training material, courses, books, articles, and -*/ /*- the like. We make no guarantees that this source code is -*/ /*- fit for any purpose. -*/ /*- -*/ /*- www.renaissancesoftware.net james@renaissancesoftware.net -*/ /*- ------------------------------------------------------------------ -*/ #include "unity_fixture.h" #include "LedDriver.h" #include "unity_fixture.h" TEST_GROUP(LedDriver); TEST_SETUP(LedDriver) { } TEST_TEAR_DOWN(LedDriver) { } TEST(LedDriver, StartHere) { /* TEST_FAIL("Start here"); */ }
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) b) the Affero GPL v3 Details of these licenses can be found at: www.gnu.org/licenses JUCE 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. ------------------------------------------------------------------------------ To release a closed-source product which uses JUCE, commercial licenses are available: visit www.juce.com for more information. ============================================================================== */ #ifndef JUCER_GENERATEDCODE_H_INCLUDED #define JUCER_GENERATEDCODE_H_INCLUDED class JucerDocument; //============================================================================== /** A class for collecting the various snippets of c++ that will be assembled into the final cpp and header files. */ class GeneratedCode { public: GeneratedCode (const JucerDocument*); ~GeneratedCode(); //============================================================================== void applyToCode (String& code, const String& fileNameRoot, const bool isForPreview, const String& oldFileWithUserData = String::empty) const; int getUniqueSuffix(); //============================================================================== const JucerDocument* const document; String className; String componentName; String parentClassInitialiser; // optional parent class initialiser to go before the items in the initialisers list StringArray initialisers; // (a list of the member variables that need initalising after the constructor declaration) String parentClasses; String constructorParams; String privateMemberDeclarations; String publicMemberDeclarations; StringArray includeFilesH, includeFilesCPP; String constructorCode; String destructorCode; String staticMemberDefinitions; String jucerMetadata; struct CallbackMethod { String requiredParentClass; String returnType; String prototype; String content; bool hasPrePostUserSections; }; OwnedArray <CallbackMethod> callbacks; String& getCallbackCode (const String& requiredParentClass, const String& returnType, const String& prototype, const bool hasPrePostUserSections); void removeCallback (const String& returnType, const String& prototype); void addImageResourceLoader (const String& imageMemberName, const String& resourceName); String getCallbackDeclarations() const; String getCallbackDefinitions() const; StringArray getExtraParentClasses() const; bool shouldUseTransMacro() const noexcept; private: String getClassDeclaration() const; String getInitialiserList() const; int suffix; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GeneratedCode) }; #endif // JUCER_GENERATEDCODE_H_INCLUDED
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SYZYGY_KASKO_TESTING_MOCK_SERVICE_H_ #define SYZYGY_KASKO_TESTING_MOCK_SERVICE_H_ #include <map> #include <string> #include <vector> #include "base/macros.h" #include "base/process/process_handle.h" #include "base/strings/string16.h" #include "syzygy/kasko/service.h" namespace kasko { namespace testing { // Handles Kasko RPC invocations by logging their parameters. class MockService : public Service { public: // Records the parameters of an RPC invocation. struct CallRecord { // The caller process ID. const base::ProcessId client_process_id; // The requested minidump type. MinidumpType minidump_type; // The supplied protobuf. const std::string protobuf; // The supplied crash keys. const std::map<base::string16, base::string16> crash_keys; }; // Instantiates a service that records calls in the provided vector. // @param call_log The vector in which calls should be recorded. // @note call_log will be modified in whichever thread the RPC is handled. // It is the client's responsibility to prevent problems from concurrent // access. explicit MockService(std::vector<CallRecord>* call_log); virtual ~MockService(); // Service implementation. virtual void SendDiagnosticReport( base::ProcessId client_process_id, uint64_t exception_info_address, base::PlatformThreadId thread_id, MinidumpType minidump_type, const char* protobuf, size_t protobuf_length, const std::map<base::string16, base::string16>& crash_keys) override; private: std::vector<CallRecord>* call_log_; DISALLOW_COPY_AND_ASSIGN(MockService); }; } // namespace testing } // namespace kasko #endif // SYZYGY_KASKO_TESTING_MOCK_SERVICE_H_
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #import <Foundation/Foundation.h> typedef NS_ENUM(NSInteger, NBMRoomErrorCode) { NBMUserGenericRoomErrorCode = 101, NBMUserNotFoundRoomErrorCode = 102, NBMUserClosedRoomErrorCode = 103, NBMExistingUserInRoomRoomErrorCode = 104, NBMRoomGenericErrorRoomErrorCode = 201, NBMRoomNotFoundRoomErrorCode = 202, NBMRoomClosedRoomErrorCode = 203, NBMRoomCannotBeCreatedRoomErrorCode = 204, NBMMediaGenericErrorRoomErrorCode = 301, NBMMediaSdpErrorRoomErrorCode = 302, NBMMediaEndpointErrorRoomErrorCode = 303, NBMMediaWebRtcEndpointErrorRoomErrorCode = 304, NBMMediaRtpEndpointErrorRoomErrorCode = 305, NBMMediaNotAWebEndpointRoomErrorCode = 306, NBMMuteErrorRoomErrorCode = 307, NBMTransportRequestErrorRoomErrorCode = 801, NBMTransportResponseErrorRoomErrorCode = 802, NBMTransportErrorRoomErrorCode = 803, NBMGenericErrorRoomErrorCode = 999 }; @class NBMPeer; @interface NBMRoom : NSObject - (instancetype)initWithUsername:(NSString *)username roomName:(NSString *)name roomURL:(NSURL *)url dataChannels:(BOOL)dataChannels; @property (nonatomic, copy, readonly) NSString *name; @property (nonatomic, strong, readonly) NSURL *url; @property (nonatomic, copy, readonly) NBMPeer *localPeer; @property (nonatomic, strong, readonly) NSSet *peers; @property (nonatomic, assign, readonly) BOOL dataChannels; @end
/* * Copyright 2014 Facebook, Inc. * * 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. */ #ifndef THRIFT_GSSSASLCLIENT_H_ #define THRIFT_GSSSASLCLIENT_H_ 1 #include <chrono> #include <folly/io/async/EventBase.h> #include <thrift/lib/cpp2/async/SaslClient.h> #include <thrift/lib/cpp2/security/KerberosSASLHandshakeClient.h> #include <thrift/lib/cpp2/security/KerberosSASLThreadManager.h> #include <thrift/lib/cpp2/security/SecurityLogger.h> #include <thrift/lib/cpp/concurrency/Mutex.h> #include <thrift/lib/cpp/util/kerberos/Krb5CredentialsCacheManager.h> #include <folly/Memory.h> namespace apache { namespace thrift { /** * Client responsible for the GSS SASL handshake. */ class GssSaslClient : public SaslClient { public: explicit GssSaslClient(folly::EventBase*, const std::shared_ptr<SecurityLogger>& logger = std::make_shared<SecurityLogger>()); void start(Callback* cb) override; void consumeFromServer(Callback* cb, std::unique_ptr<folly::IOBuf>&& message) override; std::unique_ptr<folly::IOBuf> encrypt( std::unique_ptr<folly::IOBuf>&&) override; std::unique_ptr<folly::IOBuf> decrypt( std::unique_ptr<folly::IOBuf>&&) override; void setClientIdentity(const std::string& identity) override { clientHandshake_->setRequiredClientPrincipal(identity); } void setServiceIdentity(const std::string& identity) override { clientHandshake_->setRequiredServicePrincipal(identity); } void setRequiredServicePrincipalFetcher(std::function< std::tuple<std::string, std::string, std::string>()> function) override { clientHandshake_->setRequiredServicePrincipalFetcher( std::move(function)); } std::string getClientIdentity() const override; std::string getServerIdentity() const override; const std::string* getErrorString() const override { return errorString_.get(); } // Set error string, prepend phase at which this error happened. void setErrorString(const std::string& str) override { std::string err = std::string("Phase: ") + std::to_string((int)clientHandshake_->getPhase()) + " " + str; errorString_ = folly::make_unique<std::string>(err); } void setSaslThreadManager( const std::shared_ptr<SaslThreadManager>& thread_manager) override { saslThreadManager_ = thread_manager; clientHandshake_->setSaslThreadManager(thread_manager); } void setCredentialsCacheManager( const std::shared_ptr<krb5::Krb5CredentialsCacheManager>& cc_manager) override { clientHandshake_->setCredentialsCacheManager(cc_manager); } void setHandshakeClient( const std::shared_ptr<KerberosSASLHandshakeClient>& clientHandshake) { clientHandshake_ = clientHandshake; } void setProtocolId(uint16_t protocol) override { protocol_ = protocol; } void detachEventBase() override; void attachEventBase(folly::EventBase* evb) override; static std::chrono::milliseconds getCurTime(); private: std::shared_ptr<KerberosSASLHandshakeClient> clientHandshake_; std::unique_ptr<std::string> errorString_; std::shared_ptr<apache::thrift::concurrency::Mutex> mutex_; std::shared_ptr<SaslThreadManager> saslThreadManager_; std::shared_ptr<int> seqId_; uint16_t protocol_; std::shared_ptr<bool> inProgress_; }; }} // apache::thrift #endif // THRIFT_GSSSASLCLIENT_H_
/* * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ChangeVersionData_h #define ChangeVersionData_h #include "wtf/text/WTFString.h" namespace WebCore { class ChangeVersionData { public: ChangeVersionData(String oldVersion, String newVersion) : m_oldVersion(oldVersion), m_newVersion(newVersion) { } String oldVersion() const { return m_oldVersion; } String newVersion() const { return m_newVersion; } private: String m_oldVersion; String m_newVersion; }; } // namespace WebCore #endif // ChangeVersionData_h
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD // // 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. #ifndef _ESP_SYS_UNISTD_H #define _ESP_SYS_UNISTD_H #ifdef __cplusplus extern "C" { #endif #include_next <sys/unistd.h> int truncate(const char *, off_t __length); int gethostname(char *__name, size_t __len); #ifdef __cplusplus } #endif #endif /* _SYS_UNISTD_H */
// C program for implementation of selection sort #include <stdio.h> void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp; *yp = temp; } void selectionSort(int arr[], int n) { int i, j, min_idx; // One by one move boundary of unsorted subarray for (i = 0; i < n-1; i++) { // Find the minimum element in unsorted array min_idx = i; for (j = i+1; j < n; j++) if (arr[j] < arr[min_idx]) min_idx = j; // Swap the found minimum element with the first element swap(&arr[min_idx], &arr[i]); } } /* Function to print an array */ void printArray(int arr[], int size) { int i; for (i=0; i < size; i++) printf("%d ", arr[i]); printf("\n"); } // Driver program to test above functions int main() { int arr[] = {64, 25, 12, 22, 11}; int n = sizeof(arr)/sizeof(arr[0]); selectionSort(arr, n); printf("Sorted array: \n"); printArray(arr, n); return 0; }
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/storagegateway/StorageGateway_EXPORTS.h> #include <aws/storagegateway/StorageGatewayRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <utility> namespace Aws { namespace StorageGateway { namespace Model { /** */ class AWS_STORAGEGATEWAY_API AddUploadBufferRequest : public StorageGatewayRequest { public: AddUploadBufferRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "AddUploadBuffer"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; inline const Aws::String& GetGatewayARN() const{ return m_gatewayARN; } inline bool GatewayARNHasBeenSet() const { return m_gatewayARNHasBeenSet; } inline void SetGatewayARN(const Aws::String& value) { m_gatewayARNHasBeenSet = true; m_gatewayARN = value; } inline void SetGatewayARN(Aws::String&& value) { m_gatewayARNHasBeenSet = true; m_gatewayARN = std::move(value); } inline void SetGatewayARN(const char* value) { m_gatewayARNHasBeenSet = true; m_gatewayARN.assign(value); } inline AddUploadBufferRequest& WithGatewayARN(const Aws::String& value) { SetGatewayARN(value); return *this;} inline AddUploadBufferRequest& WithGatewayARN(Aws::String&& value) { SetGatewayARN(std::move(value)); return *this;} inline AddUploadBufferRequest& WithGatewayARN(const char* value) { SetGatewayARN(value); return *this;} /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline const Aws::Vector<Aws::String>& GetDiskIds() const{ return m_diskIds; } /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline bool DiskIdsHasBeenSet() const { return m_diskIdsHasBeenSet; } /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline void SetDiskIds(const Aws::Vector<Aws::String>& value) { m_diskIdsHasBeenSet = true; m_diskIds = value; } /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline void SetDiskIds(Aws::Vector<Aws::String>&& value) { m_diskIdsHasBeenSet = true; m_diskIds = std::move(value); } /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline AddUploadBufferRequest& WithDiskIds(const Aws::Vector<Aws::String>& value) { SetDiskIds(value); return *this;} /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline AddUploadBufferRequest& WithDiskIds(Aws::Vector<Aws::String>&& value) { SetDiskIds(std::move(value)); return *this;} /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline AddUploadBufferRequest& AddDiskIds(const Aws::String& value) { m_diskIdsHasBeenSet = true; m_diskIds.push_back(value); return *this; } /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline AddUploadBufferRequest& AddDiskIds(Aws::String&& value) { m_diskIdsHasBeenSet = true; m_diskIds.push_back(std::move(value)); return *this; } /** * <p>An array of strings that identify disks that are to be configured as working * storage. Each string has a minimum length of 1 and maximum length of 300. You * can get the disk IDs from the <a>ListLocalDisks</a> API.</p> */ inline AddUploadBufferRequest& AddDiskIds(const char* value) { m_diskIdsHasBeenSet = true; m_diskIds.push_back(value); return *this; } private: Aws::String m_gatewayARN; bool m_gatewayARNHasBeenSet; Aws::Vector<Aws::String> m_diskIds; bool m_diskIdsHasBeenSet; }; } // namespace Model } // namespace StorageGateway } // namespace Aws
/* Copyright 2020 The TensorFlow Authors. 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. ==============================================================================*/ #ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_DEVICE_INFO_H_ #define TENSORFLOW_LITE_DELEGATES_GPU_CL_DEVICE_INFO_H_ #include <string> #include <vector> #include "tensorflow/lite/delegates/gpu/common/data_type.h" // for use only in device_info.cc, but keep here to make tests int GetAdrenoGPUVersion(const std::string& gpu_version); namespace tflite { namespace gpu { namespace cl { enum class Vendor { kQualcomm, kMali, kPowerVR, kNvidia, kAMD, kIntel, kUnknown }; std::string VendorToString(Vendor v); enum class OpenCLVersion { CL_1_0, CL_1_1, CL_1_2, CL_2_0, CL_2_1, CL_2_2, CL_3_0 }; std::string OpenCLVersionToString(OpenCLVersion version); struct AdrenoInfo { AdrenoInfo() = default; explicit AdrenoInfo(const std::string& device_version); int gpu_version = -1; // can be, for example, 405/430/540/530/630 etc. // This function returns some not very documented physical parameter of // Adreno6xx GPU. // We obtained it using Snapdragon Profiler. int GetMaximumWavesCount() const; // returns amount of register memory per CU(Compute Unit) in bytes. int GetRegisterMemorySizePerComputeUnit() const; // returns maximum possible amount of waves based on register usage. int GetMaximumWavesCount(int register_footprint_per_tread, bool full_wave = true) const; int GetWaveSize(bool full_wave) const; // Not supported on some Adreno devices with specific driver version. // b/131099086 bool support_one_layer_texture_array = true; }; enum class MaliGPU { T604, T622, T624, T628, T658, T678, T720, T760, T820, T830, T860, T880, G31, G51, G71, G52, G72, G76, G57, G77, G68, G78, UNKNOWN }; struct MaliInfo { MaliInfo() = default; explicit MaliInfo(const std::string& device_name); MaliGPU gpu_version; bool IsMaliT6xx() const; bool IsMaliT7xx() const; bool IsMaliT8xx() const; bool IsMidgard() const; bool IsBifrostGen1() const; bool IsBifrostGen2() const; bool IsBifrostGen3() const; bool IsBifrost() const; bool IsValhall() const; }; struct DeviceInfo { DeviceInfo() = default; bool IsAdreno() const; bool IsAdreno3xx() const; bool IsAdreno4xx() const; bool IsAdreno5xx() const; bool IsAdreno6xx() const; bool IsAdreno6xxOrHigher() const; bool IsPowerVR() const; bool IsNvidia() const; bool IsMali() const; bool IsAMD() const; bool IsIntel() const; bool SupportsTextureArray() const; bool SupportsImageBuffer() const; bool SupportsImage3D() const; bool SupportsFloatImage2D(DataType data_type, int channels) const; // To track bug on some Adreno. b/131099086 bool SupportsOneLayerTextureArray() const; bool SupportsExtension(const std::string& extension) const; bool IsCL20OrHigher() const; bool SupportsSubGroupWithSize(int sub_group_size) const; std::vector<std::string> extensions; bool supports_fp16; bool supports_image3d_writes; Vendor vendor; OpenCLVersion cl_version; int compute_units_count; uint64_t buffer_max_size; uint64_t image2d_max_width; uint64_t image2d_max_height; uint64_t image_buffer_max_size; uint64_t image_array_max_layers; uint64_t image3d_max_width; uint64_t image3d_max_height; uint64_t image3d_max_depth; int max_work_group_size_x; int max_work_group_size_y; int max_work_group_size_z; std::vector<int> supported_subgroup_sizes; // rtn is ROUND_TO_NEAREST // with rtn precision is much better then with rtz (ROUND_TO_ZERO) // Adreno 3xx supports only rtz, Adreno 4xx and more support rtn // Mali from T6xx supports rtn // PowerVR supports only rtz bool supports_fp32_rtn; bool supports_fp16_rtn; bool supports_r_f16_tex2d = false; bool supports_rg_f16_tex2d = false; bool supports_rgb_f16_tex2d = false; bool supports_rgba_f16_tex2d = false; bool supports_r_f32_tex2d = false; bool supports_rg_f32_tex2d = false; bool supports_rgb_f32_tex2d = false; bool supports_rgba_f32_tex2d = false; AdrenoInfo adreno_info; MaliInfo mali_info; }; } // namespace cl } // namespace gpu } // namespace tflite #endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_DEVICE_INFO_H_
/* hw_cluster_labs_err.c */ /* ==================================================================== * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * openssl-core@OpenSSL.org. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written * permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * EXPRESSED 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 OpenSSL PROJECT OR * ITS 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. * ==================================================================== * * This product includes cryptographic software written by Eric Young * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). * */ /* NOTE: this file was auto generated by the mkerr.pl script: any changes * made to it will be overwritten when the script next updates this file, * only reason strings will be preserved. */ #include <stdio.h> #include <openssl/err.h> #include "hw_cluster_labs_err.h" /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR static ERR_STRING_DATA CL_str_functs[]= { {ERR_PACK(0,CL_F_CLUSTER_LABS_CTRL,0), "CLUSTER_LABS_CTRL"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_DSA_SIGN,0), "CLUSTER_LABS_DSA_SIGN"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_DSA_VERIFY,0), "CLUSTER_LABS_DSA_VERIFY"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_FINISH,0), "CLUSTER_LABS_FINISH"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_INIT,0), "CLUSTER_LABS_INIT"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_MOD_EXP,0), "CLUSTER_LABS_MOD_EXP"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_MOD_EXP_CRT,0), "CLUSTER_LABS_MOD_EXP_CRT"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_RAND_BYTES,0), "CLUSTER_LABS_RAND_BYTES"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_RSA_MOD_EXP,0), "CLUSTER_LABS_RSA_MOD_EXP"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_RSA_PRIV_DEC,0), "CLUSTER_LABS_RSA_PRIV_DEC"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_RSA_PRIV_ENC,0), "CLUSTER_LABS_RSA_PRIV_ENC"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_RSA_PUB_DEC,0), "CLUSTER_LABS_RSA_PUB_DEC"}, {ERR_PACK(0,CL_F_CLUSTER_LABS_RSA_PUB_ENC,0), "CLUSTER_LABS_RSA_PUB_ENC"}, {0,NULL} }; static ERR_STRING_DATA CL_str_reasons[]= { {CL_R_ALREADY_LOADED ,"already loaded"}, {CL_R_COMMAND_NOT_IMPLEMENTED ,"command not implemented"}, {CL_R_DSO_FAILURE ,"dso failure"}, {CL_R_FUNCTION_NOT_BINDED ,"function not binded"}, {CL_R_INIT_FAILED ,"init failed"}, {CL_R_NOT_LOADED ,"not loaded"}, {0,NULL} }; #endif #ifdef CL_LIB_NAME static ERR_STRING_DATA CL_lib_name[]= { {0 ,CL_LIB_NAME}, {0,NULL} }; #endif static int CL_lib_error_code=0; static int CL_error_init=1; static void ERR_load_CL_strings(void) { if (CL_lib_error_code == 0) CL_lib_error_code=ERR_get_next_error_library(); if (CL_error_init) { CL_error_init=0; #ifndef OPENSSL_NO_ERR ERR_load_strings(CL_lib_error_code,CL_str_functs); ERR_load_strings(CL_lib_error_code,CL_str_reasons); #endif #ifdef CL_LIB_NAME CL_lib_name->error = ERR_PACK(CL_lib_error_code,0,0); ERR_load_strings(0,CL_lib_name); #endif } } static void ERR_unload_CL_strings(void) { if (CL_error_init == 0) { #ifndef OPENSSL_NO_ERR ERR_unload_strings(CL_lib_error_code,CL_str_functs); ERR_unload_strings(CL_lib_error_code,CL_str_reasons); #endif #ifdef CL_LIB_NAME ERR_unload_strings(0,CL_lib_name); #endif CL_error_init=1; } } static void ERR_CL_error(int function, int reason, char *file, int line) { if (CL_lib_error_code == 0) CL_lib_error_code=ERR_get_next_error_library(); ERR_PUT_error(CL_lib_error_code,function,reason,file,line); }
// // Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> // Creation Date: Mon Nov 28 08:55:15 PST 2016 // Last Modified: Mon Nov 28 08:55:38 PST 2016 // Filename: tool-metlev.h // URL: https://github.com/craigsapp/humlib/blob/master/include/tool-metlev.h // Syntax: C++11; humlib // vim: syntax=cpp ts=3 noexpandtab nowrap // // Description: Interface for metlev tool. // #ifndef _TOOL_METLEV_H_INCLUDED #define _TOOL_METLEV_H_INCLUDED #include "HumTool.h" #include "HumdrumFile.h" namespace hum { // START_MERGE class Tool_metlev : public HumTool { public: Tool_metlev (void); ~Tool_metlev () {}; bool run (HumdrumFileSet& infiles); bool run (HumdrumFile& infile); bool run (const string& indata, ostream& out); bool run (HumdrumFile& infile, ostream& out); protected: void fillVoiceResults (vector<vector<double> >& results, HumdrumFile& infile, vector<double>& beatlev); private: vector<HTp> m_kernspines; }; // END_MERGE } // end namespace hum #endif /* _TOOL_METLEV_H_INCLUDED */
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * 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 John Haddon nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #ifndef GAFFERIMAGE_DELETECHANNELS_H #define GAFFERIMAGE_DELETECHANNELS_H #include "GafferImage/ImageProcessor.h" #include "Gaffer/NumericPlug.h" #include "Gaffer/StringPlug.h" namespace GafferImage { class GAFFERIMAGE_API DeleteChannels : public ImageProcessor { public : enum Mode { Delete = 0, Keep = 1 }; DeleteChannels( const std::string &name=defaultName<DeleteChannels>() ); ~DeleteChannels() override; GAFFER_GRAPHCOMPONENT_DECLARE_TYPE( GafferImage::DeleteChannels, DeleteChannelsTypeId, ImageProcessor ); //! @name Plug Accessors ////////////////////////////////////////////////////////////// //@{ Gaffer::IntPlug *modePlug(); const Gaffer::IntPlug *modePlug() const; Gaffer::StringPlug *channelsPlug(); const Gaffer::StringPlug *channelsPlug() const; //@} void affects( const Gaffer::Plug *input, AffectedPlugsContainer &outputs ) const override; protected : // Reimplemented to perform the deletion. void hashChannelNames( const GafferImage::ImagePlug *output, const Gaffer::Context *context, IECore::MurmurHash &h ) const override; IECore::ConstStringVectorDataPtr computeChannelNames( const Gaffer::Context *context, const ImagePlug *parent ) const override; private : static size_t g_firstPlugIndex; }; IE_CORE_DECLAREPTR( DeleteChannels ); } // namespace GafferImage #endif // GAFFERIMAGE_DELETECHANNELS_H
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_ #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_ #include "base/prefs/pref_service.h" #include "chrome/browser/prefs/pref_model_associator.h" #include "chrome/browser/prefs/synced_pref_observer.h" #include "components/pref_registry/pref_registry_syncable.h" class PrefServiceSyncableObserver; class Profile; namespace syncer { class SyncableService; } // A PrefService that can be synced. Users are forced to declare // whether preferences are syncable or not when registering them to // this PrefService. class PrefServiceSyncable : public PrefService { public: // PrefServiceSyncable is a PrefService with added integration for // sync, and knowledge of how to create an incognito // PrefService. For code that does not need to know about the sync // integration, you should use only the plain PrefService type. // // For this reason, Profile does not expose an accessor for the // PrefServiceSyncable type. Instead, you can use the utilities // below to retrieve the PrefServiceSyncable (or its incognito // version) from a Profile. static PrefServiceSyncable* FromProfile(Profile* profile); static PrefServiceSyncable* IncognitoFromProfile(Profile* profile); // You may wish to use PrefServiceFactory or one of its subclasses // for simplified construction. PrefServiceSyncable( PrefNotifierImpl* pref_notifier, PrefValueStore* pref_value_store, PersistentPrefStore* user_prefs, user_prefs::PrefRegistrySyncable* pref_registry, base::Callback<void(PersistentPrefStore::PrefReadError)> read_error_callback, bool async); ~PrefServiceSyncable() override; // Creates an incognito copy of the pref service that shares most pref stores // but uses a fresh non-persistent overlay for the user pref store and an // individual extension pref store (to cache the effective extension prefs for // incognito windows). PrefServiceSyncable* CreateIncognitoPrefService( PrefStore* incognito_extension_prefs); // Returns true if preferences state has synchronized with the remote // preferences. If true is returned it can be assumed the local preferences // has applied changes from the remote preferences. The two may not be // identical if a change is in flight (from either side). // // TODO(albertb): Given that we now support priority preferences, callers of // this method are likely better off making the preferences they care about // into priority preferences and calling IsPrioritySyncing(). bool IsSyncing(); // Returns true if priority preferences state has synchronized with the remote // priority preferences. bool IsPrioritySyncing(); // Returns true if the pref under the given name is pulled down from sync. // Note this does not refer to SYNCABLE_PREF. bool IsPrefSynced(const std::string& name) const; void AddObserver(PrefServiceSyncableObserver* observer); void RemoveObserver(PrefServiceSyncableObserver* observer); // TODO(zea): Have PrefServiceSyncable implement // syncer::SyncableService directly. syncer::SyncableService* GetSyncableService(const syncer::ModelType& type); // Do not call this after having derived an incognito or per tab pref service. void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) override; void AddSyncedPrefObserver(const std::string& name, SyncedPrefObserver* observer); void RemoveSyncedPrefObserver(const std::string& name, SyncedPrefObserver* observer); private: friend class PrefModelAssociator; void AddRegisteredSyncablePreference(const std::string& path, uint32 flags); // Invoked internally when the IsSyncing() state changes. void OnIsSyncingChanged(); // Process a local preference change. This can trigger new SyncChanges being // sent to the syncer. void ProcessPrefChange(const std::string& name); // Whether CreateIncognitoPrefService() has been called to create a // "forked" PrefService. bool pref_service_forked_; PrefModelAssociator pref_sync_associator_; PrefModelAssociator priority_pref_sync_associator_; ObserverList<PrefServiceSyncableObserver> observer_list_; DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncable); }; #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_H_
// // SPWiFiPositionProvider.h // SmartCampus // // Copyright (c) 2014, Aalborg University // All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of the <organization> nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL AAlBORG UNIVERSITY 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. #import <Foundation/Foundation.h> #import "SOOData.h" #import "SPPosition.h" #define WIFI_INTERFACE_NAME @"en0" #define WIFI_BASE_URL @"http://smartcampus.cs.aau.dk/" #define WIFI_POSITIONING_PATH @"WifiSnifferPositioningService/SnifferService.svc/" #define WIFI_POSITIONING_URL WIFI_BASE_URL WIFI_POSITIONING_PATH #define START_WIFI_POSITINING_PATH @"StartWifiPositioning?clientMac='%@'" #define START_WIFI_POSITIONING_URL WIFI_POSITIONING_URL START_WIFI_POSITINING_PATH #define STOP_WIFI_POSITINING_PATH @"StopWifiPositioning?clientMac='%@'" #define STOP_WIFI_POSITIONING_URL WIFI_POSITIONING_URL STOP_WIFI_POSITINING_PATH #define GET_POSITION_PATH @"GetPosition?clientMac='%@'" #define GET_POSITION_URL WIFI_POSITIONING_URL GET_POSITION_PATH #define GET_RANDOM_POSITION_PATH @"TestGetRandomPosition?buildingId=%d" #define GET_RANDOM_POSITION_URL WIFI_POSITIONING_URL GET_RANDOM_POSITION_PATH @interface SPWiFiPositionProvider : NSObject + (void)startWiFiPositioning; + (void)stopWiFiPositioning; + (SPPosition *)position; + (SPPosition *)randomPosition:(int)buildingId; @end
/* * BridJ - Dynamic and blazing-fast native interop for Java. * http://bridj.googlecode.com/ * * Copyright (c) 2010-2015, Olivier Chafik (http://ochafik.com/) * 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 Olivier Chafik nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY OLIVIER CHAFIK 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 REGENTS AND 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 "PrimDefs_undef.h" #define primName char #define jprimName jchar #define jprimArray jcharArray #define primJNICapName Char #define primCapName Char #define wrapperName Character #define bufferName CharBuffer #define primSize 2 #define alignmentMask 1 #define TEMP_REORDER_VAR_TYPE jshort //#ifdef BIG_ENDIAN //#define REORDER_VALUE_BYTES(peer) REORDER_VALUE_BYTES_jshort(peer, 0, 1) //#else #define REORDER_VALUE_BYTES(peer) REORDER_VALUE_BYTES_jshort(peer, 1, 0) //#endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ #define CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ #include <string> #include <vector> #include "base/basictypes.h" // This class manages the Omnibox field trials. class OmniboxFieldTrial { public: // Creates the static field trial groups. // *** MUST NOT BE CALLED MORE THAN ONCE. *** static void ActivateStaticTrials(); // Activates all dynamic field trials. The main difference between // the autocomplete dynamic and static field trials is that the former // don't require any code changes on the Chrome side as they are controlled // on the server side. Chrome binary simply propagates all necessary // information through the X-Chrome-Variations header. // This method, unlike ActivateStaticTrials(), may be called multiple times. static void ActivateDynamicTrials(); // Returns a bitmap containing AutocompleteProvider::Type values // that should be disabled in AutocompleteController. // This method simply goes over all autocomplete dynamic field trial groups // and looks for group names like "ProvidersDisabled_NNN" where NNN is // an integer corresponding to a bitmap mask. All extracted bitmaps // are OR-ed together and returned as the final result. static int GetDisabledProviderTypes(); // --------------------------------------------------------- // For the inline History Quick Provider field trial. // Returns whether the user is in any field trial group for this // field trial. False indicates that the field trial wasn't // successfully created for some reason. static bool InDisallowInlineHQPFieldTrial(); // Returns whether the user should get the experiment setup or // the default setup for this field trial. The experiment // group prohibits inlining suggestions. static bool InDisallowInlineHQPFieldTrialExperimentGroup(); // --------------------------------------------------------- // For the suggest field trial. // Populates |field_trial_hash| with hashes of the active suggest field trial // names, if any. static void GetActiveSuggestFieldTrialHashes( std::vector<uint32>* field_trial_hash); // --------------------------------------------------------- // For the HistoryURL provider disable culling redirects field trial. // Returns whether the user is in any group for this field trial. // (Should always be true unless initialization went wrong.) static bool InHUPCullRedirectsFieldTrial(); // Returns whether we should disable culling of redirects in // HistoryURL provider. static bool InHUPCullRedirectsFieldTrialExperimentGroup(); // --------------------------------------------------------- // For the HistoryURL provider disable creating a shorter match // field trial. // Returns whether the user is in any group for this field trial. // (Should always be true unless initialization went wrong.) static bool InHUPCreateShorterMatchFieldTrial(); // Returns whether we should disable creating a shorter match in // HistoryURL provider. static bool InHUPCreateShorterMatchFieldTrialExperimentGroup(); // --------------------------------------------------------- // For the AutocompleteController "stop timer" field trial. // Returns whether the user should get the experimental setup or the // default setup for this field trial. The experiment group uses // a timer in AutocompleteController to tell the providers to stop // looking for matches after too much time has passed. In other words, // it tries to tell the providers to stop updating the list of suggested // matches if updating the matches would probably be disruptive because // they're arriving so late. static bool InStopTimerFieldTrialExperimentGroup(); // --------------------------------------------------------- // For the ZeroSuggestProvider field trial. // Returns whether the user is in any field trial where the // ZeroSuggestProvider should be used to get suggestions when the // user clicks on the omnibox but has not typed anything yet. static bool InZeroSuggestFieldTrial(); private: DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); }; #endif // CHROME_BROWSER_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_
/* Copyright (c) 2013, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Ford Motor Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_ #if defined(OS_WIN32) || defined(OS_WINCE) #else #include <strings.h> #endif #include "application_manager/commands/command_request_impl.h" #include "application_manager/commands/pending.h" #include "utils/macro.h" #include "utils/custom_string.h" namespace application_manager { namespace commands { namespace custom_str = utils::custom_string; /** * @brief ChangeRegistrationRequest command class **/ class ChangeRegistrationRequest : public CommandRequestImpl { public: /** * @brief ChangeRegistrationRequest class constructor * * @param message Incoming SmartObject message **/ explicit ChangeRegistrationRequest(const MessageSharedPtr& message); /** * @brief ChangeRegistrationRequest class destructor **/ virtual ~ChangeRegistrationRequest(); /** * @brief Execute command **/ virtual void Run(); /** * @brief Interface method that is called whenever new event received * * @param event The received event */ void on_event(const event_engine::Event& event); private: /* * @brief Search for requested language in HMI UI supported languages * * @return true if language supported by UI, otherwise false */ bool IsLanguageSupportedByUI(const int32_t& hmi_display_lang); /* * @brief Search for requested language in HMI VR supported languages * * @return true if language supported by VR, otherwise false */ bool IsLanguageSupportedByVR(const int32_t& hmi_display_lang); /* * @brief Search for requested language in HMI TTS supported languages * * @return true if language supported by TTS, otherwise false */ bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang); /* * @brief Check if there some not delivered hmi responses exist * * @return true if all responses received */ bool IsPendingResponseExist(); /* * @brief Checks result codes * * @return true if all of result codes is success */ bool AllHmiResponsesSuccess(const hmi_apis::Common_Result::eType ui, const hmi_apis::Common_Result::eType vr, const hmi_apis::Common_Result::eType tts); /** * @brief Checks change_registration params(ttsName, appname, * ngnMediaScreenAppName, vrSynonyms) on invalid characters. * * @return true if command contains \t\n \\t \\n of whitespace otherwise * returns false. */ bool IsWhiteSpaceExist(); /** * @brief Check parameters (name, vr) for * coincidence with already known parameters of registered applications * * @return SUCCESS if there is no coincidence of app.name/VR synonyms, * otherwise appropriate error code returns */ mobile_apis::Result::eType CheckCoincidence(); /** * @brief Checks if requested name is allowed by policy * @param app_name Application name * @return true, if allowed, otherwise - false */ bool IsNicknameAllowed(const custom_str::CustomString& app_name) const; /** * @brief Predicate for using with CheckCoincidence method to compare with VR * synonym SO * * @return TRUE if there is coincidence of VR, otherwise FALSE */ struct CoincidencePredicateVR { explicit CoincidencePredicateVR(const custom_str::CustomString& newItem) : newItem_(newItem){}; bool operator()(const smart_objects::SmartObject& obj) const { const custom_str::CustomString& vr_synonym = obj.asCustomString(); return newItem_.CompareIgnoreCase(vr_synonym); }; const custom_str::CustomString& newItem_; }; Pending pending_requests_; hmi_apis::Common_Result::eType ui_result_; hmi_apis::Common_Result::eType vr_result_; hmi_apis::Common_Result::eType tts_result_; DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest); }; } // namespace commands } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
// // VWWWaterView.h // Water Waves // // Created by Veari_mac02 on 14-5-23. // Copyright (c) 2014年 Veari. All rights reserved. // #import <UIKit/UIKit.h> @interface VWWWaterView : UIView @end
//------------------------------------------------------------------------------ // Copyright (C) 2012, Robert Johansson <rob@raditex.nu>, Raditex Control AB // All rights reserved. // // This file is part of the rSCADA system. // // rSCADA // http://www.rSCADA.se // info@rscada.se // //------------------------------------------------------------------------------ // // CANopen communication routines and data types. // #ifndef _CAN_IF_H_ #define _CAN_IF_H_ #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> #include <unistd.h> #include <linux/can.h> #include <linux/can/raw.h> #include <string.h> #include <stdint.h> int can_socket_open(); int can_socket_close(int socket); int can_filter_node_set(int socket, uint8_t node); int can_filter_clear(int socket); #endif /* _CAN_IF_H */
/* * Copyright (c) 2018, Alliance for Open Media. All rights reserved * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ /* Sum the difference between every corresponding element of the buffers. */ #include "config/aom_config.h" #include "config/aom_dsp_rtcd.h" #include "aom/aom_integer.h" int64_t aom_sse_c(const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, int width, int height) { int y, x; int64_t sse = 0; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { const int32_t diff = abs(a[x] - b[x]); sse += diff * diff; } a += a_stride; b += b_stride; } return sse; } #if CONFIG_AV1_HIGHBITDEPTH int64_t aom_highbd_sse_c(const uint8_t *a8, int a_stride, const uint8_t *b8, int b_stride, int width, int height) { int y, x; int64_t sse = 0; uint16_t *a = CONVERT_TO_SHORTPTR(a8); uint16_t *b = CONVERT_TO_SHORTPTR(b8); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { const int32_t diff = (int32_t)(a[x]) - (int32_t)(b[x]); sse += diff * diff; } a += a_stride; b += b_stride; } return sse; } #endif
#ifndef COMPRESSDIALOG_H #define COMPRESSDIALOG_H #include <QtGui/QDialog> #include "ui_compressdialog.h" class CompressDialog : public QDialog { Q_OBJECT public: explicit CompressDialog(const QString & fileName, QWidget *parent = 0); ~CompressDialog(); protected slots: void openClicked(); void generateMipmapsChanged(int state); void mipmapFilterChanged(QString name); void formatChanged(QString format); void colorWeightChanged(); void uniformWeightToggled(bool checked); void luminanceWeightToggled(bool checked); void normalMapModeChanged(bool checked); private: Ui::CompressDialog ui; }; #endif // COMPRESSDIALOG_H
/** * \file * * \brief RTC configuration * * Copyright (c) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * 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 * EXPRESSLY AND SPECIFICALLY 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. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef CONF_RTC_H #define CONF_RTC_H #define CONFIG_RTC_PRESCALER RTC_PRESCALER_DIV256_gc //#define CONFIG_RTC_COMPARE_INT_LEVEL RTC_COMPINTLVL_LO_gc //#define CONFIG_RTC_OVERFLOW_INT_LEVEL RTC_OVFINTLVL_LO_gc #endif /* CONF_RTC_H */
/* * Copyright (C) 2017, STMicroelectronics - All Rights Reserved * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics. * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _ASM_ARCH_HARDWARE_H #define _ASM_ARCH_HARDWARE_H /* * This empty files is needed to not break compilation * Some common drivers to STM32F4/F7 and H7 include a stm32.h file * Some cleanup need to be done to communalize all the following * stm32.h files: * * arch/arm/include/asm/arch-stm32f1/stm32.h * arch/arm/include/asm/arch-stm32f4/stm32.h * arch/arm/include/asm/arch-stm32f7/stm32.h */ #endif /* _ASM_ARCH_HARDWARE_H */
/* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ /* * ISO C Standard: 7.9 Alternative spellings <iso646.h> */ #ifndef _ISO646_H #define _ISO646_H #ifndef __cplusplus #define and && #define and_eq &= #define bitand & #define bitor | #define compl ~ #define not ! #define not_eq != #define or || #define or_eq |= #define xor ^ #define xor_eq ^= #endif #endif
#ifndef _MFnSubdData #define _MFnSubdData //- // ========================================================================== // Copyright (C) 1995 - 2006 Autodesk, Inc., and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files contain unpublished // information proprietary to Autodesk, Inc. ("Autodesk") and/or its // licensors, which is protected by U.S. and Canadian federal copyright law // and by international treaties. // // The Data may not be disclosed or distributed to third parties or be // copied or duplicated, in whole or in part, without the prior written // consent of Autodesk. // // 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. // AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED // WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF // NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, // OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO // EVENT WILL AUTODESK AND/OR ITS LICENSORS BE LIABLE FOR ANY LOST // REVENUES, DATA, OR PROFITS, OR SPECIAL, DIRECT, INDIRECT, OR // CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS LICENSORS HAS // BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES. // ========================================================================== //+ // // CLASS: MFnSubdData // // **************************************************************************** #if defined __cplusplus // **************************************************************************** // INCLUDED HEADER FILES #include <maya/MFnGeometryData.h> // **************************************************************************** // CLASS DECLARATION (MFnSubdData) //! \ingroup OpenMaya MFn //! \brief Subdiv Surface function set for dependency node data. /*! MFnSubdData allows the creation and manipulation of Subdivision Surface data objects for use in the dependency graph. If a user written dependency node either accepts or produces Subdivision Surfaces, then this class is used to extract or create the data that comes from or goes to other dependency graph nodes. The MDataHandle::type method will return kSubdiv when data of this type is present. If a node is receiving a Subdivision Surface via an input attribute, the asSubdSurface method of MDataHandle can be used to access that input Subdivision Surface. If a node is to create a Subdivision Surface and send it via an output attribute, a new MFnSubdData must be instantiated and then the create method called to build the actual data block as an MObject. This MObject should be passed to the MFnSubd::create method as the parentOrOwner parameter so that the Subdivision Surface will be constructed inside the data block. The MDataHandle::set routine is then used to pass the data block down the connection. */ class OPENMAYA_EXPORT MFnSubdData : public MFnGeometryData { declareMFn(MFnSubdData, MFnGeometryData); public: MObject create( MStatus* ReturnStatus = NULL ); BEGIN_NO_SCRIPT_SUPPORT: declareMFnConstConstructor( MFnSubdData, MFnGeometryData ); END_NO_SCRIPT_SUPPORT: protected: // No protected members private: // No private members }; #endif /* __cplusplus */ #endif /* _MFnSubdData */
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.20.1\Source\Uno\Time\Text\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> #include <Uno.Time.Text.IPatternPart-1.h> namespace g{namespace Uno{namespace Time{namespace Text{struct PatternPart;}}}} namespace g{ namespace Uno{ namespace Time{ namespace Text{ // internal abstract class PatternPart<TBucket, T> :821 // { struct PatternPart_type : uType { ::g::Uno::Time::Text::IPatternPart interface0; void(*fp_Read)(::g::Uno::Time::Text::PatternPart*, uString*, int*, void*, int*); void(*fp_Write)(::g::Uno::Time::Text::PatternPart*, void*, uString**); }; PatternPart_type* PatternPart_typeof(); void PatternPart__ctor__fn(PatternPart* __this); void PatternPart__get_ExpectedSize_fn(PatternPart* __this, int* __retval); void PatternPart__set_ExpectedSize_fn(PatternPart* __this, int* value); void PatternPart__Get_fn(PatternPart* __this, void* bucket, uTRef __retval); void PatternPart__get_Getter_fn(PatternPart* __this, uDelegate** __retval); void PatternPart__set_Getter_fn(PatternPart* __this, uDelegate* value); void PatternPart__get_Obligatory_fn(PatternPart* __this, bool* __retval); void PatternPart__set_Obligatory_fn(PatternPart* __this, bool* value); void PatternPart__Set_fn(PatternPart* __this, void* bucket, void* val); void PatternPart__get_Setter_fn(PatternPart* __this, uDelegate** __retval); void PatternPart__set_Setter_fn(PatternPart* __this, uDelegate* value); void PatternPart__get_SkipNextPartsCountIfThisNotSpecified_fn(PatternPart* __this, int* __retval); void PatternPart__set_SkipNextPartsCountIfThisNotSpecified_fn(PatternPart* __this, int* value); void PatternPart__Write_fn(PatternPart* __this, void* value, uString** __retval); struct PatternPart : uObject { int _ExpectedSize; uStrong<uDelegate*> _Getter; bool _Obligatory; uStrong<uDelegate*> _Setter; int _SkipNextPartsCountIfThisNotSpecified; void ctor_(); int ExpectedSize(); void ExpectedSize(int value); template<class TBucket, class T> T Get(TBucket bucket) { T __retval; return PatternPart__Get_fn(this, uConstrain(__type->GetBase(PatternPart_typeof())->T(0), bucket), &__retval), __retval; } uDelegate* Getter(); void Getter(uDelegate* value); bool Obligatory(); void Obligatory(bool value); template<class TBucket> int Read(uString* line, int position, TBucket value) { int __retval; return (((PatternPart_type*)__type)->fp_Read)(this, line, &position, uConstrain(__type->GetBase(PatternPart_typeof())->T(0), value), &__retval), __retval; } void Read_ex(uString* line, int* position, void* value, int* __retval) { (((PatternPart_type*)__type)->fp_Read)(this, line, position, value, __retval); } template<class TBucket, class T> void Set(TBucket bucket, T val) { PatternPart__Set_fn(this, uConstrain(__type->GetBase(PatternPart_typeof())->T(0), bucket), uConstrain(__type->GetBase(PatternPart_typeof())->T(1), val)); } uDelegate* Setter(); void Setter(uDelegate* value); int SkipNextPartsCountIfThisNotSpecified(); void SkipNextPartsCountIfThisNotSpecified(int value); template<class TBucket> uString* Write(TBucket value) { uString* __retval; return (((PatternPart_type*)__type)->fp_Write)(this, uConstrain(__type->GetBase(PatternPart_typeof())->T(0), value), &__retval), __retval; } void Write_ex(void* value, uString** __retval) { (((PatternPart_type*)__type)->fp_Write)(this, value, __retval); } template<class TBucket> static uString* Write(PatternPart* __this, TBucket value) { uString* __retval; return PatternPart__Write_fn(__this, uConstrain(__this->__type->GetBase(PatternPart_typeof())->T(0), value), &__retval), __retval; } }; // } }}}} // ::g::Uno::Time::Text
/*! Startup function - initialize kernel subsystem */ #define _K_STARTUP_C_ #include "time.h" #include "device.h" #include "memory.h" #include <kernel/errno.h> #include <kernel/features.h> #include <arch/interrupt.h> #include <arch/processor.h> #include <lib/string.h> #include <api/prog_info.h> char system_info[] = OS_NAME ": " NAME_MAJOR ":" NAME_MINOR ", " "Version: " VERSION " (" ARCH ")"; /* state of kernel features */ uint kernel_features = FEATURE_SUPPORTED; /* initially set all to "on" state */ /*! * First kernel function (after boot loader loads it to memory) */ void k_startup () { extern void *k_stdout; /* console for kernel messages */ extern prog_info_t pi; /* set initial stdout */ kdevice_set_initial_stdout (); /* initialize memory subsystem (needed for boot) */ k_memory_init (); /*! start with regular initialization */ /* interrupts */ arch_init_interrupts (); /* detect memory faults (qemu do not detect segment violations!) */ arch_register_interrupt_handler ( INT_MEM_FAULT, k_memory_fault, NULL ); arch_register_interrupt_handler ( INT_UNDEF_FAULT, k_memory_fault, NULL ); /* timer subsystem */ k_time_init (); /* devices */ k_devices_init (); /* switch to default 'stdout' for kernel */ k_stdout = k_device_open ( K_STDOUT, O_WRONLY ); kprintf ( "%s\n", system_info ); pi.heap = kmalloc ( PROG_HEAP_SIZE ); pi.heap_size = PROG_HEAP_SIZE; /* enable interrupts */ enable_interrupts (); /* starting program routine */ prog_init ( NULL ); kprintf ( "\nSystem halted!\n" ); halt (); } /*! Turn kernel feature on/off */ uint sys__feature ( uint features, int cmd, int enable ) { uint prev_state = kernel_features & features; ASSERT ( !( features & ~FEATURE_SUPPORTED ) ); if ( cmd == FEATURE_GET ) return prev_state; /* update state */ if ( enable ) kernel_features |= features; else kernel_features &= ~features; /* action required? */ if ( ( features & FEATURE_INTERRUPTS ) ) { if ( enable ) enable_interrupts (); else disable_interrupts (); } return prev_state; }
/** * @file outline.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Outlines for moving and resizing client windows. * */ #ifndef OUTLINE_H #define OUTLINE_H /** Draw an outline. * @param x The x-coordinate. * @param y The y-coordinate. * @param width The width of the outline. * @param height The height of the outline. */ void DrawOutline(int x, int y, int width, int height); /** Clear an outline. */ void ClearOutline(void); #endif /* OUTLINE_H */
/* * WARNING: do not edit! * Generated by util/mkbuildinf.pl * * Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #define PLATFORM "platform: linux-x32" #define DATE "built on: Tue Apr 21 13:29:19 2020 UTC" /* * Generate compiler_flags as an array of individual characters. This is a * workaround for the situation where CFLAGS gets too long for a C90 string * literal */ static const char compiler_flags[] = { 'c','o','m','p','i','l','e','r',':',' ','g','c','c',' ','-','f', 'P','I','C',' ','-','p','t','h','r','e','a','d',' ','-','m','x', '3','2',' ','-','W','a',',','-','-','n','o','e','x','e','c','s', 't','a','c','k',' ','-','W','a','l','l',' ','-','O','3',' ','-', 'D','O','P','E','N','S','S','L','_','U','S','E','_','N','O','D', 'E','L','E','T','E',' ','-','D','L','_','E','N','D','I','A','N', ' ','-','D','O','P','E','N','S','S','L','_','P','I','C',' ','-', 'D','O','P','E','N','S','S','L','_','C','P','U','I','D','_','O', 'B','J',' ','-','D','O','P','E','N','S','S','L','_','I','A','3', '2','_','S','S','E','2',' ','-','D','O','P','E','N','S','S','L', '_','B','N','_','A','S','M','_','M','O','N','T',' ','-','D','O', 'P','E','N','S','S','L','_','B','N','_','A','S','M','_','M','O', 'N','T','5',' ','-','D','O','P','E','N','S','S','L','_','B','N', '_','A','S','M','_','G','F','2','m',' ','-','D','S','H','A','1', '_','A','S','M',' ','-','D','S','H','A','2','5','6','_','A','S', 'M',' ','-','D','S','H','A','5','1','2','_','A','S','M',' ','-', 'D','K','E','C','C','A','K','1','6','0','0','_','A','S','M',' ', '-','D','R','C','4','_','A','S','M',' ','-','D','M','D','5','_', 'A','S','M',' ','-','D','A','E','S','N','I','_','A','S','M',' ', '-','D','V','P','A','E','S','_','A','S','M',' ','-','D','G','H', 'A','S','H','_','A','S','M',' ','-','D','E','C','P','_','N','I', 'S','T','Z','2','5','6','_','A','S','M',' ','-','D','X','2','5', '5','1','9','_','A','S','M',' ','-','D','P','O','L','Y','1','3', '0','5','_','A','S','M',' ','-','D','N','D','E','B','U','G','\0' };
#import <UIKit/UIKit.h> #import "Swocket.h" FOUNDATION_EXPORT double SwocketVersionNumber; FOUNDATION_EXPORT const unsigned char SwocketVersionString[];
// Copyright [2013] tracy.cpp@gmail.com (TracyYih) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import "OCGumbo.h" @class OCQueryObject; typedef OCQueryObject * (^OCGumboQueryBlockAS) (NSString *); typedef NSString * (^OCGumboQueryBlockSS) (NSString *); typedef NSString * (^OCGumboQueryBlockSV) (void); @interface OCGumboNode (Query) /** * Query children elements from current node by selector. * * @param selector (NSString *) can be elementID | tagName | classSelector | tagName.classSelector | tagName#elementID. */ @property (nonatomic, weak, readonly) OCGumboQueryBlockAS Query; /** * Get the attribute value of the element by attributeName. * * @param attributeName (NSString *) the attribute name. */ @property (nonatomic, weak, readonly) OCGumboQueryBlockSS attr; /** * Get the combined text contents of element. */ @property (nonatomic, weak, readonly) OCGumboQueryBlockSV text; /** * Get the raw contents of element. */ @property (nonatomic, weak, readonly) OCGumboQueryBlockSV html; @end #pragma mark - typedef OCGumboNode * (^NSArrayQueryBlockNV) (void); typedef OCGumboNode * (^NSArrayQueryBlockNI) (NSUInteger); typedef BOOL (^NSArrayQueryBlockBS) (NSString *); typedef NSUInteger (^NSArrayQueryBlockIN) (OCGumboNode *); typedef OCQueryObject * (^NSArrayQueryBlockAS) (NSString *); typedef OCQueryObject * (^NSArrayQueryBlockSA) (void); typedef NSString * (^NSArrayQueryBlockSV) (void); @interface OCQueryObject : NSArray /** * Get the combined text contents of the collection. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockSV text; /** * Get the combined text array of element. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockSA textArray; /** * Get the first element of the current collection. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockNV first; /** * Get the last element of the current collection. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockNV last; /** * Get the element by index from current collection. * * @param index (NSUInteger) the index of the element. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockNI get; /** * Check if any elements in the collection have the specified class. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockBS hasClass; /** * Get the position of an element in current collection. * * @param element (OCGumboNode *) */ @property (nonatomic, weak, readonly) NSArrayQueryBlockIN index; /** * Find elements that match the selector in the current collection. * * @param selector (NSString *) can be elementID | tagName | classSelector | tagName.classSelector | tagName#elementID. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockAS find; /** * Get immediate children of each element in the current collection matching the selector. * * @param selector (NSString *) can be elementID | tagName | classSelector | tagName.classSelector | tagName#elementID. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockAS children; /** * Get immediate parents of each element in the collection matching the selector. * * @param selector (NSString *) can be elementID | tagName | classSelector | tagName.classSelector | tagName#elementID. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockAS parent; /** * Get all ancestors of each element in the collection matching the selector. * * @param selector (NSString *) can be elementID | tagName | classSelector | tagName.classSelector | tagName#elementID. */ @property (nonatomic, weak, readonly) NSArrayQueryBlockAS parents; @end
// // SPMySQLKeepAliveTimer.h // SPMySQLFramework // // Created by Rowan Beentje (rowan.beent.je) on March 5, 2012 // Copyright (c) 2012 Rowan Beentje. All rights reserved. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // More info at <https://github.com/sequelpro/sequelpro> @interface SPMySQLKeepAliveTimer : NSObject { id timerTarget; SEL timerSelector; NSTimeInterval timerRepeatInterval; NSTimer *wrappedTimer; } - (instancetype)initWithInterval:(NSTimeInterval)anInterval target:(id)aTarget selector:(SEL)aSelector NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; - (void)invalidate; @end
#ifndef NORTHBRIDGE_INTEL_I945_CHIP_H #define NORTHBRIDGE_INTEL_I945_CHIP_H #include <drivers/intel/gma/i915.h> struct northbridge_intel_i945_config { /* In units of 100us timer */ /* Timings as defined in VESA Notebook Panel Standard */ u16 gpu_panel_power_up_delay; /* T1+T2 time sequence */ u16 gpu_panel_power_down_delay; /* T3 time sequence */ u16 gpu_panel_power_backlight_on_delay; /* T5 time sequence */ u16 gpu_panel_power_backlight_off_delay; /* Tx time sequence */ /* In units of 0.1s */ u8 gpu_panel_power_cycle_delay; u32 gpu_hotplug; u32 pwm_freq; int gpu_lvds_use_spread_spectrum_clock; struct i915_gpu_controller_info gfx; int pci_mmio_size; }; #endif /* NORTHBRIDGE_INTEL_I945_CHIP_H */
/* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-profile_estimate" } */ extern int global; int bar(int); void foo (int bound) { int i, ret = 0; for (i = 0; i <= bound; i++) { if (i < bound - 2) global += bar (i); if (i <= bound) global += bar (i); if (i + 1 < bound) global += bar (i); if (i != bound) global += bar (i); } } /* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */
/******************************************************************************* This is the driver for the GMAC on-chip Ethernet controller for ST SoCs. DWC Ether MAC 10/100/1000 Universal version 3.41a has been used for developing this code. This contains the functions to handle the dma. Copyright (C) 2007-2009 STMicroelectronics Ltd This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. The full GNU General Public License is included in this distribution in the file called "COPYING". Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> *******************************************************************************/ #include "dwmac1000.h" #include "dwmac_dma.h" static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, u32 dma_tx, u32 dma_rx) { u32 value = readl(ioaddr + DMA_BUS_MODE); int limit; /* DMA SW reset */ value |= DMA_BUS_MODE_SFT_RESET; writel(value, ioaddr + DMA_BUS_MODE); limit = 10; while (limit--) { if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET)) break; mdelay(10); } if (limit < 0) return -EBUSY; value = /* DMA_BUS_MODE_FB | */ DMA_BUS_MODE_4PBL | ((pbl << DMA_BUS_MODE_PBL_SHIFT) | (pbl << DMA_BUS_MODE_RPBL_SHIFT)); #ifdef CONFIG_STMMAC_DA value |= DMA_BUS_MODE_DA; /* Rx has priority over tx */ #endif writel(value, ioaddr + DMA_BUS_MODE); /* Mask interrupts by writing to CSR7 */ writel(DMA_INTR_DEFAULT_MASK, ioaddr + DMA_INTR_ENA); /* The base address of the RX/TX descriptor lists must be written into * DMA CSR3 and CSR4, respectively. */ writel(dma_tx, ioaddr + DMA_TX_BASE_ADDR); writel(dma_rx, ioaddr + DMA_RCV_BASE_ADDR); return 0; } static void dwmac1000_dma_operation_mode(void __iomem *ioaddr, int txmode, int rxmode) { u32 csr6 = readl(ioaddr + DMA_CONTROL); if (txmode == SF_DMA_MODE) { CHIP_DBG(KERN_DEBUG "GMAC: enable TX store and forward mode\n"); /* Transmit COE type 2 cannot be done in cut-through mode. */ csr6 |= DMA_CONTROL_TSF; /* Operating on second frame increase the performance * especially when transmit store-and-forward is used.*/ csr6 |= DMA_CONTROL_OSF; } else { CHIP_DBG(KERN_DEBUG "GMAC: disabling TX store and forward mode" " (threshold = %d)\n", txmode); csr6 &= ~DMA_CONTROL_TSF; csr6 &= DMA_CONTROL_TC_TX_MASK; /* Set the transmit threshold */ if (txmode <= 32) csr6 |= DMA_CONTROL_TTC_32; else if (txmode <= 64) csr6 |= DMA_CONTROL_TTC_64; else if (txmode <= 128) csr6 |= DMA_CONTROL_TTC_128; else if (txmode <= 192) csr6 |= DMA_CONTROL_TTC_192; else csr6 |= DMA_CONTROL_TTC_256; } if (rxmode == SF_DMA_MODE) { CHIP_DBG(KERN_DEBUG "GMAC: enable RX store and forward mode\n"); csr6 |= DMA_CONTROL_RSF; } else { CHIP_DBG(KERN_DEBUG "GMAC: disabling RX store and forward mode" " (threshold = %d)\n", rxmode); csr6 &= ~DMA_CONTROL_RSF; csr6 &= DMA_CONTROL_TC_RX_MASK; if (rxmode <= 32) csr6 |= DMA_CONTROL_RTC_32; else if (rxmode <= 64) csr6 |= DMA_CONTROL_RTC_64; else if (rxmode <= 96) csr6 |= DMA_CONTROL_RTC_96; else csr6 |= DMA_CONTROL_RTC_128; } writel(csr6, ioaddr + DMA_CONTROL); } static void dwmac1000_dump_dma_regs(void __iomem *ioaddr) { int i; pr_info(" DMA registers\n"); for (i = 0; i < 22; i++) { if ((i < 9) || (i > 17)) { int offset = i * 4; pr_err("\t Reg No. %d (offset 0x%x): 0x%08x\n", i, (DMA_BUS_MODE + offset), readl(ioaddr + DMA_BUS_MODE + offset)); } } } static unsigned int dwmac1000_get_hw_feature(void __iomem *ioaddr) { return readl(ioaddr + DMA_HW_FEATURE); } const struct stmmac_dma_ops dwmac1000_dma_ops = { .init = dwmac1000_dma_init, .dump_regs = dwmac1000_dump_dma_regs, .dma_mode = dwmac1000_dma_operation_mode, .enable_dma_transmission = dwmac_enable_dma_transmission, .enable_dma_irq = dwmac_enable_dma_irq, .disable_dma_irq = dwmac_disable_dma_irq, .start_tx = dwmac_dma_start_tx, .stop_tx = dwmac_dma_stop_tx, .start_rx = dwmac_dma_start_rx, .stop_rx = dwmac_dma_stop_rx, .dma_interrupt = dwmac_dma_interrupt, .get_hw_feature = dwmac1000_get_hw_feature, };
// broken_indicator.h -*-c++-*- // // Copyright (C) 2005 Daniel Burrows // // 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; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // #ifndef BROKEN_INDICATOR_H #define BROKEN_INDICATOR_H /** \brief Generates a (hopefully) unobtrusive hint about how to use the * problem resolver. * * \file broken_indicator.h */ namespace cwidget { namespace widgets { class widget; } namespace util { template<class T> class ref_ptr; } } /** \return a newly generated "broken indicator". */ cwidget::util::ref_ptr<cwidget::widgets::widget> make_broken_indicator(); #endif // BROKEN_INDICATOR_H
/* gethostname emulation for SysV and POSIX.1. Copyright (C) 1992, 2003, 2006, 2008-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* David MacKenzie <djm@gnu.ai.mit.edu> Windows port by Simon Josefsson <simon@josefsson.org> */ #include <config.h> #if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) /* Unix API. */ /* Specification. */ #include <unistd.h> #ifdef HAVE_UNAME # include <sys/utsname.h> #endif #include <string.h> /* Put up to LEN chars of the host name into NAME. Null terminate it if the name is shorter than LEN. Return 0 if ok, -1 if error. */ #include <stddef.h> int gethostname (char *name, size_t len) { #ifdef HAVE_UNAME struct utsname uts; if (uname (&uts) == -1) return -1; if (len > sizeof (uts.nodename)) { /* More space than we need is available. */ name[sizeof (uts.nodename)] = '\0'; len = sizeof (uts.nodename); } strncpy (name, uts.nodename, len); #else strcpy (name, ""); /* Hardcode your system name if you want. */ #endif return 0; } #else /* Native Windows API. Which primitive to choose? - gethostname() requires linking with -lws2_32. - GetComputerName() does not return the right kind of hostname. - GetComputerNameEx(ComputerNameDnsHostname,...) returns the right hostname, but it is hard to use portably: - It requires defining _WIN32_WINNT to at least 0x0500. - With mingw, it also requires "#define GetComputerNameEx GetComputerNameExA". - With older versions of mingw, none of the declarations are present at all, not even of the enum value ComputerNameDnsHostname. So we use gethostname(). Linking with -lws2_32 is the least evil. */ #define WIN32_LEAN_AND_MEAN /* Get winsock2.h. */ #include <unistd.h> /* Get INT_MAX. */ #include <limits.h> /* Get set_winsock_errno. */ #include "w32sock.h" #include "sockets.h" #undef gethostname int rpl_gethostname (char *name, size_t len) { int r; if (len > INT_MAX) len = INT_MAX; gl_sockets_startup (SOCKETS_1_1); r = gethostname (name, (int) len); if (r < 0) set_winsock_errno (); return r; } #endif
/******************************************************************* * * Copyright (C) 1997,1998 Marcus Kreutzberger <kreutzbe@informatik.mu-luebeck.de> * Copyright (C) 2006 Henrique Pinto <henrique.pinto@kdemail.net> * * This file is part of the KDE project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * ********************************************************************/ #ifndef BOARD_H #define BOARD_H #include "renderer.h" #include <QGraphicsView> #include <QGraphicsScene> #include <QSize> #include <QVector> #include <QGraphicsPixmapItem> #include <QStack> #include <QPair> #include <QKeyEvent> namespace QSame { class Board; class Stone: public QGraphicsPixmapItem { public: Stone( QSame::Board *board, int x, int y, QGraphicsItem *parent = 0 ); protected: virtual void hoverEnterEvent( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent( QGraphicsSceneHoverEvent * event ); virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ); virtual void keyPressEvent( QKeyEvent *event); private: int m_x, m_y; QSame::Board *m_board; }; typedef QPair<int, int> Coordinate; class GameState { public: GameState(): m_valid( false ) {} GameState( QSame::Board *board ); QVector<quint8> m_boardData; quint8 m_width; quint8 m_height; quint8 m_colorCount; quint32 m_boardNumber; quint32 m_score; bool m_valid; bool m_changed; }; class Board: public QGraphicsScene { friend class QSame::Stone; friend class QSame::GameState; Q_OBJECT public: explicit Board( QObject *parent = 0 ); void newGame( quint32 boardNumber = 0, quint8 width = 15, quint8 height = 10, quint8 colorCount = 3 ); void resize( const QSize& size ); quint32 width() const { return m_width; } quint32 height() const { return m_height; } quint32 score() const { return m_score; } quint32 boardNumber() const { return m_boardNumber; } quint8 colors() const { return m_colorCount; } quint8 count( quint8 color ) const { return m_boardData.count( color ); } int markedStones() const { return m_markedStones.count(); } void markNext(int dir); void displayCursor(); void removeMarked(); bool changed() const { return m_changed; } bool canUndo() const { return !m_undoList.empty(); } bool undo(); bool isGameOver() const; bool won() const; signals: void newGameStarted( quint32 boardNumber, quint8 colors ); void newCountOfMarkedStones( int markedStones ); void stonesRemoved( int numberOfRemovedStones ); void gameOver(); void scoreChanged( quint32 newScore ); protected: virtual void drawBackground( QPainter *painter, const QRectF& rect ); void mark( int x, int y ); bool isMarked( int x, int y); void unmark(); private: void initializeBoardData(); void createItems(); void generateGameOverPixmap( bool won ); void markHelper( int x, int y, quint8 color ); int map( int x, int y ) const; bool validPosition( int x, int y ) const; QSame::Renderer m_renderer; quint8 m_width; quint8 m_height; quint8 m_colorCount; quint32 m_boardNumber; quint32 m_score; bool m_changed; QVector<quint8> m_boardData; QVector<QSame::Stone*> m_stones; QSize m_elementsSize; QList<QSame::Coordinate> m_markedStones; QStack<QSame::GameState> m_undoList; QSame::Coordinate m_cursor; QGraphicsPixmapItem *m_gameOverOverlay; }; } // namespace QSame #endif // BOARD_H