text
stringlengths
4
6.14k
#ifndef ROOTS_H #define ROOTS_H #include "bisection.h" #include "muller.h" #include "brent.h" #include "newton.h" #include "secant.h" #include "rootlocalizer.h" #endif // ROOTS_H
/* cairo - a vector graphics library with display and print output * * Copyright © 2002 University of Southern California * * This library is free software; you can redistribute it and/or * modify it either under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * (the "LGPL") or, at your option, under the terms of the Mozilla * Public License Version 1.1 (the "MPL"). If you do not alter this * notice, a recipient may use your version of this file under either * the MPL or the LGPL. * * You should have received a copy of the LGPL along with this library * in the file COPYING-LGPL-2.1; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * You should have received a copy of the MPL along with this library * in the file COPYING-MPL-1.1 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY * OF ANY KIND, either express or implied. See the LGPL or the MPL for * the specific language governing rights and limitations. * * The Original Code is the cairo graphics library. * * The Initial Developer of the Original Code is University of Southern * California. * * Contributor(s): * Carl D. Worth <cworth@cworth.org> */ #ifndef CAIRO_XLIB_XRENDER_H #define CAIRO_XLIB_XRENDER_H #include <cairo.h> #if CAIRO_HAS_XLIB_XRENDER_SURFACE #include <X11/Xlib.h> #include <X11/extensions/Xrender.h> CAIRO_BEGIN_DECLS cairo_public cairo_surface_t * cairo_xlib_surface_create_with_xrender_format (Display *dpy, Drawable drawable, Screen *screen, XRenderPictFormat *format, int width, int height); cairo_public XRenderPictFormat * cairo_xlib_surface_get_xrender_format (cairo_surface_t *surface); CAIRO_END_DECLS #else /* CAIRO_HAS_XLIB_XRENDER_SURFACE */ # error Cairo was not compiled with support for the xlib XRender backend #endif /* CAIRO_HAS_XLIB_XRENDER_SURFACE */ #endif /* CAIRO_XLIB_XRENDER_H */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* base class for rendering objects that do not have child lists */ #ifndef nsLeafFrame_h___ #define nsLeafFrame_h___ #include "nsFrame.h" #include "nsDisplayList.h" /** * Abstract class that provides simple fixed-size layout for leaf objects * (e.g. images, form elements, etc.). Deriviations provide the implementation * of the GetDesiredSize method. The rendering method knows how to render * borders and backgrounds. */ class nsLeafFrame : public nsFrame { public: // nsIFrame replacements NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { DO_GLOBAL_REFLOW_COUNT_DSP("nsLeafFrame"); return DisplayBorderBackgroundOutline(aBuilder, aLists); } /** * Both GetMinWidth and GetPrefWidth will return whatever GetIntrinsicWidth * returns. */ virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext); virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext); /** * Our auto size is just intrinsic width and intrinsic height. */ virtual nsSize ComputeAutoSize(nsIRenderingContext *aRenderingContext, nsSize aCBSize, nscoord aAvailableWidth, nsSize aMargin, nsSize aBorder, nsSize aPadding, PRBool aShrinkWrap); /** * Reflow our frame. This will use the computed width plus borderpadding for * the desired width, and use the return value of GetIntrinsicHeight plus * borderpadding for the desired height. Ascent will be set to the height, * and descent will be set to 0. */ NS_IMETHOD Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); /** * This method does most of the work that Reflow() above need done. */ NS_IMETHOD DoReflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); virtual PRBool IsFrameOfType(PRUint32 aFlags) const { // We don't actually contain a block, but we do always want a // computed width, so tell a little white lie here. return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplacedContainsBlock)); } protected: nsLeafFrame(nsStyleContext* aContext) : nsFrame(aContext) {} virtual ~nsLeafFrame(); /** * Return the intrinsic width of the frame's content area. Note that this * should not include borders or padding and should not depend on the applied * styles. */ virtual nscoord GetIntrinsicWidth() = 0; /** * Return the intrinsic height of the frame's content area. This should not * include border or padding. This will only matter if the specified height * is auto. Note that subclasses must either implement this or override * Reflow and ComputeAutoSize; the default Reflow and ComputeAutoSize impls * call this method. */ virtual nscoord GetIntrinsicHeight(); /** * Subroutine to add in borders and padding */ void AddBordersAndPadding(const nsHTMLReflowState& aReflowState, nsHTMLReflowMetrics& aDesiredSize); /** * Set aDesiredSize to be the available size */ void SizeToAvailSize(const nsHTMLReflowState& aReflowState, nsHTMLReflowMetrics& aDesiredSize); }; #endif /* nsLeafFrame_h___ */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsInterfaceHashtable_h__ #define nsInterfaceHashtable_h__ #include "nsBaseHashtable.h" #include "nsHashKeys.h" #include "nsCOMPtr.h" /** * templated hashtable class maps keys to interface pointers. * See nsBaseHashtable for complete declaration. * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h * for a complete specification. * @param Interface the interface-type being wrapped * @see nsDataHashtable, nsClassHashtable */ template<class KeyClass, class Interface> class nsInterfaceHashtable : public nsBaseHashtable<KeyClass, nsCOMPtr<Interface>, Interface*> { public: typedef typename KeyClass::KeyType KeyType; typedef Interface* UserDataType; typedef nsBaseHashtable<KeyClass, nsCOMPtr<Interface>, Interface*> base_type; nsInterfaceHashtable() {} explicit nsInterfaceHashtable(uint32_t aInitLength) : nsBaseHashtable<KeyClass, nsCOMPtr<Interface>, Interface*>(aInitLength) { } /** * @copydoc nsBaseHashtable::Get * @param aData This is an XPCOM getter, so aData is already_addrefed. * If the key doesn't exist, aData will be set to nullptr. */ bool Get(KeyType aKey, UserDataType* aData) const; /** * @copydoc nsBaseHashtable::Get */ already_AddRefed<Interface> Get(KeyType aKey) const; /** * Gets a weak reference to the hashtable entry. * @param aFound If not nullptr, will be set to true if the entry is found, * to false otherwise. * @return The entry, or nullptr if not found. Do not release this pointer! */ Interface* GetWeak(KeyType aKey, bool* aFound = nullptr) const; }; template<typename K, typename T> inline void ImplCycleCollectionUnlink(nsInterfaceHashtable<K, T>& aField) { aField.Clear(); } template<typename K, typename T> inline void ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, const nsInterfaceHashtable<K, T>& aField, const char* aName, uint32_t aFlags = 0) { for (auto iter = aField.ConstIter(); !iter.Done(); iter.Next()) { CycleCollectionNoteChild(aCallback, iter.UserData(), aName, aFlags); } } // // nsInterfaceHashtable definitions // template<class KeyClass, class Interface> bool nsInterfaceHashtable<KeyClass, Interface>::Get(KeyType aKey, UserDataType* aInterface) const { typename base_type::EntryType* ent = this->GetEntry(aKey); if (ent) { if (aInterface) { *aInterface = ent->mData; NS_IF_ADDREF(*aInterface); } return true; } // if the key doesn't exist, set *aInterface to null // so that it is a valid XPCOM getter if (aInterface) { *aInterface = nullptr; } return false; } template<class KeyClass, class Interface> already_AddRefed<Interface> nsInterfaceHashtable<KeyClass, Interface>::Get(KeyType aKey) const { typename base_type::EntryType* ent = this->GetEntry(aKey); if (!ent) { return nullptr; } nsCOMPtr<Interface> copy = ent->mData; return copy.forget(); } template<class KeyClass, class Interface> Interface* nsInterfaceHashtable<KeyClass, Interface>::GetWeak(KeyType aKey, bool* aFound) const { typename base_type::EntryType* ent = this->GetEntry(aKey); if (ent) { if (aFound) { *aFound = true; } return ent->mData; } // Key does not exist, return nullptr and set aFound to false if (aFound) { *aFound = false; } return nullptr; } #endif // nsInterfaceHashtable_h__
/* Copyright (c) 2013-2017 Jeffrey Pfau * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <mgba-util/elf-read.h> #ifdef USE_ELF #include <mgba-util/vfs.h> DEFINE_VECTOR(ELFProgramHeaders, Elf32_Phdr); DEFINE_VECTOR(ELFSectionHeaders, Elf32_Shdr); static bool _elfInit = false; struct ELF { Elf* e; struct VFile* vf; size_t size; char* memory; }; struct ELF* ELFOpen(struct VFile* vf) { if (!_elfInit) { _elfInit = elf_version(EV_CURRENT) != EV_NONE; if (!_elfInit) { return NULL; } } if (!vf) { return NULL; } size_t size = vf->size(vf); char* memory = vf->map(vf, size, MAP_READ); if (!memory) { return NULL; } Elf* e = elf_memory(memory, size); if (!e || elf_kind(e) != ELF_K_ELF) { elf_end(e); vf->unmap(vf, memory, size); return false; } struct ELF* elf = malloc(sizeof(*elf)); elf->e = e; elf->vf = vf; elf->size = size; elf->memory = memory; return elf; } void ELFClose(struct ELF* elf) { elf_end(elf->e); elf->vf->unmap(elf->vf, elf->memory, elf->size); free(elf); } void* ELFBytes(struct ELF* elf, size_t* size) { if (size) { *size = elf->size; } return elf->memory; } uint16_t ELFMachine(struct ELF* elf) { Elf32_Ehdr* hdr = elf32_getehdr(elf->e); if (!hdr) { return 0; } return hdr->e_machine; } uint32_t ELFEntry(struct ELF* elf) { Elf32_Ehdr* hdr = elf32_getehdr(elf->e); if (!hdr) { return 0; } return hdr->e_entry; } void ELFGetProgramHeaders(struct ELF* elf, struct ELFProgramHeaders* ph) { ELFProgramHeadersClear(ph); Elf32_Ehdr* hdr = elf32_getehdr(elf->e); Elf32_Phdr* phdr = elf32_getphdr(elf->e); ELFProgramHeadersResize(ph, hdr->e_phnum); memcpy(ELFProgramHeadersGetPointer(ph, 0), phdr, sizeof(*phdr) * hdr->e_phnum); } void ELFGetSectionHeaders(struct ELF* elf, struct ELFSectionHeaders* sh) { ELFSectionHeadersClear(sh); Elf_Scn* section = elf_getscn(elf->e, 0); do { *ELFSectionHeadersAppend(sh) = *elf32_getshdr(section); } while ((section = elf_nextscn(elf->e, section))); } Elf32_Shdr* ELFGetSectionHeader(struct ELF* elf, size_t index) { Elf_Scn* section = elf_getscn(elf->e, index); return elf32_getshdr(section); } size_t ELFFindSection(struct ELF* elf, const char* name) { Elf32_Ehdr* hdr = elf32_getehdr(elf->e); size_t shstrtab = hdr->e_shstrndx; if (strcmp(name, ".shstrtab") == 0) { return shstrtab; } Elf_Scn* section = NULL; while ((section = elf_nextscn(elf->e, section))) { Elf32_Shdr* shdr = elf32_getshdr(section); const char* sname = elf_strptr(elf->e, shstrtab, shdr->sh_name); if (strcmp(sname, name) == 0) { return elf_ndxscn(section); } } return 0; } const char* ELFGetString(struct ELF* elf, size_t section, size_t string) { return elf_strptr(elf->e, section, string); } #endif
#pragma once #include "NativeMemory.hpp" #include "PatternInfo.h" #include "../Util/Logger.hpp" #include "../Util/Strings.hpp" #include <string> #include <utility> namespace MemoryPatcher { // simple NOP patcher class Patcher { public: Patcher(std::string name, PatternInfo& pattern, bool verbose) : mName(std::move(name)) , mPattern(pattern) , mVerbose(verbose) , mMaxAttempts(4) , mAttempts(0) , mPatched(false) , mAddress(0) , mTemp(0) { } Patcher(std::string name, PatternInfo& pattern) : Patcher(std::move(name), pattern, false) { } virtual ~Patcher() { if (Patched()) { logger.Write(DEBUG, "Patcher '%s' d'tor cleanup", mName.c_str()); Restore(); } } virtual bool Patch() { if (mAttempts > mMaxAttempts) { return false; } if (mPatched) { if (mVerbose) logger.Write(DEBUG, "[Patch] [%s] Already patched", mName.c_str()); return true; } mTemp = Apply(); if (mTemp) { mAddress = mTemp; mPatched = true; mAttempts = 0; if (mVerbose) { std::string bytes = ByteArrayToString(mPattern.Data.data(), mPattern.Data.size()); logger.Write(DEBUG, "[Patch] [%s] Patch success, original code: %s", mName.c_str(), bytes.c_str()); } return true; } logger.Write(ERROR, "[Patch] [%s] Patch failed", mName.c_str()); mAttempts++; if (mAttempts > mMaxAttempts) { logger.Write(ERROR, "[Patch] [%s] Patch attempt limit exceeded", mName.c_str()); logger.Write(ERROR, "[Patch] [%s] Patching disabled", mName.c_str()); } return false; } virtual bool Restore() { if (mVerbose) logger.Write(DEBUG, "[Patch] [%s] Restoring instructions", mName.c_str()); if (!mPatched) { if (mVerbose) logger.Write(DEBUG, "[Patch] [%s] Already restored/intact", mName.c_str()); return true; } if (mAddress) { memcpy((void*)mAddress, mPattern.Data.data(), mPattern.Data.size()); mAddress = 0; mPatched = false; mAttempts = 0; if (mVerbose) { logger.Write(DEBUG, "[Patch] [%s] Restore success", mName.c_str()); } return true; } logger.Write(ERROR, "[Patch] [%s] restore failed", mName.c_str()); return false; } uintptr_t Test() const { auto addr = mem::FindPattern(mPattern.Pattern, mPattern.Mask); if (addr) logger.Write(DEBUG, "[Patch] Test: [%s] found at 0x%p", mName.c_str(), addr); else logger.Write(ERROR, "[Patch] Test: [%s] not found", mName.c_str()); return addr; } bool Patched() const { return mPatched; } protected: const std::string mName; PatternInfo& mPattern; bool mVerbose; const int mMaxAttempts; int mAttempts; bool mPatched; uintptr_t mAddress; uintptr_t mTemp; virtual uintptr_t Apply() { uintptr_t address; if (mTemp != NULL) { address = mTemp; } else { address = mem::FindPattern(mPattern.Pattern, mPattern.Mask); if (address) { address += mPattern.Offset; logger.Write(DEBUG, "[Patch] [%s] found at 0x%p", mName.c_str(), address); } else { logger.Write(ERROR, "[Patch] [%s] not found", mName.c_str()); } } if (address) { memcpy(mPattern.Data.data(), (void*)address, mPattern.Data.size()); memset(reinterpret_cast<void *>(address), 0x90, mPattern.Data.size()); } return address; } }; // TODO: Can probably be removed when mPattern.Data makes more sense later? class PatcherJmp : public Patcher { public: PatcherJmp(const std::string& name, PatternInfo& pattern, bool verbose) : Patcher(name, pattern, verbose) {} PatcherJmp(const std::string& name, PatternInfo& pattern) : Patcher(name, pattern) {} protected: uintptr_t Apply() override { uintptr_t address; if (mTemp != NULL) { address = mTemp; } else { address = mem::FindPattern(mPattern.Pattern, mPattern.Mask); if (address) { address += mPattern.Offset; logger.Write(DEBUG, "[Patch] [%s] found at 0x%p", mName.c_str(), address); } else { logger.Write(ERROR, "[Patch] [%s] not found", mName.c_str()); } } if (address) { uint8_t instrArr[6] = { 0xE9, 0x00, 0x00, 0x00, 0x00, 0x90 }; // make preliminary instruction: JMP to <adrr> uint8_t origSteerInstrDest[4] = { 0x00, 0x00, 0x00, 0x00 }; memcpy(mPattern.Data.data(), (void*)address, 6); // save whole orig instruction memcpy(origSteerInstrDest, (void*)(address + 2), 4); // save the address it writes to origSteerInstrDest[0] += 1; // Increment first byte by 1 memcpy(instrArr + 1, origSteerInstrDest, 4); // use saved address in new instruction memcpy((void*)address, instrArr, 6); // patch with new fixed instruction return address; } return 0; } }; }
#ifndef NETWORH_ESTABLISH_HELPER_H #define NETWORH_ESTABLISH_HELPER_H #include "FreeRTOS.h" #include "list.h" #include "FreeRTOS_IP.h" void vApplicationIPNetworkEventHook(eIPCallbackEvent_t eNetworkEvent); #endif
/***************************************************************************** * PokerTH - The open source texas holdem engine * * Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * * * * * * Additional permission under GNU AGPL version 3 section 7 * * * * If you modify this program, or any covered work, by linking or * * combining it with the OpenSSL project's OpenSSL library (or a * * modified version of that library), containing parts covered by the * * terms of the OpenSSL or SSLeay licenses, the authors of PokerTH * * (Felix Hammer, Florian Thauer, Lothar May) grant you additional * * permission to convey the resulting work. * * Corresponding Source for a non-source form of such a combination * * shall include the source code for the parts of OpenSSL used as well * * as that of the covered work. * *****************************************************************************/ #ifndef CARDDECKSTYLEREADER_H #define CARDDECKSTYLEREADER_H #include <tinyxml.h> #include "configfile.h" #include <string> #include <QtCore> #include <QtGui> #define POKERTH_CD_STYLE_FILE_VERSION 2 enum CdStyleState { CD_STYLE_OK = 0, CD_STYLE_OUTDATED, CD_STYLE_FIELDS_EMPTY, CD_STYLE_PICTURES_MISSING, CD_STYLE_UNDEFINED }; class CardDeckStyleReader : public QObject { Q_OBJECT public: CardDeckStyleReader(ConfigFile *c, QWidget *w ); ~CardDeckStyleReader(); void readStyleFile(QString); QString getStyleDescription() const { return StyleDescription; } QString getStyleMaintainerName() const { return StyleMaintainerName; } QString getStyleMaintainerEMail() const { return StyleMaintainerEMail; } QString getStyleCreateDate() const { return StyleCreateDate; } QString getCurrentFileName() const { return currentFileName; } QString getCurrentDir() const { return currentDir; } QString getPreview() const { return Preview; } QString getBigIndexesActionBottom() const { return BigIndexesActionBottom; } bool getFallBack() const { return fallBack; } bool getLoadedSuccessfull() const { return loadedSuccessfull; } CdStyleState getState() const { return myState; } QString getMyStateToolTipInfo(); void showErrorMessage(); void showLeftItemsErrorMessage(); void showCardsLeftErrorMessage(); void showOutdatedErrorMessage(); private: QString StyleDescription; QString StyleMaintainerName; QString StyleMaintainerEMail; QString StyleCreateDate; QString PokerTHStyleFileVersion; QString Preview; QString BigIndexesActionBottom; QString currentFileName; QString currentDir; QByteArray fileContent; QStringList cardsLeft; QStringList leftItems; ConfigFile *myConfig; QWidget *myW; bool fallBack; bool loadedSuccessfull; CdStyleState myState; }; #endif
/** * Copyright (c) 2016 DeepCortex GmbH <legal@eventql.io> * Authors: * - Paul Asmuth <paul@eventql.io> * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License ("the license") as * published by the Free Software Foundation, either version 3 of the License, * or any later version. * * In accordance with Section 7(e) of the license, the licensing of the Program * under the license does not imply a trademark license. Therefore any rights, * title and interest in our trademarks remain entirely with us. * * 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 license for more details. * * You can be released from the requirements of the license by purchasing a * commercial license. Buying such a license is mandatory as soon as you develop * commercial activities involving this program without disclosing the source * code of your own applications */ #ifndef _STX_REFLECT_PROPERTY_H #define _STX_REFLECT_PROPERTY_H #include <vector> #include <string> #include <functional> #include "eventql/util/reflect/indexsequence.h" namespace reflect { template <typename ClassType, typename TargetType> class PropertyReader { public: PropertyReader(TargetType* target); template <typename PropertyType> void prop( PropertyType prop, uint32_t id, const std::string& prop_name, bool optional); const ClassType& instance() const; protected: ClassType instance_; TargetType* target_; }; template <typename ClassType, typename TargetType> class PropertyWriter { public: PropertyWriter(const ClassType& instance, TargetType* target); template <typename PropertyType> void prop( PropertyType prop, uint32_t id, const std::string& prop_name, bool optional); protected: const ClassType& instance_; TargetType* target_; }; template <typename TargetType> class PropertyProxy { public: PropertyProxy(TargetType* target); template <typename PropertyType> void prop( PropertyType prop, uint32_t id, const std::string& prop_name, bool optional); protected: TargetType* target_; }; } #include "property_impl.h" #endif
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2018 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include <kernel/kernel.h> #include <kernel/user.h> #include <kotaka/paths/system.h> #include <kotaka/privilege.h> #include <type.h> #define VERIFY() \ do {\ if (!client || client != previous_object())\ error("Unauthorized caller: expected " +\ object_name(client) + ", got " +\ object_name(previous_object()));\ } while (0) inherit a SECOND_AUTO; inherit w LIB_WIZTOOL; object client; string directory; string *messages; static void create(int clone) { if (clone) { w::create(200); messages = ({ }); directory = USR_DIR + "/" + query_owner(); } } static void message(string str) { messages += ({ str }); } int num_messages() { VERIFY(); return sizeof(messages); } string *query_messages() { VERIFY(); return messages; } void clear_messages() { VERIFY(); messages = ({ }); } private string normalize(string in) { return DRIVER->normalize_path(in, directory, query_owner()); } void set_client(object new_client) { ACCESS_CHECK(previous_program() == PROXYD); client = new_client; } void set_directory(string new_directory) { VERIFY(); directory = normalize(new_directory); } string query_directory() { VERIFY(); return directory; } void add_user(string user) { VERIFY(); ::add_user(user); } void remove_user(string user) { VERIFY(); ::remove_user(user); } void set_access(string user, string file, int type) { VERIFY(); file = normalize(file); ::set_access(user, file, type); } void set_global_access(string dir, int flag) { VERIFY(); dir = normalize(dir); ::set_global_access(dir, flag); } void add_owner(string rowner) { VERIFY(); ::add_owner(rowner); } void remove_owner(string rowner) { VERIFY(); ::remove_owner(rowner); } void set_rsrc(string name, int max, int decay, int period) { VERIFY(); ::set_rsrc(name, max, decay, period); } mixed *query_rsrc(string name) { VERIFY(); return ::query_rsrc(name); } void rsrc_set_limit(string rowner, string name, int max) { VERIFY(); ::rsrc_set_limit(rowner, name, max); } mixed *rsrc_get(string owner, string name) { VERIFY(); return ::rsrc_get(owner, name); } int rsrc_incr(string rowner, string name, mixed index, int incr, varargs int force) { VERIFY(); return ::rsrc_incr(rowner, name, index, incr, force); } object compile_object(string path, string source...) { VERIFY(); path = normalize(path); return w::compile_object(path, source...); } object clone_object(string path) { VERIFY(); path = normalize(path); return w::clone_object(path); } int destruct_object(mixed obj) { VERIFY(); if (typeof(obj) == T_STRING) { obj = normalize(obj); } return w::destruct_object(obj); } object new_object(string path) { VERIFY(); path = normalize(path); return w::new_object(path); } mixed read_file(string path, varargs int offset, int size) { VERIFY(); path = normalize(path); return ::read_file(path, offset, size); } int write_file(string path, string str, varargs int offset) { VERIFY(); path = normalize(path); return ::write_file(path, str, offset); } int remove_file(string path) { VERIFY(); path = normalize(path); return ::remove_file(path); } int rename_file(string from, string to) { VERIFY(); from = normalize(from); to = normalize(to); return ::rename_file(from, to); } mixed *file_info(string path) { VERIFY(); path = normalize(path); return ::file_info(path); } mixed **get_dir(string path) { VERIFY(); path = normalize(path); return ::get_dir(path); } int make_dir(string path) { VERIFY(); path = normalize(path); return ::make_dir(path); } int remove_dir(string path) { VERIFY(); path = normalize(path); return ::remove_dir(path); } void swapout() { VERIFY(); ::swapout(); } void dump_state(varargs int increment) { VERIFY(); w::dump_state(increment); } void shutdown(varargs int hotboot) { VERIFY(); ::shutdown(hotboot); }
/* * Mezzanine - an overhead visual object tracker. * Copyright (C) Andrew Howard 2002 * * 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. * */ /*************************************************************************** * Desc: Functions for set blob parameters * Author: Andrew Howard * Date: 11 Apr 2002 * CVS: $Id: blobfind.c,v 1.1 2004-12-12 23:36:34 johnsond Exp $ ***************************************************************************/ #include <assert.h> #include <stdlib.h> #include "mezzcal.h" // Information about all the definitions typedef struct { imagewnd_t *imagewnd; // The window with the image tablewnd_t *tablewnd; // The window with the table mezz_mmap_t *mmap; // Pointer to mmap mezz_blobdef_t *blobdef; // Pointer to mmap blob definition rtk_tableitem_t *area[2]; // Blob area settings rtk_tableitem_t *sizex[2]; // Blob width rtk_tableitem_t *sizey[2]; // Blob height rtk_fig_t *blobfig; // Figure for drawing blobs } blobfind_t; // The one and only blobfind set static blobfind_t *blobfind; // Initialise the blobfind interface int blobfind_init(imagewnd_t *imagewnd, tablewnd_t *tablewnd, mezz_mmap_t *mmap) { blobfind = malloc(sizeof(blobfind_t)); blobfind->imagewnd = imagewnd; blobfind->tablewnd = tablewnd; // Store pointer to the ipc mmap blobfind->mmap = mmap; blobfind->blobdef = &mmap->blobdef; blobfind->blobfig = rtk_fig_create(imagewnd->canvas, imagewnd->imagefig, 1); blobfind->area[0] = rtk_tableitem_create_int(tablewnd->table, "blob min area", 0, 10000); rtk_tableitem_set_int(blobfind->area[0], blobfind->blobdef->min_area); blobfind->area[1] = rtk_tableitem_create_int(tablewnd->table, "blob max area", 0, 10000); rtk_tableitem_set_int(blobfind->area[1], blobfind->blobdef->max_area); blobfind->sizex[0] = rtk_tableitem_create_int(tablewnd->table, "blob min width", 0, 10000); rtk_tableitem_set_int(blobfind->sizex[0], blobfind->blobdef->min_sizex); blobfind->sizex[1] = rtk_tableitem_create_int(tablewnd->table, "blob max width", 0, 10000); rtk_tableitem_set_int(blobfind->sizex[1], blobfind->blobdef->max_sizex); blobfind->sizey[0] = rtk_tableitem_create_int(tablewnd->table, "blob min height", 0, 10000); rtk_tableitem_set_int(blobfind->sizey[0], blobfind->blobdef->min_sizey); blobfind->sizey[1] = rtk_tableitem_create_int(tablewnd->table, "blob max height", 0, 10000); rtk_tableitem_set_int(blobfind->sizey[1], blobfind->blobdef->max_sizey); return 0; } // Update the blobfind interface void blobfind_update() { int i; int color; mezz_blob_t *blob; // Draw in the extracted blobs rtk_fig_clear(blobfind->blobfig); if (rtk_menuitem_ischecked(blobfind->imagewnd->blobitem)) { for (i = 0; i < blobfind->mmap->bloblist.count; i++) { blob = blobfind->mmap->bloblist.blobs + i; if (blob->class < 0) continue; color = blobfind->mmap->classdeflist.classdefs[blob->class].color; rtk_fig_color_rgb32(blobfind->blobfig, color); rtk_fig_rectangle(blobfind->blobfig, (blob->max_x + blob->min_x)/2, (blob->max_y + blob->min_y)/2, 0, (blob->max_x - blob->min_x), (blob->max_y - blob->min_y), 0); } } // Update blob settings from the table blobfind->blobdef->min_area = rtk_tableitem_get_int(blobfind->area[0]); blobfind->blobdef->max_area = rtk_tableitem_get_int(blobfind->area[1]); blobfind->blobdef->min_sizex = rtk_tableitem_get_int(blobfind->sizex[0]); blobfind->blobdef->max_sizex = rtk_tableitem_get_int(blobfind->sizex[1]); blobfind->blobdef->min_sizey = rtk_tableitem_get_int(blobfind->sizey[0]); blobfind->blobdef->max_sizey = rtk_tableitem_get_int(blobfind->sizey[1]); }
#include <stdio.h> #include <fcntl.h> int main() { int fd; fd = open("1", O_RDONLY); if(fd >= 0) printf("open handle value:%d\n", fd); return 0; }
/* * Copyright (C) 2016 Fanout, Inc. * * This file is part of Pushpin. * * $FANOUT_BEGIN_LICENSE:AGPL$ * * Pushpin is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) * any later version. * * Pushpin 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 Affero General Public License for * more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Alternatively, Pushpin may be used under the terms of a commercial license, * where the commercial license agreement is provided with the software or * contained in a written agreement between you and Fanout. For further * information use the contact form at <https://fanout.io/enterprise/>. * * $FANOUT_END_LICENSE$ */ #ifndef CIDSET_H #define CIDSET_H #include <QSet> #include <QString> #include <QMetaType> typedef QSet<QString> CidSet; Q_DECLARE_METATYPE(CidSet); #endif
/* * led.c * * Created on: Jul 15, 2013 * Author: zhizhouli */ #include <stdint.h> #include "FPGA.h" #include "led.h" #define LED_ADDRESS led_address #define LED_DATA *((volatile int*) led_address) void set_rgb_led(void* led_address, char r, char g, char b) { unsigned int i=0x0; i = r + (g << 8) + (b << 16); LED_DATA = i; return; }
/* * naive-psi.h * * Created on: Jul 9, 2014 * Author: mzohner */ #ifndef NAIVE_PSI_H_ #define NAIVE_PSI_H_ #include "../util/typedefs.h" #include "../util/connection.h" #include "../util/crypto/crypto.h" #include "../util/crypto/pk-crypto.h" #include <glib.h> #include "../util/helpers.h" void print_naive_psi_usage(); uint32_t naivepsi(role_type role, uint32_t neles, uint32_t pneles, uint32_t* elebytelens, uint8_t** elements, uint8_t*** result, uint32_t** resbytelens, crypto* crypt_env, CSocket* sock, uint32_t ntasks); uint32_t naivepsi(role_type role, uint32_t neles, uint32_t pneles, uint32_t elebytelen, uint8_t* elements, uint8_t** result, crypto* crypt_env, CSocket* sock, uint32_t ntasks); uint32_t naivepsi(role_type role, uint32_t neles, uint32_t pneles, task_ctx ectx, crypto* crypt_env, CSocket* sock, uint32_t ntasks, uint32_t* matches); #endif /* NAIVE_PSI_H_ */
/* * _StateControl.h * * Created on: Aug 27, 2016 * Author: Kai */ #ifndef OpenKAI_src_State__StateControl_H_ #define OpenKAI_src_State__StateControl_H_ #include "../Base/_ModuleBase.h" #include "../UI/_Console.h" #include "../State/Goto.h" #include "../State/Waypoint.h" #include "../State/Land.h" #include "../State/Loiter.h" #include "../State/State.h" #include "../State/RTH.h" #include "../State/Takeoff.h" #define ADD_STATE(x) if(pKs->m_class==#x){S.m_pInst=new x();S.m_pKiss=pKs;} namespace kai { struct STATE_INST { State* m_pInst; Kiss* m_pKiss; void init(void) { m_pInst = NULL; m_pKiss = NULL; } }; class _StateControl: public _ModuleBase { public: _StateControl(); virtual ~_StateControl(); bool init(void* pKiss); bool start(void); void console(void* pConsole); State* getState(void); string getStateName(void); int getStateIdx(void); STATE_TYPE getStateType(void); int getStateIdxByName (const string& n); void transit(void); void transit(const string& n); void transit(int iS); private: void update(void); static void* getUpdate(void* This) { (( _StateControl *) This)->update(); return NULL; } vector<STATE_INST> m_vState; int m_iS; //current state }; } #endif
// Copyright (C) 2015 Acrosync LLC // // Unless explicitly acquired and licensed from Licensor under another // license, the contents of this file are subject to the Reciprocal Public // License ("RPL") Version 1.5, or subsequent versions as allowed by the RPL, // and You may not copy or use this file in either source code or executable // form, except in compliance with the terms and conditions of the RPL. // // All software distributed under the RPL is provided strictly on an "AS // IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND // LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT // LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific // language governing rights and limitations under the RPL. #ifndef INCLUDED_RSYNC_UTIL_H #define INCLUDED_RSYNC_UTIL_H #include "rsync_entry.h" #include <openssl/md4.h> #include <openssl/md5.h> #include <string> #include <vector> #include <time.h> namespace rsync { struct Util { // A helpfer class for deleting entries in an entry list. class EntryListReleaser { public: EntryListReleaser(std::vector<Entry*> *entryList): d_entryList(entryList) { } ~EntryListReleaser() { for (unsigned int i = 0; i < d_entryList->size(); ++i) { delete (*d_entryList)[i]; } } private: // NOT IMPLEMENTED EntryListReleaser(const EntryListReleaser&); EntryListReleaser& operator=(const EntryListReleaser&); std::vector<Entry*> *d_entryList; }; // For calculating MD4 or MD5 checksums based on the rsync protocol version union md_struct { MD4_CTX md4; MD5_CTX md5; }; static void md_init(int protocol, md_struct *context); static void md_update(int protocol, md_struct *context, const char *data, int size); static void md_final(int protocol, md_struct *context, char digest[16]); // For proper intialization and shutdown of dependency libraries. static void startup(); static void cleanup(); // Return the last error in a readable format. static std::string getLastError(); // Break up a string separated by the delimiters. static void tokenize(const std::string line, std::vector<std::string> *results, const char *delimiters); #if defined(WIN32) || defined(__MINGW32__) // If the process has elevated priviledges. static bool isProcessElevated(); // Elevate the process to have a higher priviledge level. static bool elevateProcess(); #endif }; } #endif //INCLUDED_RSYNC_UTIL_H
/* * Generated by util/mkerr.pl DO NOT EDIT * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (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 */ #ifndef OPENSSL_CTERR_H # define OPENSSL_CTERR_H # pragma once # include <openssl/macros.h> # if !OPENSSL_API_3 # define HEADER_CTERR_H # endif # include <openssl/opensslconf.h> # include <openssl/symhacks.h> # include <openssl/opensslconf.h> # ifndef OPENSSL_NO_CT # ifdef __cplusplus extern "C" # endif int ERR_load_CT_strings(void); /* * CT function codes. */ # if !OPENSSL_API_3 # define CT_F_CTLOG_NEW 0 # define CT_F_CTLOG_NEW_FROM_BASE64 0 # define CT_F_CTLOG_NEW_FROM_CONF 0 # define CT_F_CTLOG_STORE_LOAD_CTX_NEW 0 # define CT_F_CTLOG_STORE_LOAD_FILE 0 # define CT_F_CTLOG_STORE_LOAD_LOG 0 # define CT_F_CTLOG_STORE_NEW 0 # define CT_F_CT_BASE64_DECODE 0 # define CT_F_CT_POLICY_EVAL_CTX_NEW 0 # define CT_F_CT_V1_LOG_ID_FROM_PKEY 0 # define CT_F_I2O_SCT 0 # define CT_F_I2O_SCT_LIST 0 # define CT_F_I2O_SCT_SIGNATURE 0 # define CT_F_O2I_SCT 0 # define CT_F_O2I_SCT_LIST 0 # define CT_F_O2I_SCT_SIGNATURE 0 # define CT_F_SCT_CTX_NEW 0 # define CT_F_SCT_CTX_VERIFY 0 # define CT_F_SCT_NEW 0 # define CT_F_SCT_NEW_FROM_BASE64 0 # define CT_F_SCT_SET0_LOG_ID 0 # define CT_F_SCT_SET1_EXTENSIONS 0 # define CT_F_SCT_SET1_LOG_ID 0 # define CT_F_SCT_SET1_SIGNATURE 0 # define CT_F_SCT_SET_LOG_ENTRY_TYPE 0 # define CT_F_SCT_SET_SIGNATURE_NID 0 # define CT_F_SCT_SET_VERSION 0 # endif /* * CT reason codes. */ # define CT_R_BASE64_DECODE_ERROR 108 # define CT_R_INVALID_LOG_ID_LENGTH 100 # define CT_R_LOG_CONF_INVALID 109 # define CT_R_LOG_CONF_INVALID_KEY 110 # define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 # define CT_R_LOG_CONF_MISSING_KEY 112 # define CT_R_LOG_KEY_INVALID 113 # define CT_R_SCT_FUTURE_TIMESTAMP 116 # define CT_R_SCT_INVALID 104 # define CT_R_SCT_INVALID_SIGNATURE 107 # define CT_R_SCT_LIST_INVALID 105 # define CT_R_SCT_LOG_ID_MISMATCH 114 # define CT_R_SCT_NOT_SET 106 # define CT_R_SCT_UNSUPPORTED_VERSION 115 # define CT_R_UNRECOGNIZED_SIGNATURE_NID 101 # define CT_R_UNSUPPORTED_ENTRY_TYPE 102 # define CT_R_UNSUPPORTED_VERSION 103 # endif #endif
//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // span_solid_rgba8 // //---------------------------------------------------------------------------- #ifndef AGG_SPAN_SOLID_INCLUDED #define AGG_SPAN_SOLID_INCLUDED #include "agg_basics.h" namespace agg { //--------------------------------------------------------------span_solid template<class ColorT> class span_solid { public: typedef ColorT color_type; //-------------------------------------------------------------------- void color(const color_type& c) { m_color = c; } const color_type& color() const { return m_color; } //-------------------------------------------------------------------- void prepare() {} //-------------------------------------------------------------------- void generate(color_type* span, int x, int y, unsigned len) { do { *span++ = m_color; } while(--len); } private: color_type m_color; }; } #endif
// HelpUtils.h #ifndef __HELP_UTILS_H #define __HELP_UTILS_H #include "../../../Common/MyString.h" void ShowHelpWindow(HWND hwnd, LPCWSTR topicFile); #endif
/**************************************************************************** * Copyright 2014 Evan Drumwright * This library is distributed under the terms of the Apache V2.0 License ****************************************************************************/ #ifndef _UNDEFINED_AXIS_EXCEPTION_H_ #define _UNDEFINED_AXIS_EXCEPTION_H_ #include <stdexcept> namespace Ravelin { /// Exception thrown when axis has not been defined but user calls operation that requires its definition class UndefinedAxisException : public std::runtime_error { public: UndefinedAxisException() : std::runtime_error("Axis was not defined prior to operation that requires a defined access") {} }; // end class } // end namespace #endif
#include "cs.h" /* sparse QR factorization [V,beta,pinv,R] = qr (A) */ csn *cs_qr (const cs *A, const css *S) { CS_ENTRY *Rx, *Vx, *Ax, *x ; double *Beta ; CS_INT i, k, p,/* m,*/ n, vnz, p1, top, m2, len, col, rnz, *s, *leftmost, *Ap, *Ai, *parent, *Rp, *Ri, *Vp, *Vi, *w, *pinv, *q ; cs *R, *V ; csn *N ; if (!CS_CSC (A) || !S) return (NULL) ; /*m = A->m ; */ n = A->n ; Ap = A->p ; Ai = A->i ; Ax = A->x ; q = S->q ; parent = S->parent ; pinv = S->pinv ; m2 = S->m2 ; vnz = S->lnz ; rnz = S->unz ; leftmost = S->leftmost ; w = (CS_INT *) cs_malloc (m2+n, sizeof (CS_INT)) ; /* get CS_INT workspace */ x = (CS_ENTRY *)cs_malloc (m2, sizeof (CS_ENTRY)) ; /* get CS_ENTRY workspace */ N = (csn *) cs_calloc (1, sizeof (csn)) ; /* allocate result */ if (!w || !x || !N) return (cs_ndone (N, NULL, w, x, 0)) ; s = w + m2 ; /* s is size n */ for (k = 0 ; k < m2 ; k++) x [k] = 0 ; /* clear workspace x */ N->L = V = cs_spalloc (m2, n, vnz, 1, 0) ; /* allocate result V */ N->U = R = cs_spalloc (m2, n, rnz, 1, 0) ; /* allocate result R */ N->B = Beta = (double *) cs_malloc (n, sizeof (double)) ; /* allocate result Beta */ if (!R || !V || !Beta) return (cs_ndone (N, NULL, w, x, 0)) ; Rp = R->p ; Ri = R->i ; Rx = R->x ; Vp = V->p ; Vi = V->i ; Vx = V->x ; for (i = 0 ; i < m2 ; i++) w [i] = -1 ; /* clear w, to mark nodes */ rnz = 0 ; vnz = 0 ; for (k = 0 ; k < n ; k++) /* compute V and R */ { Rp [k] = rnz ; /* R(:,k) starts here */ Vp [k] = p1 = vnz ; /* V(:,k) starts here */ w [k] = k ; /* add V(k,k) to pattern of V */ Vi [vnz++] = k ; top = n ; col = q ? q [k] : k ; for (p = Ap [col] ; p < Ap [col+1] ; p++) /* find R(:,k) pattern */ { i = leftmost [Ai [p]] ; /* i = min(find(A(i,q))) */ for (len = 0 ; w [i] != k ; i = parent [i]) /* traverse up to k */ { s [len++] = i ; w [i] = k ; } while (len > 0) s [--top] = s [--len] ; /* push path on stack */ i = pinv [Ai [p]] ; /* i = permuted row of A(:,col) */ x [i] = Ax [p] ; /* x (i) = A(:,col) */ if (i > k && w [i] < k) /* pattern of V(:,k) = x (k+1:m) */ { Vi [vnz++] = i ; /* add i to pattern of V(:,k) */ w [i] = k ; } } for (p = top ; p < n ; p++) /* for each i in pattern of R(:,k) */ { i = s [p] ; /* R(i,k) is nonzero */ cs_happly (V, i, Beta [i], x) ; /* apply (V(i),Beta(i)) to x */ Ri [rnz] = i ; /* R(i,k) = x(i) */ Rx [rnz++] = x [i] ; x [i] = 0 ; if (parent [i] == k) vnz = cs_scatter (V, i, 0, w, NULL, k, V, vnz); } for (p = p1 ; p < vnz ; p++) /* gather V(:,k) = x */ { Vx [p] = x [Vi [p]] ; x [Vi [p]] = 0 ; } Ri [rnz] = k ; /* R(k,k) = norm (x) */ Rx [rnz++] = cs_house (Vx+p1, Beta+k, vnz-p1) ; /* [v,beta]=house(x) */ } Rp [n] = rnz ; /* finalize R */ Vp [n] = vnz ; /* finalize V */ return (cs_ndone (N, NULL, w, x, 1)) ; /* success */ }
#include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <dirent.h> #include <mntent.h> #include <unistd.h> #include <sys/ioctl.h> #include "stats.h" #include "trace.h" #include "dict.h" #include "string1.h" #include "lustre_obd_to_mnt.h" /* This function grabs the super block address from each Lustre OBD names and allows it to be used a dictionary ref. The key will be the lov name without the super block address. */ struct dict sb_dict; __attribute__((constructor)) static void sb_dict_init(void) { const char *lov_dir_path = "/proc/fs/lustre/lov"; if (dict_init(&sb_dict, 8) < 0) { ERROR("cannot create sb_dict: %m\n"); goto out; } char lov_name[128] = ""; char *sb_mnt = NULL; DIR *lov_dir = NULL; lov_dir = opendir(lov_dir_path); if (lov_dir == NULL) { ERROR("cannot open `%s': %m\n", lov_dir_path); goto out; } struct dirent *de; while ((de = readdir(lov_dir)) != NULL) { if (de->d_type != DT_DIR || *de->d_name == '.') continue; snprintf(lov_name, sizeof(lov_name), de->d_name); /* lov_name is of the form `work-clilov-ffff8102658ec800'. */ if (strlen(lov_name) < 16) { ERROR("invalid lov name `%s'\n", lov_name); goto next; } /* Get superblock address (the `ffff8102658ec800' part). */ const char *sb = lov_name + strlen(lov_name) - 16; hash_t hash = dict_strhash(sb); struct dict_entry *de = dict_entry_ref(&sb_dict, hash, sb); if (de->d_key != NULL) { TRACE("multiple filesystems with super block `%s'\n", sb); goto next; } /* Get name of lov w/ superblock address stripped */ char *p; p = lov_name + strlen(lov_name) - 16 - 1; *p = '\0'; sb_mnt = malloc(16 + 1 + strlen(lov_name) + 1); if (sb_mnt == NULL) { ERROR("cannot allocate sb_mnt: %m\n"); goto next; } strcpy(sb_mnt, sb); strcpy(sb_mnt + 16 + 1, lov_name); if (dict_entry_set(&sb_dict, de, hash, sb_mnt) < 0) { ERROR("cannot set sb_dict entry: %m\n"); free(sb_mnt); goto next; } next: continue; } out: if (lov_dir != NULL) closedir(lov_dir); TRACE("found %zu lustre filesystems\n", sb_dict.d_count); #ifdef DEBUG do { size_t i = 0; char *sb_mnt; while ((sb_mnt = dict_for_each(&sb_dict, &i)) != NULL) TRACE("sb `%s', mnt `%s'\n", sb_mnt, sb_mnt + 16 + 1); } while (0); #endif } char *lustre_obd_to_mnt(const char *name) { char *sb_mnt; /* name should be of the form `work-clilov-ffff8102658ec800'. */ if (strlen(name) < 16) { ERROR("invalid obd name `%s'\n", name); return NULL; } sb_mnt = dict_ref(&sb_dict, name + strlen(name) - 16); if (sb_mnt == NULL) { ERROR("no super block found for obd `%s'. build a new super block dict\n", name); sb_dict_init(); sb_mnt = dict_ref(&sb_dict, name + strlen(name) - 16); } if (sb_mnt == NULL) return NULL; return sb_mnt + 16 + 1; } /* XXX dict_destroy(&sb_dict, &free); */
/* * Copyright (C) 2005 Tommi Maekitalo * * 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. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * 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 */ #ifndef TNTDB_SQLITE_ERROR_H #define TNTDB_SQLITE_ERROR_H #include <tntdb/error.h> #include <sqlite3.h> #include <string> namespace tntdb { namespace sqlite { class SqliteError : public Error { const char* function; public: SqliteError(const char* function, const std::string& msg) : Error(std::string(function) + ": " + msg) { } SqliteError(const char* function, const char* errmsg) : Error(std::string(function) + ": " + (errmsg ? errmsg : "unknown error")) { } SqliteError(const char* function, char* errmsg, bool do_free); const char* getFunction() const { return function; } }; class Execerror : public SqliteError { int errcode; public: Execerror(const char* function, sqlite3* db, int _errcode); Execerror(const char* function, sqlite3_stmt* stmt, int _errcode); Execerror(const char* function, int _errcode, const char* errmsg) : SqliteError(function, errmsg), errcode(_errcode) { } Execerror(const char* function, int _errcode, char* errmsg, bool do_free) : SqliteError(function, errmsg, do_free), errcode(_errcode) { } int getErrorcode() const { return errcode; } }; } } #endif // TNTDB_SQLITE_ERROR_H
/* * consumer_gtk2.c -- A consumer for GTK2 apps * Copyright (C) 2003-2004 Ushodaya Enterprises Limited * Author: Charles Yates * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdlib.h> #include <framework/mlt_consumer.h> #include <framework/mlt_factory.h> #include <gdk/gdk.h> #include <gdk/gdkx.h> #include <gtk/gtk.h> mlt_consumer consumer_gtk2_preview_init( mlt_profile profile, GtkWidget *widget ) { // Create an sdl preview consumer mlt_consumer consumer = NULL; // This is a nasty little hack which is required by SDL if ( widget != NULL ) { Window xwin = GDK_WINDOW_XWINDOW( widget->window ); char windowhack[ 32 ]; sprintf( windowhack, "%ld", xwin ); setenv( "SDL_WINDOWID", windowhack, 1 ); } // Create an sdl preview consumer consumer = mlt_factory_consumer( profile, "sdl_preview", NULL ); // Now assign the lock/unlock callbacks if ( consumer != NULL ) { mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer ); mlt_properties_set_int( properties, "app_locked", 1 ); mlt_properties_set_data( properties, "app_lock", gdk_threads_enter, 0, NULL, NULL ); mlt_properties_set_data( properties, "app_unlock", gdk_threads_leave, 0, NULL, NULL ); } return consumer; }
/***************************************************************************** * This file is part of the Gluon Development Platform * Copyright (c) 2012 Arjen Hiemstra <ahiemstra@heimr.nl> * * 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 */ #ifndef GLUONGRAPHICS_GLXSHADER_H #define GLUONGRAPHICS_GLXSHADER_H #include <graphics/shader.h> namespace GluonGraphics { namespace GLX { class GLXShader : public GluonGraphics::Shader { public: explicit GLXShader( ); virtual ~GLXShader(); virtual bool build(); virtual bool bind(); virtual void release(); private: class Private; Private* const d; }; } } #endif // GLUONGRAPHICS_GLXSHADER_H
/********************************************************************** * $Id$ * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * ********************************************************************** * $Log$ * Revision 1.2 2004/07/19 13:19:31 strk * Documentation fixes * * Revision 1.1 2004/07/02 13:20:42 strk * Header files moved under geos/ dir. * * Revision 1.5 2003/11/07 01:23:42 pramsey * Add standard CVS headers licence notices and copyrights to all cpp and h * files. * * **********************************************************************/ #ifndef GEOS_INDEXSWEEPLINE_H #define GEOS_INDEXSWEEPLINE_H #include <memory> #include <vector> #include <geos/platform.h> using namespace std; namespace geos { class SweepLineInterval { public: SweepLineInterval(double newMin, double newMax); SweepLineInterval(double newMin, double newMax, void* newItem); double getMin(); double getMax(); void* getItem(); private: double min, max; void* item; }; class SweepLineOverlapAction { public: virtual void overlap(SweepLineInterval *s0,SweepLineInterval *s1)=0; }; class indexSweepLineEvent { public: enum { INSERT = 1, DELETE }; indexSweepLineEvent(double x,indexSweepLineEvent *newInsertEvent,SweepLineInterval *newSweepInt); bool isInsert(); bool isDelete(); indexSweepLineEvent* getInsertEvent(); int getDeleteEventIndex(); void setDeleteEventIndex(int newDeleteEventIndex); SweepLineInterval* getInterval(); /** * ProjectionEvents are ordered first by their x-value, and then by their eventType. * It is important that Insert events are sorted before Delete events, so that * items whose Insert and Delete events occur at the same x-value will be * correctly handled. */ int compareTo(indexSweepLineEvent *pe); int compareTo(void *o); private: double xValue; int eventType; indexSweepLineEvent *insertEvent; // null if this is an INSERT event int deleteEventIndex; SweepLineInterval *sweepInt; }; /* * A sweepline implements a sorted index on a set of intervals. * It is used to compute all overlaps between the interval in the index. */ class SweepLineIndex { public: SweepLineIndex(); ~SweepLineIndex(); void add(SweepLineInterval *sweepInt); void computeOverlaps(SweepLineOverlapAction *action); private: vector<indexSweepLineEvent*> *events; bool indexBuilt; // statistics information int nOverlaps; /** * Because Delete Events have a link to their corresponding Insert event, * it is possible to compute exactly the range of events which must be * compared to a given Insert event object. */ void buildIndex(); void processOverlaps(int start,int end,SweepLineInterval *s0,SweepLineOverlapAction *action); }; bool isleLessThen(indexSweepLineEvent *first,indexSweepLineEvent *second); } #endif
/** @file utils_misc.h A simple test driver and test cases for DSME <p> Copyright (C) 2011 Nokia Corporation @author Jyrki Hämäläinen <ext-jyrki.hamalainen@nokia.com> This file is part of Dsme. Dsme is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Dsme 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 Dsme. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DSME_TEST_MISCUTILS_H #define DSME_TEST_MISCUTILS_H static const char* dsme_module_path = "../modules/.libs/"; static bool message_queue_is_empty(void) { int count = 0; GSList* node; count = g_slist_length(message_queue); if (count == 1) { fprintf(stderr, "[=> 1 more message queued]\n"); } else if (count) { fprintf(stderr, "[=> %d more messages queued]\n", count); } else { fprintf(stderr, "[=> no more messages]\n"); } if (count != 0) { for (node = message_queue; node; node = node->next) { fprintf(stderr, "[%x]\n", ((queued_msg_t*)(node->data))->data->type_); } } return count == 0; } #define queued(T) ((T*)queued_(DSME_MSG_ID_(T), #T)) static inline void* queued_(unsigned type, const char* name) { dsmemsg_generic_t* msg = 0; GSList* node; char* other_messages = 0; for (node = message_queue; node; node = node->next) { queued_msg_t* m = node->data; if (m->data->type_ == type) { msg = m->data; free(m); message_queue = g_slist_delete_link(message_queue, node); break; } else { int dummy_ret; if (other_messages == 0) { dummy_ret = asprintf(&other_messages, "%x", m->data->type_); } else { char* s = 0; dummy_ret = asprintf(&s, "%s, %x", other_messages, m->data->type_); free(other_messages), other_messages = s; } (void)dummy_ret; /* We don't really care about the return value */ } } fprintf(stderr, msg ? "[=> %s was queued]\n" : "[=> %s was not queued\n", name); if (other_messages) { fprintf(stderr, "[=> other messages: %s]\n", other_messages); free(other_messages); } return msg; } #define TEST_MSG_INIT(T) DSME_MSG_INIT(T); fprintf(stderr, "\n[%s ", #T) static inline void send_message(const module_t* module, const void* msg) { endpoint_t endpoint = { module, 0 }; fprintf(stderr, " SENT]\n"); handle_message(&endpoint, module, msg); } /* UTILITY */ static void fatal(const char* format, ...) { va_list ap; va_start(ap, format); fprintf(stderr, format, ap); fprintf(stderr, "\n"); va_end(ap); exit(EXIT_FAILURE); } static module_t* load_module_under_test(const char* path) { module_t* module = 0; char* canonical; fprintf(stderr, "\n[LOADING MODULE %s]\n", path); canonical = realpath(path, 0); if (!canonical) { perror(path); fatal("realpath() failed"); } else { if (!(module = load_module(canonical, 0))) { fatal("load_module() failed"); } free(canonical); } return module; } static void unload_module_under_test(module_t* module) { fprintf(stderr, "\n[UNLOADING MODULE]\n"); if (!unload_module(module)) { fatal("unload_module() failed"); } } #endif /* DSME_TEST_MISCUTILS_H */
/* * This file is part of libbluray * Copyright (C) 2009-2010 John Stebbins * Copyright (C) 2012-2016 Petri Hintukainen <phintuka@users.sourceforge.net> * * 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, see * <http://www.gnu.org/licenses/>. */ #if !defined(_MPLS_PARSE_H_) #define _MPLS_PARSE_H_ #include "uo_mask_table.h" #include "util/attributes.h" #include <stdint.h> #define BD_MARK_ENTRY 0x01 #define BD_MARK_LINK 0x02 typedef struct { uint8_t stream_type; uint8_t coding_type; uint16_t pid; uint8_t subpath_id; uint8_t subclip_id; uint8_t format; uint8_t rate; uint8_t char_code; char lang[4]; // Secondary audio specific fields uint8_t sa_num_primary_audio_ref; uint8_t *sa_primary_audio_ref; // Secondary video specific fields uint8_t sv_num_secondary_audio_ref; uint8_t sv_num_pip_pg_ref; uint8_t *sv_secondary_audio_ref; uint8_t *sv_pip_pg_ref; } MPLS_STREAM; typedef struct { uint8_t num_video; uint8_t num_audio; uint8_t num_pg; uint8_t num_ig; uint8_t num_secondary_audio; uint8_t num_secondary_video; uint8_t num_pip_pg; MPLS_STREAM *video; MPLS_STREAM *audio; MPLS_STREAM *pg; MPLS_STREAM *ig; MPLS_STREAM *secondary_audio; MPLS_STREAM *secondary_video; } MPLS_STN; typedef struct { char clip_id[6]; char codec_id[5]; uint8_t stc_id; } MPLS_CLIP; typedef struct { uint8_t is_multi_angle; uint8_t connection_condition; uint32_t in_time; uint32_t out_time; BD_UO_MASK uo_mask; uint8_t random_access_flag; uint8_t still_mode; uint16_t still_time; uint8_t angle_count; uint8_t is_different_audio; uint8_t is_seamless_angle; MPLS_CLIP *clip; MPLS_STN stn; } MPLS_PI; typedef struct { uint8_t mark_type; uint16_t play_item_ref; uint32_t time; uint16_t entry_es_pid; uint32_t duration; } MPLS_PLM; typedef struct { uint8_t playback_type; uint16_t playback_count; BD_UO_MASK uo_mask; uint8_t random_access_flag; uint8_t audio_mix_flag; uint8_t lossless_bypass_flag; } MPLS_AI; typedef struct { uint8_t connection_condition; uint8_t is_multi_clip; uint32_t in_time; uint32_t out_time; uint16_t sync_play_item_id; uint32_t sync_pts; uint8_t clip_count; MPLS_CLIP *clip; } MPLS_SUB_PI; typedef struct { uint8_t type; uint8_t is_repeat; uint8_t sub_playitem_count; MPLS_SUB_PI *sub_play_item; } MPLS_SUB; typedef enum { pip_scaling_none = 1, /* unscaled */ pip_scaling_half = 2, /* 1:2 */ pip_scaling_quarter = 3, /* 1:4 */ pip_scaling_one_half = 4, /* 3:2 */ pip_scaling_fullscreen = 5, /* scale to main video size */ } mpls_pip_scaling; typedef struct { uint32_t time; /* start timestamp (clip time) when the block is valid */ uint16_t xpos; uint16_t ypos; uint8_t scale_factor; /* mpls_pip_scaling. Note: PSR14 may override this ! */ } MPLS_PIP_DATA; typedef enum { pip_timeline_sync_mainpath = 1, /* timeline refers to main path */ pip_timeline_async_subpath = 2, /* timeline refers to sub-path time */ pip_timeline_async_mainpath = 3, /* timeline refers to main path */ } mpls_pip_timeline; typedef struct { uint16_t clip_ref; /* clip id for secondary_video_ref (STN) */ uint8_t secondary_video_ref; /* secondary video stream id (STN) */ uint8_t timeline_type; /* mpls_pip_timeline */ uint8_t luma_key_flag; /* use luma keying */ uint8_t upper_limit_luma_key; /* luma key (secondary video pixels with Y <= this value are transparent) */ uint8_t trick_play_flag; /* show synchronous PiP when playing trick speed */ uint16_t data_count; MPLS_PIP_DATA *data; } MPLS_PIP_METADATA; typedef struct mpls_pl { uint32_t type_indicator; uint32_t type_indicator2; uint32_t list_pos; uint32_t mark_pos; uint32_t ext_pos; MPLS_AI app_info; uint16_t list_count; uint16_t sub_count; uint16_t mark_count; MPLS_PI *play_item; MPLS_SUB *sub_path; MPLS_PLM *play_mark; // extension data (profile 5, version 2.4) uint16_t ext_sub_count; MPLS_SUB *ext_sub_path; // sub path entries extension // extension data (Picture-In-Picture metadata) uint16_t ext_pip_data_count; MPLS_PIP_METADATA *ext_pip_data; // pip metadata extension } MPLS_PL; struct bd_disc; BD_PRIVATE MPLS_PL* mpls_parse(const char *path) BD_ATTR_MALLOC; BD_PRIVATE MPLS_PL* mpls_get(struct bd_disc *disc, const char *file); BD_PRIVATE void mpls_free(MPLS_PL *pl); BD_PRIVATE int mpls_parse_uo(uint8_t *buf, BD_UO_MASK *uo); #endif // _MPLS_PARSE_H_
/** * @file oval_probe.h * @brief OVAL probe interface API public header * @author "Daniel Kopecek" <dkopecek@redhat.com> * * @addtogroup PROBEINTERFACE * @{ */ /* * Copyright 2009-2010 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * "Daniel Kopecek" <dkopecek@redhat.com> */ #pragma once #ifndef OVAL_PROBE_H #define OVAL_PROBE_H #include <stdio.h> #include <stdarg.h> #include <stdint.h> #include "oval_definitions.h" #include "oval_system_characteristics.h" #include "oval_probe_session.h" /* * probe session flags */ #define OVAL_PDFLAG_NOREPLY 0x0001 /**< don't send probe result to library - just an ack */ #define OVAL_PDFLAG_NORECONN 0x0002 /**< don't try to reconnect on fatal errors */ #define OVAL_PDGLAG_RUNALL 0x0004 /**< execute all probes when executing the first */ #define OVAL_PDFLAG_RUNNOW 0x0008 /**< execute all probes immediately */ #define OVAL_PDFLAG_SLAVE 0x0010 #define OVAL_PDFLAG_MASK (0x0001|0x0002|0x0004|0x0008|0x0010) /** * Evaluate system info probe * @param sess probe session * @param out_sysinfo address of a pointer to hold the result */ int oval_probe_query_sysinfo(oval_probe_session_t *sess, struct oval_sysinfo **out_sysinfo) __attribute__ ((nonnull(1, 2))); /** * Evaluate an object * @param sess probe session * @param object the object to evaluate */ int oval_probe_query_object(oval_probe_session_t *psess, struct oval_object *object, int flags, struct oval_syschar **out_syschar) __attribute__ ((nonnull(1, 2))); /** * Probe objects required for the evalatuation of the specified definition and update the system characteristics model associated with the session * @param sess probe session * @param id definition id * @return 0 on success; -1 on error; 1 warning */ OSCAP_DEPRECATED(int oval_probe_query_definition(oval_probe_session_t *sess, const char *id)) __attribute__ ((nonnull(1, 2))); /** * Query the specified variable and all its dependencies in order to compute the vector of its values * @param sess probe session * @param variable the variable to query * @return 0 on success */ int oval_probe_query_variable(oval_probe_session_t *sess, struct oval_variable *variable); #define OVAL_PROBEMETA_LIST_VERBOSE 0x00000001 /**< Be verbose when listing supported probes */ #define OVAL_PROBEMETA_LIST_DYNAMIC 0x00000002 /**< Perform additional checks when listing supported probes (i.e. list only existing external probes) */ #define OVAL_PROBEMETA_LIST_OTYPE 0x00000004 /**< Show the otype / family type of the probe */ void oval_probe_meta_list(FILE *output, int flags); const char *oval_probe_ext_getdir(void); #endif /* OVAL_PROBE_H */ /// @}
/********************************************************* * Copyright (C) 2007-2017 VMware, Inc. All rights reserved. * * 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 version 2.1 and no 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 Lesser GNU 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, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * unicodeTransforms.h -- * * Operations that transform all the characters in a string. * * Transform operations like uppercase and lowercase are * locale-sensitive (depending on the user's country and language * preferences). */ #ifndef _UNICODE_TRANSFORMS_H_ #define _UNICODE_TRANSFORMS_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #include "unicodeTypes.h" #if defined(__cplusplus) extern "C" { #endif /* * Standardizes the case of the string by doing a locale-agnostic * uppercase operation, then a locale-agnostic lowercase operation. */ char *Unicode_FoldCase(const char *str); /* * Trims whitespace from either side of the string. */ char *Unicode_Trim(const char *str); char *Unicode_TrimLeft(const char *str); char *Unicode_TrimRight(const char *str); #if defined(__cplusplus) } // extern "C" #endif #endif // _UNICODE_TRANSFORMS_H_
/****************************************************************************** * This file is part of the Gluon Development Platform * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl> * * 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 */ #ifndef GLUON_ENGINE_MESHRENDERERCOMPONENT_H #define GLUON_ENGINE_MESHRENDERERCOMPONENT_H #include <engine/component.h> namespace GluonGraphics { class MaterialInstance; } namespace GluonEngine { class Asset; class MeshRendererComponent : public Component { Q_OBJECT GLUON_OBJECT( GluonEngine::MeshRendererComponent ) Q_PROPERTY( GluonEngine::Asset* mesh READ mesh WRITE setMesh ) Q_PROPERTY( GluonGraphics::MaterialInstance* material READ material WRITE setMaterial ) Q_INTERFACES( GluonEngine::Component ) public: Q_INVOKABLE MeshRendererComponent( QObject* parent = 0 ); ~MeshRendererComponent(); QString category() const; void initialize(); void start(); void draw( int timeLapse = 0 ); void cleanup(); GluonEngine::Asset* mesh(); GluonGraphics::MaterialInstance* material(); public Q_SLOTS: void setMesh( GluonEngine::Asset* mesh ); void setMaterial( GluonGraphics::MaterialInstance* material ); void setMaterial( const QString& path ); private: class Private; Private* const d; }; } Q_DECLARE_METATYPE( GluonEngine::MeshRendererComponent* ) #endif // GLUON_ENGINE_MESHRENDERERCOMPONENT_H
/*************************************************************************** NBitmap.mcc - New Bitmap MUI Custom Class Copyright (C) 2006 by Daniel Allsopp Copyright (C) 2007-2021 NList Open Source Team 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. NList classes Support Site: http://www.sf.net/projects/nlist-classes $Id$ ***************************************************************************/ #ifndef NBITMAP_H #define NBITMAP_H #ifdef __cplusplus extern "C" { #endif #if !defined(__AROS__) && defined(__PPC__) #if defined(__GNUC__) #pragma pack(2) #elif defined(__VBCC__) #pragma amiga-align #endif #endif #ifndef EXEC_TYPES_H #include <exec/types.h> #endif #define MUIC_NBitmap "NBitmap.mcc" #define NBitmapObject MUI_NewObject(MUIC_NBitmap #if !defined(__AROS__) && defined(__PPC__) #if defined(__GNUC__) #pragma pack() #elif defined(__VBCC__) #pragma default-align #endif #endif #ifdef __cplusplus } #endif #endif /* NBITMAP_MCC_H */
/* GIO - GLib Input, Output and Streaming Library * * Copyright (C) 2006-2007 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * Author: Alexander Larsson <alexl@redhat.com> */ #include <config.h> #include <glib.h> #include <locale.h> #include <glib/gi18n.h> #include <gio/gio.h> static gboolean force = FALSE; static gboolean show_version = FALSE; static GOptionEntry entries[] = { {"force", 'f', 0, G_OPTION_ARG_NONE, &force, N_("Ignore nonexistent files, never prompt"), NULL}, { "version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Show program version"), NULL }, { NULL } }; int main (int argc, char *argv[]) { GError *error; GOptionContext *context; GFile *file; int retval = 0; gchar *param; gchar *summary; setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, GVFS_LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); error = NULL; param = g_strdup_printf ("[%s...]", _("FILE")); summary = _("Delete the given files."); context = g_option_context_new (param); g_option_context_set_summary (context, summary); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); g_option_context_parse (context, &argc, &argv, &error); g_option_context_free (context); g_free (param); if (error != NULL) { g_printerr (_("Error parsing commandline options: %s\n"), error->message); g_printerr ("\n"); g_printerr (_("Try \"%s --help\" for more information."), g_get_prgname ()); g_printerr ("\n"); g_error_free (error); return 1; } if (show_version) { g_print (PACKAGE_STRING "\n"); return 0; } if (argc > 1) { int i; for (i = 1; i < argc; i++) { file = g_file_new_for_commandline_arg (argv[i]); error = NULL; if (!g_file_delete (file, NULL, &error)) { if (!force || !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { g_printerr ("Error deleting file: %s\n", error->message); retval = 1; } g_error_free (error); } g_object_unref (file); } } return retval; }
/* * Copyright (C) 2010-2012 Jiri Techet <techet@gmail.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 St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION) #error "Only <champlain/champlain.h> can be included directly." #endif #ifndef _CHAMPLAIN_TILE_CACHE_H_ #define _CHAMPLAIN_TILE_CACHE_H_ #include <champlain/champlain-defines.h> #include <champlain/champlain-map-source.h> G_BEGIN_DECLS #define CHAMPLAIN_TYPE_TILE_CACHE champlain_tile_cache_get_type () #define CHAMPLAIN_TILE_CACHE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_TILE_CACHE, ChamplainTileCache)) #define CHAMPLAIN_TILE_CACHE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_TILE_CACHE, ChamplainTileCacheClass)) #define CHAMPLAIN_IS_TILE_CACHE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_TILE_CACHE)) #define CHAMPLAIN_IS_TILE_CACHE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_TILE_CACHE)) #define CHAMPLAIN_TILE_CACHE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_TILE_CACHE, ChamplainTileCacheClass)) typedef struct _ChamplainTileCachePrivate ChamplainTileCachePrivate; typedef struct _ChamplainTileCache ChamplainTileCache; typedef struct _ChamplainTileCacheClass ChamplainTileCacheClass; /** * ChamplainTileCache: * * The #ChamplainTileCache structure contains only private data * and should be accessed using the provided API * * Since: 0.6 */ struct _ChamplainTileCache { ChamplainMapSource parent_instance; ChamplainTileCachePrivate *priv; }; struct _ChamplainTileCacheClass { ChamplainMapSourceClass parent_class; void (*store_tile)(ChamplainTileCache *tile_cache, ChamplainTile *tile, const gchar *contents, gsize size); void (*refresh_tile_time)(ChamplainTileCache *tile_cache, ChamplainTile *tile); void (*on_tile_filled)(ChamplainTileCache *tile_cache, ChamplainTile *tile); }; GType champlain_tile_cache_get_type (void); void champlain_tile_cache_store_tile (ChamplainTileCache *tile_cache, ChamplainTile *tile, const gchar *contents, gsize size); void champlain_tile_cache_refresh_tile_time (ChamplainTileCache *tile_cache, ChamplainTile *tile); void champlain_tile_cache_on_tile_filled (ChamplainTileCache *tile_cache, ChamplainTile *tile); G_END_DECLS #endif /* _CHAMPLAIN_TILE_CACHE_H_ */
#include <git2.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "common.h" static int use_remote(git_repository *repo, char *name) { git_remote *remote = NULL; int error; const git_remote_head **refs; size_t refs_len, i; git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; // Find the remote by name error = git_remote_lookup(&remote, repo, name); if (error < 0) { error = git_remote_create_anonymous(&remote, repo, name, NULL); if (error < 0) goto cleanup; } /** * Connect to the remote and call the printing function for * each of the remote references. */ callbacks.credentials = cred_acquire_cb; error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks); if (error < 0) goto cleanup; /** * Get the list of references on the remote and print out * their name next to what they point to. */ if (git_remote_ls(&refs, &refs_len, remote) < 0) goto cleanup; for (i = 0; i < refs_len; i++) { char oid[GIT_OID_HEXSZ + 1] = {0}; git_oid_fmt(oid, &refs[i]->oid); printf("%s\t%s\n", oid, refs[i]->name); } cleanup: git_remote_free(remote); return error; } /** Entry point for this command */ int ls_remote(git_repository *repo, int argc, char **argv) { int error; if (argc < 2) { fprintf(stderr, "usage: %s ls-remote <remote>\n", argv[-1]); return EXIT_FAILURE; } error = use_remote(repo, argv[1]); return error; }
// -*-c++-*- // //-----------------------------------------------------------------------bl- //-------------------------------------------------------------------------- // // MASA - Manufactured Analytical Solutions Abstraction Library // // Copyright (C) 2010,2011,2012,2013 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General // Public License as published by the Free Software Foundation. // // 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 // //-----------------------------------------------------------------------el- // $Author: nick $ // $Id: // // c_laplace_example.cpp: example of the API used for // the 2D laplace's equation //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // #include <masa.h> int main() { int i,j,k; // declarations double ffield,phi_field; double tempx,tempy; //problem size double lx,ly; double dx,dy; int nx,ny; // error condition int err = 0; // initialize nx = 10; // number of points ny = 10; lx=1; // length ly=1; dx=lx/nx; dy=ly/ny; // initialize the problem err += masa_init("laplace example","laplace_2d"); // evaluate source terms over the domain (0<x<1, 0<y<1) for(i=0;i<nx;i++) for(j=0;j<nx;j++) { tempx=i*dx; tempy=j*dy; ffield = masa_eval_2d_source_f (tempx,tempy); phi_field = masa_eval_2d_exact_phi(tempx,tempy); masa_test_default(ffield); masa_test_default(phi_field); } return err; }// end program
/* Test of u32_mbtoucr() function. Copyright (C) 2010-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2010. */ #include <config.h> #include "unistr.h" #include "macros.h" int main () { ucs4_t uc; int ret; /* Test NUL unit input. */ { static const uint32_t input[] = { 0 }; uc = 0xBADFACE; ret = u32_mbtoucr (&uc, input, 1); ASSERT (ret == 1); ASSERT (uc == 0); } /* Test ISO 646 unit input. */ { ucs4_t c; uint32_t buf[1]; for (c = 0; c < 0x80; c++) { buf[0] = c; uc = 0xBADFACE; ret = u32_mbtoucr (&uc, buf, 1); ASSERT (ret == 1); ASSERT (uc == c); } } /* Test BMP unit input. */ { static const uint32_t input[] = { 0x20AC }; uc = 0xBADFACE; ret = u32_mbtoucr (&uc, input, 1); ASSERT (ret == 1); ASSERT (uc == 0x20AC); } /* Test non-BMP unit input. */ { static const uint32_t input[] = { 0x1D51F }; uc = 0xBADFACE; ret = u32_mbtoucr (&uc, input, 1); ASSERT (ret == 1); ASSERT (uc == 0x1D51F); } /* Test incomplete/invalid 1-unit input. */ { static const uint32_t input[] = { 0x340000 }; uc = 0xBADFACE; ret = u32_mbtoucr (&uc, input, 1); ASSERT (ret == -1); ASSERT (uc == 0xFFFD); } return 0; }
/* * USBDeviceCustom.h * * Created on: Aug 11, 2016 * Author: iceman */ #ifndef LIB_USBDEVICECUSTOM_H_ #define LIB_USBDEVICECUSTOM_H_ #include <inttypes.h> #include <stddef.h> class USBDeviceCustom { public: USBDeviceCustom(); void begin(); bool isConnected(); bool isDeviceConfigured(); bool isInitialized(); bool dataAvailable(); int write(const uint8_t *data, size_t size); int read(uint8_t *data, size_t size); private: void init(); }; extern USBDeviceCustom UsbBulk; #endif /* LIB_USBDEVICECUSTOM_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 VEHICLEDATAMAPPING_H #define VEHICLEDATAMAPPING_H #include <map> #include <vector> #include "JSONHandler/SDLRPCObjects/V2/VehicleDataType.h" namespace log4cplus { class Logger; } namespace NsAppManager { class Application; /** * \brief a VehicleData-registered-app map */ typedef std::multimap<NsSmartDeviceLinkRPCV2::VehicleDataType::VehicleDataTypeInternal, Application*> VehicleDataMap; /** * \brief a VehicleData-registered-app map iterator */ typedef std::multimap<NsSmartDeviceLinkRPCV2::VehicleDataType::VehicleDataTypeInternal, Application*>::iterator VehicleDataMapIterator; /** * \brief a VehicleData-registered-app map item */ typedef std::pair<NsSmartDeviceLinkRPCV2::VehicleDataType::VehicleDataTypeInternal, Application*> VehicleDataMapItem; /** * \brief VehicleDataMapping acts as a mapping of VehicleData to registered application which subscribes to them */ class VehicleDataMapping { public: /** * \brief Default class constructor */ VehicleDataMapping(); /** * \brief Default class destructor */ ~VehicleDataMapping(); /** * \brief add a VehicleData to a mapping * \param vehicleDataName button name * \param app application to map a button to * \return false if such subscribe already exists. */ bool addVehicleDataMapping(const NsSmartDeviceLinkRPCV2::VehicleDataType& vehicleDataName, Application* app); /** * \brief remove a VehicleData from a mapping * \param vehicleDataName button name * \return false if no such subscribe found. */ bool removeVehicleDataMapping(const NsSmartDeviceLinkRPCV2::VehicleDataType& vehicleDataName, Application* app); /** * \brief remove an application from a mapping * \param app application to remove all associated buttons from mapping */ void removeItem(Application* app); /** * \brief cleans all the mapping */ void clear(); /** * \brief find a registry item subscribed to VehicleData * \param vehicleData VehicleDataTypeInternal value * \param result reference to empty vector to store results. * \return count of subscribers */ int findRegistryItemsSubscribedToVehicleData(const NsSmartDeviceLinkRPCV2::VehicleDataType& vehicleDataName, std::vector<Application*>& result); private: /** * \brief Copy constructor */ VehicleDataMapping(const VehicleDataMapping&); VehicleDataMap mVehicleDataMapping; static log4cplus::Logger mLogger; }; } #endif // VEHICLEDATAMAPPING_H
/** STCompiledScript.h Written by: Stefan Urbanek <stefan.urbanek@gmail.com> Date: 2000 This file is part of the StepTalk project. */ #import <Foundation/NSObject.h> @class NSDictionary; @class NSMutableDictionary; @class NSString; @class NSArray; @class STCompiledMethod; @class STEnvironment; @interface STCompiledScript:NSObject { NSMutableDictionary *methodDictionary; NSArray *variableNames; } - initWithVariableNames:(NSArray *)array; - (id)executeInEnvironment:(STEnvironment *)env; - (STCompiledMethod *)methodWithName:(NSString *)name; - (void)addMethod:(STCompiledMethod *)method; - (NSArray *)variableNames; @end
#ifndef QSPINFIELD_H #define QSPINFIELD_H #include "qabstractformfield.h" #include <QSpinBox> class QSpinField : public QAbstractFormField { Q_OBJECT private: QSpinBox* spin; public: QSpinField(QWidget* parent=NULL, int min=0, int max=100); void setValue(QVariant value); QVariant value(); int min(); int max(); QWidget* widget(); private slots: void onValueUpdated(int newInput); }; #endif // QSPINFIELD_H
/***************************************************************************************** BioQt - Integrated Bioinformatics Library Copyright (C) 2013-2014 Usama S Erawab <alrawab@hotmail.com> Libya 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 ************************************************************************************************/ /** *BioQt::REnzyme *@author Usama S Erawab * */ #ifndef RENZYME_H #define RENZYME_H #include <BioQt_global.h> #include <QtCore> namespace BioQt { class BIOQTSHARED_EXPORT REnzymeData : public QSharedData { public: REnzymeData(){ } REnzymeData(const REnzymeData &other) : QSharedData(other), name(other.name),pattern(other.pattern), length(other.length),ncuts(other.ncuts), blunt(other.blunt),c1(other.c1), c2(other.c2),c3(other.c3), c4(other.c4){} ~REnzymeData() { } /** * @brief name name of enzyme. */ QString name; /** * @brief pattern recognition site */ QString pattern; /** * @brief length of pattern */ int length;//pattren length /** * @brief ncuts number of cuts made by enzyme * Zero represents unknown */ int ncuts;// /** * @brief blunt true if blunt end cut, false if sticky */ bool blunt; /** * @brief c1 First 5' cut */ int c1; /** * @brief c2 First 3' cut */ int c2; /** * @brief c3 Second 5' cut */ int c3; /** * @brief c4 Second 3' cut */ int c4; }; class BIOQTSHARED_EXPORT REnzyme { // Q_PROPERTY(QString name READ getName WRITE name) // Q_PROPERTY(QString pattern READ get WRITE setName) public: REnzyme() { d = new REnzymeData; } //-------------------> REnzyme( QString name,QString pattern,int length, int ncuts, bool blunt,int c1,int c2,int c3,int c4 ) { d = new REnzymeData; setName(name); setPattern(pattern); setLength(length); setNcuts(ncuts); setBlunt(blunt); setC1(c1); setC2(c2); setC3(c3); setC4(c4); } //------------> REnzyme(const REnzyme &other) : d (other.d) { } void setName(QString name) { d->name = name; } void setPattern(QString pattern){d->pattern=pattern;} void setLength(int length) {d->length=length;} void setNcuts(int ncuts) {d->ncuts=ncuts;} void setBlunt(bool blunt){d->blunt=blunt;} void setC1(int c1){d->c1=c1;} void setC2(int c2){d->c2=c2;} void setC3(int c3) {d->c3=c3;} void setC4(int c4){d->c4=c4;} QString name() const { return d->name; } QString pattren() const { return d->pattern; } int length() const {return d->length;} int ncuts() const {return d->ncuts;} bool blunt() const {return d->blunt;} int c1() const {return d->c1;} int c2() const {return d->c2;} int c3() const {return d->c3;} int c4() const {return d->c4;} //----------------------------------------------------------- private: QSharedDataPointer<REnzymeData> d; }; } // namespace BioQt #endif // BIOQT_RENZYME_H
#ifndef SETTINGSWIDGET_H #define SETTINGSWIDGET_H #include <QList> #include <QWidget> #include "SettingsRepository.h" namespace Ui { class SettingsWidget; } class SettingsWidget : public QWidget { Q_OBJECT public: explicit SettingsWidget(QWidget *parent = 0); ~SettingsWidget(); QList<RedmineConnector::SettingsRepository> repositories(); void setRepositories(QList<RedmineConnector::SettingsRepository> repositories); private slots: void addNewRepository(); void deleteCurrentRepository(); void showRepository(int num); void setCurrentRepoName(QString name); void setCurrentRepoServer(QString server); void setCurrentRepoUser(QString user); void setCurrentRepoPassword(QString password); void setCurrentRepoSavePassword(int state); private: Ui::SettingsWidget *ui; QList<RedmineConnector::SettingsRepository> m_repositories; int m_currentRepository; void setInputsEnabled(bool enabled); }; #endif // SETTINGSWIDGET_H
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "../src/process.h" Channel *up; Channel *down; void random_up(Process *p) { while (1) { CSP_chanOutInt8(up, 1); usleep((rand() % 1000) * 1000); } } void random_down(Process *p) { while (1) { CSP_chanOutInt8(down, 1); usleep((rand() % 1000) * 1000); } } int is_ok_1(void * counter) { int a = *(int *) counter; return a < 5; } int is_ok_2(void *counter) { int a = *(int *) counter; return a > -5; } void counter(Process *p) { signed int count; signed int v; while (1) { { CSP_Alt_t alt; Channel *clist[2]; struct CSP_Alt_Guard g1 = {&is_ok_1, &count}; struct CSP_Alt_Guard g2 = {&is_ok_2, &count}; clist[0] = up; clist[0]->altGuard = &g1; clist[1] = down; clist[1]->altGuard = &g2; CSP_altInit(&alt); switch (CSP_priAltSelect(&alt, clist, 2)) { case 0: { signed int tmp; CSP_chanInCopy(up, &tmp, sizeof (signed int)); } count++; break ; case 1: { CSP_chanInCopy(down, &v, sizeof (signed int)); count -= v; } break ; } CSP_altClose(&alt); } printf("counter: %d\n", count); } } int main() { Channel up_; up = &up_; CSP_chanInit(up, CSP_ONE2ONE_CHANNEL, 0); Channel down_; down = &down_; CSP_chanInit(down, CSP_ONE2ONE_CHANNEL, 0); Process p_up; ProcInit(&p_up, random_up, NULL, 0, 0); Process p_down; ProcInit(&p_down, random_down, NULL, 0, 0); Process p_count; ProcInit(&p_count, counter, NULL, 0, 0); ProcPar(&p_up, &p_down, &p_count, NULL); return 0; }
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef DSCAMERASERVICE_H #define DSCAMERASERVICE_H #include <QtCore/qobject.h> #include <qmediaservice.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class DSCameraControl; class DSCameraSession; class DSVideoOutputControl; class DSVideoDeviceControl; class DSVideoRendererControl; class DSImageCaptureControl; class DSVideoWidgetControl; class DSCameraService : public QMediaService { Q_OBJECT public: DSCameraService(QObject *parent = 0); ~DSCameraService(); virtual QMediaControl* requestControl(const char *name); virtual void releaseControl(QMediaControl *control); private: DSCameraControl *m_control; DSCameraSession *m_session; DSVideoOutputControl *m_videoOutput; DSVideoWidgetControl *m_viewFinderWidget; DSVideoDeviceControl *m_videoDevice; DSVideoRendererControl *m_videoRenderer; DSImageCaptureControl *m_imageCapture; QByteArray m_device; }; QT_END_NAMESPACE QT_END_HEADER #endif
/********************************************************* * Copyright (C) 2010 VMware, Inc. All rights reserved. * * 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 version 2.1 and no 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 Lesser GNU 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, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _LIBMUTEXRANK_H #define _LIBMUTEXRANK_H #include "mutexRank.h" /* * MXUser mutex ranks for bora/lib code. * * The ranks define the ordering in which locks are allowed to be acquired. * * Only locks with higher rank numbers (generally more localized) * can be acquired while a lock with a lower rank number is active. * * bora/lib lock rank space is from RANK_libLockBase on up to * RANK_LEAF (see vm_basic_defs).asdf * * (Keep all of the below offsets in hex). */ /* * hostDeviceInfo HAL lock * * Must be < vmhs locks since this is held around the RANK_vmhsHDILock * callback lock which vmhs passes into that library. */ #define RANK_hdiHALLock (RANK_libLockBase + 0x1005) /* * vmhs locks (must be < vigor) */ #define RANK_vmhsHDILock (RANK_libLockBase + 0x3002) #define RANK_vmhsThrMxLock (RANK_libLockBase + 0x3005) #define RANK_vmhsVmxMxLock (RANK_libLockBase + 0x3005) /* * hgfs locks */ #define RANK_hgfsSessionArrayLock (RANK_libLockBase + 0x4010) #define RANK_hgfsSharedFolders (RANK_libLockBase + 0x4030) #define RANK_hgfsNotifyLock (RANK_libLockBase + 0x4040) #define RANK_hgfsFileIOLock (RANK_libLockBase + 0x4050) #define RANK_hgfsSearchArrayLock (RANK_libLockBase + 0x4060) #define RANK_hgfsNodeArrayLock (RANK_libLockBase + 0x4070) /* * SLPv2 global lock */ #define RANK_slpv2GlobalLock (RANK_libLockBase + 0x4305) /* * vigor (must be < VMDB range and < disklib, see bug 741290) */ #define RANK_vigorClientLock (RANK_libLockBase + 0x4400) #define RANK_vigorOfflineClientLock (RANK_libLockBase + 0x4410) /* * NFC lib lock */ #define RANK_nfcLibLock (RANK_libLockBase + 0x4505) /* * policy ops pending list lock */ #define RANK_popPendingListLock (RANK_libLockBase + 0x4605) /* * disklib and I/O related locks */ #define RANK_diskLibLock (RANK_libLockBase + 0x5001) #define RANK_nasPluginLock (RANK_libLockBase + 0x5007) #define RANK_nasPluginMappingLock (RANK_libLockBase + 0x5008) #define RANK_diskLibPluginLock (RANK_libLockBase + 0x5010) #define RANK_vmioPluginRootLock (RANK_libLockBase + 0x5020) #define RANK_vmioPluginSysLock (RANK_libLockBase + 0x5040) #define RANK_fsCmdLock (RANK_libLockBase + 0x5050) #define RANK_scsiStateLock (RANK_libLockBase + 0x5060) #define RANK_parInitLock (RANK_libLockBase + 0x5070) #define RANK_namespaceLock (RANK_libLockBase + 0x5080) /* * VMDB range: * (RANK_libLockBase + 0x5500, RANK_libLockBase + 0x5600) */ #define RANK_vmuSecPolicyLock (RANK_libLockBase + 0x5505) #define RANK_vmdbCnxRpcLock (RANK_libLockBase + 0x5510) #define RANK_vmdbCnxRpcBarrierLock (RANK_libLockBase + 0x5520) #define RANK_vmdbCnxLock (RANK_libLockBase + 0x5530) #define RANK_vmdbSecureLock (RANK_libLockBase + 0x5540) #define RANK_vmdbDbLock (RANK_libLockBase + 0x5550) #define RANK_vmdbW32HookLock (RANK_libLockBase + 0x5560) #define RANK_vmdbWQPoolLock (RANK_libLockBase + 0x5570) #define RANK_vmdbMemMapLock (RANK_libLockBase + 0x5580) /* * USB range: * (RANK_libLockBase + 0x6500, RANK_libLockBase + 0x6600) */ #define RANK_usbArbCliClientLock (RANK_libLockBase + 0x6505) #define RANK_usbEnumClientsLock (RANK_libLockBase + 0x6506) #define RANK_usbArbCliGlobalLock (RANK_libLockBase + 0x6507) #define RANK_usbEnumBackendsLock (RANK_libLockBase + 0x6508) #define RANK_usbEnumBackendLock (RANK_libLockBase + 0x6509) /* * misc locks * * Assuming ordering is important here for the listed locks. Other * non-leaf locks are usually defined with RANK_LEAF - 1. * * At least: * impersonate < pollDefault * keyLocator < preference (for checking AESNI) * keyLocator < ssl (bug 743010) * configDb < keyLocator (for unlocking dictionaries) * battery/button < preference * workerLib < something for sure under VThread_Create * licenseCheck < preference */ #define RANK_getSafeTmpDirLock (RANK_libLockBase + 0x7020) #define RANK_batteryLock (RANK_libLockBase + 0x7030) #define RANK_buttonLock (RANK_libLockBase + 0x7040) #define RANK_impersonateLock (RANK_libLockBase + 0x7045) #define RANK_pollDefaultLock (RANK_libLockBase + 0x7050) #define RANK_workerLibLock (RANK_libLockBase + 0x7060) #define RANK_configDbLock (RANK_libLockBase + 0x7070) #define RANK_keyLocatorLock (RANK_libLockBase + 0x7080) #define RANK_sslStateLock (RANK_libLockBase + 0x7085) #define RANK_licenseCheckLock (RANK_libLockBase + 0x7090) #define RANK_preferenceLock (RANK_libLockBase + 0x7100) #endif /* _LIBMUTEXRANK_H */
/******************************************************************************* * PRIMME PReconditioned Iterative MultiMethod Eigensolver * Copyright (C) 2005 James R. McCombs, Andreas Stathopoulos * * This file is part of PRIMME. * * PRIMME 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. * * PRIMME 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 St, Fifth Floor, Boston, MA 02110-1301 USA * * File: correction_private.h * * Purpose - Definitions to be used exclusively by correction.c * * Module name : %M% * SID : %I% * Date : %G% ******************************************************************************/ #ifndef CORRECTION_PRIVATE_H #define CORRECTION_PRIVATE_H #define INNER_SOLVE_FAILURE -1 static double computeRobustShift(int blockIndex, double resNorm, double *prevRitzVals, int numPrevRitzVals, double *sortedRitzVals, double *approxOlsenShift, int numSorted, int *ilev, primme_params *primme); static void mergeSort(double *lockedEvals, int numLocked, double *ritzVals, int *flag, int basisSize, double *sortedEvals, int *ilev, int blockSize, primme_params *primme); static void Olsen_preconditioner_block(double *r, double *x, int blockSize, double *rwork, primme_params *primme) ; static void apply_preconditioner_block(double *v, double *result, int blockSize, primme_params *primme); static void setup_JD_projectors(double *x, double *r, double *evecs, double *evecsHat, double *Kinvx, double *xKinvx, double **Lprojector, double **RprojectorQ, double **RprojectorX, int *sizeLprojector, int *sizeRprojectorQ, int *sizeRprojectorX, int numLocked, int numConverged, primme_params *primme); #endif
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (info@qt.nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at info@qt.nokia.com. ** **************************************************************************/ #ifndef QTQUICKAPP_H #define QTQUICKAPP_H #include "abstractmobileapp.h" #include <QtCore/QHash> #include <QtCore/QStringList> namespace Qt4ProjectManager { namespace Internal { class QtQuickApp; struct QmlCppPlugin; struct QmlModule { enum Path { // Example: Module "com.foo.bar" in "c:/modules/". // "qmldir" file is in "c:/modules/com/foo/bar/". // Application .pro file is "c:/app/app.pro". Root, // "c:/modules/" (absolute) ContentDir, // "../modules/com/foo/bar" (relative form .pro file) ContentBase, // "com/foo/" DeployedContentBase // "<qmlmodules>/com/foo" (on deploy target) }; QmlModule(const QString &name, const QFileInfo &rootDir, const QFileInfo &qmldir, bool isExternal, QtQuickApp *qtQuickApp); QString path(Path path) const; const QString uri; // "com.foo.bar" const QFileInfo rootDir; // Location of "com/" const QFileInfo qmldir; // 'qmldir' file. const bool isExternal; // Either external or inside a source paths const QtQuickApp *qtQuickApp; QHash<QString, QmlCppPlugin *> cppPlugins; // Just as info. No ownership. }; struct QmlCppPlugin { QmlCppPlugin(const QString &name, const QFileInfo &path, const QmlModule *module, const QFileInfo &proFile); const QString name; // Original name const QFileInfo path; // Plugin path where qmldir points to const QmlModule *module; const QFileInfo proFile; // .pro file for the plugin }; struct QtQuickAppGeneratedFileInfo : public AbstractGeneratedFileInfo { enum ExtendedFileType { MainQmlFile = ExtendedFile, MainPageQmlFile, AppViewerPriFile, AppViewerCppFile, AppViewerHFile }; QtQuickAppGeneratedFileInfo() : AbstractGeneratedFileInfo() {} }; class QtQuickApp : public AbstractMobileApp { public: enum ExtendedFileType { MainQml = ExtendedFile, MainQmlDeployed, MainQmlOrigin, AppViewerPri, AppViewerPriOrigin, AppViewerCpp, AppViewerCppOrigin, AppViewerH, AppViewerHOrigin, QmlDir, QmlDirProFileRelative, ModulesDir, MainPageQml, MainPageQmlOrigin }; enum Mode { ModeGenerate, ModeImport }; enum ComponentSet { QtQuick10Components, Symbian10Components, Meego10Components }; QtQuickApp(); virtual ~QtQuickApp(); void setComponentSet(ComponentSet componentSet); ComponentSet componentSet() const; void setMainQml(Mode mode, const QString &file = QString()); Mode mainQmlMode() const; bool setExternalModules(const QStringList &uris, const QStringList &importPaths); #ifndef CREATORLESSTEST virtual Core::GeneratedFiles generateFiles(QString *errorMessage) const; #else bool generateFiles(QString *errorMessage) const; #endif // CREATORLESSTEST bool useExistingMainQml() const; const QList<QmlModule*> modules() const; static const int StubVersion; private: virtual QByteArray generateFileExtended(int fileType, bool *versionAndCheckSum, QString *comment, QString *errorMessage) const; virtual QString pathExtended(int fileType) const; virtual QString originsRoot() const; virtual QString mainWindowClassName() const; virtual int stubVersionMinor() const; virtual bool adaptCurrentMainCppTemplateLine(QString &line) const; virtual void handleCurrentProFileTemplateLine(const QString &line, QTextStream &proFileTemplate, QTextStream &proFile, bool &commentOutNextLine) const; QList<AbstractGeneratedFileInfo> updateableFiles(const QString &mainProFile) const; QList<DeploymentFolder> deploymentFolders() const; bool addExternalModule(const QString &uri, const QFileInfo &dir, const QFileInfo &contentDir); bool addCppPlugins(QmlModule *module); bool addCppPlugin(const QString &qmldirLine, QmlModule *module); void clearModulesAndPlugins(); QString componentSetDir(ComponentSet componentSet) const; QFileInfo m_mainQmlFile; Mode m_mainQmlMode; QStringList m_importPaths; QList<QmlModule *> m_modules; QList<QmlCppPlugin *> m_cppPlugins; ComponentSet m_componentSet; }; } // namespace Internal } // namespace Qt4ProjectManager #endif // QTQUICKAPP_H
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QV8PROFILERSERVICE_P_H #define QV8PROFILERSERVICE_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <private/qqmldebugservice_p.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE struct Q_AUTOTEST_EXPORT QV8ProfilerData { int messageType; QString filename; QString functionname; int lineNumber; double totalTime; double selfTime; int treeLevel; QByteArray toByteArray() const; }; class QQmlEngine; class QV8ProfilerServicePrivate; class Q_AUTOTEST_EXPORT QV8ProfilerService : public QQmlDebugService { Q_OBJECT public: enum MessageType { V8Entry, V8Complete, V8SnapshotChunk, V8SnapshotComplete, V8Started, V8MaximumMessage }; QV8ProfilerService(QObject *parent = 0); ~QV8ProfilerService(); static QV8ProfilerService *instance(); static void initialize(); public slots: void startProfiling(const QString &title); void stopProfiling(const QString &title); void takeSnapshot(); void deleteSnapshots(); void sendProfilingData(); protected: void stateAboutToBeChanged(State state); void messageReceived(const QByteArray &); private: Q_DISABLE_COPY(QV8ProfilerService) Q_DECLARE_PRIVATE(QV8ProfilerService) }; QT_END_NAMESPACE QT_END_HEADER #endif // QV8PROFILERSERVICE_P_H
/*********************************************************************** * The rDock program was developed from 1998 - 2006 by the software team * at RiboTargets (subsequently Vernalis (R&D) Ltd). * In 2006, the software was licensed to the University of York for * maintenance and distribution. * In 2012, Vernalis and the University of York agreed to release the * program as Open Source software. * This version is licensed under GNU-LGPL version 3.0 with support from * the University of Barcelona. * http://rdock.sourceforge.net/ ***********************************************************************/ //Base implementation class for all attractive and repulsive polar scoring fns //Provides methods for: creating interaction centers, calculating interaction //scores #ifndef _RBTPOLARSF_H_ #define _RBTPOLARSF_H_ #include "RbtBaseSF.h" #include "RbtInteractionGrid.h" #include "RbtAnnotationHandler.h" class RbtPolarSF : public virtual RbtBaseSF, public virtual RbtAnnotationHandler { public: //Class type string static RbtString _CT; //Parameter names static RbtString _INCR; static RbtString _R12FACTOR; static RbtString _R12INCR; static RbtString _DR12MIN; static RbtString _DR12MAX; static RbtString _A1; static RbtString _DA1MIN; static RbtString _DA1MAX; static RbtString _A2; static RbtString _DA2MIN; static RbtString _DA2MAX; static RbtString _INCMETAL; static RbtString _INCHBD; static RbtString _INCHBA; static RbtString _INCGUAN; static RbtString _GUAN_PLANE; static RbtString _ABS_DR12; static RbtString _LP_OSP2; static RbtString _LP_PHI; static RbtString _LP_DPHIMIN; static RbtString _LP_DPHIMAX; static RbtString _LP_DTHETAMIN; static RbtString _LP_DTHETAMAX; virtual ~RbtPolarSF(); protected: RbtPolarSF(); RbtInteractionCenterList CreateAcceptorInteractionCenters(const RbtAtomList& atomList) const; RbtInteractionCenterList CreateDonorInteractionCenters(const RbtAtomList& atomList) const; //Index the intramolecular interactions between two lists void BuildIntraMap(const RbtInteractionCenterList& ICList1, const RbtInteractionCenterList& ICList2, RbtInteractionListMap& intns) const; //Index the intramolecular interactions within a single list void BuildIntraMap(const RbtInteractionCenterList& ICList, RbtInteractionListMap& intns) const; RbtDouble IntraScore(const RbtInteractionCenterList& posList, const RbtInteractionCenterList& negList, const RbtInteractionListMap& prtIntns, RbtBool attr) const; void Partition(const RbtInteractionCenterList& posList, const RbtInteractionCenterList& negList, const RbtInteractionListMap& intns, RbtInteractionListMap& prtIntns, RbtDouble dist=0.0) const; //Generic scoring function params struct f1prms { RbtDouble R0,DRMin,DRMax,slope; f1prms::f1prms(RbtDouble R, RbtDouble DMin, RbtDouble DMax) : R0(R),DRMin(DMin),DRMax(DMax),slope(1.0/(DMax-DMin)) {}; }; inline f1prms GetRprms() const {return f1prms(0.0,m_DR12Min,m_DR12Max);} inline f1prms GetA1prms() const {return f1prms(m_A1,m_DA1Min,m_DA1Max);} inline f1prms GetA2prms() const {return f1prms(m_A2,m_DA2Min,m_DA2Max);} RbtDouble PolarScore(const RbtInteractionCenter* intn, const RbtInteractionCenterList& intnList, const f1prms& Rprms, const f1prms& A1prms, const f1prms& A2prms) const; //As this has a virtual base class we need a separate OwnParameterUpdated //which can be called by concrete subclass ParameterUpdated methods //See Stroustrup C++ 3rd edition, p395, on programming virtual base classes void OwnParameterUpdated(const RbtString& strName); private: //Generic scoring function primitive inline RbtDouble f1(RbtDouble DR, const f1prms& prms) const { return (DR > prms.DRMax) ? 0.0 : (DR > prms.DRMin) ? 1.0-prms.slope*(DR-prms.DRMin) : 1.0; }; void UpdateLPprms(); //DM 25 Oct 2000 - heavily used params RbtDouble m_R12Factor; RbtDouble m_R12Incr; RbtDouble m_DR12Min; RbtDouble m_DR12Max; RbtDouble m_A1; RbtDouble m_DA1Min; RbtDouble m_DA1Max; RbtDouble m_A2; RbtDouble m_DA2Min; RbtDouble m_DA2Max; RbtBool m_bAbsDR12; RbtDouble m_LP_PHI; RbtDouble m_LP_DPHIMin; RbtDouble m_LP_DPHIMax; RbtDouble m_LP_DTHETAMin; RbtDouble m_LP_DTHETAMax; f1prms m_PHI_lp_prms; f1prms m_PHI_plane_prms; f1prms m_THETAprms; }; #endif //_RBTPOLARSF_H_
// Created file "Lib\src\Svcguid\X64\iid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IKernelTransaction, 0x79427a2b, 0xf895, 0x40e0, 0xbe, 0x79, 0xb5, 0x7d, 0xc8, 0x2e, 0xd2, 0x31);
/* * * This file is part of Tulip (http://tulip.labri.fr) * * Authors: David Auber and the Tulip development Team * from LaBRI, University of Bordeaux * * Tulip 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. * * Tulip 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. * */ ///@cond DOXYGEN_HIDDEN #ifndef PROPERTYANIMATION_H_ #define PROPERTYANIMATION_H_ #include <tulip/Animation.h> #include <tulip/BooleanProperty.h> namespace tlp { template <typename PropType, typename NodeType, typename EdgeType> class PropertyAnimation : public Animation { public: PropertyAnimation(tlp::Graph *graph, PropType *start, PropType *end, PropType *out, tlp::BooleanProperty *selection = nullptr, int frameCount = 1, bool computeNodes = true, bool computeEdges = true, QObject *parent = nullptr); ~PropertyAnimation() override; void frameChanged(int f) override; protected: tlp::Graph *_graph; PropType *_start; PropType *_end; PropType *_out; tlp::BooleanProperty *_selection; bool _computeNodes; bool _computeEdges; virtual NodeType getNodeFrameValue(const NodeType &startValue, const NodeType &endValue, int frame) = 0; virtual EdgeType getEdgeFrameValue(const EdgeType &startValue, const EdgeType &endValue, int frame) = 0; virtual bool equalNodes(const NodeType &v1, const NodeType &v2) { return v1 == v2; } virtual bool equalEdges(const EdgeType &v1, const EdgeType &v2) { return v1 == v2; } }; #include "cxx/PropertyAnimation.cxx" } // namespace tlp #endif /* PROPERTYANIMATION_H_ */ ///@endcond
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_GETGEOLOCATIONREQUEST_H #define QTAWS_GETGEOLOCATIONREQUEST_H #include "route53request.h" namespace QtAws { namespace Route53 { class GetGeoLocationRequestPrivate; class QTAWSROUTE53_EXPORT GetGeoLocationRequest : public Route53Request { public: GetGeoLocationRequest(const GetGeoLocationRequest &other); GetGeoLocationRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(GetGeoLocationRequest) }; } // namespace Route53 } // namespace QtAws #endif
// Created file "Lib\src\dmoguids\dmoguids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_DISK_ADAPTIVE_POWERDOWN, 0x396a32e1, 0x499a, 0x40b2, 0x91, 0x24, 0xa9, 0x6a, 0xfe, 0x70, 0x76, 0x67);
#pragma once #define _FILE_MTL_NEW_MTL "newmtl" #define _FILE_MTL_COLOR_AMBIENT "Ka" #define _FILE_MTL_COLOR_DIFFUSE "Kd" #define _FILE_MTL_COLOR_SPECULAR "Ks" #define _FILE_MTL_TRANSPARENCY_0 "d" #define _FILE_MTL_TRANSPARENCY_1 "Tr" #define _FILE_MTL_TEX_AMBIENT "map_Ka" #define _FILE_MTL_TEX_DIFFUSE "map_Kd" #define _FILE_MTL_TEX_SPECULAR "map_Ks" #define _FILE_MTL_TEX_SPECULAR_HIGHLIGHT "map_Ns" #define _FILE_MTL_TEX_ALPHA "map_d" #define _FILE_MTL_TEX_BUMP_0 "map_Bump" #define _FILE_MTL_TEX_BUMP_1 "bump" #define _FILE_MTL_TEX_DISPLACEMENT "disp" enum FILE_MTL_ATTRIBUTES { MTL_NEW_MTL, MTL_COLOR_AMBIENT, MTL_COLOR_DIFFUSE, MTL_COLOR_SPECULAR, MTL_TRANSPARENCY, MTL_TEX_AMBIENT, MTL_TEX_DIFFUSE, MTL_TEX_SPECULAR, MTL_TEX_SPECULAR_HIGHLIGHT, MTL_TEX_ALPHA, MTL_TEX_BUMP, MTL_TEX_DISPLACEMENT }; #include "CFileContainer.h" #include "Vectors.h" class CMTLRawData { public: CMTLRawData(); ~CMTLRawData(); struct MaterialDefinition { MaterialDefinition() : texAmbientFile(NULL),texDiffuseFile(NULL), texAlphaMapFile(NULL),texBumpMapFile(NULL), texDisplacementFile(NULL),texSpecularFile(NULL), transparency(1.0f), mtlName(NULL) {} char* mtlName; CVector3 ambient; CVector3 diffuse; CVector3 specular; float transparency; char* texAmbientFile; char* texDiffuseFile; char* texSpecularFile; char* texAlphaMapFile; char* texBumpMapFile; char* texDisplacementFile; }; //Methods void AddNewMaterial(char* mtlName); void AddAmbientColor(CVector3 color); void AddDiffuseColor(CVector3 color); void AddSpecularColor(CVector3 color); void AddAmbientTexture(char* name); void AddDiffuseTexture(char* name); void AddSpecularTexture(char* name); void AddSpecularHighlightTexture(char* name); void AddAlphaTexture(char* name); void AddBumpMapTexture(char* name); void AddDisplacementTexture(char* name); void AddTransparency(float transparency); MaterialDefinition GetMaterial(int index); int GetNumberOfMaterials() {return m_nMaterials;} private: MaterialDefinition* m_pMaterial; int m_nMaterials; }; class CMTLFileContainer : public CFileContainer { public: CMTLFileContainer(); ~CMTLFileContainer(); bool LoadCurrentFile(); CMTLRawData GetRawData() {return m_rawData;} private: CMTLRawData m_rawData; bool LoadNewMtl(); bool LoadAmbientColor(); bool LoadDiffuseColor(); bool LoadSpecularColor(); bool LoadAmbientTexture(); bool LoadDiffuseTexture(); bool LoadSpecularTexture(); bool LoadTransparency(); bool LoadSpecularHighlightTexture(); bool LoadAlphaTexture(); bool LoadBumpMapTexture(); bool LoadDisplacementTexture(); };
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATEPROJECTRESPONSE_P_H #define QTAWS_CREATEPROJECTRESPONSE_P_H #include "mobileresponse_p.h" namespace QtAws { namespace Mobile { class CreateProjectResponse; class CreateProjectResponsePrivate : public MobileResponsePrivate { public: explicit CreateProjectResponsePrivate(CreateProjectResponse * const q); void parseCreateProjectResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(CreateProjectResponse) Q_DISABLE_COPY(CreateProjectResponsePrivate) }; } // namespace Mobile } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBEGLOBALTABLESETTINGSREQUEST_P_H #define QTAWS_DESCRIBEGLOBALTABLESETTINGSREQUEST_P_H #include "dynamodbrequest_p.h" #include "describeglobaltablesettingsrequest.h" namespace QtAws { namespace DynamoDB { class DescribeGlobalTableSettingsRequest; class DescribeGlobalTableSettingsRequestPrivate : public DynamoDBRequestPrivate { public: DescribeGlobalTableSettingsRequestPrivate(const DynamoDBRequest::Action action, DescribeGlobalTableSettingsRequest * const q); DescribeGlobalTableSettingsRequestPrivate(const DescribeGlobalTableSettingsRequestPrivate &other, DescribeGlobalTableSettingsRequest * const q); private: Q_DECLARE_PUBLIC(DescribeGlobalTableSettingsRequest) }; } // namespace DynamoDB } // namespace QtAws #endif
/* * * This file is part of Tulip (http://tulip.labri.fr) * * Authors: David Auber and the Tulip development Team * from LaBRI, University of Bordeaux * * Tulip 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. * * Tulip is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * */ #ifndef PYTHONTABWIDGET_H #define PYTHONTABWIDGET_H #include <QTabWidget> #include <tulip/tulipconf.h> class TLP_PYTHON_SCOPE PythonTabWidget : public QTabWidget { public: explicit PythonTabWidget(QWidget *parent = nullptr); void setDrawTabBarBgGradient(const bool drawGradient) { _drawGradient = drawGradient; } void setTextColor(const QColor &textColor) { _textColor = textColor; } protected: void paintEvent(QPaintEvent *event) override; bool _drawGradient; QColor _textColor; }; #endif // PYTHONTABWIDGET_H
/***** * drawpath3.h * * Stores a path3 that has been added to a picture. *****/ #ifndef DRAWPATH3_H #define DRAWPATH3_H #include "drawelement.h" #include "path3.h" namespace camp { class drawPath3 : public drawElement { protected: const path3 g; triple center; bool straight; RGBAColour color; bool invisible; Interaction interaction; triple Min,Max; public: drawPath3(path3 g, triple center, const pen& p, Interaction interaction) : g(g), center(center), straight(g.piecewisestraight()), color(rgba(p)), invisible(p.invisible()), interaction(interaction), Min(g.min()), Max(g.max()) {} drawPath3(const double* t, const drawPath3 *s) : g(camp::transformed(t,s->g)), straight(s->straight), color(s->color), invisible(s->invisible), interaction(s->interaction), Min(g.min()), Max(g.max()) { center=t*s->center; } virtual ~drawPath3() {} bool is3D() {return true;} void bounds(const double* t, bbox3& B) { if(t != NULL) { const path3 tg(camp::transformed(t,g)); B.add(tg.min()); B.add(tg.max()); } else { B.add(Min); B.add(Max); } } void ratio(const double* t, pair &b, double (*m)(double, double), double, bool &first) { pair z; if(t != NULL) { const path3 tg(camp::transformed(t,g)); z=tg.ratio(m); } else z=g.ratio(m); if(first) { b=z; first=false; } else b=pair(m(b.getx(),z.getx()),m(b.gety(),z.gety())); } bool write(prcfile *out, unsigned int *, double, groupsmap&); void render(GLUnurbs*, double, const triple&, const triple&, double, bool lighton, bool transparent); drawElement *transformed(const double* t); }; class drawNurbsPath3 : public drawElement { protected: size_t degree; size_t n; Triple *controls; double *weights; double *knots; RGBAColour color; bool invisible; triple Min,Max; #ifdef HAVE_GL GLfloat *Controls; GLfloat *Knots; #endif public: drawNurbsPath3(const vm::array& g, const vm::array* knot, const vm::array* weight, const pen& p) : color(rgba(p)), invisible(p.invisible()) { size_t weightsize=checkArray(weight); string wrongsize="Inconsistent NURBS data"; n=checkArray(&g); if(n == 0 || (weightsize != 0 && weightsize != n)) reportError(wrongsize); controls=new(UseGC) Triple[n]; size_t k=0; for(size_t i=0; i < n; ++i) store(controls[k++],vm::read<triple>(g,i)); if(weightsize > 0) { size_t k=0; weights=new(UseGC) double[n]; for(size_t i=0; i < n; ++i) weights[k++]=vm::read<double>(weight,i); } else weights=NULL; size_t nknots=checkArray(knot); if(nknots <= n+1 || nknots > 2*n) reportError(wrongsize); degree=nknots-n-1; run::copyArrayC(knots,knot,0,NoGC); #ifdef HAVE_GL Controls=NULL; #endif } drawNurbsPath3(const double* t, const drawNurbsPath3 *s) : degree(s->degree), n(s->n), weights(s->weights), knots(s->knots), color(s->color), invisible(s->invisible) { controls=new(UseGC) Triple[n]; transformTriples(t,n,controls,s->controls); #ifdef HAVE_GL Controls=NULL; #endif } bool is3D() {return true;} void bounds(const double* t, bbox3& b); virtual ~drawNurbsPath3() {} bool write(prcfile *out, unsigned int *, double, groupsmap&); void displacement(); void ratio(const double* t, pair &b, double (*m)(double, double), double fuzz, bool &first); void render(GLUnurbs *nurb, double size2, const triple& Min, const triple& Max, double perspective, bool lighton, bool transparent); drawElement *transformed(const double* t); }; } #endif
// DirectIO support for mkrwifi1010 _define_pin(0, PORT_A, 22); _define_pin(1, PORT_A, 23); _define_pin(2, PORT_A, 10); _define_pin(3, PORT_A, 11); _define_pin(4, PORT_B, 10); _define_pin(5, PORT_B, 11); _define_pin(6, PORT_A, 20); _define_pin(7, PORT_A, 21); _define_pin(8, PORT_A, 16); _define_pin(9, PORT_A, 17); _define_pin(10, PORT_A, 19); _define_pin(11, PORT_A, 8); _define_pin(12, PORT_A, 9); _define_pin(13, PORT_B, 23); _define_pin(14, PORT_B, 22); _define_pin(15, PORT_A, 2); _define_pin(16, PORT_B, 2); _define_pin(17, PORT_B, 3); _define_pin(18, PORT_A, 4); _define_pin(19, PORT_A, 5); _define_pin(20, PORT_A, 6); _define_pin(21, PORT_A, 7); _define_pin(22, PORT_A, 24); _define_pin(23, PORT_A, 25); _define_pin(24, PORT_A, 18); _define_pin(25, PORT_A, 3); _define_pin(26, PORT_A, 12); _define_pin(27, PORT_A, 13); _define_pin(28, PORT_A, 14); _define_pin(29, PORT_A, 15); _define_pin(30, PORT_A, 27); _define_pin(31, PORT_B, 8); _define_pin(32, PORT_B, 9); _define_pin(33, PORT_A, 0); _define_pin(34, PORT_A, 1); _define_pin(35, PORT_A, 28);
#ifndef GRANDOMSEQUENCENODE_P_P_H #define GRANDOMSEQUENCENODE_P_P_H #include "gcompositenode_p_p.h" #include "grandomsequencenode_p_p.h" class GRandomSequenceNodePrivate : public GCompositeNodePrivate { Q_DECLARE_PUBLIC(GRandomSequenceNode) public: GRandomSequenceNodePrivate(); virtual ~GRandomSequenceNodePrivate(); private: virtual void confirmEvent(GGhostConfirmEvent *event) Q_DECL_FINAL; public: virtual bool reset() Q_DECL_FINAL; virtual void execute() Q_DECL_FINAL; virtual bool terminate() Q_DECL_FINAL; private: void executeNextChildNode(); private: void resortChildNodes(); private: Ghost::UpdateMode updateMode; GGhostNodeList sortedChildNodes; Ghost::RandomMode randomMode; }; #endif // GRANDOMSEQUENCENODE_P_P_H
// Created file "Lib\src\Uuid\bthguid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(LANAccessUsingPPPServiceClass_UUID, 0x00001102, 0x0000, 0x1000, 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb);
/* * Copyright (c) 2012 Clément Bœsch * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * PJS (Phoenix Japanimation Society) subtitles format demuxer * * @see http://subs.com.ru/page.php?al=pjs */ #include "avformat.h" #include "internal.h" #include "subtitles.h" typedef struct { FFDemuxSubtitlesQueue q; } PJSContext; static int pjs_probe(AVProbeData *p) { char c; int64_t start, end; const unsigned char *ptr = p->buf; if (sscanf(ptr, "%"SCNd64",%"SCNd64",%c", &start, &end, &c) == 3) { size_t q1pos = strcspn(ptr, "\""); size_t q2pos = q1pos + strcspn(ptr + q1pos + 1, "\"") + 1; if (strcspn(ptr, "\r\n") > q2pos) return AVPROBE_SCORE_MAX; } return 0; } static int64_t read_ts(char **line, int *duration) { int64_t start, end; if (sscanf(*line, "%"SCNd64",%"SCNd64, &start, &end) == 2) { *line += strcspn(*line, "\""); *line += !!**line; if (end < start || end - (uint64_t)start > INT_MAX) return AV_NOPTS_VALUE; *duration = end - start; return start; } return AV_NOPTS_VALUE; } static int pjs_read_header(AVFormatContext *s) { PJSContext *pjs = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); int res = 0; if (!st) return AVERROR(ENOMEM); avpriv_set_pts_info(st, 64, 1, 10); st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codecpar->codec_id = AV_CODEC_ID_PJS; while (!avio_feof(s->pb)) { char line[4096]; char *p = line; const int64_t pos = avio_tell(s->pb); int len = ff_get_line(s->pb, line, sizeof(line)); int64_t pts_start; int duration; if (!len) break; line[strcspn(line, "\r\n")] = 0; pts_start = read_ts(&p, &duration); if (pts_start != AV_NOPTS_VALUE) { AVPacket *sub; p[strcspn(p, "\"")] = 0; sub = ff_subtitles_queue_insert(&pjs->q, p, strlen(p), 0); if (!sub) return AVERROR(ENOMEM); sub->pos = pos; sub->pts = pts_start; sub->duration = duration; } } ff_subtitles_queue_finalize(s, &pjs->q); return res; } static int pjs_read_packet(AVFormatContext *s, AVPacket *pkt) { PJSContext *pjs = s->priv_data; return ff_subtitles_queue_read_packet(&pjs->q, pkt); } static int pjs_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags) { PJSContext *pjs = s->priv_data; return ff_subtitles_queue_seek(&pjs->q, s, stream_index, min_ts, ts, max_ts, flags); } static int pjs_read_close(AVFormatContext *s) { PJSContext *pjs = s->priv_data; ff_subtitles_queue_clean(&pjs->q); return 0; } AVInputFormat ff_pjs_demuxer = { .name = "pjs", .long_name = NULL_IF_CONFIG_SMALL("PJS (Phoenix Japanimation Society) subtitles"), .priv_data_size = sizeof(PJSContext), .read_probe = pjs_probe, .read_header = pjs_read_header, .read_packet = pjs_read_packet, .read_seek2 = pjs_read_seek, .read_close = pjs_read_close, .extensions = "pjs", };
/* * Copyright (C) 2017 Vrije Universiteit Amsterdam * * Licensed under the Apache License, Version 2.0 (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. * * Description: TODO: <Add brief description about file purpose> * Author: TODO <Add proper author> * */ #ifndef REVOLVE_BRAIN_BASECONTROLLER_H_ #define REVOLVE_BRAIN_BASECONTROLLER_H_ #include <vector> #include "brain/Actuator.h" #include "brain/Sensor.h" namespace revolve { namespace brain { class BaseController { public: /// \brief REMEMBER TO MAKE YOUR CHILD DECONSTRUCTORS VIRTUAL AS WELL virtual ~BaseController() {} /// \brief Update the controller to the next step and sends signals /// to the actuators /// /// \param actuators outputs of the controller /// \param sensors inputs of the controller /// \param t global time reference /// \param step time since last update virtual void update( const std::vector< ActuatorPtr > &actuators, const std::vector< SensorPtr > &sensors, double t, double step) = 0; }; } } #endif // REVOLVE_BRAIN_BASECONTROLLER_H_
// Created file "Lib\src\amstrmid\X64\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IDvdInfo2, 0x34151510, 0xeec0, 0x11d2, 0x82, 0x01, 0x00, 0xa0, 0xc9, 0xd7, 0x48, 0x42);
/* * Template definition functions * * Copyright (C) 2011-2022, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * 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 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 <https://www.gnu.org/licenses/>. */ #if !defined( _LIBEVTX_INTERNAL_TEMPLATE_DEFINITION_H ) #define _LIBEVTX_INTERNAL_TEMPLATE_DEFINITION_H #include <common.h> #include <types.h> #include "libevtx_extern.h" #include "libevtx_io_handle.h" #include "libevtx_libcdata.h" #include "libevtx_libcerror.h" #include "libevtx_libfwevt.h" #include "libevtx_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libevtx_internal_template_definition libevtx_internal_template_definition_t; struct libevtx_internal_template_definition { /* The WEVT template */ libfwevt_template_t *wevt_template; /* The XML document */ libfwevt_xml_document_t *xml_document; }; LIBEVTX_EXTERN \ int libevtx_template_definition_initialize( libevtx_template_definition_t **template_definition, libcerror_error_t **error ); LIBEVTX_EXTERN \ int libevtx_template_definition_free( libevtx_template_definition_t **template_definition, libcerror_error_t **error ); LIBEVTX_EXTERN \ int libevtx_template_definition_set_data( libevtx_template_definition_t *template_definition, const uint8_t *data, size_t data_size, uint32_t data_offset, libcerror_error_t **error ); int libevtx_template_definition_read( libevtx_internal_template_definition_t *internal_template_definition, libevtx_io_handle_t *io_handle, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBEVTX_INTERNAL_TEMPLATE_DEFINITION_H ) */
#ifndef PACKEDIT_H #define PACKEDIT_H #include "cardslist.h" #include <QDropEvent> #include <QLineEdit> #include <QDir> #include <QPushButton> class PackEdit : public CardsList { Q_OBJECT public: PackEdit(QWidget *parent); void mousePressEvent(QMouseEvent *); void dropEvent(QDropEvent *); void dragEnterEvent(QDragEnterEvent *); virtual void startDrag(int); signals: void saved(); public slots: void sort(); void saveList(QString); void clearList() { ls.clear(); emit sizeChanged(0); update(); } private: int itemAt2(const QPoint); bool filter(quint32 id); int posIndex(QPoint); }; class PackEditView : public QWidget { Q_OBJECT private: PackEdit *pe; QLineEdit *nameEdit; public: PackEditView(QWidget *parent); auto getList() -> decltype(pe->getList()) { return pe->getList(); } void refresh() { pe->refresh(); } signals: void refreshPack(); void saved(); public slots: void setCards(Type::DeckP cards) { pe->setCards(cards); } void setCurrentCardId(quint32 id) { pe->setCurrentCardId(id); } void checkLeave() { pe->checkLeave(); } void setName(QString name) { nameEdit->setText(name); } private slots: void saveList() { pe->saveList(nameEdit->text()); emit refreshPack(); } }; #endif // PACKEDIT_H
// Created file "Lib\src\dxguid\X64\dxguid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_SysMouseEm2, 0x6f1d2b81, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
// Created file "Lib\src\Uuid\X64\ndisguid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_NDIS_GEN_CO_MEDIA_SUPPORTED, 0x791ad193, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c);
#ifndef SCALARENTITYDISTANCE_H #define SCALARENTITYDISTANCE_H #include <QObject> #include <QtXml> #include "geometry.h" namespace oi{ /*! * \brief The ScalarEntityDistance class */ class OI_CORE_EXPORT ScalarEntityDistance : public Geometry { Q_OBJECT public: ScalarEntityDistance(const bool &isNominal, QObject *parent = 0); ScalarEntityDistance(const bool &isNominal, const double &distance, QObject *parent = 0); ScalarEntityDistance(const ScalarEntityDistance &copy, QObject *parent = 0); ScalarEntityDistance &operator=(const ScalarEntityDistance &copy); ~ScalarEntityDistance(); //######################################## //order of unknown parameters (Qxx-matrix) //######################################## enum DistanceUnknowns{ unknownDistance = 0 }; //############################## //get or set distance parameters //############################## const double &getDistance() const; void setDistance(const double &distance); //############################# //get or set unknown parameters //############################# virtual QMap<GeometryParameters, QString> getUnknownParameters(const QMap<DimensionType, UnitType> &displayUnits, const QMap<DimensionType, int> &displayDigits) const; virtual void setUnknownParameters(const QMap<GeometryParameters, double> &parameters); //########################### //reexecute the function list //########################### void recalc(); //################# //save and load XML //################# QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const; bool fromOpenIndyXML(QDomElement &xmlElem); //############### //display methods //############### QString getDisplayDistance(const UnitType &type, const int &digits, const bool &showDiff = false) const; private: //################### //distance attributes //################### double distance; }; } #endif // SCALARENTITYDISTANCE_H
/*---------------------------------------------------------------------------- * Name: LED.c * Purpose: low level LED functions * Note(s): *---------------------------------------------------------------------------- * This file is part of the uVision/ARM development tools. * This software may only be used under the terms of a valid, current, * end user licence from KEIL for a compatible version of KEIL software * development tools. Nothing else gives you the right to use this software. * * This software is supplied "AS IS" without warranties of any kind. * * Copyright (c) 2011 Keil - An ARM Company. All rights reserved. *----------------------------------------------------------------------------*/ #include "STM32F4xx.h" #include "LED.h" const unsigned long led_mask[] = {1UL << 12, 1UL << 13, 1UL << 14, 1UL << 15}; /*---------------------------------------------------------------------------- initialize LED Pins *----------------------------------------------------------------------------*/ void LED_Init (void) { RCC->AHB1ENR |= ((1UL << 3) ); /* Enable GPIOD clock */ GPIOD->MODER &= ~((3UL << 2*12) | (3UL << 2*13) | (3UL << 2*14) | (3UL << 2*15) ); /* PD.12..15 is output */ GPIOD->MODER |= ((1UL << 2*12) | (1UL << 2*13) | (1UL << 2*14) | (1UL << 2*15) ); GPIOD->OTYPER &= ~((1UL << 12) | (1UL << 13) | (1UL << 14) | (1UL << 15) ); /* PD.12..15 is output Push-Pull */ GPIOD->OSPEEDR &= ~((3UL << 2*12) | (3UL << 2*13) | (3UL << 2*14) | (3UL << 2*15) ); /* PD.12..15 is 50MHz Fast Speed */ GPIOD->OSPEEDR |= ((2UL << 2*12) | (2UL << 2*13) | (2UL << 2*14) | (2UL << 2*15) ); GPIOD->PUPDR &= ~((3UL << 2*12) | (3UL << 2*13) | (3UL << 2*14) | (3UL << 2*15) ); /* PD.12..15 is Pull up */ GPIOD->PUPDR |= ((1UL << 2*12) | (1UL << 2*13) | (1UL << 2*14) | (1UL << 2*15) ); } /*---------------------------------------------------------------------------- Function that turns on requested LED *----------------------------------------------------------------------------*/ void LED_On (unsigned int num) { if (num < LED_NUM) { GPIOD->BSRRL = led_mask[num]; } } /*---------------------------------------------------------------------------- Function that turns off requested LED *----------------------------------------------------------------------------*/ void LED_Off (unsigned int num) { if (num < LED_NUM) { GPIOD->BSRRH = led_mask[num]; } } /*---------------------------------------------------------------------------- Function that outputs value to LEDs *----------------------------------------------------------------------------*/ void LED_Out(unsigned int value) { int i; for (i = 0; i < LED_NUM; i++) { if (value & (1<<i)) { LED_On (i); } else { LED_Off(i); } } }
/** * @file * This file is part of ASAGI. * * ASAGI 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. * * ASAGI 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 ASAGI. If not, see <http://www.gnu.org/licenses/>. * * Diese Datei ist Teil von ASAGI. * * ASAGI ist Freie Software: Sie koennen es unter den Bedingungen * der GNU Lesser General Public License, wie von der Free Software * Foundation, Version 3 der Lizenz oder (nach Ihrer Option) jeder * spaeteren veroeffentlichten Version, weiterverbreiten und/oder * modifizieren. * * ASAGI wird in der Hoffnung, dass es nuetzlich sein wird, aber * OHNE JEDE GEWAEHELEISTUNG, bereitgestellt; sogar ohne die implizite * Gewaehrleistung der MARKTFAEHIGKEIT oder EIGNUNG FUER EINEN BESTIMMTEN * ZWECK. Siehe die GNU Lesser General Public License fuer weitere Details. * * Sie sollten eine Kopie der GNU Lesser General Public License zusammen * mit diesem Programm erhalten haben. Wenn nicht, siehe * <http://www.gnu.org/licenses/>. * * @copyright 2015 Sebastian Rettenberger <rettenbs@in.tum.de> */ #ifndef TRANSFER_NUMAFULL_H #define TRANSFER_NUMAFULL_H #include <cstring> namespace transfer { /** * Copies blocks between NUMA assuming full storage */ class NumaFull { private: /** Pointer to the local static memory */ const unsigned char* m_data; /** Number of blocks per NUMA domain */ unsigned long m_blockCount; /** Block size (in bytes) */ unsigned long m_blockSize; /** The rank of this process */ int m_rank; public: NumaFull() : m_data(0L), m_blockCount(0), m_blockSize(0), m_rank(-1) { } virtual ~NumaFull() { } /** * Initialize the transfer class */ asagi::Grid::Error init(const unsigned char* data, unsigned long blockCount, unsigned long blockSize, const types::Type &type, const mpi::MPIComm &mpiComm, const numa::NumaComm &numaComm, cache::CacheManager &cacheManager) { m_blockCount = blockCount; m_blockSize = blockSize * type.size(); // Compute the start of the memory m_data = &data[- static_cast<long>(numaComm.domainId() * m_blockSize * m_blockCount)]; m_rank = mpiComm.rank(); return asagi::Grid::SUCCESS; } /** * Gets a block from the static storage of another NUMA domain * * @param blockId The global block id * @param remoteRank The rank where the block is stored * @param domainId Id of the NUMA domain that stores the data * @param offset Offset of the block on the NUMA domain * @param cache Pointer to the local cache for this block */ bool transfer(unsigned long blockId, int remoteRank, unsigned int domainId, unsigned long offset, unsigned char* cache) { if (remoteRank != m_rank) return false; memcpy(cache, &m_data[(m_blockCount * domainId + offset) * m_blockSize], m_blockSize); return true; } }; } #endif // TRANSFER_NUMAFULL_H
/* mpfr_get_q -- get a multiple-precision rational from a floating-point number Copyright 2004, 2006-2019 Free Software Foundation, Inc. Contributed by the AriC and Caramba projects, INRIA. This file is part of the GNU MPFR Library. The GNU MPFR 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 3 of the License, or (at your option) any later version. The GNU MPFR 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 MPFR Library; see the file COPYING.LESSER. If not, see https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mpfr-impl.h" #ifndef MPFR_USE_MINI_GMP /* part of the code was copied from get_z.c */ void mpfr_get_q (mpq_ptr q, mpfr_srcptr f) { mpfr_exp_t exp; mpz_ptr u = mpq_numref (q); mpz_ptr v = mpq_denref (q); /* v is set to 1 and will not be changed directly. This ensures that q will be canonical. */ mpz_set_ui (v, 1); if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f))) { if (MPFR_UNLIKELY (MPFR_NOTZERO (f))) MPFR_SET_ERANGEFLAG (); mpz_set_ui (u, 0); /* The ternary value is 0 even for infinity. Giving the rounding direction in this case would not make much sense anyway, and the direction would not necessarily match rnd. */ } else { exp = mpfr_get_z_2exp (u, f); if (exp >= 0) { MPFR_ASSERTN (exp <= (mp_bitcnt_t) -1); mpz_mul_2exp (u, u, exp); } else /* exp < 0 */ { MPFR_ASSERTN (-exp <= (mp_bitcnt_t) -1); mpq_div_2exp (q, q, -exp); } } } #endif
/* Copyright (C) 2007 <SWGEmu> This File is part of Core3. 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 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Linking Engine3 statically or dynamically with other modules is making a combined work based on Engine3. Thus, the terms and conditions of the GNU Lesser General Public License cover the whole combination. In addition, as a special exception, the copyright holders of Engine3 give you permission to combine Engine3 program with free software programs or libraries that are released under the GNU LGPL and with code included in the standard release of Core3 under the GNU LGPL license (or modified versions of such code, with unchanged license). You may copy and distribute such a system following the terms of the GNU LGPL for Engine3 and the licenses of the other code concerned, provided that you include the source code of that other code when and as the GNU LGPL requires distribution of source code. Note that people who make modified versions of Engine3 are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. */ #ifndef CSCREATETICKETSLASHCOMMAND_H_ #define CSCREATETICKETSLASHCOMMAND_H_ #include "../../../scene/SceneObject.h" class CsCreateTicketSlashCommand : public SlashCommand { public: CsCreateTicketSlashCommand(const String& name, ZoneProcessServerImplementation* server) : SlashCommand(name, server) { } bool doSlashCommand(Player* player, Message* packet) { return true; } }; #endif //CSCREATETICKETSLASHCOMMAND_H_
// Created file "Lib\src\Uuid\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PPM_PERFMON_PERFSTATE_GUID, 0x7fd18652, 0x0cfe, 0x40d2, 0xb0, 0xa1, 0x0b, 0x06, 0x6a, 0x87, 0x75, 0x9e);
#include "z_list.h" #include <stdlib.h> struct list_head * new_list_head() { struct list_head * head = (struct list_head *)malloc(sizeof(struct list_head)); head->next = head->prev = head; return head; } __inline void free_list_head(struct list_head * head) { free(head); } __inline int list_empty(const struct list_head *head) { return head->next == head; } size_t list_length(const struct list_head *head) { size_t count = 0; struct list_head *itr = head->next; while (itr != head) {itr = itr->next; count++;} return count; } void __list_add(struct list_head *node, struct list_head *prev, struct list_head *next) { node->prev = prev; node->next = next; prev->next = node; next->prev = node; } __inline void list_add(struct list_head *head, struct list_head *node) { __list_add(node,head,head->next); } __inline void list_add_tail(struct list_head *head, struct list_head *node) { __list_add(node,head->prev,head); } struct list_head * __list_del(struct list_head *prev, struct list_head *next) { struct list_head *node = prev->next; prev->next = next; next->prev = prev; return node; } __inline struct list_head * list_del(struct list_head *head) { return __list_del(head,head->next->next); }
/* * Definitions to silence compiler warnings about unused function attributes/parameters. * * Copyright (C) 2006-2022, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * 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 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 <https://www.gnu.org/licenses/>. */ #if !defined( _LIBCDATA_UNUSED_H ) #define _LIBCDATA_UNUSED_H #include <common.h> #if !defined( LIBCDATA_ATTRIBUTE_UNUSED ) #if defined( __GNUC__ ) && __GNUC__ >= 3 #define LIBCDATA_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define LIBCDATA_ATTRIBUTE_UNUSED #endif #endif #if defined( _MSC_VER ) #define LIBCDATA_UNREFERENCED_PARAMETER( parameter ) \ UNREFERENCED_PARAMETER( parameter ); #else #define LIBCDATA_UNREFERENCED_PARAMETER( parameter ) \ /* parameter */ #endif #endif /* !defined( _LIBCDATA_UNUSED_H ) */
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTBOTVERSIONSREQUEST_H #define QTAWS_LISTBOTVERSIONSREQUEST_H #include "lexmodelsv2request.h" namespace QtAws { namespace LexModelsV2 { class ListBotVersionsRequestPrivate; class QTAWSLEXMODELSV2_EXPORT ListBotVersionsRequest : public LexModelsV2Request { public: ListBotVersionsRequest(const ListBotVersionsRequest &other); ListBotVersionsRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(ListBotVersionsRequest) }; } // namespace LexModelsV2 } // namespace QtAws #endif
#pragma once #include <string> #include <vector> #include <Windows.h> #include <SDL.h> #include <SDL_image.h> #include "define.h" #include "debug.h" #include "graphics-manager.h" #include "sdl-manager.h" enum BrickType {BLUE_BRICK, RED_BRICK}; enum ObjectType {TYPE_PADDLE , TYPE_BRICK, TYPE_BALL};
#ifndef CRC_H #define CRC_H #include <stdint.h> #define CRC8_INIT 0xff #define CRC16_INIT 0xffff #define CRC32_INIT 0xffffffff // CCITT polinom 0x04C11DB7, no XorOut variant CRC-32/JAMCRC uint32_t crc32(const void* data, uint32_t len, uint32_t crc_init); // CCITT polinom 0x1021, no XorOut variant CRC-16/CCITT-FALSE uint16_t crc16(const void* data, uint32_t len, uint16_t crc_init); // CCITT polinom 0x07, no XorOut variant CRC-8/ROHC uint8_t crc8(const void* data, uint32_t len, uint8_t crc_init); #endif // CRC_H
// Created file "Lib\src\windowscodecs\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(CLSID_WICXMPSeqMetadataWriter, 0x6d68d1de, 0xd432, 0x4b0f, 0x92, 0x3a, 0x09, 0x11, 0x83, 0xa9, 0xbd, 0xa7);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_IMPORTAPPLICATIONUSAGERESPONSE_H #define QTAWS_IMPORTAPPLICATIONUSAGERESPONSE_H #include "applicationcostprofilerresponse.h" #include "importapplicationusagerequest.h" namespace QtAws { namespace ApplicationCostProfiler { class ImportApplicationUsageResponsePrivate; class QTAWSAPPLICATIONCOSTPROFILER_EXPORT ImportApplicationUsageResponse : public ApplicationCostProfilerResponse { Q_OBJECT public: ImportApplicationUsageResponse(const ImportApplicationUsageRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const ImportApplicationUsageRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(ImportApplicationUsageResponse) Q_DISABLE_COPY(ImportApplicationUsageResponse) }; } // namespace ApplicationCostProfiler } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTINDICESRESPONSE_P_H #define QTAWS_LISTINDICESRESPONSE_P_H #include "kendraresponse_p.h" namespace QtAws { namespace kendra { class ListIndicesResponse; class ListIndicesResponsePrivate : public kendraResponsePrivate { public: explicit ListIndicesResponsePrivate(ListIndicesResponse * const q); void parseListIndicesResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(ListIndicesResponse) Q_DISABLE_COPY(ListIndicesResponsePrivate) }; } // namespace kendra } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBEORDERABLEDBINSTANCEOPTIONSREQUEST_P_H #define QTAWS_DESCRIBEORDERABLEDBINSTANCEOPTIONSREQUEST_P_H #include "neptunerequest_p.h" #include "describeorderabledbinstanceoptionsrequest.h" namespace QtAws { namespace Neptune { class DescribeOrderableDBInstanceOptionsRequest; class DescribeOrderableDBInstanceOptionsRequestPrivate : public NeptuneRequestPrivate { public: DescribeOrderableDBInstanceOptionsRequestPrivate(const NeptuneRequest::Action action, DescribeOrderableDBInstanceOptionsRequest * const q); DescribeOrderableDBInstanceOptionsRequestPrivate(const DescribeOrderableDBInstanceOptionsRequestPrivate &other, DescribeOrderableDBInstanceOptionsRequest * const q); private: Q_DECLARE_PUBLIC(DescribeOrderableDBInstanceOptionsRequest) }; } // namespace Neptune } // namespace QtAws #endif
/* * ===================================================================================== * * Filename: queue.c * * Description: Queue interface and scheduler * * Version: 1.0 * Created: 07/24/2014 02:24:46 PM * Revision: none * Compiler: icc * * Author: Cao Zongyan (), zycao@sccas.cn * Company: Supercomputing Center, CNIC, CAS, China * * ===================================================================================== */ #include "global.h" #include "queue.h" __OffloadVar_Macro__ static CalcBody* part; __OffloadVar_Macro__ static Node* tree; void initGlobal(CalcBody* p, Node* t) { part = p; tree = t; } int init_queues_tw(TWQ *p_pq, int n) { int i; for(i=0;i<n;i++) { p_pq[i].size = QUEUE_BLOCK_SIZE; p_pq[i].length = 0; p_pq[i].head = 0; p_pq[i].tail = 0; p_pq[i].elements = (TWelement*)xmalloc(sizeof(TWelement)*p_pq[i].size, 9101); } return 0; } int enqueue_tw(TWQ *pq, Int ta, Int tb) { TWelement *pe=pq->elements; if (pq->length == pq->size-256) { DBG_INFO(DBG_MEMORY, "Enlarge Q0 s=%d, l=%d, TA=%d, nPa=%d, TB=%d, nPb=%d, hd=%d, tl=%d.\n", pq->size, pq->length, ta, tree[ta].nPart, tb, tree[tb].nPart, pq->head, pq->tail); pq->size += QUEUE_BLOCK_SIZE; pq->elements = (TWelement*)xrealloc(pq->elements, pq->size*sizeof(TWelement), 9102); pe = pq->elements; if (pq->tail < pq->head) { if (pq->tail>QUEUE_BLOCK_SIZE) { memcpy((void*)(pe+pq->size-QUEUE_BLOCK_SIZE), (void*)pe, sizeof(TWelement)*QUEUE_BLOCK_SIZE); memcpy((void*)pe, (void*)(pe+QUEUE_BLOCK_SIZE), sizeof(TWelement)*(pq->tail-QUEUE_BLOCK_SIZE)); } else { memcpy((void*)(pe+pq->size-QUEUE_BLOCK_SIZE), (void*)pe, sizeof(TWelement)*pq->tail); } pq->tail=(pq->head+pq->length)%pq->size; } DBG_INFO(DBG_MEMORY, "Enlarge Q1 s=%d, l=%d, TA=%d, nPa=%d, TB=%d, nPb=%d, hd=%d, tl=%d.\n", pq->size, pq->length, ta, tree[ta].nPart, tb, tree[tb].nPart, pq->head, pq->tail); } pe[pq->tail].TA = ta; pe[pq->tail].TB = tb; pq->tail = (pq->tail+1)%pq->size; // printf("Enqueue TA=%d, nPa=%d, TB=%d, nPb=%d.\n", ta, tree[ta].nPart, tb, tree[tb].nPart); pq->length++; return 0; } int dequeue_tw(TWQ *pq, TWelement *peout) { TWelement *pe = pq->elements+pq->head; // printf("w head=%d, tail=%d \n", pq->head, pq->tail); if (pq->length>0) { peout->TA = pe->TA; peout->TB = pe->TB; pq->head = (pq->head+1)%pq->size; pq->length--; // printf("w head=%d, tail=%d \n", pq->head, pq->tail); // printf("Dequeue TA=%d, nPa=%d, TB=%d, nPb=%d.\n", peout->TA, tree[peout->TA].nPart, peout->TB, tree[peout->TB].nPart); return 0; } else { return -1; } } int destroy_queues_tw(TWQ *pq, int n) { int i; for (i=0; i<n; i++) { if (pq[i].size > 0) { free(pq[i].elements); pq[i].elements = NULL; pq[i].head = pq[i].tail = -1; pq[i].size = 0; pq[i].length = 0; } } } int process_queue_tw(TWQ *PQ_treewalk, void *param, int process(Int, Int, TWQ*, void*)) { TWelement el; dequeue_tw(PQ_treewalk, &el); // printf("w"); process(el.TA, el.TB, PQ_treewalk, param); }
#ifndef LIBUNITY_H #define LIBUNITY_H #include <string> #include <libs/json.hpp> namespace cute { using Json = nlohmann::json; std::string aesEncrypt(const std::string &passwd,const std::string &source); std::string aesDecrypt(const std::string &passwd,const std::string &source); } #endif // LIBUNITY_H
/** * \file md2.h * * \brief MD2 message digest algorithm (hash function) * * \warning MD2 is considered a weak message digest and its use constitutes a * security risk. We recommend considering stronger message digests * instead. */ /* * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * * 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 MBEDTLS_MD2_H #define MBEDTLS_MD2_H #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #include <stddef.h> #ifdef __cplusplus extern "C" { #endif #if !defined(MBEDTLS_MD2_ALT) // Regular implementation // /** * \brief MD2 context structure * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ typedef struct mbedtls_md2_context { unsigned char cksum[16]; /*!< checksum of the data block */ unsigned char state[48]; /*!< intermediate digest state */ unsigned char buffer[16]; /*!< data block being processed */ size_t left; /*!< amount of data in buffer */ } mbedtls_md2_context; #else /* MBEDTLS_MD2_ALT */ #include "md2_alt.h" #endif /* MBEDTLS_MD2_ALT */ /** * \brief Initialize MD2 context * * \param ctx MD2 context to be initialized * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ void mbedtls_md2_init( mbedtls_md2_context *ctx ); /** * \brief Clear MD2 context * * \param ctx MD2 context to be cleared * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ void mbedtls_md2_free( mbedtls_md2_context *ctx ); /** * \brief Clone (the state of) an MD2 context * * \param dst The destination context * \param src The context to be cloned * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ void mbedtls_md2_clone( mbedtls_md2_context *dst, const mbedtls_md2_context *src ); /** * \brief MD2 context setup * * \param ctx context to be initialized * * \return 0 if successful * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx ); /** * \brief MD2 process buffer * * \param ctx MD2 context * \param input buffer holding the data * \param ilen length of the input data * * \return 0 if successful * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ int mbedtls_md2_update_ret( mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief MD2 final digest * * \param ctx MD2 context * \param output MD2 checksum result * * \return 0 if successful * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx, unsigned char output[16] ); /** * \brief MD2 process data block (internal use only) * * \param ctx MD2 context * * \return 0 if successful * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ int mbedtls_internal_md2_process( mbedtls_md2_context *ctx ); /** * \brief Output = MD2( input buffer ) * * \param input buffer holding the data * \param ilen length of the input data * \param output MD2 checksum result * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ int mbedtls_md2_ret( const unsigned char *input, size_t ilen, unsigned char output[16] ); #if defined(MBEDTLS_SELF_TEST) /** * \brief Checkup routine * * \return 0 if successful, or 1 if the test failed * * \warning MD2 is considered a weak message digest and its use * constitutes a security risk. We recommend considering * stronger message digests instead. * */ int mbedtls_md2_self_test( int verbose ); #endif /* MBEDTLS_SELF_TEST */ #ifdef __cplusplus } #endif #endif /* mbedtls_md2.h */
#include <stdio.h> #include <stdlib.h> #define I 10 #define J 20 #define K 30 #define TRUE 1 #define FALSE 0 int a[I]:[*], b[I][J]:[*], c[I][J][K]:[*]; int a_normal[I], b_normal[I][J], c_normal[I][J][K]; #pragma xmp nodes p(1) void test_ok(int flag) { if(flag){ printf("PASS\n"); } else{ printf("ERROR\n"); exit(1); } } void initialize() { for(int i=0;i<I;i++){ a[i] = a_normal[i] = i; for(int j=0;j<J;j++){ b[i][j] = b_normal[i][j] = (i * I) + j; for(int k=0;k<J;k++){ c[i][j][k] = c_normal[i][j][k] = (i * I * J) + (j * J) + k; } } } } int scalar_get() { a_normal[0] = a[0]:[1]; b[1][2] = a[3]:[1]; b[2:3:2][2] = a[4]:[1]; a_normal[1] = b[0][3]:[1]; c[1][2][2] = b[3][2]:[1]; c[2:2:2][2:2:3][1] = b[4][2]:[1]; int flag = TRUE; if(a_normal[0] != a[0]) flag = FALSE; if(b[1][2] != a[3]) flag = FALSE; if(b[2][2] != a[4] || b[4][2] != a[4] || b[6][2] != a[4]) flag = FALSE; if(a_normal[1] != b[0][3]) flag = FALSE; if(c[1][2][2] != b[3][2]) flag = FALSE; if(c[2][2][1] != b[4][2] || c[2][5][1] != b[4][2] || c[4][2][1] != b[4][2] || c[4][5][1] != b[4][2]) flag = FALSE; return flag; } int vector_get() { a_normal[2:5] = a[0:5]:[1]; a[5:4] = b[0:4][3]:[1]; c[1:2:3][2][2] = b[3][2:2:2]:[1]; int flag = TRUE; for(int i=0;i<5;i++) if(a_normal[2+i] != a[i]) flag = FALSE; for(int i=0;i<4;i++) if(a[5+i] != b[i][3]) flag = FALSE; if(c[1][2][2] != b[3][2] || c[4][2][2] != b[3][4]) flag = FALSE; return flag; } int main() { initialize(); test_ok(scalar_get()); initialize(); test_ok(vector_get()); return 0; }
#ifndef _ALIGNERLOCAL_H #define _ALIGNERLOCAL_H #include "alignment.h" #include "aligner.h" namespace bode { /** * \brief <span class=stat_bad>red</span> Aligns sequences using local alignment * * */ class AlignerLocal: public Aligner { public: AlignerLocal(int ms,int ma,int mi,int go,int ge); protected: void init(int str1len,int str2len); int stopTB(int i,int j); int findEnd(); void fill(); }; } #endif
#pragma once #include "sim/DogController.h" #include "sim/BaseControllerQ.h" class cDogControllerQ : public virtual cDogController, public virtual cBaseControllerQ { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW cDogControllerQ(); virtual ~cDogControllerQ(); protected: };
/* * Notification functions * * Copyright (C) 2011-2022, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * 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 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 <https://www.gnu.org/licenses/>. */ #include <common.h> #include <file_stream.h> #include <types.h> #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include <stdlib.h> #endif #include "libevtx_libcerror.h" #include "libevtx_libcnotify.h" #include "libevtx_notify.h" #if !defined( HAVE_LOCAL_LIBEVTX ) /* Sets the verbose notification */ void libevtx_notify_set_verbose( int verbose ) { libcnotify_verbose_set( verbose ); } /* Sets the notification stream * Returns 1 if successful or -1 on error */ int libevtx_notify_set_stream( FILE *stream, libcerror_error_t **error ) { static char *function = "libevtx_notify_set_stream"; if( libcnotify_stream_set( stream, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, "%s: unable to set stream.", function ); return( -1 ); } return( 1 ); } /* Opens the notification stream using a filename * The stream is opened in append mode * Returns 1 if successful or -1 on error */ int libevtx_notify_stream_open( const char *filename, libcerror_error_t **error ) { static char *function = "libevtx_notify_stream_open"; if( libcnotify_stream_open( filename, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 1 ); } /* Closes the notification stream if opened using a filename * Returns 0 if successful or -1 on error */ int libevtx_notify_stream_close( libcerror_error_t **error ) { static char *function = "libevtx_notify_stream_close"; if( libcnotify_stream_close( error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, "%s: unable to open stream.", function ); return( -1 ); } return( 0 ); } #endif /* !defined( HAVE_LOCAL_LIBEVTX ) */
/* * Sieve of Eratosthenes * * Programmed by Michael J. Quinn * * Last modification: 7 September 2001 */ #include "mpi.h" #include <math.h> #include <stdio.h> #include <stdlib.h> #define MIN(a,b) ((a)<(b)?(a):(b)) int main (int argc, char *argv[]) { unsigned int count; /* Local prime count */ double elapsed_time; /* Parallel execution time */ unsigned long first; /* Index of first multiple */ unsigned long last; unsigned long position; unsigned int global_count; /* Global prime count */ unsigned long long high_value; /* Highest value on this proc */ unsigned long long i; int id; /* Process ID number */ unsigned long index; /* Index of current prime */ unsigned long odds_block_size; unsigned long prime_block_size; unsigned long iprime_block_size; unsigned long long low_value; /* Lowest value on this proc */ char *marked; /* Portion of 2,...,'n' */ unsigned long long int n; /* Sieving from 2, ..., 'n' */ int p; /* Number of processes */ unsigned long proc0_size; /* Size of proc 0's subarray */ unsigned long prime; /* Current prime */ unsigned long kprime; /* Prime in marked0 */ unsigned long long size; /* Elements in 'marked' */ unsigned long long n_size; /* Number of odds between 3 to n */ unsigned long sqrtn; /* Square root of n */ char *marked0; /* Primes in between 3 to sqrt(n) */ MPI_Init (&argc, &argv); /* Start the timer */ MPI_Comm_rank (MPI_COMM_WORLD, &id); MPI_Comm_size (MPI_COMM_WORLD, &p); MPI_Barrier(MPI_COMM_WORLD); elapsed_time = -MPI_Wtime(); if (argc != 4) { if (!id) printf ("Command line: %s <m>\n", argv[0]); MPI_Finalize(); exit (1); } //n = atoll(argv[1]); char *e; n = strtoull(argv[1], &e, 10); int obs = atoi(argv[2]); int pbs = atoi(argv[3]); odds_block_size = obs * obs; prime_block_size = pbs * pbs; /* Compute number of odds between 3 to n */ n_size = (n + 1) / 2; /* Finding primes from 3 to sqrt(n) */ sqrtn = ceil(sqrt((double) n))/2; marked0 = (char *) malloc(sqrtn + 1); for(i = 0; i <=sqrtn; i++) marked0[i] = 0; index = 0; kprime = 3; do{ first = (kprime * kprime - 3) / 2; for(i = first; i <= sqrtn; i += kprime) marked0[i] = 1; while(marked0[++index]); kprime = 2 + (2 * index + 1); } while(kprime * kprime <= sqrtn); //count = 0; //if(id == 0) for(i = 0; i <= sqrtn; i++) if(!(marked0[i])) { count++; printf("%llu ", 2 + 2 * i + 1); fflush(stdout); } //printf("\nID=%d\tSQRTN=%lu\tCOUNT=%d\n", id, sqrtn,count); fflush(stdout); /* Figure out this process's share of the array, as well as the integers represented by the first and last array elements */ low_value = 2 + (2 * (id * (n_size - 1) / p)) + 1; high_value = 2 + (2 * (((id + 1) * (n_size - 1) / p) - 1)) + 1; size = (high_value - low_value + 1) / 2; /* Bail out if all the primes used for sieving are not all held by process 0 */ proc0_size = (n_size - 1) / p; if ((2 + (2 * proc0_size) + 1) < (int) sqrt((double) n)) { if (!id) printf ("Too many processes\n"); MPI_Finalize(); exit (1); } /* Allocate this process's share of the array. */ //printf("ID=%d\tLOW_VALUE=%d\tHIGH_VALUE=%d\tSIZE=%d\n", id, low_value, high_value, size); //fflush(stdout); marked = (char *) malloc (size); if (marked == NULL) { printf ("Cannot allocate enough memory\n"); MPI_Finalize(); exit (1); } for (i = 0; i <= size; i++) marked[i] = 0; unsigned long long start; unsigned long long end; for(start = 0; start <= size; start += odds_block_size + 1){ end = start + odds_block_size; if(end > size) end = size; position = 2 + 2 * start + 1; /* Start from 3 */ prime = 3; for(iprime_block_size = 0; iprime_block_size <= sqrtn; iprime_block_size += prime_block_size + 1){ index = iprime_block_size; do { if(prime * prime > 2 * end + low_value) break; position = 2 * start + low_value; if(prime * prime > position) first = (prime * prime - position) / 2; else { if (!(position % prime)) first = 0; else{ first = prime - (position % prime); if(!(first % 2)) first = first / 2; else first = (first + prime) / 2; } } first += start; //if(id==1){ printf("ID=%d LOW_VALUE=%llu START=%llu(%llu) END=%llu(%llu) PRIME=%lu FIRST=%llu(%lu) SIZE=%llu\n", id, low_value, 2*start+low_value,start, 2*end+low_value,end, prime,2*first+low_value, first, size); fflush(stdout); } for (i = first; i <= end; i += prime){ marked[i] = 1; //if(id==1){ printf("%llu ", 2 * i + low_value); fflush(stdout); } } //if(id==1){ printf("\n"); fflush(stdout); } while(marked0[++index]); prime = 2 + (2 * index + 1); } while (index <= iprime_block_size + prime_block_size); } } count = 0; for (i = 0; i <= size; i++) if (!marked[i]){ count++; } if (p > 1) MPI_Reduce (&count, &global_count, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); /* Stop the timer */ elapsed_time += MPI_Wtime(); /* Print the results */ if (!id) { global_count++; //Counting 2 as prime... printf ("%d, %d, %llu, %d, %d, %10.6f\n", obs, pbs, n, p, global_count, elapsed_time); } MPI_Finalize (); return 0; }
/** * * Phantom OS * * Copyright (C) 2005-2010 Dmitry Zavalishin, dz@dz.ru * * Kernel ready: no, this is not a kernel code. * * This source file implements X11 based wrapper for VM to * run in Unix-hosted environment. * * TODO: GBR -> RGB!! * **/ //#include <phantom_libc.h> #include <string.h> #include <assert.h> #include <video/screen.h> #include <video/internal.h> #include "gcc_replacements.h" #include "x11_screen.h" #define VSCREEN_WIDTH 1024 #define VSCREEN_HEIGHT 768 struct drv_video_screen_t drv_video_x11 = { "X11", // size VSCREEN_WIDTH, VSCREEN_HEIGHT, 32, // mouse x y flags 0, 0, 0, // screen 0, probe: (void *)vid_null, start: (void *)vid_null, stop: (void *)vid_null, vid_null, (void*)vid_null, (void*)vid_null, vid_null, mouse: vid_null, mouse_redraw_cursor: vid_mouse_draw_deflt, mouse_set_cursor: vid_mouse_set_cursor_deflt, mouse_disable: vid_mouse_off_deflt, mouse_enable: vid_mouse_on_deflt, }; static int eline = 0; static int init_ok = 0; static int init_err = 0; //static char screen_image [VSCREEN_WIDTH*VSCREEN_HEIGHT*3]; //static void drv_x11_screen_update(void) { win_x11_update(); eline = 1; } /* LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { case WM_PAINT: break; case WM_MOUSEMOVE: { int xPos = (short)(0x0FFFF & lParam);//GET_X_LPARAM(lParam); int yPos = VSCREEN_HEIGHT - (short)(0x0FFFF & (lParam>>16));//GET_Y_LPARAM(lParam); // printf("%d,%d\n", xPos, yPos ); drv_video_x11.mouse_x = xPos; drv_video_x11.mouse_y = yPos; drv_video_x11.mouse_flags = wParam; drv_video_x11.mouse(); } break; default: return DefWindowProc(hWnd, iMessage, wParam, lParam); } return 0; } */ void win_x11_set_screen( void *vmem ) { drv_video_x11.screen = vmem; } //int WINAPI void pvm_x11_window_thread() { if(win_x11_init(VSCREEN_WIDTH,VSCREEN_HEIGHT)) { init_err = 1; return; // BUG: report error } /* int i; for( i = 0; i < VSCREEN_WIDTH * VSCREEN_HEIGHT * 3; i++) { screen_image[i] = 34; } */ //drv_video_x11.screen = screen_image; drv_video_x11.xsize = VSCREEN_WIDTH; drv_video_x11.ysize = VSCREEN_HEIGHT; drv_video_x11.update = &drv_x11_screen_update; #if 0 drv_video_x11.bitblt = &vid_bitblt_forw; #if VIDEO_DRV_WINBLT drv_video_x11.winblt = &vid_win_winblt; #endif drv_video_x11.readblt = &vid_readblt_forw; drv_video_x11.bitblt_part = &vid_bitblt_part_forw; #else drv_video_x11.bitblt = &vid_bitblt_rev; #if VIDEO_DRV_WINBLT drv_video_x11.winblt = &vid_win_winblt_rev; #endif drv_video_x11.readblt = &vid_readblt_rev; drv_video_x11.bitblt_part = &vid_bitblt_part_rev; #endif drv_video_x11.mouse_redraw_cursor = &vid_mouse_draw_deflt; drv_video_x11.mouse_set_cursor = &vid_mouse_set_cursor_deflt; drv_video_x11.mouse_disable = &vid_mouse_off_deflt; drv_video_x11.mouse_enable = &vid_mouse_on_deflt; init_ok = 1; win_x11_message_loop(); //printf("Message loop end\n"); } int pvm_video_init() { video_drv = &drv_video_x11; drv_video_x11.screen = 0; // Not ready yet printf("Starting X11 graphics 'driver'\n" ); static unsigned long tid; if( 0 == CreateThread( 0, 0, (void *)&pvm_x11_window_thread, (void*)0, 0, &tid ) ) panic("can't start window thread"); int repeat = 10000; while(repeat-- > 0) { sleep(1); if( init_err ) break; if( init_ok ) { scr_zbuf_init(); scr_zbuf_turn_upside(1); switch_screen_bitblt_to_32bpp( 1 ); return 0; } } return -1; } void win_x11_key_event( int x, int y, unsigned int state, unsigned int keycode, int isRelease ) { printf("-ky- %x %x\r", state, keycode ); } void win_x11_mouse_event( int x, int y, unsigned int state ) { drv_video_x11.mouse_x = x; drv_video_x11.mouse_y = y; drv_video_x11.mouse_flags = state; drv_video_x11.mouse(); #if 1 struct ui_event e; e.type = UI_EVENT_TYPE_MOUSE; e.time = fast_time(); e.focus= 0; e.m.buttons = state; e.abs_x = x; e.abs_y = VSCREEN_HEIGHT - y - 1; ev_q_put_any( &e ); printf("-ms- %x\r", state ); #endif }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_RESOLVEALIASREQUEST_H #define QTAWS_RESOLVEALIASREQUEST_H #include "gameliftrequest.h" namespace QtAws { namespace GameLift { class ResolveAliasRequestPrivate; class QTAWSGAMELIFT_EXPORT ResolveAliasRequest : public GameLiftRequest { public: ResolveAliasRequest(const ResolveAliasRequest &other); ResolveAliasRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(ResolveAliasRequest) }; } // namespace GameLift } // namespace QtAws #endif
/* * libid3tag - ID3 tag manipulation library * Copyright (C) 2000-2001 Robert Leslie * * 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: debug.c,v 1.4 2001/10/20 22:15:47 rob Exp $ */ # ifdef HAVE_CONFIG_H # include "config1.h" # endif # include "global1.h" # undef malloc # undef calloc # undef realloc # undef free # include <stdio.h> # include <stdlib.h> # include <string.h> # include "debug.h" # if defined(DEBUG) # define DEBUG_MAGIC 0xdeadbeefL struct debug { char const *file; unsigned int line; size_t size; struct debug *next; struct debug *prev; long int magic; }; static struct debug *allocated; static int registered; static void check(void) { struct debug *debug; for (debug = allocated; debug; debug = debug->next) { if (debug->magic != DEBUG_MAGIC) { fprintf(stderr, "memory corruption\n"); break; } fprintf(stderr, "%s:%u: leaked %u bytes\n", debug->file, debug->line, debug->size); } } void *id3_debug_malloc(size_t size, char const *file, unsigned int line) { struct debug *debug; if (!registered) { atexit(check); registered = 1; } if (size == 0) fprintf(stderr, "%s:%u: malloc(0)\n", file, line); debug = malloc(sizeof(*debug) + size); if (debug == 0) { fprintf(stderr, "%s:%u: malloc(%u) failed\n", file, line, size); return 0; } debug->magic = DEBUG_MAGIC; debug->file = file; debug->line = line; debug->size = size; debug->next = allocated; debug->prev = 0; if (allocated) allocated->prev = debug; allocated = debug; return ++debug; } void *id3_debug_calloc(size_t nmemb, size_t size, char const *file, unsigned int line) { void *ptr; ptr = id3_debug_malloc(nmemb * size, file, line); if (ptr) memset(ptr, 0, nmemb * size); return ptr; } void *id3_debug_realloc(void *ptr, size_t size, char const *file, unsigned int line) { struct debug *debug, *new; if (size == 0) { id3_debug_free(ptr, file, line); return 0; } if (ptr == 0) return id3_debug_malloc(size, file, line); debug = ptr; --debug; if (debug->magic != DEBUG_MAGIC) { fprintf(stderr, "%s:%u: realloc(%p, %u) memory not allocated\n", file, line, ptr, size); return 0; } new = realloc(debug, sizeof(*debug) + size); if (new == 0) { fprintf(stderr, "%s:%u: realloc(%p, %u) failed\n", file, line, ptr, size); return 0; } if (allocated == debug) allocated = new; debug = new; debug->file = file; debug->line = line; debug->size = size; if (debug->next) debug->next->prev = debug; if (debug->prev) debug->prev->next = debug; return ++debug; } void id3_debug_free(void *ptr, char const *file, unsigned int line) { struct debug *debug; if (ptr == 0) { fprintf(stderr, "%s:%u: free(0)\n", file, line); return; } debug = ptr; --debug; if (debug->magic != DEBUG_MAGIC) { fprintf(stderr, "%s:%u: free(%p) memory not allocated\n", file, line, ptr); return; } debug->magic = 0; if (debug->next) debug->next->prev = debug->prev; if (debug->prev) debug->prev->next = debug->next; if (allocated == debug) allocated = debug->next; free(debug); } void *id3_debug_release(void *ptr, char const *file, unsigned int line) { struct debug *debug; if (ptr == 0) return 0; debug = ptr; --debug; if (debug->magic != DEBUG_MAGIC) { fprintf(stderr, "%s:%u: release(%p) memory not allocated\n", file, line, ptr); return ptr; } if (debug->next) debug->next->prev = debug->prev; if (debug->prev) debug->prev->next = debug->next; if (allocated == debug) allocated = debug->next; memmove(debug, debug + 1, debug->size); return debug; } # endif
/** * @file Trace.h * @version 1.0 * * @section License * Copyright (C) 2015-2016, Mikael Patel * * 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. * * @section Description * Some serial trace support macros. */ #ifndef TRACE_H #define TRACE_H #define TRACE(msg) \ do { \ Serial.print(millis()); \ Serial.print(':'); \ Serial.print(__PRETTY_FUNCTION__); \ Serial.print(':'); \ Serial.print(F(msg)); \ } while (0) #define TRACELN(msg) \ do { \ TRACE(msg); \ Serial.println(); \ } while (0) #endif
/* * * * Copyright CEA/DAM/DIF (2005) * contributeur : Philippe DENIEL philippe.deniel@cea.fr * Thomas LEIBOVICI thomas.leibovici@cea.fr * * * 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * --------------------------------------- */ /** * \file fsal_types.h * \author $Author: leibovic $ * \date $Date: 2006/02/08 12:45:27 $ * \version $Revision: 1.19 $ * \brief File System Abstraction Layer types and constants. * */ #ifndef _FSAL_TYPES_SPECIFIC_H #define _FSAL_TYPES_SPECIFIC_H #include "ganesha_fuse_wrap.h" # define CONF_LABEL_FS_SPECIFIC "FUSE" #include <sys/types.h> #include <sys/param.h> #include "config_parsing.h" #include "err_fsal.h" #include "fsal_glue_const.h" #define fsal_handle_t fusefsal_handle_t #define fsal_op_context_t fusefsal_op_context_t #define fsal_file_t fusefsal_file_t #define fsal_dir_t fusefsal_dir_t #define fsal_export_context_t fusefsal_export_context_t #define fsal_lockdesc_t fusefsal_lockdesc_t #define fsal_cookie_t fusefsal_cookie_t #define fs_specific_initinfo_t fusefs_specific_initinfo_t #define fsal_cred_t fusefsal_cred_t /* In this section, you must define your own FSAL internal types. * Here are some template types : */ typedef union { struct { ino_t inode; dev_t device; unsigned int validator; /* because fuse filesystem can reuse their old inode numbers, which is not NFS compliant. */ } data ; #ifdef _BUILD_SHARED_FSAL char pad[FSAL_HANDLE_T_SIZE]; #endif } fusefsal_handle_t; typedef struct { fsal_staticfsinfo_t * fe_static_fs_info; /* Must be the first entry in this structure */ fusefsal_handle_t root_handle; fsal_path_t root_full_path; /* not expected to change when filesystem is mounted ! */ struct ganefuse *ganefuse; } fusefsal_export_context_t; #define FSAL_EXPORT_CONTEXT_SPECIFIC( pexport_context ) (uint64_t)(FSAL_Handle_to_RBTIndex( &(pexport_context->root_handle), 0 ) ) typedef struct { fusefsal_export_context_t *export_context; /* Must be the first entry in this structure */ struct user_credentials credential; struct ganefuse_context ganefuse_context; } fusefsal_op_context_t; #define FSAL_OP_CONTEXT_TO_UID( pcontext ) ( pcontext->credential.user ) #define FSAL_OP_CONTEXT_TO_GID( pcontext ) ( pcontext->credential.group ) typedef struct { fusefsal_handle_t dir_handle; fusefsal_op_context_t context; struct ganefuse_file_info dir_info; } fusefsal_dir_t; typedef struct { fusefsal_handle_t file_handle; fusefsal_op_context_t context; struct ganefuse_file_info file_info; fsal_off_t current_offset; } fusefsal_file_t; //# define FSAL_FILENO(_p_f) ( (_p_f)->file_info.fh ) typedef union { off_t data; #ifdef _BUILD_SHARED_FSAL char pad[FSAL_COOKIE_T_SIZE]; #endif } fusefsal_cookie_t; //#define FSAL_READDIR_FROM_BEGINNING ((fusefsal_cookie_t)0) typedef struct { struct ganefuse_operations *fs_ops; void *user_data; } fusefs_specific_initinfo_t; #endif /* _FSAL_TYPES_SPECIFIC_H */
// Created file "Lib\src\Uuid\uiribbon_uuid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_LIDOPEN_POWERSTATE, 0x99ff10e7, 0x23b1, 0x4c07, 0xa9, 0xd1, 0x5c, 0x32, 0x06, 0xd7, 0x41, 0xb4);
#include <stdlib.h> #include <stdio.h> void * calloc(size_t n_elements, size_t element_size) { char *new_memory; n_elements *= element_size; new_memory = malloc(n_elements); if(new_memory != NULL) { char *ptr; ptr = new_memory; /* Fiecare bit va fi initializat cu nul */ while(--n_elements >= 0) *ptr++ = '\0'; } return new_memory; }